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

Reading snapshot state: RPC interface for fetching snapshot state by given a burnchain hash or a burnchain height #3114

Open
gzelda opened this issue Apr 26, 2022 · 2 comments
Assignees
Labels
icebox Issues that are not being worked on

Comments

@gzelda
Copy link

gzelda commented Apr 26, 2022

This issue is related to #1969 which aims to split mining program from origin stacks-node

Describe the solution you'd like
Two endpoints:
GET /v2/snapshot/{burnchain_height}
GET /v2/snapshot/{hash}

The params includes the following information:

  • burnchain_height is the burnChain block height
  • burnchain_hash is the burnChain block hash

They are all uniqueIndex in snapshot table which can points to a unique row in SQLite query.

If the node cannot provide a valid snapshot state (e.g., if the node haven't reached burnchain_height or there is no burnchain_hash in the database) a 400 response is returned.

The 200 response should contain the following data:

  • block_height
  • burn_header_hash
  • sortition_hash
  • consensus_hash
  • winner_block_txid

Example response data

{
  "block_height":  666090,
  "burn_header_hash" : "000000000000000000092cb34cb90e88c39fc70f75d786d0f26ebbfc15dd872d",
  "sortition_hash": "e3d7b4e06944adba6a461b2ae50f5b0a7882ff7bbd98e2280ee88df493814439",
  "consensus_hash": "1660396b37a3441508fa954e80f578dc5805e5ed",
  "winner_block_txid": "0a3ee8755e62d83b589adc957286f5f9b09695e2e52c4cea68555be0686da0a4",
}
@jcnelson jcnelson self-assigned this May 2, 2022
@pavitthrap
Copy link
Contributor

@jcnelson can I re-assign this issue to @a3slade?

@jcnelson
Copy link
Member

Sure, go ahead.

@jcnelson jcnelson added the icebox Issues that are not being worked on label Mar 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
icebox Issues that are not being worked on
Projects
Status: Status: 🆕 New
Development

No branches or pull requests

3 participants