-
Notifications
You must be signed in to change notification settings - Fork 7
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
Indexing metadata section in Forc manifest #21
Conversation
name = "my-fuel-project" | ||
|
||
[project.metadata.indexing] | ||
namespace = "examaple-namespace" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How will we ensure that namespace is unique across projects?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought about this for awhile and I'm still not sure how to address this in the indexing metadata section.
For context, the namespace functionality was actually used as a way to separate indexers that may have the same name. Due to the original indexer's ability to be self-hosted, it was unlikely that namespaces would be collide since teams were generally expected to run their own indexer service deployment. Additionally, the original indexer also contained functionality to use forc wallet
to place indexer uploading/stopping/removal behind authenticated routes.
The next iteration of the indexer is intended to be a sort of hosted "public good" service. Thus, the indexer team expects users to deploy their indexers to the service, and in order to ensure that database tables are distinct from one another (as they've generally been named after their GraphQL or Sway types), we need to determine a unique prefix for tables associated with the same contract. The prefix should be user-chosen as the developer experience with using a user-generated identifier is likely to be better than something generated that has no meaning to them. I did think about using a contract ID, but that will change if the content of the contract changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe the indexer website should provide the user with a unique key, which can be used as a prefix?
Are users paying for the indexing service? If so, it should be easy to have a key (or even user-chosen unique namespace) linked to their billing account.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's probably a good idea; users could request one using forc wallet
and the service could handle generating a unique key in an idempotent manner.
@sdankel I addressed your feedback through a combination of changes to the document and replies to your comments. |
Co-authored-by: Sophie Dankel <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left 2 nits, my last question before merging this is what is our approach on workspace level metadata? Should that be allowed or left to a future rfc? cc @FuelLabs/tooling
Co-authored-by: Kaya Gökalp <[email protected]>
Co-authored-by: Kaya Gökalp <[email protected]>
I think we should also allow metadata in the top level workspace Forc.toml. I'm looking at a number of large developed workspaces from other teams and think they might feel limited without it. |
That make sense to me, only thing remaining is that deciding on what should be the policy of conflicting metadata declarations one coming from workspace, and one coming from member package. I think our aim (as forc) should be being totally transparent to this field as this has nothing to do with forc but external tools. So we whould not check any conflicts etc. This is the behaviour of cargo with similar reasonings i believe quoting the linked doc:
Another option would be disallowing package level metadata if there is one in workspace level. But it might hurt the expressivity and also does not really make sense for forc to enforce this as it does not deal with metadata info at all. After we decide on this, we should the decision in the RFC and then we can merge it maybe? |
I guess this should be moved to https://github.com/FuelLabs/sway-rfcs |
Have added the
More details can be found here. |
As the indexing team works towards a more efficient, user-friendly implementation of the indexer, I'd like to propose allowing for the addition of an optional indexing metadata section to the Forc project manifest.
[Rendered]