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

Endpoint to retrieve all keys for a data-map #2168

Closed
obycode opened this issue Nov 17, 2024 · 2 comments
Closed

Endpoint to retrieve all keys for a data-map #2168

obycode opened this issue Nov 17, 2024 · 2 comments

Comments

@obycode
Copy link
Member

obycode commented Nov 17, 2024

In the stacks-node, we have an RPC endpoint to retrieve a value from a data map, but we have no way to retrieve all of the keys currently in that map. Having a list of all keys in a data map is useful in many situations, and how to get these keys is an often asked question. The solution often recommended currently is to include a list in the contract that gets updated whenever map is updated, but this adds unnecessary on-chain cost. Alternatively, the set of keys can be tracked off-chain by each user.

This seems like something that the API could probably expose, since it can track the events and store this information in the databases (maybe it already does, I'm not sure).

@zone117x
Copy link
Member

zone117x commented Nov 18, 2024

The API does not receive or store events like on data-map change.

If that event does exist on stacks-core, I don't think this API would be an appropriate service to handle them. I'd recommend creating a new service for something like "extended-clarity-data-store" which could focus on doing that at scale.

@smcclellan
Copy link
Contributor

Closing due to above.

@smcclellan smcclellan closed this as not planned Won't fix, can't repro, duplicate, stale Nov 18, 2024
@github-project-automation github-project-automation bot moved this from 🆕 New to ✅ Done in API Board Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

3 participants