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

Add additional GET RPC endpoints #4358

Open
wileyj opened this issue Feb 8, 2024 · 2 comments
Open

Add additional GET RPC endpoints #4358

wileyj opened this issue Feb 8, 2024 · 2 comments
Assignees
Labels
enhancement Iterations on existing features or infrastructure. good first issue Appropriate for a new open source contribution.

Comments

@wileyj
Copy link
Contributor

wileyj commented Feb 8, 2024

Problem: the stacks blockchain RPC interface for GET requests is limited compared the data exposed in bitcoin/etc and the rich data in Hiro's API.

With recent changes to the HTTP interface (https://github.com/stacks-network/stacks-core/tree/master/stackslib/src/net/api), it should be much easier to add more RPC endpoints to expose some generic data. Initially, i'm thinking something like:

  • block data
  • tx data
  • address info

some comparable bitcoin-cli rpc commands:
getblockhash
getblock
getrawtransaction
gettxout

for the data exposed, i don't think it should be a requirement to be as detailed as the Hiro API - but i think should be enough to understand what is in a block, or what a tx is doing (as well as retrieving the block hash by a block height).

references:
bitcoin RPC:

Hiro API:

@wileyj wileyj added enhancement Iterations on existing features or infrastructure. good first issue Appropriate for a new open source contribution. labels Feb 8, 2024
@github-project-automation github-project-automation bot moved this to Status: 🆕 New in Stacks Core Eng Feb 8, 2024
@jcnelson
Copy link
Member

jcnelson commented Feb 8, 2024

  • We have getblock via GET /v2/blocks/{index-block-hash}.
  • We have gettxout via GET /v2/accounts/{:address}

We can add an endpoint to get a sortition for a particular block height, which would be the equivalent of getblockhash.

We don't have our equivalent of txindex turned on by default, so getrawtransaction would be disabled by default. However, we could add this endpoint to serve whatever indexed transactions we have if the user enables txindex.

@8marz8
Copy link
Contributor

8marz8 commented Mar 5, 2024

@saralab Do you think this would be a good ticket for me to work on during my free cycles/after my current tickets are merged? If so, perhaps it could be further scoped with the help of @kantai and @jferrant to determine what would be most useful for Nakamoto.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Iterations on existing features or infrastructure. good first issue Appropriate for a new open source contribution.
Projects
Status: Status: 🆕 New
Development

No branches or pull requests

4 participants