Add last valid block height to rpc Fees (#17506)

* Add last_valid_block_height to fees rpc

* Add getBlockHeight rpc

* Update docs
This commit is contained in:
Tyera Eulberg
2021-05-26 01:26:19 -06:00
committed by GitHub
parent 7ce910f459
commit e9bc1c6b07
7 changed files with 106 additions and 3 deletions

View File

@ -21,6 +21,7 @@ gives a convenient interface for the RPC methods.
- [getAccountInfo](jsonrpc-api.md#getaccountinfo)
- [getBalance](jsonrpc-api.md#getbalance)
- [getBlock](jsonrpc-api.md#getblock)
- [getBlockHeight](jsonrpc-api.md#getblockheight)
- [getBlockProduction](jsonrpc-api.md#getblockproduction)
- [getBlockCommitment](jsonrpc-api.md#getblockcommitment)
- [getBlocks](jsonrpc-api.md#getblocks)
@ -578,6 +579,32 @@ The JSON structure of token balances is defined as a list of objects in the foll
- `uiAmountString: <string>` - Token amount as a string, accounting for decimals.
### getBlockHeight
Returns the current block height of the node
#### Parameters:
- `<object>` - (optional) [Commitment](jsonrpc-api.md#configuring-state-commitment)
#### Results:
- `<u64>` - Current block height
#### Example:
Request:
```bash
curl http://localhost:8899 -X POST -H "Content-Type: application/json" -d '
{"jsonrpc":"2.0","id":1, "method":"getBlockHeight"}
'
```
Result:
```json
{"jsonrpc":"2.0","result":1233,"id":1}
```
### getBlockProduction
Returns recent block production information from the current or previous epoch.
@ -1066,6 +1093,7 @@ The result will be an RpcResponse JSON object with `value` set to a JSON object
- `blockhash: <string>` - a Hash as base-58 encoded string
- `feeCalculator: <object>` - FeeCalculator object, the fee schedule for this block hash
- `lastValidSlot: <u64>` - DEPRECATED - this value is inaccurate and should not be relied upon
- `lastValidBlockHeight: <u64>` - last [block height](../../terminology.md#block-height) at which a blockhash will be valid
#### Example:
@ -1089,7 +1117,8 @@ Result:
"feeCalculator": {
"lamportsPerSignature": 5000
},
"lastValidSlot": 297
"lastValidSlot": 297,
"lastValidBlockHeight": 296
}
},
"id": 1