Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can we extract a core library from Polaris? #410

Open
Samrose-Ahmed opened this issue Apr 10, 2021 · 1 comment
Open

Can we extract a core library from Polaris? #410

Samrose-Ahmed opened this issue Apr 10, 2021 · 1 comment
Labels
question Further information is requested

Comments

@Samrose-Ahmed
Copy link

What problem does your feature solve?

Users, i.e implementing anchors or parts of the Stellar protocol, value the abstractions in this library. However, this library is quite opinionated, it ties you to a specific web framework (Django), assumes and brings in dependencies for your database, has UI components (outside the Stellar SEPS), etc. Users who have a different architecture cannot easily use this library.

What would you like to see?

Extract the platform/db/backend agnostic portions of the library into a new less opinionated library so users can benefit from the abstractions herein. This shouldn't affect this library as it can depend on the new library internally without changing its interface.

What alternatives are there?

  • Status quo: I'm basically looking at the implementations here as inspiration and implementing in my own codebase.
  • Implement a separate independent library: Would work but seems like unnecessary duplication of effort.
@JakeUrban
Copy link
Contributor

JakeUrban commented Apr 13, 2021

Hello @Samrose-Ahmed , thanks for the feedback.

Polaris is definitely an opinionated project. Its primary purpose is to reduce the technical work necessary when starting an anchoring business, and attempts to provide all functionality that isn't specific to a given anchor.

Creating a core library that this project utilizes is an interesting idea, but when I try to think through what could be extracted and put into such a library, it doesn't sound very compelling.

Essentially, the library would consist of a set of request & response schema validators. In rare cases Polaris is able to provide functionality beyond this without input from the anchor, such as SEP-10 challenge validation, but I'm not convinced such a library would be widely used given the limited scope and simplicity of the functionality it would implement.

Addressing the points you brought up specifically,

it ties you to a specific web framework (Django)

True, but given that Django is the most comprehensive framework that exists the Python ecosystem, I don't see any problem with this other than personal preference & familiarity. It doesn't lack functionality that other frameworks offer, maybe other than async IO, which is being developed in 3.0+.

assumes and brings in dependencies for your database

If you're talking about the psycopg2 library, I agree that this shouldn't have been included in the project's requirements, and will be removed in Polaris 2.0. cryptography is an unfortunately hefty package as well, although its the most reputable and well maintained.

Everything else is related to Django and relatively lightweight.

update: psycopg2 has been removed from Polaris dependencies in v2.0.

has UI components (outside the Stellar SEPS)

It does, but using it is completely optional. Polaris provides users mechanisms to use a completely independent application for SEP-24 interactive flows and doesn't require you to compile the static assets included in the package if you don't need them.

If you think I'm missing something that changes the value prop of a 'core' library we can discuss further.

@JakeUrban JakeUrban changed the title Feature Request: Extract a core library? Can we extract a core library from Polaris? May 4, 2022
@JakeUrban JakeUrban added question Further information is requested and removed discussion labels May 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants