cfx_epochNumber
Returns highest epoch number.
- 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_epochNumber"
}'
Params
epoch_number optional
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 : string
Pattern :
^0x([1-9a-f][0-9a-f]{0,63}|0)$
Examples
- cfx_epochNumber
- cfx_epochNumber
- cfx_epochNumber
- cfx_epochNumber
- cfx_epochNumber
- cfx_epochNumber
- cfx_epochNumber
Request
curl -X POST --data \
'{
"jsonrpc": "2.0",
"id": 1,
"method": "cfx_epochNumber",
"params": [
"0x4350b21"
]
}' \
-H "Content-Type: application/json" \
localhost:12539
Response
"0x4350b21"
Request
curl -X POST --data \
'{
"jsonrpc": "2.0",
"id": 1,
"method": "cfx_epochNumber",
"params": [
"latest_mined"
]
}' \
-H "Content-Type: application/json" \
localhost:12539
Response
"0x4351322"
Request
curl -X POST --data \
'{
"jsonrpc": "2.0",
"id": 1,
"method": "cfx_epochNumber",
"params": [
"earliest"
]
}' \
-H "Content-Type: application/json" \
localhost:12539
Response
"0x0"
Request
curl -X POST --data \
'{
"jsonrpc": "2.0",
"id": 1,
"method": "cfx_epochNumber",
"params": [
"latest_state"
]
}' \
-H "Content-Type: application/json" \
localhost:12539
Response
"0x435131e"
Request
curl -X POST --data \
'{
"jsonrpc": "2.0",
"id": 1,
"method": "cfx_epochNumber",
"params": [
"latest_confirmed"
]
}' \
-H "Content-Type: application/json" \
localhost:12539
Response
"0x43512e6"
Request
curl -X POST --data \
'{
"jsonrpc": "2.0",
"id": 1,
"method": "cfx_epochNumber",
"params": [
"latest_finalized"
]
}' \
-H "Content-Type: application/json" \
localhost:12539
Response
"0x43510d4"
Request
curl -X POST --data \
'{
"jsonrpc": "2.0",
"id": 1,
"method": "cfx_epochNumber",
"params": [
"latest_checkpoint"
]
}' \
-H "Content-Type: application/json" \
localhost:12539
Response
"0x433bea0"