Skip to content

Commit

Permalink
feat: update rpc endpoint docs
Browse files Browse the repository at this point in the history
  • Loading branch information
collinc97 committed Dec 17, 2021
1 parent 32a4c72 commit 6659e5d
Show file tree
Hide file tree
Showing 23 changed files with 173 additions and 173 deletions.
26 changes: 13 additions & 13 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions src/rpc/documentation/public_endpoints/getblock.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@ Returns the block given the block height.

### Arguments

| Parameter | Type | Required | Description |
| Parameter | Type | Required | Description |
|:--------------:|:------:|:--------:|:---------------------------------------:|
| `block_height` | number | Yes | The block height of the requested block |
| `block_height` | number | Yes | The block height of the requested block |

### Response

| Parameter | Type | Description |
|:---------------------------:|:------:|:-----------:|
| `block_hash` | string | The hash of the block. |
| `header` | object | The block header containing the state of the ledger at the block. |
| `previous_block_hash` | string | The hash of the previous block. |
| `transactions` | object | The list of transactions included in the block. |
| Parameter | Type | Description |
|:---------------------:|:------:|:-----------------------------------------------------------------:|
| `block_hash` | string | The hash of the block. |
| `header` | object | The block header containing the state of the ledger at the block. |
| `previous_block_hash` | string | The hash of the previous block. |
| `transactions` | object | The list of transactions included in the block. |

### Example Request
```ignore
Expand Down
6 changes: 3 additions & 3 deletions src/rpc/documentation/public_endpoints/getblockhash.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ Returns the block hash for the given block height, if it exists in the canonical

### Arguments

| Parameter | Type | Required | Description |
| Parameter | Type | Required | Description |
|:--------------:|:------:|:--------:|:--------------------------------------------:|
| `block_height` | number | Yes | The block height of the requested block hash |
| `block_height` | number | Yes | The block height of the requested block hash |

### Response

Expand All @@ -23,6 +23,6 @@ curl --data-binary '{"jsonrpc": "2.0", "id":"documentation", "method": "getblock
{
"jsonrpc": "2.0",
"result": "ab18946qsq2ppqylhk03ftpg7wjuknp4gwpqz0hhp8hl2ahn94sg5zqxd8qw8",
"id": 1
"id": "1"
}
```
8 changes: 4 additions & 4 deletions src/rpc/documentation/public_endpoints/getblockhashes.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ Returns up to `MAXIMUM_BLOCK_REQUEST` block hashes from the given `start_block_h

### Arguments

| Parameter | Type | Required | Description |
| Parameter | Type | Required | Description |
|:--------------------:|:------:|:--------:|:----------------------------------------------------:|
| `start_block_height` | number | Yes | The start block height of the requested block hashes |
| `end_block_height` | number | Yes | The end block height of the requested block hashes |
| `start_block_height` | number | Yes | The start block height of the requested block hashes |
| `end_block_height` | number | Yes | The end block height of the requested block hashes |

### Response

| Parameter | Type | Description |
| Parameter | Type | Description |
|:---------:|:------:|:------------------------------------------------:|
| `result` | array | The list of block hashes of the requested blocks |

Expand Down
32 changes: 16 additions & 16 deletions src/rpc/documentation/public_endpoints/getblockheader.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,28 @@ Returns the block header for the given the block height.

### Arguments

| Parameter | Type | Required | Description |
| Parameter | Type | Required | Description |
|:--------------:|:------:|:--------:|:----------------------------------------------:|
| `block_height` | number | Yes | The block height of the requested block header |
| `block_height` | number | Yes | The block height of the requested block header |

### Response

| Parameter | Type | Description |
|:-----------------------:|:------:|:--------------------------------------------:|
| `metadata` | object | The block header metadata. |
| `nonce` | string | The nonce for Proof of Succinct Work.
| `previous_ledger_root` | string | The Merkle root representing the blocks in the ledger up to the previous block. |
| `proof` | string | Proof of Succinct Work |
| `transactions_root` | string | The Merkle root representing the transactions in the block. |
| Parameter | Type | Description |
|:----------------------:|:------:|:-------------------------------------------------------------------------------:|
| `metadata` | object | The block header metadata. |
| `nonce` | string | The nonce for Proof of Succinct Work. |
| `previous_ledger_root` | string | The Merkle root representing the blocks in the ledger up to the previous block. |
| `proof` | string | Proof of Succinct Work |
| `transactions_root` | string | The Merkle root representing the transactions in the block. |

#### Block Header Metadata

| Parameter | Type | Description |
|:-------------------:|:------:|:-----------:|
| `cumulative_weight` | number | The cumulative weight of the chain at this block. |
| `difficulty_target` | number | Proof of work algorithm difficulty target for the block. |
| `height` | number | The height of the block. |
| `timestamp` | number | The block timestamp is a Unix epoch time (UTC) (according to the miner). |
| Parameter | Type | Description |
|:-------------------:|:------:|:------------------------------------------------------------------------:|
| `cumulative_weight` | number | The cumulative weight of the chain at this block. |
| `difficulty_target` | number | Proof of work algorithm difficulty target for the block. |
| `height` | number | The height of the block. |
| `timestamp` | number | The block timestamp is a Unix epoch time (UTC) (according to the miner). |

### Example Request
```ignore
Expand All @@ -47,6 +47,6 @@ curl --data-binary '{"jsonrpc": "2.0", "id":"documentation", "method": "getblock
"proof": "hzkp1qvqqqqqqqqqqqpqqqqqqqqqqqqwpcgtfx3p968slxsgm0ej54pyp46df56ufnmwz3d2rjajg2fj62hq5en9nnx2cdnrww8d9nw9qdqf67m8ctxnk6xyk8tu5gthjjd48f085wvua32px9mw29g7ee2562wjt2fz2ncklpgefeefrfmv90xqgha5r42svfn9nktlpjvtezspwm2l4ejg7kqyydg5s5hgcq2c6taxxtlz4yww43dz0gvxdj4uex9sq83dp9hq3kgcfvgu47mquptj20cyzu0jdksqq2annt72wg4ysfskpsj0kayf9m6t73xs8qhwczrscqqcqqqqqqqqqqqj5d5uw7jep7kmnssfjv3utj97d2pghy0u3wjmlj750dv5y3wc9axdhvj3qs60u9wfl96d2r39qqq9ek8fy8dckr6an58arfrawnuemmqw464rud6r50t8x5cxfn9lhtj6jtma82rahw4zmv2emt8r5h5qfvnd34p93ejxrn6rph8r9ul8tfe65l8t4pvxnpltmcxjnn8wsgvr3d3qc7n39y8wlwz3f0kn3z8yqqgqqqqqqqqqqp2lrqkejgksx2vasrwssl4plmt05vk9he22x0k5uca6k0kehyda6cxu5vrj0q4qqe75elekpj086qpcjqrvgq5tk7cp6q9dj8g0unzvwwg8c5459ug3h3k6r077s8lrh3z63s262jfa5y528f0nnmc89wqgyqqqqqqqqqqqyfekfkkzzgr94sdfzkvyzgh3kag03evgmczdyteaaznnjgla87y3959mxv74c2pk3k5fs3hx4lcgwajgjn8h5x7aj2fc7mns9qegmzr9d8ljnrlwvzwhu0f7r9czwevwq3zeevkkt2033yexr55d3v93swzke3tvcdmlqyrsaey46wqxcvm4l7gzxvlca9a8p7wcls4a9mccsqvqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqyqqqqqqqqqqqm8jv4psnamnzyqqwp9svtmekgysu5gcns7tk4rf2x9g6vay36afuhszk4kyd3t9m72g3kgf57y8gzq00zpcr7l9lyulduxxqe0658j2kyct252hhmvdt7u9t9029z7cazxr40dcx8glm3xg429v2tly3fm70mkmcu56r37czya0elz79cjcfuap9qzgpjd2y6ng6h7uyflzxvqqqqqf9tevv",
"transactions_root": "ht1gl4pv2jw4vyjtdrxn4806vttajn3k3fm2yrfe8akt36zqs72psxsv8rw4c"
},
"id": 1
"id": "1"
}
```
6 changes: 3 additions & 3 deletions src/rpc/documentation/public_endpoints/getblockheight.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ Returns the block height for the given the block hash.

### Arguments

| Parameter | Type | Required | Description |
| Parameter | Type | Required | Description |
|:------------:|:------:|:--------:|:--------------------------------------------:|
| `block_hash` | string | Yes | The block hash of the requested block height |
| `block_hash` | string | Yes | The block hash of the requested block height |

### Response

| Parameter | Type | Description |
| Parameter | Type | Description |
|:---------:|:------:|:-----------------------------------------------------:|
| `result` | number | The block height of the block at the given block hash |

Expand Down
20 changes: 10 additions & 10 deletions src/rpc/documentation/public_endpoints/getblocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,26 @@ Returns up to `MAX_RESPONSE_BLOCKS` blocks from the given `start_block_height` t

### Arguments

| Parameter | Type | Required | Description |
| 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. |
| `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 |
| Parameter | Type | Description |
|:---------------------:|:------:|:----------------------------------------:|
| `result` | array | The array of requested blocks |
| `result` | array | The array of requested blocks |


#### Block

| Parameter | Type | Description |
| Parameter | Type | Description |
|:---------------------------:|:------:|:-----------------------------------------------------------------:|
| `block_hash` | string | The hash of the block. |
| `header` | object | The block header containing the state of the ledger at the block. |
| `previous_block_hash` | string | The hash of the previous block. |
| `transactions` | object | The list of transactions included in the block. |
| `block_hash` | string | The hash of the block. |
| `header` | object | The block header containing the state of the ledger at the block. |
| `previous_block_hash` | string | The hash of the previous block. |
| `transactions` | object | The list of transactions included in the block. |


### Example Request
Expand Down
20 changes: 10 additions & 10 deletions src/rpc/documentation/public_endpoints/getblocktemplate.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ None

### Response

| Parameter | Type | Description |
|:--------------------- |:------:|:----------- |
| `previous_block_hash` | string | The hash of the previous block. |
| `block_height` | number | The height of the new block. |
| `time` | number | The block timestamp of the new block. |
| `difficulty_target` | number | The difficulty target of the new block. |
| `cumulative_weight` | number | The cumulative weight of the new block. |
| `ledger_root` | string | The latest state from the ledger. |
| `transactions` | array | The list of transactions included in the new block. |
| `coinbase_reward` | number | The coinbase reward for mining the new block (does not include transaction fees). |
| Parameter | Type | Description |
|:----------------------:|:------:|:---------------------------------------------------------------------------------:|
| `block_height` | number | The height of the new block. |
| `coinbase_reward` | number | The coinbase reward for mining the new block (does not include transaction fees). |
| `cumulative_weight` | number | The cumulative weight of the new block. |
| `difficulty_target` | number | The difficulty target of the new block. |
| `ledger_root` | string | The latest state from the ledger. |
| `previous_block_hash` | string | The hash of the previous block. |
| `time` | number | The block timestamp of the new block. |
| `transactions` | array | The list of transactions included in the new block. |

### Example Request
```ignore
Expand Down
20 changes: 10 additions & 10 deletions src/rpc/documentation/public_endpoints/getblocktransactions.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,24 @@ Returns the transactions from the block of the given block height.

### Arguments

| Parameter | Type | Required | Description |
| Parameter | Type | Required | Description |
|:--------------:|:------:|:--------:|:----------------------------------------------------:|
| `block_height` | number | Yes | The block height of the requested block transactions |
| `block_height` | number | Yes | The block height of the requested block transactions |

### Response

| Parameter | Type | Description |
| Parameter | Type | Description |
|:---------:|:------:|:----------------------------------------:|
| `result` | object | The transactions of the requested block. |

#### Transaction

| Parameter | Type | Description |
|:-------------------:|:------:|:-----------:|
| `inner_circuit_id` | string | The ID of the inner circuit used to execute each transition. |
| `ledger_root` | string | The ledger root used to prove inclusion of ledger-consumed records. |
| `transaction_id` | string | The ID of the transaction. |
| `transitions` | array | The state transitions. |
| Parameter | Type | Description |
|:------------------:|:------:|:-------------------------------------------------------------------:|
| `inner_circuit_id` | string | The ID of the inner circuit used to execute each transition. |
| `ledger_root` | string | The ledger root used to prove inclusion of ledger-consumed records. |
| `transaction_id` | string | The ID of the transaction. |
| `transitions` | array | The state transitions. |

### Example Request
```ignore
Expand Down Expand Up @@ -71,6 +71,6 @@ curl --data-binary '{"jsonrpc": "2.0", "id":"documentation", "method": "getblock
}
]
},
"id": 1
"id": "1"
}
```
Loading

0 comments on commit 6659e5d

Please sign in to comment.