Casper RPC
How to use it
// yarn add @tatumio/tatum
import { TatumSDK, Casper, Network } from '@tatumio/tatum'
const tatum = await TatumSDK.init<Casper>({ network: Network.CASPER })
const result = await tatum.rpc.infoGetChainspec()
await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs
Request Example
curl --location 'https://api.tatum.io/v3/blockchain/node/casper-mainnet/' \
--header 'Content-Type: application/json' \
--header 'x-api-key: {API_KEY}' \
--data '{
"jsonrpc":"2.0",
"method":"info_get_chainspec",
"id":0
}'
Overview
info_get_chainspec
is an RPC method on the Casper blockchain that retrieves the current chainspec details. The chainspec includes protocol configuration information essential for the functioning and governance of the network.
Parameters
The info_get_chainspec
method does not require any parameters.
Return Object
The info_get_chainspec
method returns an object with the following fields:
api_version
: The API version. Example:"1.5.6"
chainspec
: An object containing the chainspec details.
Response
{
"jsonrpc": "2.0",
"id": 0,
"result": {
"api_version": "1.5.6",
"chainspec": {
// Chainspec details
}
}
}
Notes
- This method returns the current chainspec details of the network.
- This method does not require any parameters.
For more detailed information, refer to the official Casper documentation.