跳到主要内容

cfx_getBlockByEpochNumber

Returns block with given epoch number.

Params

(2)

1. epoch_number (required)

(one of)
string
Match pattern:
^0x([1-9a-f][0-9a-f]{0,15}|0)$

2. include_txs (required)

boolean

Result

(cfx_getBlockByEpochNumber_result)
object or null
adaptive
boolean
baseFeePerGas
string or null
Match pattern:
^0x([1-9a-f][0-9a-f]{0,63}|0)$
blame
string
Match pattern:
^0x([1-9a-f][0-9a-f]{0,15}|0)$
blockNumber
string or null
Match pattern:
^0x([1-9a-f][0-9a-f]{0,63}|0)$
custom
array[string]
deferredLogsBloomHash
string
Match pattern:
^0x[0-9,a-f,A-F]{64}$
deferredReceiptsRoot
string
Match pattern:
^0x[0-9,a-f,A-F]{64}$
deferredStateRoot
string
Match pattern:
^0x[0-9,a-f,A-F]{64}$
difficulty
string
Match pattern:
^0x([1-9a-f][0-9a-f]{0,63}|0)$
epochNumber
string or null
Match pattern:
^0x([1-9a-f][0-9a-f]{0,63}|0)$
gasLimit
string
Match pattern:
^0x([1-9a-f][0-9a-f]{0,63}|0)$
gasUsed
string or null
Match pattern:
^0x([1-9a-f][0-9a-f]{0,63}|0)$
hash
string
Match pattern:
^0x[0-9,a-f,A-F]{64}$
height
string
Match pattern:
^0x([1-9a-f][0-9a-f]{0,63}|0)$
miner
string
Match pattern:
^(NET\d+|CFX|CFXTEST)(:TYPE\..*|):[ABCDEFGHJKMNPRSTUVWXYZ0123456789]{42}$
nonce
string
Match pattern:
^0x([1-9a-f][0-9a-f]{0,63}|0)$
parentHash
string
Match pattern:
^0x[0-9,a-f,A-F]{64}$
posReference
string or null
Match pattern:
^0x[0-9,a-f,A-F]{64}$
powQuality
string or null
Match pattern:
^0x([1-9a-f][0-9a-f]{0,63}|0)$
refereeHashes
array[string]
size
string or null
Match pattern:
^0x([1-9a-f][0-9a-f]{0,63}|0)$
timestamp
string
Match pattern:
^0x([1-9a-f][0-9a-f]{0,63}|0)$
transactions
transactionsRoot
string
Match pattern:
^0x[0-9,a-f,A-F]{64}$

Examples

Request

curl -X POST --data \
'{
"method": "cfx_getBlockByEpochNumber",
"params": [
"latest_mined",
false
],
"jsonrpc": "2.0",
"id": 1
}' \
-H "Content-Type: application/json" \
localhost:12539

Result

{
"adaptive": false,
"baseFeePerGas": "0x3b9aca00",
"blame": "0x0",
"blockNumber": "0x5546676",
"custom": [
"0x01"
],
"deferredLogsBloomHash": "0xd397b3b043d87fcd6fad1291ff0bfd16401c274896d8c63a923727f077b8e0b5",
"deferredReceiptsRoot": "0x09f8709ea9f344a810811a373b30861568f5686e649d6177fd92ea2db7477508",
"deferredStateRoot": "0x9207d655134e154139fbbbc21a604df20006e9bc823a4d5aa98a4f908eff8cae",
"difficulty": "0x30398df",
"epochNumber": "0x4351312",
"gasLimit": "0x1c9c380",
"gasUsed": "0x0",
"hash": "0xa7ae72a6d198e2f4bb53cc39216239bab7e7e54f77ff14a858ac2a367db20b27",
"height": "0x4351312",
"miner": "CFXTEST:TYPE.USER:AANG4D91REJDBPGMGTMSPDYEFXKUBJ2BBYWRWM9J3Z",
"nonce": "0x50fbbc4eed19a17f",
"parentHash": "0xc3e749973910ba91c25298c82bbefcd6a1f81058bcb4d5199fdb668c5bedb8b2",
"posReference": "0x15d1f8229af27823a143410127f88bcbd8fb686a35c9a216c545dff74b5b13f6",
"powQuality": "0x5071249",
"refereeHashes": [
"0xb2f6aae3385d277fb22a98748d1ebedd7d44759a2dc91a22a0a2af8f3cca5a58"
],
"size": "0x0",
"timestamp": "0x624e609a",
"transactions": [],
"transactionsRoot": "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470"
}

Endpoint

Params

epoch_number

include_txs


Request

curl -X POST --data \
'{
"method": "cfx_getBlockByEpochNumber",
"params": [
null,
null
],
"jsonrpc": "2.0",
"id": 1
}' \
-H "Content-Type: application/json" \
https://test.confluxrpc.com