跳到主要内容

cfx_getBlocksByEpoch

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

Params

epoch_number required

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

Result

Schema
type : array
  • items[x] string
    type : string
    Pattern : ^0x[0-9,a-f,A-F]{64}$

Examples

Request

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

Response

[
"0x65edf7f1e1ffec4fd0eca4a2a6efb127b11d887dc7ca522ff75e418fda32d160"
]