-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from AleoHQ/feat/docs-rpc
Fix get_blocks endpoint + add documentation
- Loading branch information
Showing
8 changed files
with
38 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
src/network/rpc/documentation/public_endpoints/getblocks.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
Returns up to `MAX_RESPONSE_BLOCKS` blocks from the given `start_block_height` to `end_block_height`. | ||
|
||
### Arguments | ||
|
||
| Parameter | Type | Required | Description | | ||
|:--------------------:|:------:|:--------:|:-----------------------------------------------------------:| | ||
| `start_block_height` | number | Yes | The block height of the first requested block in the array. | | ||
| `end_block_height` | number | Yes | The block height of the last requested block in the array. | | ||
|
||
### Response | ||
|
||
| Parameter | Type | Description | | ||
|:---------------------:|:------:|:----------------------------------------:| | ||
| `None` | array | The array of requested blocks | | ||
|
||
|
||
#### JSON Block object | ||
Each block in the array will contain the following: | ||
|
||
| Parameter | Type | Description | | ||
|:---------------------------:|:------:|:-----------------------------------------------------------------:| | ||
| `block_hash` | string | The hash of the block | | ||
| `previous_block_hash` | string | The hash of the previous block | | ||
| `header` | number | The block header containing the state of the ledger at this block | | ||
| `transactions` | number | The list of transactions included in the block | | ||
|
||
|
||
### Example | ||
```ignore | ||
curl --data-binary '{"jsonrpc": "2.0", "id":"documentation", "method": "getblocks", "params": [1, 50] }' -H 'content-type: application/json' http://127.0.0.1:3030/ | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters