Block methods
These methods query blocks and their contents, including block details, transaction counts, receipts, and uncles.
eth_getBlockByHash
Returns information about the block matching the specified block hash.
Parameters
-
hash: string - 32-byte hash of a block. -
verbose: boolean - Iftrue, returns the full transaction objects; iffalse, returns the transaction hashes.
Returns
-
Block object, or
nullwhen there is no block.-
number: quantity, integer - Block number.nullwhen block is pending. -
hash: data, 32 bytes - Hash of the block.nullwhen block is pending. -
parentHash: data, 32 bytes - Hash of the parent block. -
nonce: data, 8 bytes - Hash of the generated proof of work.nullwhen block is pending. -
sha3Uncles: data, 32 bytes - SHA3 of the uncle's data in the block. -
logsBloom: data, 256 bytes - Bloom filter for the block logs.nullwhen block is pending. -
transactionsRoot: data, 32 bytes - Root of the transaction trie for the block. -
stateRoot: data, 32 bytes - Root of the final state trie for the block. -
receiptsRoot: data, 32 bytes - Root of the receipts trie for the block. -
miner: data, 20 bytes - Address to pay mining rewards to. -
difficulty: quantity, integer - Difficulty for this block. -
totalDifficulty: quantity, integer - Total difficulty of the chain until this block. This field is only returned for pre-merge (Proof of Work) blocks. This value will always be0for an uncle block. -
extraData: data - Extra data field for this block. The first 32 bytes is vanity data you can set using the--miner-extra-datacommand line option. Stores extra data when used with IBFT. -
size: quantity, integer - Size of block in bytes. -
gasLimit: quantity - Maximum gas allowed in this block. -
gasUsed: quantity - Total gas used by all transactions in this block. -
timestamp: quantity - Hex-encoded Unix timestamp (in seconds) for block assembly. -
transactions: array - Array of transaction objects, or 32 byte transaction hashes depending on the specified boolean parameter.-
accessList: array - (Optional) List of addresses and storage keys the transaction plans to access. Used inACCESS_LISTtransactions and may be used inEIP1559transactions. -
blockHash: data, 32 bytes - Hash of the block containing this transaction.nullwhen transaction is pending. -
blockNumber: quantity - Block number of the block containing this transaction.nullwhen transaction is pending. -
blockTimestamp: quantity - Hex-encoded Unix timestamp (in seconds) of the block containing this transaction.nullwhen transaction is pending. -
chainId: quantity - Chain ID. -
from: data, 20 bytes - Address of the sender. -
gas: quantity - Gas provided by the sender. -
gasPrice: quantity - (Optional) Gas price, in Wei, provided by the sender. Used only in non-EIP1559transactions. -
maxPriorityFeePerGas: quantity, integer - (Optional) Maximum fee, in Wei, the sender is willing to pay per gas above the base fee. Used only inEIP1559transactions. -
maxFeePerGas: quantity, integer - (Optional) Maximum total fee (base fee + priority fee), in Wei, the sender is willing to pay per gas. Used only inEIP1559transactions. -
hash: data, 32 bytes - Hash of the transaction. -
input: data - Data sent with the transaction to create or invoke a contract. -
nonce: quantity - Number of transactions made by the sender before this one. -
to: data, 20 bytes - Address of the receiver.nullif a contract creation transaction. -
transactionIndex: quantity, integer - Index position of the transaction in the block.nullwhen transaction is pending. -
transactionType: string - Transaction type. -
value: quantity - Value transferred, in Wei. -
v: quantity - ECDSA Recovery ID. -
r: data, 32 bytes - ECDSA signature r. -
s: data, 32 bytes - ECDSA signature s.
-
-
uncles: array - Array of uncle hashes. -
baseFeePerGas: quantity - The block's base fee per gas. This field is empty for blocks created before EIP-1559.
-
Example
- curl HTTP
- wscat WS
- JSON result
- curl GraphQL
- GraphQL
- GraphQL result
curl -X POST http://127.0.0.1:8545/ \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"method": "eth_getBlockByHash",
"params": [
"0xd5f1812548be429cbdc6376b29611fc49e06f1359758c4ceaaa3b393e2239f9c",
false
],
"id": 53
}'
{
"jsonrpc": "2.0",
"method": "eth_getBlockByHash",
"params": [
"0xd5f1812548be429cbdc6376b29611fc49e06f1359758c4ceaaa3b393e2239f9c",
false
],
"id": 53
}
{
"jsonrpc": "2.0",
"id": 53,
"result": {
"number": "0x68b3",
"hash": "0xd5f1812548be429cbdc6376b29611fc49e06f1359758c4ceaaa3b393e2239f9c",
"mixHash": "0x24900fb3da77674a861c428429dce0762707ecb6052325bbd9b3c64e74b5af9d",
"parentHash": "0x1f68ac259155e2f38211ddad0f0a15394d55417b185a93923e2abe71bb7a4d6d",
"nonce": "0x378da40ff335b070",
"sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"logsBloom": "0x00000000000000100000004080000000000500000000000000020000100000000800001000000004000001000000000000000800040010000020100000000400000010000000000000000040000000000000040000000000000000000000000000000400002400000000000000000000000000000004000004000000000000840000000800000080010004000000001000000800000000000000000000000000000000000800000000000040000000020000000000000000000800000400000000000000000000000600000400000000002000000000000000000000004000000000000000100000000000000000000000000000000000040000900010000000",
"transactionsRoot": "0x4d0c8e91e16bdff538c03211c5c73632ed054d00a7e210c0eb25146c20048126",
"stateRoot": "0x91309efa7e42c1f137f31fe9edbe88ae087e6620d0d59031324da3e2f4f93233",
"receiptsRoot": "0x68461ab700003503a305083630a8fb8d14927238f0bc8b6b3d246c0c64f21f4a",
"miner": "0xb42b6c4a95406c78ff892d270ad20b22642e102d",
"difficulty": "0x66e619a",
"totalDifficulty": "0x1e875d746ae",
"extraData": "0xd583010502846765746885676f312e37856c696e7578",
"size": "0x334",
"gasLimit": "0x47e7c4",
"gasUsed": "0x37993",
"timestamp": "0x5835c54d",
"uncles": [],
"transactions": [
"0xa0807e117a8dd124ab949f460f08c36c72b710188f01609595223b325e58e0fc",
"0xeae6d797af50cb62a596ec3939114d63967c374fa57de9bc0f4e2b576ed6639d"
],
"baseFeePerGas": "0x7"
}
}
curl -X POST http://localhost:8547/graphql \
-H "Content-Type: application/json" \
--data '{
"query": "{block (hash : \"0xb0efed1fc9326fee967cb2d845d4ebe57c5350a0670c8e86f8052dea6f219f92\") {number transactions{hash} timestamp difficulty totalDifficulty gasUsed gasLimit hash nonce ommerCount logsBloom mixHash ommerHash extraData stateRoot receiptsRoot transactionCount transactionsRoot}}"
}'
{
block(hash: "0xb0efed1fc9326fee967cb2d845d4ebe57c5350a0670c8e86f8052dea6f219f92") {
number
transactions {
hash
}
timestamp
difficulty
totalDifficulty
gasUsed
gasLimit
hash
nonce
ommerCount
logsBloom
mixHash
ommerHash
extraData
stateRoot
receiptsRoot
transactionCount
transactionsRoot
}
}
{
"data": {
"block": {
"number": 17607,
"transactions": [],
"timestamp": "0x5cdbdfb5",
"difficulty": "0x1",
"totalDifficulty": "0x44c8",
"gasUsed": 0,
"gasLimit": 4700000,
"hash": "0xb0efed1fc9326fee967cb2d845d4ebe57c5350a0670c8e86f8052dea6f219f92",
"nonce": "0x0000000000000000",
"ommerCount": 0,
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"mixHash": "0x63746963616c2062797a616e74696e65206661756c7420746f6c6572616e6365",
"ommerHash": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"extraData": "0xf882a00000000000000000000000000000000000000000000000000000000000000000d5949811ebc35d7b06b3fa8dc5809a1f9c52751e1deb808400000000f843b841fae6d25da0b91e3e88669d0a765c98479d86d53e9ea1f3fb6b36d7ff22fa622a3da0c49c20e5562c774e90acae8ad487936f6b6019cd8a782db684693cba1e9800",
"stateRoot": "0xa7086c266aed46cd3bc45579178f8acb36d9d147de575a3ecbf8c7e6f1c737fc",
"receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"transactionCount": 0,
"transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"baseFeePerGas": "0x7"
}
}
}
eth_getBlockByNumber
Returns information about the block matching the specified block number.
Parameters
-
blockNumber: string - Hexadecimal integer representing a block number, or one of the string tagslatest,earliest,pending,finalized, orsafe, as described in block parameter.notependingreturns the same value aslatest. -
verbose: boolean - Iftrue, returns the full transaction objects; iffalse, returns only the hashes of the transactions.
Returns
-
Block object, or
nullwhen there is no block.-
number: quantity, integer - Block number.nullwhen block is pending. -
hash: data, 32 bytes - Hash of the block.nullwhen block is pending. -
parentHash: data, 32 bytes - Hash of the parent block. -
nonce: data, 8 bytes - Hash of the generated proof of work.nullwhen block is pending. -
sha3Uncles: data, 32 bytes - SHA3 of the uncle's data in the block. -
logsBloom: data, 256 bytes - Bloom filter for the block logs.nullwhen block is pending. -
transactionsRoot: data, 32 bytes - Root of the transaction trie for the block. -
stateRoot: data, 32 bytes - Root of the final state trie for the block. -
receiptsRoot: data, 32 bytes - Root of the receipts trie for the block. -
miner: data, 20 bytes - Address to pay mining rewards to. -
difficulty: quantity, integer - Difficulty for this block. -
totalDifficulty: quantity, integer - Total difficulty of the chain until this block. This field is only returned for pre-merge (Proof of Work) blocks. This value will always be0for an uncle block. -
extraData: data - Extra data field for this block. The first 32 bytes is vanity data you can set using the--miner-extra-datacommand line option. Stores extra data when used with IBFT. -
size: quantity, integer - Size of block in bytes. -
gasLimit: quantity - Maximum gas allowed in this block. -
gasUsed: quantity - Total gas used by all transactions in this block. -
timestamp: quantity - Hex-encoded Unix timestamp (in seconds) for block assembly. -
transactions: array - Array of transaction objects, or 32 byte transaction hashes depending on the specified boolean parameter.-
accessList: array - (Optional) List of addresses and storage keys the transaction plans to access. Used inACCESS_LISTtransactions and may be used inEIP1559transactions. -
blockHash: data, 32 bytes - Hash of the block containing this transaction.nullwhen transaction is pending. -
blockNumber: quantity - Block number of the block containing this transaction.nullwhen transaction is pending. -
blockTimestamp: quantity - Hex-encoded Unix timestamp (in seconds) of the block containing this transaction.nullwhen transaction is pending. -
chainId: quantity - Chain ID. -
from: data, 20 bytes - Address of the sender. -
gas: quantity - Gas provided by the sender. -
gasPrice: quantity - (Optional) Gas price, in Wei, provided by the sender. Used only in non-EIP1559transactions. -
maxPriorityFeePerGas: quantity, integer - (Optional) Maximum fee, in Wei, the sender is willing to pay per gas above the base fee. Used only inEIP1559transactions. -
maxFeePerGas: quantity, integer - (Optional) Maximum total fee (base fee + priority fee), in Wei, the sender is willing to pay per gas. Used only inEIP1559transactions. -
hash: data, 32 bytes - Hash of the transaction. -
input: data - Data sent with the transaction to create or invoke a contract. -
nonce: quantity - Number of transactions made by the sender before this one. -
to: data, 20 bytes - Address of the receiver.nullif a contract creation transaction. -
transactionIndex: quantity, integer - Index position of the transaction in the block.nullwhen transaction is pending. -
transactionType: string - Transaction type. -
value: quantity - Value transferred, in Wei. -
v: quantity - ECDSA Recovery ID. -
r: data, 32 bytes - ECDSA signature r. -
s: data, 32 bytes - ECDSA signature s.
-
-
uncles: array - Array of uncle hashes. -
baseFeePerGas: quantity - The block's base fee per gas. This field is empty for blocks created before EIP-1559.
-
Example
- curl HTTP
- wscat WS
- JSON result
- curl GraphQL
- GraphQL
- GraphQL result
curl -X POST http://127.0.0.1:8545/ \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"method": "eth_getBlockByNumber",
"params": [
"0x68B3",
true
],
"id": 1
}'
{
"jsonrpc": "2.0",
"method": "eth_getBlockByNumber",
"params": [
"0x68B3",
true
],
"id": 1
}
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"number": "0x68b3",
"hash": "0xd5f1812548be429cbdc6376b29611fc49e06f1359758c4ceaaa3b393e2239f9c",
"mixHash": "0x24900fb3da77674a861c428429dce0762707ecb6052325bbd9b3c64e74b5af9d",
"parentHash": "0x1f68ac259155e2f38211ddad0f0a15394d55417b185a93923e2abe71bb7a4d6d",
"nonce": "0x378da40ff335b070",
"sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"logsBloom": "0x00000000000000100000004080000000000500000000000000020000100000000800001000000004000001000000000000000800040010000020100000000400000010000000000000000040000000000000040000000000000000000000000000000400002400000000000000000000000000000004000004000000000000840000000800000080010004000000001000000800000000000000000000000000000000000800000000000040000000020000000000000000000800000400000000000000000000000600000400000000002000000000000000000000004000000000000000100000000000000000000000000000000000040000900010000000",
"transactionsRoot": "0x4d0c8e91e16bdff538c03211c5c73632ed054d00a7e210c0eb25146c20048126",
"stateRoot": "0x91309efa7e42c1f137f31fe9edbe88ae087e6620d0d59031324da3e2f4f93233",
"receiptsRoot": "0x68461ab700003503a305083630a8fb8d14927238f0bc8b6b3d246c0c64f21f4a",
"miner": "0xb42b6c4a95406c78ff892d270ad20b22642e102d",
"difficulty": "0x66e619a",
"totalDifficulty": "0x1e875d746ae",
"extraData": "0xd583010502846765746885676f312e37856c696e7578",
"size": "0x334",
"gasLimit": "0x47e7c4",
"gasUsed": "0x37993",
"timestamp": "0x5835c54d",
"uncles": [],
"transactions": [],
"baseFeePerGas": "0x7"
}
}
curl -X POST http://localhost:8547/graphql \
-H "Content-Type: application/json" \
--data '{
"query": "{block (number : 100) {transactions{hash} timestamp difficulty totalDifficulty gasUsed gasLimit hash nonce ommerCount logsBloom mixHash ommerHash extraData stateRoot receiptsRoot transactionCount transactionsRoot ommers{hash} ommerAt(index : 1){hash} miner{address} account(address: \"0xfe3b557e8fb62b89f4916b721be55ceb828dbd73\"){balance} parent{hash} }}"
}'
{
block(number: 100) {
transactions {
hash
}
timestamp
difficulty
totalDifficulty
gasUsed
gasLimit
hash
nonce
ommerCount
logsBloom
mixHash
ommerHash
extraData
stateRoot
receiptsRoot
transactionCount
transactionsRoot
ommers {
hash
}
ommerAt(index: 1) {
hash
}
miner {
address
}
account(address: "0xfe3b557e8fb62b89f4916b721be55ceb828dbd73") {
balance
}
parent {
hash
}
}
}
{
"data": {
"block": {
"transactions": [],
"timestamp": "0x5cd10933",
"difficulty": "0x1",
"totalDifficulty": "0x65",
"gasUsed": 0,
"gasLimit": 4700000,
"hash": "0x63b3ea2bc37fec8f82680eb823652da6af8acebb4f6c4d0ff659c55be473c8b0",
"nonce": "0x0000000000000000",
"ommerCount": 0,
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"mixHash": "0x63746963616c2062797a616e74696e65206661756c7420746f6c6572616e6365",
"ommerHash": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"extraData": "0xf882a00000000000000000000000000000000000000000000000000000000000000000d5949811ebc35d7b06b3fa8dc5809a1f9c52751e1deb808400000000f843b8414d877d8d0ced37ea138fab55a978f3740367a24a31731322ecdc3368f11e0d4966c9ce17ae59a76fb94eb436e8a386868f6bd6b0a5678e58daf49f5dd940558b00",
"stateRoot": "0xd650578a04b39f50cc979155f4510ec28c2c0a7c1e5fdbf84609bc7b1c430f48",
"receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"transactionCount": 0,
"transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"ommers": [],
"ommerAt": null,
"miner": {
"address": "0x9811ebc35d7b06b3fa8dc5809a1f9c52751e1deb"
},
"account": {
"balance": "0xad0f47f269cbf31ac"
},
"parent": {
"hash": "0x7bca25e1fa5e395fd6029eb496a70b6b5495843976bf9e49b993c723ded29d9e"
},
"baseFeePerGas": "0x7"
}
}
}
eth_getBlockReceipts
Returns all transaction receipts for a given block. Transaction receipts provide a way to track the success or failure of a transaction (1 if successful and 0 if failed), as well as the amount of
gas used and any event logs that might have been produced by a smart contract during the transaction.
Parameters
-
blockNumber: string - Hexadecimal integer representing a block number, or one of the string tagslatest,earliest,pending,finalized, orsafe, as described in block parameter.notependingreturns the same value aslatest.
Returns
-
List of transaction receipt objects, or
nullwhen there is no block.-
blockHash: data, 32 bytes - Hash of block containing this transaction. -
blockNumber: quantity - Block number of block containing this transaction. -
blockTimestamp: quantity - Hex-encoded unix timestamp (in seconds) of the block that includes this transaction. -
contractAddress: data, 20 bytes - Contract address created, if contract creation transaction, otherwise,null. A failed contract creation transaction still produces a contract address value. -
cumulativeGasUsed: quantity - Total amount of gas used by previous transactions in the block and this transaction. -
effectiveGasPrice: quantity - The actual value per gas deducted from the sender's account. -
from: data, 20 bytes - Address of the sender. -
gasUsed: quantity - Amount of gas used by this specific transaction. -
logs: array - Array of log objects generated by this transaction.-
removed: tag -trueif log removed because of a chain reorganization.falseif a valid log. -
logIndex: quantity, integer - Log index position in the block.nullwhen log is pending. -
transactionIndex: quantity, integer - Index position of the starting transaction for the log.nullwhen log is pending. -
transactionHash: data, 32 bytes - Hash of the starting transaction for the log.nullwhen log is pending. -
blockHash: data, 32 bytes - Hash of the block that includes the log.nullwhen log is pending. -
blockNumber: quantity - Number of block that includes the log.nullwhen log is pending. -
blockTimestamp: quantity - Hex-encoded unix timestamp (in seconds) of the block that includes the log. -
address: data, 20 bytes - Address the log originated from. -
data: data - Non-indexed arguments of the log. -
topics: array of data, 32 bytes each - Event signature hash and 0 to 3 indexed log arguments.
-
-
logsBloom: data, 256 bytes - Bloom filter for light clients to quickly retrieve related logs. -
status: quantity - Either0x0(failure),0x1(success), or0x2(invalid). -
to: data, 20 bytes - Address of the receiver, if sending ether, otherwise, null. -
transactionHash: data, 32 bytes - Hash of the transaction. -
transactionIndex: quantity, integer - Index position of transaction in the block. -
transactionType: string - Transaction type. -
revertReason: string - ABI-encoded string that displays the reason for reverting the transaction. Only available if revert reason is enabled. -
type: quantity - Transaction type,0x00for legacy transactions,0x01for access list types,0x02for dynamic fees, and0x03for blob transactions. -
root: data, 32 bytes - Pre-Byzantium transactions return this field instead ofstatus. Post-transaction state root.
-
Example
- curl HTTP
- wscat WS
- JSON result
- curl GraphQL
- GraphQL
- GraphQL result
curl -X POST http://127.0.0.1:8545/ \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"method": "eth_getBlockReceipts",
"params": [
"latest"
],
"id": 1
}'
{
"jsonrpc": "2.0",
"method": "eth_getBlockReceipts",
"params": [
"0x6f55"
],
"id": 1
}
{
"jsonrpc": "2.0",
"id": 1,
"result": [
{
"blockHash": "0x19514ce955c65e4dd2cd41f435a75a46a08535b8fc16bc660f8092b32590b182",
"blockNumber": "0x6f55",
"contractAddress": null,
"cumulativeGasUsed": "0x18c36",
"from": "0x22896bfc68814bfd855b1a167255ee497006e730",
"gasUsed": "0x18c36",
"effectiveGasPrice": "0x9502f907",
"logs": [
{
"address": "0xfd584430cafa2f451b4e2ebcf3986a21fff04350",
"topics": [
"0x2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d",
"0x4be29e0e4eb91f98f709d98803cba271592782e293b84a625e025cbb40197ba8",
"0x000000000000000000000000835281a2563db4ebf1b626172e085dc406bfc7d2",
"0x00000000000000000000000022896bfc68814bfd855b1a167255ee497006e730"
],
"data": "0x",
"blockNumber": "0x6f55",
"transactionHash": "0x4a481e4649da999d92db0585c36cba94c18a33747e95dc235330e6c737c6f975",
"transactionIndex": "0x0",
"blockHash": "0x19514ce955c65e4dd2cd41f435a75a46a08535b8fc16bc660f8092b32590b182",
"blockTimestamp": "0x561bc2e0",
"logIndex": "0x0",
"removed": false
}
],
"logsBloom": "0x00000004000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000080020000000000000200010000000000000000000001000000800000000000000000000000000000000000000000000000000000100100000000000000000000008000000000000000000000000000000002000000000000000000000",
"status": "0x1",
"to": "0xfd584430cafa2f451b4e2ebcf3986a21fff04350",
"transactionHash": "0x4a481e4649da999d92db0585c36cba94c18a33747e95dc235330e6c737c6f975",
"transactionIndex": "0x0",
"type": "0x0"
},
{
"blockHash": "0x19514ce955c65e4dd2cd41f435a75a46a08535b8fc16bc660f8092b32590b182",
"blockNumber": "0x6f55",
"contractAddress": null,
"cumulativeGasUsed": "0x1de3e",
"from": "0x712e3a792c974b3e3dbe41229ad4290791c75a82",
"gasUsed": "0x5208",
"effectiveGasPrice": "0x9502f907",
"logs": [],
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"status": "0x1",
"to": "0xd42e2b1c14d02f1df5369a9827cb8e6f3f75f338",
"transactionHash": "0xefb83b4e3f1c317e8da0f8e2fbb2fe964f34ee184466032aeecac79f20eacaf6",
"transactionIndex": "0x1",
"type": "0x2"
}
]
}
curl -X POST http://localhost:8547/graphql \
-H "Content-Type: application/json" \
--data '{
"query": "{block (hash: \"0x4d746a3381673a5180744a56e78cded4696b77317866c2253566e0fa16967e1d\") {transactions{block{hash logsBloom} hash createdContract{address} cumulativeGasUsed gas gasUsed logs{topics} from{address} to{address} index}}}"
}'
{
block (hash: "0x4d746a3381673a5180744a56e78cded4696b77317866c2253566e0fa16967e1d") {
transactions {
block {
hash
logsBloom
}
hash
createdContract {
address
}
cumulativeGasUsed
gas
gasUsed
logs{
topics
}
from{
address
}
to {
address
}
index
}
}
}
{
"data" : {
"block" : {
"transactions" : [ {
"block" : {
"hash" : "0x4d746a3381673a5180744a56e78cded4696b77317866c2253566e0fa16967e1d",
"logsBloom" : "0x2e0a8080520608000e38181e0c9081e813a00c184a010d1900c9602240428dc6480004444098428b945010802454104002827420426591a200224016802841900031bd4440828ec9b113081880027c01cc47105c1885d556216200880026160810050028422a4b0c4bc8087372860851000802c8d901158504a482100d488040119c08045e500824402054a0d91cc433188909020a06ac841914a2a082c104a1260460014b8b001b28030202518c040008266038a880026208041d082503589054581223c188004396804801280c00020c492816060a421831c8820ac04460303a9e48128238e0098f319030083808150c4914b8840000206715481500690000"
},
"hash" : "0x7afe779fd0c6d4a1b6f330e679a5cf94095eaa57d2ce0c0ef991dfb2b405374f",
"createdContract" : null,
"cumulativeGasUsed" : "0x5208",
"gas" : "0x61a8",
"gasUsed" : "0x5208",
"logs" : [ ],
"from" : {
"address" : "0x66f962241b8ff853849c85a63a0ce20bae4f68d5"
},
"to" : {
"address" : "0x6be8356826a9fc7b2d911fcc1de6342ae5f5b9a3"
},
"index" : "0x0"
}, {
"block" : {
"hash" : "0x4d746a3381673a5180744a56e78cded4696b77317866c2253566e0fa16967e1d",
"logsBloom" : "0x2e0a8080520608000e38181e0c9081e813a00c184a010d1900c9602240428dc6480004444098428b945010802454104002827420426591a200224016802841900031bd4440828ec9b113081880027c01cc47105c1885d556216200880026160810050028422a4b0c4bc8087372860851000802c8d901158504a482100d488040119c08045e500824402054a0d91cc433188909020a06ac841914a2a082c104a1260460014b8b001b28030202518c040008266038a880026208041d082503589054581223c188004396804801280c00020c492816060a421831c8820ac04460303a9e48128238e0098f319030083808150c4914b8840000206715481500690000"
},
"hash" : "0x412f04ba27c1c096dadb2d8af54ee61034c3d4679fdd025a634e95fa2238713c",
"createdContract" : null,
"cumulativeGasUsed" : "0xbcdb2",
"gas" : "0xbdfe0",
"gasUsed" : "0xb7baa",
"logs" : [ {
"topics" : [ "0xd93fde3ea1bb11dcd7a4e66320a05fc5aa63983b6447eff660084c4b1b1b499b", "0x00000000000000000000000000000000000000000000000000000000000e4d3a" ]
} ],
"from" : {
"address" : "0xe253f7a6533c62755f470b33fa5bcd659a5db3cd"
},
"to" : {
"address" : "0x95ff8d3ce9dcb7455beb7845143bea84fe5c4f6f"
},
"index" : "0x1"
} ]
}
}
}
eth_getBlockTransactionCountByHash
Returns the number of transactions in the block matching the specified block hash.
Parameters
hash: string - 32-byte block hash.
Returns
- Integer representing the number of transactions in the specified block, or
nullif no matching block hash is found.
Example
- curl HTTP
- wscat WS
- JSON result
- curl GraphQL
- GraphQL
- GraphQL result
curl -X POST http://127.0.0.1:8545/ \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"method": "eth_getBlockTransactionCountByHash",
"params": [
"0xb903239f8543d04b5dc1ba6579132b143087c68db1b2168786408fcbce568238"
],
"id": 53
}'
{
"jsonrpc": "2.0",
"method": "eth_getBlockTransactionCountByHash",
"params": [
"0xb903239f8543d04b5dc1ba6579132b143087c68db1b2168786408fcbce568238"
],
"id": 53
}
{
"jsonrpc": "2.0",
"id": 53,
"result": null
}
curl -X POST http://localhost:8547/graphql \
-H "Content-Type: application/json" \
--data '{
"query": "{block(hash:\"0xe455c14f757b0b9b67774baad1be1c180a4c1657df52259dbb685bf375408097\"){transactionCount}}"
}'
{
block(hash: "0xe455c14f757b0b9b67774baad1be1c180a4c1657df52259dbb685bf375408097") {
transactionCount
}
}
{
"data": {
"block": {
"transactionCount": 1
}
}
}
eth_getBlockTransactionCountByNumber
Returns the number of transactions in a block matching the specified block number.
Parameters
-
blockNumber: string - Hexadecimal integer representing a block number, or one of the string tagslatest,earliest,pending,finalized, orsafe, as described in block parameter.notependingreturns the same value aslatest.
Returns
- Integer representing the number of transactions in the specified block, or
nullif no matching block number is found.
Example
- curl HTTP
- wscat WS
- JSON result
- curl GraphQL
- GraphQL
- GraphQL result
curl -X POST http://127.0.0.1:8545/ \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"method": "eth_getBlockTransactionCountByNumber",
"params": [
"0xe8"
],
"id": 51
}'
{
"jsonrpc": "2.0",
"method": "eth_getBlockTransactionCountByNumber",
"params": [
"0xe8"
],
"id": 51
}
{
"jsonrpc": "2.0",
"id": 51,
"result": "0x8"
}
curl -X POST http://localhost:8547/graphql \
-H "Content-Type: application/json" \
--data '{
"query": "{block(number:232){transactionCount}}"
}'
{
block(number: 232) {
transactionCount
}
}
{
"data": {
"block": {
"transactionCount": 1
}
}
}
eth_getUncleByBlockHashAndIndex
Returns uncle specified by block hash and index.
Parameters
-
block: string - 32-byte block hash. -
uncleIndex: string - Index of the uncle.
Returns
-
Block object.
-
number: quantity, integer - Block number.nullwhen block is pending. -
hash: data, 32 bytes - Hash of the block.nullwhen block is pending. -
parentHash: data, 32 bytes - Hash of the parent block. -
nonce: data, 8 bytes - Hash of the generated proof of work.nullwhen block is pending. -
sha3Uncles: data, 32 bytes - SHA3 of the uncle's data in the block. -
logsBloom: data, 256 bytes - Bloom filter for the block logs.nullwhen block is pending. -
transactionsRoot: data, 32 bytes - Root of the transaction trie for the block. -
stateRoot: data, 32 bytes - Root of the final state trie for the block. -
receiptsRoot: data, 32 bytes - Root of the receipts trie for the block. -
miner: data, 20 bytes - Address to pay mining rewards to. -
difficulty: quantity, integer - Difficulty for this block. -
totalDifficulty: quantity, integer - Total difficulty of the chain until this block. This field is only returned for pre-merge (Proof of Work) blocks. This value will always be0for an uncle block. -
extraData: data - Extra data field for this block. The first 32 bytes is vanity data you can set using the--miner-extra-datacommand line option. Stores extra data when used with IBFT. -
size: quantity, integer - Size of block in bytes. -
gasLimit: quantity - Maximum gas allowed in this block. -
gasUsed: quantity - Total gas used by all transactions in this block. -
timestamp: quantity - Hex-encoded Unix timestamp (in seconds) for block assembly. -
transactions: array - Array of transaction objects, or 32 byte transaction hashes depending on the specified boolean parameter.-
accessList: array - (Optional) List of addresses and storage keys the transaction plans to access. Used inACCESS_LISTtransactions and may be used inEIP1559transactions. -
blockHash: data, 32 bytes - Hash of the block containing this transaction.nullwhen transaction is pending. -
blockNumber: quantity - Block number of the block containing this transaction.nullwhen transaction is pending. -
blockTimestamp: quantity - Hex-encoded Unix timestamp (in seconds) of the block containing this transaction.nullwhen transaction is pending. -
chainId: quantity - Chain ID. -
from: data, 20 bytes - Address of the sender. -
gas: quantity - Gas provided by the sender. -
gasPrice: quantity - (Optional) Gas price, in Wei, provided by the sender. Used only in non-EIP1559transactions. -
maxPriorityFeePerGas: quantity, integer - (Optional) Maximum fee, in Wei, the sender is willing to pay per gas above the base fee. Used only inEIP1559transactions. -
maxFeePerGas: quantity, integer - (Optional) Maximum total fee (base fee + priority fee), in Wei, the sender is willing to pay per gas. Used only inEIP1559transactions. -
hash: data, 32 bytes - Hash of the transaction. -
input: data - Data sent with the transaction to create or invoke a contract. -
nonce: quantity - Number of transactions made by the sender before this one. -
to: data, 20 bytes - Address of the receiver.nullif a contract creation transaction. -
transactionIndex: quantity, integer - Index position of the transaction in the block.nullwhen transaction is pending. -
transactionType: string - Transaction type. -
value: quantity - Value transferred, in Wei. -
v: quantity - ECDSA Recovery ID. -
r: data, 32 bytes - ECDSA signature r. -
s: data, 32 bytes - ECDSA signature s.
-
-
uncles: array - Array of uncle hashes. -
baseFeePerGas: quantity - The block's base fee per gas. This field is empty for blocks created before EIP-1559.
noteUncles don't contain individual transactions.
-
Example
- curl HTTP
- wscat WS
- JSON result
- curl GraphQL
- GraphQL
- GraphQL result
curl -X POST http://127.0.0.1:8545/ \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"method": "eth_getUncleByBlockHashAndIndex",
"params": [
"0xc48fb64230a82f65a08e7280bd8745e7fea87bc7c206309dee32209fe9a985f7",
"0x0"
],
"id": 1
}'
{
"jsonrpc": "2.0",
"method": "eth_getUncleByBlockHashAndIndex",
"params": [
"0xc48fb64230a82f65a08e7280bd8745e7fea87bc7c206309dee32209fe9a985f7",
"0x0"
],
"id": 1
}
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"difficulty": "0x76b123df93230",
"extraData": "0x50505945206e616e6f706f6f6c2e6f7267",
"gasLimit": "0x7a121d",
"gasUsed": "0x7a0175",
"hash": "0xc20189c0b1a4a23116ab3b177e929137f6e826f17fc4c2e880e7258c620e9817",
"logsBloom": "0x890086c024487ca422be846a201a10e41bc2882902312116c1119609482031e9c000e2a708004a10281024028020c505727a12570c4810121c59024490b040894406a1c23c37a0094810921da3923600c71c03044b40924280038d07ab91964a008084264a01641380798840805a284cce201a8026045451002500113a00de441001320805ca2840037000111640d090442c11116d2112948084240242340400236ce81502063401dcc214b9105194d050884721c1208800b20501a4201400276004142f118e60808284506979a86e050820101c170c185e2310005205a82a2100382422104182090184800c02489e033440218142140045801c024cc1818485",
"miner": "0x52bc44d5378309ee2abf1539bf71de1b7d7be3b5",
"mixHash": "0xf557cc827e058862aa3ea1bd6088fb8766f70c0eac4117c56cf85b7911f82a14",
"nonce": "0xd320b48904347cdd",
"number": "0x768964",
"parentHash": "0x98d752708b3677df8f439c4529f999b94663d5494dbfc08909656db3c90f6255",
"receiptsRoot": "0x0f838f0ceb73368e7fc8d713a7761e5be31e3b4beafe1a6875a7f275f82da45b",
"sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"size": "0x21a",
"stateRoot": "0xa0c7d4fca79810c89c517eff8dadb9c6d6f4bcc27c2edfb301301e1cf7dec642",
"timestamp": "0x5cdcbba6",
"totalDifficulty": "0x229ad33cabd4c40d23d",
"transactionsRoot": "0x866e38e91d01ef0387b8e07ccf35cd910224271ccf2b7477b8c8439e8b70f365",
"uncles": []
}
}
curl -X POST http://localhost:8547/graphql \
-H "Content-Type: application/json" \
--data '{
"query": "{block(hash:\"0xc48fb64230a82f65a08e7280bd8745e7fea87bc7c206309dee32209fe9a985f7\"){ ommerAt(index: 0) {difficulty extraData gasLimit gasUsed hash logsBloom mixHash nonce number receiptsRoot stateRoot timestamp totalDifficulty transactionsRoot}}}"
}'
{
block(hash: "0xc48fb64230a82f65a08e7280bd8745e7fea87bc7c206309dee32209fe9a985f7") {
ommerAt(index: 0) {
difficulty
extraData
gasLimit
gasUsed
hash
logsBloom
mixHash
nonce
number
receiptsRoot
stateRoot
timestamp
totalDifficulty
transactionsRoot
}
}
}
{
"data": {
"block": {
"difficulty": "0x1",
"extraData": "0xf882a00000000000000000000000000000000000000000000000000000000000000000d5949811ebc35d7b06b3fa8dc5809a1f9c52751e1deb808400000000f843b8418e98ef756acdae1e510b1df4b507b7af04eb3802db7fa0f3e73e7d0721b3645e76f4eb3d0dbf0de75620c4405bd5a663247cdd9616482c883053856d857f884a01",
"gasLimit": 4700000,
"gasUsed": 0,
"hash": "0x0efe67972b982eb6be5df84e5238eb07475f86afa8a7de708f6a13ac0ff60d6c",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"mixHash": "0x63746963616c2062797a616e74696e65206661756c7420746f6c6572616e6365",
"nonce": "0x0000000000000000",
"number": 200,
"receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"stateRoot": "0xd650578a04b39f50cc979155f4510ec28c2c0a7c1e5fdbf84609bc7b1c430f48",
"timestamp": "0x5cd109fb",
"totalDifficulty": "0xc9",
"transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"
}
}
}
eth_getUncleByBlockNumberAndIndex
Returns uncle specified by block number and index.
Parameters
-
blockNumber: string - Hexadecimal integer representing a block number, or one of the string tagslatest,earliest,pending,finalized, orsafe, as described in block parameter.notependingreturns the same value aslatest. -
uncleIndex: string - Index of the uncle.
Returns
-
Block object.
-
number: quantity, integer - Block number.nullwhen block is pending. -
hash: data, 32 bytes - Hash of the block.nullwhen block is pending. -
parentHash: data, 32 bytes - Hash of the parent block. -
nonce: data, 8 bytes - Hash of the generated proof of work.nullwhen block is pending. -
sha3Uncles: data, 32 bytes - SHA3 of the uncle's data in the block. -
logsBloom: data, 256 bytes - Bloom filter for the block logs.nullwhen block is pending. -
transactionsRoot: data, 32 bytes - Root of the transaction trie for the block. -
stateRoot: data, 32 bytes - Root of the final state trie for the block. -
receiptsRoot: data, 32 bytes - Root of the receipts trie for the block. -
miner: data, 20 bytes - Address to pay mining rewards to. -
difficulty: quantity, integer - Difficulty for this block. -
totalDifficulty: quantity, integer - Total difficulty of the chain until this block. This field is only returned for pre-merge (Proof of Work) blocks. This value will always be0for an uncle block. -
extraData: data - Extra data field for this block. The first 32 bytes is vanity data you can set using the--miner-extra-datacommand line option. Stores extra data when used with IBFT. -
size: quantity, integer - Size of block in bytes. -
gasLimit: quantity - Maximum gas allowed in this block. -
gasUsed: quantity - Total gas used by all transactions in this block. -
timestamp: quantity - Hex-encoded Unix timestamp (in seconds) for block assembly. -
transactions: array - Array of transaction objects, or 32 byte transaction hashes depending on the specified boolean parameter.-
accessList: array - (Optional) List of addresses and storage keys the transaction plans to access. Used inACCESS_LISTtransactions and may be used inEIP1559transactions. -
blockHash: data, 32 bytes - Hash of the block containing this transaction.nullwhen transaction is pending. -
blockNumber: quantity - Block number of the block containing this transaction.nullwhen transaction is pending. -
blockTimestamp: quantity - Hex-encoded Unix timestamp (in seconds) of the block containing this transaction.nullwhen transaction is pending. -
chainId: quantity - Chain ID. -
from: data, 20 bytes - Address of the sender. -
gas: quantity - Gas provided by the sender. -
gasPrice: quantity - (Optional) Gas price, in Wei, provided by the sender. Used only in non-EIP1559transactions. -
maxPriorityFeePerGas: quantity, integer - (Optional) Maximum fee, in Wei, the sender is willing to pay per gas above the base fee. Used only inEIP1559transactions. -
maxFeePerGas: quantity, integer - (Optional) Maximum total fee (base fee + priority fee), in Wei, the sender is willing to pay per gas. Used only inEIP1559transactions. -
hash: data, 32 bytes - Hash of the transaction. -
input: data - Data sent with the transaction to create or invoke a contract. -
nonce: quantity - Number of transactions made by the sender before this one. -
to: data, 20 bytes - Address of the receiver.nullif a contract creation transaction. -
transactionIndex: quantity, integer - Index position of the transaction in the block.nullwhen transaction is pending. -
transactionType: string - Transaction type. -
value: quantity - Value transferred, in Wei. -
v: quantity - ECDSA Recovery ID. -
r: data, 32 bytes - ECDSA signature r. -
s: data, 32 bytes - ECDSA signature s.
-
-
uncles: array - Array of uncle hashes. -
baseFeePerGas: quantity - The block's base fee per gas. This field is empty for blocks created before EIP-1559.
noteUncles don't contain individual transactions.
-
Example
- curl HTTP
- wscat WS
- JSON result
- curl GraphQL
- GraphQL
- GraphQL result
curl -X POST http://127.0.0.1:8545/ \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"method": "eth_getUncleByBlockNumberAndIndex",
"params": [
"0x7689D2",
"0x0"
],
"id": 1
}'
{
"jsonrpc": "2.0",
"method": "eth_getUncleByBlockNumberAndIndex",
"params": [
"0x7689D2",
"0x0"
],
"id": 1
}
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"difficulty": "0x77daec467bf93",
"extraData": "0x50505945206e616e6f706f6f6c2e6f7267",
"gasLimit": "0x7a121d",
"gasUsed": "0x7a0f7b",
"hash": "0x42d83ae9c0743f4b1f9c61ff7ea8b164c1bab3627decd49233760680be006ecf",
"logsBloom": "0x888200800000340120220008640200500408006100038400100581c000080240080a0014e8002010080004088040004022402a000c18010001400100002a041141a0610a0052900600041018c0002a0003090020404c00206010010513d00020005380124e08050480710000000108401012b0901c1424006000083a10a8c1040100a0440081050210124400040044304070004001100000012600806008061d0320800000b40042160600002480000000800000c0002100200940801c000820800048024904710000400640490026000a44300309000286088010c2300060003011380006400200812009144042204810209020410a84000410520c08802941",
"miner": "0x52bc44d5378309ee2abf1539bf71de1b7d7be3b5",
"mixHash": "0xf977fcdb52868be410b75ef2becc35cc312f13ab0a6ce400ecd9d445f66fa3f2",
"nonce": "0x628b28403bf1e3d3",
"number": "0x7689d0",
"parentHash": "0xb32cfdfbf4adb05d30f02fcc6fe039cc6666402142954051c1a1cb9cc91aa11e",
"receiptsRoot": "0x9c7c8361d1a24ea2841432234c81974a9920d3eba2b2b1c496b5f925a95cb4ac",
"sha3Uncles": "0x7d972aa1b182b7e93f1db043f03fbdbfac6874fe7e67e162141bcc0aefa6336b",
"size": "0x21a",
"stateRoot": "0x74e97b77813146344d75acb5a52a006cc6dfaca678a10fb8a484a8443e919272",
"timestamp": "0x5cdcc0a7",
"totalDifficulty": "0x229b0583b4bd2698ca0",
"transactionsRoot": "0x1d21626afddf05e5866de66ca3fcd98f1caf5357eba0cc6ec675606e116a891b",
"uncles": []
}
}
curl -X POST http://localhost:8547/graphql \
-H "Content-Type: application/json" \
--data '{
"query": "{block(number:2587){ ommerAt(index: 0) {difficulty extraData gasLimit gasUsed hash logsBloom mixHash nonce number receiptsRoot stateRoot timestamp totalDifficulty transactionsRoot}}}"
}'
{
block(number: 2587) {
ommerAt(index: 0) {
difficulty
extraData
gasLimit
gasUsed
hash
logsBloom
mixHash
nonce
number
receiptsRoot
stateRoot
timestamp
totalDifficulty
transactionsRoot
}
}
}
{
"data": {
"block": {
"ommerAt": null
}
}
}
eth_getUncleCountByBlockHash
Returns the number of uncles in a block from a block matching the given block hash.
Parameters
block: string - 32-byte block hash.
Returns
- Integer representing the number of uncles in the specified block.
Example
- curl HTTP
- wscat WS
- JSON result
- curl GraphQL
- GraphQL
- GraphQL result
curl -X POST http://127.0.0.1:8545/ \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"method": "eth_getUncleCountByBlockHash",
"params": [
"0xb903239f8543d04b5dc1ba6579132b143087c68db1b2168786408fcbce568238"
],
"id": 1
}'
{
"jsonrpc": "2.0",
"method": "eth_getUncleCountByBlockHash",
"params": [
"0xb903239f8543d04b5dc1ba6579132b143087c68db1b2168786408fcbce568238"
],
"id": 1
}
{
"jsonrpc": "2.0",
"id": 1,
"result": 0x0
}
curl -X POST http://localhost:8547/graphql \
-H "Content-Type: application/json" \
--data '{
"query": "{block(hash:\"0x65c08d792e4192b9ece6b6f2390da7da464208b22d88490be8add9373917b426\"){ommerCount}}"
}'
{
block(hash: "0x65c08d792e4192b9ece6b6f2390da7da464208b22d88490be8add9373917b426") {
ommerCount
}
}
{
"data": {
"block": {
"ommerCount": 2
}
}
}
eth_getUncleCountByBlockNumber
Returns the number of uncles in a block matching the specified block number.
Parameters
-
blockNumber: string - Hexadecimal integer representing a block number, or one of the string tagslatest,earliest,pending,finalized, orsafe, as described in block parameter.notependingreturns the same value aslatest.
Returns
- Integer representing the number of uncles in the specified block.
Example
- curl HTTP
- wscat WS
- JSON result
- curl GraphQL
- GraphQL
- GraphQL result
curl -X POST http://127.0.0.1:8545/ \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"method": "eth_getUncleCountByBlockNumber",
"params": [
"0xe8"
],
"id": 1
}'
{
"jsonrpc": "2.0",
"method": "eth_getUncleCountByBlockNumber",
"params": [
"0xe8"
],
"id": 1
}
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x1"
}
curl -X POST http://localhost:8547/graphql \
-H "Content-Type: application/json" \
--data '{
"query": "{block(number:\"0x59fd\"){ommerCount}}"
}'
{
block(number: "0x59fd") {
ommerCount
}
}
{
"data": {
"block": {
"ommerCount": 0
}
}
}