Skip to content

Commit

Permalink
chore: update the openapi.yaml file with the new API calls
Browse files Browse the repository at this point in the history
  • Loading branch information
jcnelson committed Mar 20, 2024
1 parent 77f91d2 commit d356a59
Showing 2 changed files with 76 additions and 3 deletions.
9 changes: 9 additions & 0 deletions docs/rpc/api/core-node/get_tenure_info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"consensus_hash": "4c5a49be0e34dc603b66f090fd07d28a2f76a2ad",
"parent_consensus_hash": "fa8a04af41957499afdd4082b9b702ffca9a4370",
"parent_tenure_start_block_id": "0cfec8433849d353ad6b2fe1173da143e3d4a3ab452588a14eb074d0181ac202",
"reward_cycle": 8,
"tenure_start_block_id": "0425099d51547c714df6a7864c040c1a605b198ff07f71d19a823139c88a35f8",
"tip_block_id": "52d64f5e47abc7666c4fed3fe850f381f93f2d588ee2a92a4e07b44f14588d5e",
"tip_height": 416
}
70 changes: 67 additions & 3 deletions docs/rpc/openapi.yaml
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@ servers:
- url: http://localhost:20443/
description: Local
info:
title: Stacks 2.0 RPC API
title: Stacks 2.0+ RPC API
version: '1.0.0'
description: |
This is the documentation for the `stacks-node` RPC interface.
@@ -560,8 +560,8 @@ paths:
operationId: post_block_proposal
description: |
Used by stackers to validate a proposed Stacks block from a miner.
**This endpoint will only accept requests over the local loopback network interface.**
**This API endpoint requires a basic Authorization header.**
responses:
202:
description: Block proposal has been accepted for processing. The result will be returned via the event observer.
@@ -607,3 +607,67 @@ paths:
application/json:
example:
$ref: ./api/core-node/get_stacker_set.400.example.json

/v3/blocks/{block_id}:
get:
summary: Fetch a Nakamoto block
tags:
- Blocks
operationId: get_block_v3
description:
Fetch a Nakamoto block by its index block hash.
responses:
200:
description: The raw SIP-003-encoded block will be returned.
content:
application/octet-stream:
schema:
type: string
format: binary
404:
description: The block could not be found
content:
application/text-plain: {}

/v3/tenures/info:
get:
summary: Fetch metadata about the ongoing Nakamoto tenure
tags:
- Blocks
operationId: get_tenure_info
description:
Fetch metadata about the ongoing Nakamoto tenure. This information is sufficient to obtain and authenticate the highest complete tenure, as well as obtain new tenure blocks.
responses:
200:
description: Metadata about the ongoing tenure
content:
application/json:
example:
*ref: ./api/core-node/get_tenure_info.json

/v3/tenures/{block_id}:
get:
summary: Fetch a sequence of Nakamoto blocks in a tenure
tags:
- Blocks
operationId: get_tenures
description:
Fetch a sequence of Nakamoto blocks in a tenure. The blocks will be served in order from highest to lowest. The blocks will be encoded in their SIP-003 wire format, and concatenated together.
responses:
200:
description: SIP-003-encoded Nakamoto blocks, concatenated together
content:
application/octet-stream:
schema:
type: string
format: binary
parameters:
name: stop
in: query
description:
The block ID hash of the highest block in this tenure that is already known to the caller. Neither the corresponding block nor any of its ancestors will be served. This is used to fetch tenure blocks that the caller does not have.
required: false
schema:
type: string
format: 64-character hex string

0 comments on commit d356a59

Please sign in to comment.