From 5e431fbee2a56953b8fa4f9d28ee1a814df280a3 Mon Sep 17 00:00:00 2001 From: Tyera Eulberg Date: Thu, 7 Oct 2021 14:38:28 -0600 Subject: [PATCH] Update deprecated snapshot/fees/blockhash api docs (#20522) * Move and notate deprecated blockhash/fees docs * Update getHighestSnapshotSlot note --- docs/src/developing/clients/jsonrpc-api.md | 402 +++++++++++---------- 1 file changed, 207 insertions(+), 195 deletions(-) diff --git a/docs/src/developing/clients/jsonrpc-api.md b/docs/src/developing/clients/jsonrpc-api.md index fbf417d35f..dd105e9fce 100644 --- a/docs/src/developing/clients/jsonrpc-api.md +++ b/docs/src/developing/clients/jsonrpc-api.md @@ -994,157 +994,11 @@ Result: } ``` -### getFeeCalculatorForBlockhash - -Returns the fee calculator associated with the query blockhash, or `null` if the blockhash has expired - -#### Parameters: - -- `` - query blockhash as a Base58 encoded string -- `` - (optional) [Commitment](jsonrpc-api.md#configuring-state-commitment) - -#### Results: - -The result will be an RpcResponse JSON object with `value` equal to: - -- `` - if the query blockhash has expired -- `` - otherwise, a JSON object containing: - - `feeCalculator: `, `FeeCalculator` object describing the cluster fee rate at the queried blockhash - -#### Example: - -Request: -```bash -curl http://localhost:8899 -X POST -H "Content-Type: application/json" -d ' - { - "jsonrpc": "2.0", - "id": 1, - "method": "getFeeCalculatorForBlockhash", - "params": [ - "GJxqhuxcgfn5Tcj6y3f8X4FeCDd2RQ6SnEMo1AAxrPRZ" - ] - } -' -``` - -Result: -```json -{ - "jsonrpc": "2.0", - "result": { - "context": { - "slot": 221 - }, - "value": { - "feeCalculator": { - "lamportsPerSignature": 5000 - } - } - }, - "id": 1 -} -``` - -### getFeeRateGovernor - -Returns the fee rate governor information from the root bank - -#### Parameters: - -None - -#### Results: - -The `result` field will be an `object` with the following fields: - -- `burnPercent: `, Percentage of fees collected to be destroyed -- `maxLamportsPerSignature: `, Largest value `lamportsPerSignature` can attain for the next slot -- `minLamportsPerSignature: `, Smallest value `lamportsPerSignature` can attain for the next slot -- `targetLamportsPerSignature: `, Desired fee rate for the cluster -- `targetSignaturesPerSlot: `, Desired signature rate for the cluster - -#### Example: - -Request: -```bash -curl http://localhost:8899 -X POST -H "Content-Type: application/json" -d ' - {"jsonrpc":"2.0","id":1, "method":"getFeeRateGovernor"} -' -``` - -Result: -```json -{ - "jsonrpc": "2.0", - "result": { - "context": { - "slot": 54 - }, - "value": { - "feeRateGovernor": { - "burnPercent": 50, - "maxLamportsPerSignature": 100000, - "minLamportsPerSignature": 5000, - "targetLamportsPerSignature": 10000, - "targetSignaturesPerSlot": 20000 - } - } - }, - "id": 1 -} -``` - -### getFees - -Returns a recent block hash from the ledger, a fee schedule that can be used to -compute the cost of submitting a transaction using it, and the last slot in -which the blockhash will be valid. - -#### Parameters: - -- `` - (optional) [Commitment](jsonrpc-api.md#configuring-state-commitment) - -#### Results: - -The result will be an RpcResponse JSON object with `value` set to a JSON object with the following fields: - -- `blockhash: ` - a Hash as base-58 encoded string -- `feeCalculator: ` - FeeCalculator object, the fee schedule for this block hash -- `lastValidSlot: ` - DEPRECATED - this value is inaccurate and should not be relied upon -- `lastValidBlockHeight: ` - last [block height](../../terminology.md#block-height) at which a blockhash will be valid - -#### Example: - -Request: -```bash -curl http://localhost:8899 -X POST -H "Content-Type: application/json" -d ' - {"jsonrpc":"2.0","id":1, "method":"getFees"} -' -``` - -Result: -```json -{ - "jsonrpc": "2.0", - "result": { - "context": { - "slot": 1 - }, - "value": { - "blockhash": "CSymwgTNX1j3E4qhKfJAUE41nBWEwXufoYryPbkde5RR", - "feeCalculator": { - "lamportsPerSignature": 5000 - }, - "lastValidSlot": 297, - "lastValidBlockHeight": 296 - } - }, - "id": 1 -} -``` - ### getFeeForMessage +**NEW: This method is only available in solana-core v1.9 or newer. Please use +[getFees](jsonrpc-api.md#getfees) for solana-core v1.7/v1.8** + Get the fee the network will charge for a particular Message #### Parameters: @@ -1299,8 +1153,8 @@ Unhealthy Result (if additional information is available) ### getHighestSnapshotSlot -**NEW: This method is only available in solana-core v1.8 or newer. Please use -[getSnapshotSlot](jsonrpc-api.md#getsnapshotslot) for solana-core v1.7** +**NEW: This method is only available in solana-core v1.9 or newer. Please use +[getSnapshotSlot](jsonrpc-api.md#getsnapshotslot) for solana-core v1.7/v1.8** Returns the highest slot information that the node has snapshots for. @@ -2056,50 +1910,6 @@ Result: } ``` -### getRecentBlockhash - -Returns a recent block hash from the ledger, and a fee schedule that can be used to compute the cost of submitting a transaction using it. - -#### Parameters: - -- `` - (optional) [Commitment](jsonrpc-api.md#configuring-state-commitment) - -#### Results: - -An RpcResponse containing a JSON object consisting of a string blockhash and FeeCalculator JSON object. - -- `RpcResponse` - RpcResponse JSON object with `value` field set to a JSON object including: -- `blockhash: ` - a Hash as base-58 encoded string -- `feeCalculator: ` - FeeCalculator object, the fee schedule for this block hash - -#### Example: - -Request: -```bash -curl http://localhost:8899 -X POST -H "Content-Type: application/json" -d ' - {"jsonrpc":"2.0","id":1, "method":"getRecentBlockhash"} -' -``` - -Result: -```json -{ - "jsonrpc": "2.0", - "result": { - "context": { - "slot": 1 - }, - "value": { - "blockhash": "CSymwgTNX1j3E4qhKfJAUE41nBWEwXufoYryPbkde5RR", - "feeCalculator": { - "lamportsPerSignature": 5000 - } - } - }, - "id": 1 -} -``` - ### getRecentPerformanceSamples Returns a list of recent performance samples, in reverse slot order. Performance samples are taken every 60 seconds and @@ -4788,6 +4598,208 @@ Result: } ``` +### getFeeCalculatorForBlockhash + +**DEPRECATED: Please use [isBlockhashValid](jsonrpc-api.md#isblockhashvalid) or [getFeeForMessage](jsonrpc-api.md#getfeeformessage) instead** +This method is expected to be removed in solana-core v2.0 + +Returns the fee calculator associated with the query blockhash, or `null` if the blockhash has expired + +#### Parameters: + +- `` - query blockhash as a Base58 encoded string +- `` - (optional) [Commitment](jsonrpc-api.md#configuring-state-commitment) + +#### Results: + +The result will be an RpcResponse JSON object with `value` equal to: + +- `` - if the query blockhash has expired +- `` - otherwise, a JSON object containing: + - `feeCalculator: `, `FeeCalculator` object describing the cluster fee rate at the queried blockhash + +#### Example: + +Request: +```bash +curl http://localhost:8899 -X POST -H "Content-Type: application/json" -d ' + { + "jsonrpc": "2.0", + "id": 1, + "method": "getFeeCalculatorForBlockhash", + "params": [ + "GJxqhuxcgfn5Tcj6y3f8X4FeCDd2RQ6SnEMo1AAxrPRZ" + ] + } +' +``` + +Result: +```json +{ + "jsonrpc": "2.0", + "result": { + "context": { + "slot": 221 + }, + "value": { + "feeCalculator": { + "lamportsPerSignature": 5000 + } + } + }, + "id": 1 +} +``` + +### getFeeRateGovernor + +Returns the fee rate governor information from the root bank + +#### Parameters: + +None + +#### Results: + +The `result` field will be an `object` with the following fields: + +- `burnPercent: `, Percentage of fees collected to be destroyed +- `maxLamportsPerSignature: `, Largest value `lamportsPerSignature` can attain for the next slot +- `minLamportsPerSignature: `, Smallest value `lamportsPerSignature` can attain for the next slot +- `targetLamportsPerSignature: `, Desired fee rate for the cluster +- `targetSignaturesPerSlot: `, Desired signature rate for the cluster + +#### Example: + +Request: +```bash +curl http://localhost:8899 -X POST -H "Content-Type: application/json" -d ' + {"jsonrpc":"2.0","id":1, "method":"getFeeRateGovernor"} +' +``` + +Result: +```json +{ + "jsonrpc": "2.0", + "result": { + "context": { + "slot": 54 + }, + "value": { + "feeRateGovernor": { + "burnPercent": 50, + "maxLamportsPerSignature": 100000, + "minLamportsPerSignature": 5000, + "targetLamportsPerSignature": 10000, + "targetSignaturesPerSlot": 20000 + } + } + }, + "id": 1 +} +``` + +### getFees + +**DEPRECATED: Please use [getFeeForMessage](jsonrpc-api.md#getfeeformessage) instead** +This method is expected to be removed in solana-core v2.0 + +Returns a recent block hash from the ledger, a fee schedule that can be used to +compute the cost of submitting a transaction using it, and the last slot in +which the blockhash will be valid. + +#### Parameters: + +- `` - (optional) [Commitment](jsonrpc-api.md#configuring-state-commitment) + +#### Results: + +The result will be an RpcResponse JSON object with `value` set to a JSON object with the following fields: + +- `blockhash: ` - a Hash as base-58 encoded string +- `feeCalculator: ` - FeeCalculator object, the fee schedule for this block hash +- `lastValidSlot: ` - DEPRECATED - this value is inaccurate and should not be relied upon +- `lastValidBlockHeight: ` - last [block height](../../terminology.md#block-height) at which a blockhash will be valid + +#### Example: + +Request: +```bash +curl http://localhost:8899 -X POST -H "Content-Type: application/json" -d ' + {"jsonrpc":"2.0","id":1, "method":"getFees"} +' +``` + +Result: +```json +{ + "jsonrpc": "2.0", + "result": { + "context": { + "slot": 1 + }, + "value": { + "blockhash": "CSymwgTNX1j3E4qhKfJAUE41nBWEwXufoYryPbkde5RR", + "feeCalculator": { + "lamportsPerSignature": 5000 + }, + "lastValidSlot": 297, + "lastValidBlockHeight": 296 + } + }, + "id": 1 +} +``` + +### getRecentBlockhash + +**DEPRECATED: Please use [getFeeForMessage](jsonrpc-api.md#getfeeformessage) instead** +This method is expected to be removed in solana-core v2.0 + +Returns a recent block hash from the ledger, and a fee schedule that can be used to compute the cost of submitting a transaction using it. + +#### Parameters: + +- `` - (optional) [Commitment](jsonrpc-api.md#configuring-state-commitment) + +#### Results: + +An RpcResponse containing a JSON object consisting of a string blockhash and FeeCalculator JSON object. + +- `RpcResponse` - RpcResponse JSON object with `value` field set to a JSON object including: +- `blockhash: ` - a Hash as base-58 encoded string +- `feeCalculator: ` - FeeCalculator object, the fee schedule for this block hash + +#### Example: + +Request: +```bash +curl http://localhost:8899 -X POST -H "Content-Type: application/json" -d ' + {"jsonrpc":"2.0","id":1, "method":"getRecentBlockhash"} +' +``` + +Result: +```json +{ + "jsonrpc": "2.0", + "result": { + "context": { + "slot": 1 + }, + "value": { + "blockhash": "CSymwgTNX1j3E4qhKfJAUE41nBWEwXufoYryPbkde5RR", + "feeCalculator": { + "lamportsPerSignature": 5000 + } + } + }, + "id": 1 +} +``` + ### getSnapshotSlot **DEPRECATED: Please use [getHighestSnapshotSlot](jsonrpc-api.md#gethighestsnapshotslot) instead**