Saltar al contenido principal

cfx_getBlockByEpochNumber

Returns block with given epoch number.

curl --request POST \
--url https://main.confluxrpc.com \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '
{
"id": 1,
"jsonrpc": "2.0",
"params": ["latest_mined",false],
"method": "cfx_getBlockByEpochNumber"
}'

Params

epoch_number required

Represents rpc api epoch number param.
oneOf
type : string
Pattern : ^0x([1-9a-f][0-9a-f]{0,15}|0)$

include_txs required

Schema
type : boolean

Result

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

Examples

Request

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

Response

{
"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"
}