cfx_getBlocksByEpoch
- CURL
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
- U64
- string
type : string
Pattern :
^0x([1-9a-f][0-9a-f]{0,15}|0)$
type : string
Possible values :
earliest
latest_checkpoint
latest_finalized
latest_confirmed
latest_state
latest_mined
Result
Schema
type : array
items[x]
stringtype : stringPattern :^0x[0-9,a-f,A-F]{64}$
Examples
- cfx_getBlocksByEpoch
- cfx_getBlocksByEpoch
- cfx_getBlocksByEpoch
- cfx_getBlocksByEpoch
- cfx_getBlocksByEpoch
- cfx_getBlocksByEpoch
- cfx_getBlocksByEpoch
Request
curl -X POST --data \
'{
"jsonrpc": "2.0",
"id": 1,
"method": "cfx_getBlocksByEpoch",
"params": [
"0x4350b21"
]
}' \
-H "Content-Type: application/json" \
localhost:12539
Response
[
"0x65edf7f1e1ffec4fd0eca4a2a6efb127b11d887dc7ca522ff75e418fda32d160"
]
Request
curl -X POST --data \
'{
"jsonrpc": "2.0",
"id": 1,
"method": "cfx_getBlocksByEpoch",
"params": [
"latest_mined"
]
}' \
-H "Content-Type: application/json" \
localhost:12539
Response
[
"0xebecb710c98a2b3dbe557f8a36c2bf7130cc95d086be6b0627a84fd07e914e86"
]