outdated
- Frontier: RPC request templates in curl
- eth: block_number
- eth: eth_estimateGas
- eth: eth_sendRawTransaction
- eth: eth_sendTransaction
- eth: eth_call
- eth: eth_getBlockTransactionCountByHash
- eth: eth_getBlockByNumber
- eth: eth_getBlockByHash
- eth: eth_getTransactionReceipt
- eth: eth_getTransactionByBlockNumberAndIndex
- eth: eth_getTransactionByBlockHashAndIndex
- eth: eth_getTransactionByHash
- eth: eth_getTransactionCount
- eth: eth_syncing
- eth: eth_getStorageAt
- eth: eth_gasPrice
- eth: eth_blockNumber
- eth: eth_getCode
- eth: eth_chainId
- eth: eth_getBalance
- eth: coinbase
- eth: accounts
- eth: eth_getUncleByBlockNumberAndIndex
- eth: eth_getUncleByBlockHashAndIndex
- eth: eth_getUncleCountByBlockNumber
- eth: eth_getUncleCountByBlockHash
- eth: getWork
- eth: submitWork
- eth: submitHashrate
- eth: protocolVersion
- eth: hashrate
- eth: eth_maxPriorityFeePerGas
- eth: fee_history
- eth: eth_mining
- eth: block_by_number
Get the current block number
curl --header "Content-Type: application/json" \
--request POST \
--data '{"jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 0}' \
http://localhost:9944
curl --header "Content-Type: application/json" \
--request POST \
--data '{"jsonrpc": "2.0", "method": "eth_estimateGas", "params": [{"from":null,"to":"0x6b175474e89094c44da98b954eedeac495271d0f","data":"0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE"}, "finalized"], "id": 0}' \
http://localhost:9944
curl --header "Content-Type: application/json" \
--request POST \
--data '{"jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": ["0x0000000000000000"], "id": 0}' \
http://localhost:9944
curl --header "Content-Type: application/json" \
--request POST \
--data '{"jsonrpc": "2.0", "method": "eth_sendTransaction", "params": [{"from":null,"to":"0x6b175474e89094c44da98b954eedeac495271d0f","data":"0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE"}, "finalized"], "id": 0}' \
http://localhost:9944
curl --header "Content-Type: application/json" \
--request POST \
--data '{"jsonrpc": "2.0", "method": "eth_call", "params": [{"from":null,"to":"0x6b175474e89094c44da98b954eedeac495271d0f","data":"0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE"}, "finalized"], "id": 0}' \
http://localhost:9944
curl --header "Content-Type: application/json" \
--request POST \
--data '{"jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByHash", "params": ["0x0000000000000000000000000000000000000000000000000000000000000000"], "id": 0}' \
http://localhost:9944
curl --header "Content-Type: application/json" \
--request POST \
--data '{"jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": [12345, false], "id": 0}' \
http://localhost:9944
curl --header "Content-Type: application/json" \
--request POST \
--data '{"jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": ["0x0000000000000000000000000000000000000000000000000000000000000000", false], "id": 0}' \
http://localhost:9944
curl --header "Content-Type: application/json" \
--request POST \
--data '{"jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": ["0x0000000000000000000000000000000000000000000000000000000000000000"], "id": 0}' \
http://localhost:9944
curl --header "Content-Type: application/json" \
--request POST \
--data '{"jsonrpc": "2.0", "method": "eth_getTransactionByBlockNumberAndIndex", "params": ["latest", 0], "id": 0}' \
http://localhost:9944
curl --header "Content-Type: application/json" \
--request POST \
--data '{"jsonrpc": "2.0", "method": "eth_getTransactionByBlockHashAndIndex", "params": ["0x0000000000000000000000000000000000000000000000000000000000000000", 0], "id": 0}' \
http://localhost:9944
curl --header "Content-Type: application/json" \
--request POST \
--data '{"jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": ["0x0000000000000000000000000000000000000000000000000000000000000000"], "id": 0}' \
http://localhost:9944
curl --header "Content-Type: application/json" \
--request POST \
--data '{"jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": ["0x0000000000000000000000000000000000000000", "latest"], "id": 0}' \
http://localhost:9944
curl --header "Content-Type: application/json" \
--request POST \
--data '{"jsonrpc": "2.0", "method": "eth_syncing", "params": [], "id": 0}' \
http://localhost:9944
curl --header "Content-Type: application/json" \
--request POST \
--data '{"jsonrpc": "2.0", "method": "eth_getStorageAt", "params": ["0x0000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000", "latest"], "id": 0}' \
http://localhost:9944
curl --header "Content-Type: application/json" \
--request POST \
--data '{"jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 0}' \
http://localhost:9944
curl --header "Content-Type: application/json" \
--request POST \
--data '{"jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 0}' \
http://localhost:9944
curl --header "Content-Type: application/json" \
--request POST \
--data '{"jsonrpc": "2.0", "method": "eth_getCode", "params": ["0x0000000000000000000000000000000000000000", "latest"], "id": 0}' \
http://localhost:9944
curl --header "Content-Type: application/json" \
--request POST \
--data '{"jsonrpc": "2.0", "method": "eth_chainId", "params": [], "id": 0}' \
http://localhost:9944
curl --header "Content-Type: application/json" \
--request POST \
--data '{"jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0x0000000000000000000000000000000000000000", "latest"], "id": 0}' \
http://localhost:9944
curl --header "Content-Type: application/json" \
--request POST \
--data '{"jsonrpc": "2.0", "method": "eth_coinbase", "params": [], "id": 0}' \
http://localhost:9944
curl --header "Content-Type: application/json" \
--request POST \
--data '{"jsonrpc": "2.0", "method": "eth_accounts", "params": [], "id": 0}' \
http://localhost:9944
curl --header "Content-Type: application/json" \
--request POST \
--data '{"jsonrpc": "2.0", "method": "eth_getUncleByBlockNumberAndIndex", "params": [0, 0], "id": 0}' \
http://localhost:9944
curl --header "Content-Type: application/json" \
--request POST \
--data '{"jsonrpc": "2.0", "method": "eth_getUncleByBlockHashAndIndex", "params": ["0x0000000000000000000000000000000000000000000000000000000000000000", 0], "id": 0}' \
http://localhost:9944
curl --header "Content-Type: application/json" \
--request POST \
--data '{"jsonrpc": "2.0", "method": "eth_getUncleCountByBlockNumber", "params": [707], "id": 0}' \
http://localhost:9944
curl --header "Content-Type: application/json" \
--request POST \
--data '{"jsonrpc": "2.0", "method": "eth_getUncleCountByBlockHash", "params": [ "0x0000000000000000000000000000000000000000000000000000000000000000"], "id": 0}' \
http://localhost:9944
curl --header "Content-Type: application/json" \
--request POST \
--data '{"jsonrpc": "2.0", "method": "eth_getWork", "params": [], "id": 0}' \
http://localhost:9944
curl --header "Content-Type: application/json" \
--request POST \
--data '{"jsonrpc": "2.0", "method": "eth_submitWork", "params": ["0x0000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000"], "id": 0}' \
http://localhost:9944
curl --header "Content-Type: application/json" \
--request POST \
--data '{"jsonrpc": "2.0", "method": "eth_submitHashrate", "params": ["0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000"], "id": 0}' \
http://localhost:9944
curl --header "Content-Type: application/json" \
--request POST \
--data '{"jsonrpc": "2.0", "method": "eth_protocolVersion", "params": [], "id": 0}' \
http://localhost:9944
curl --header "Content-Type: application/json" \
--request POST \
--data '{"jsonrpc": "2.0", "method": "eth_hashrate", "params": ["0x3", 10, []], "id": 0}' \
http://localhost:9944
curl --header "Content-Type: application/json" \
--request POST \
--data '{"jsonrpc": "2.0", "method": "eth_maxPriorityFeePerGas", "params": [], "id": 0}' \
http://localhost:9944
curl --header "Content-Type: application/json" \
--request POST \
--data '{"jsonrpc": "2.0", "method": "eth_feeHistory", "params": ["0x3", 10, []], "id": 0}' \
http://localhost:9944
Get the current block number
curl --header "Content-Type: application/json" \
--request POST \
--data '{"jsonrpc": "2.0", "method": "eth_mining", "params": [], "id": 0}' \
http://localhost:9944 | jq ".result"
Get block by number
curl --header "Content-Type: application/json" \
--request POST \
--data '{"jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": [3, false], "id": 0}' \
http://localhost:9944 | jq ".result.hash"