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"
]
Request
curl -X POST --data \
'{
"jsonrpc": "2.0",
"id": 1,
"method": "cfx_getBlocksByEpoch",
"params": [
"earliest"
]
}' \
-H "Content-Type: application/json" \
localhost:12539
Response
[
"0x3fb9d350f95424c3c27fcf248d9a6f633a83c2a75c11ef887ea41540c85e7804"
]
Request
curl -X POST --data \
'{
"jsonrpc": "2.0",
"id": 1,
"method": "cfx_getBlocksByEpoch",
"params": [
"latest_state"
]
}' \
-H "Content-Type: application/json" \
localhost:12539
Response
[
"0x3f5ba01f7ac1c30ddc40f97b5a89786491472ddac4261a06338c48b746c3dfdb"
]
Request
curl -X POST --data \
'{
"jsonrpc": "2.0",
"id": 1,
"method": "cfx_getBlocksByEpoch",
"params": [
"latest_confirmed"
]
}' \
-H "Content-Type: application/json" \
localhost:12539
Response
[
"0xdbfe35783e046eab1bdb519506dd4d11f2a4f6bdd67d6c4d83fe14ccdfdbceb2"
]
Request
curl -X POST --data \
'{
"jsonrpc": "2.0",
"id": 1,
"method": "cfx_getBlocksByEpoch",
"params": [
"latest_finalized"
]
}' \
-H "Content-Type: application/json" \
localhost:12539
Response
[
"0x163f896ad555627c591692241570bd5d99290c8a826f409433687e843bd2e021"
]
Request
curl -X POST --data \
'{
"jsonrpc": "2.0",
"id": 1,
"method": "cfx_getBlocksByEpoch",
"params": [
"latest_checkpoint"
]
}' \
-H "Content-Type: application/json" \
localhost:12539
Response
[
"0xec07ad889b4aba91b578a7536aa9c3ddb60fe9cbdfd5e9204fc108b255f08bb7",
"0x3dc71e0aa01c258cc1a2415ba54a4fb36a53ba19be4ea3be6e566e879a42ddd0"
]