cfx_getStorageRoot
- 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": ["CFXTEST:TYPE.USER:AATGGCS6J4VMKE5M10WY04SKDZ7D27RDX2CZXKDMY3",null],
"method": "cfx_getStorageRoot"
}'
Params
address required
Schema
type : string
Pattern :
^(NET\d+|CFX|CFXTEST)(:TYPE\..*|):[ABCDEFGHJKMNPRSTUVWXYZ0123456789]{42}$
epoch_num 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[0-9,a-f,A-F]{64}$
Examples
- cfx_getStorageRoot
- cfx_getStorageRoot
- cfx_getStorageRoot
- cfx_getStorageRoot
- cfx_getStorageRoot
- cfx_getStorageRoot
- cfx_getStorageRoot
- cfx_getStorageRoot
- cfx_getStorageRoot
Request
curl -X POST --data \
'{
"jsonrpc": "2.0",
"id": 1,
"method": "cfx_getStorageRoot",
"params": [
"CFXTEST:TYPE.USER:AATGGCS6J4VMKE5M10WY04SKDZ7D27RDX2CZXKDMY3"
]
}' \
-H "Content-Type: application/json" \
localhost:12539
Response
{
"delta": null,
"intermediate": null,
"snapshot": null
}
Request
curl -X POST --data \
'{
"jsonrpc": "2.0",
"id": 1,
"method": "cfx_getStorageRoot",
"params": [
"CFXTEST:TYPE.USER:AATGGCS6J4VMKE5M10WY04SKDZ7D27RDX2CZXKDMY3",
"latest_mined"
]
}' \
-H "Content-Type: application/json" \
localhost:12539
Response
{
"code": -32602,
"message": "Invalid parameters: epoch_num",
"data": "\"Latest mined epoch is not executed\""
}
Request
curl -X POST --data \
'{
"jsonrpc": "2.0",
"id": 1,
"method": "cfx_getStorageRoot",
"params": [
"CFXTEST:TYPE.USER:AATGGCS6J4VMKE5M10WY04SKDZ7D27RDX2CZXKDMY3",
"earliest"
]
}' \
-H "Content-Type: application/json" \
localhost:12539
Response
{
"code": -32016,
"message": "Error processing request: State for epoch (number=0 hash=0x3fb9d350f95424c3c27fcf248d9a6f633a83c2a75c11ef887ea41540c85e7804) does not exist: out-of-bound StateAvailabilityBoundary { synced_state_height: 0, lower_bound: 70580001, upper_bound: 70587163, optimistic_executed_height: Some(70587162) }"
}
Request
curl -X POST --data \
'{
"jsonrpc": "2.0",
"id": 1,
"method": "cfx_getStorageRoot",
"params": [
"CFXTEST:TYPE.USER:AATGGCS6J4VMKE5M10WY04SKDZ7D27RDX2CZXKDMY3",
"latest_state"
]
}' \
-H "Content-Type: application/json" \
localhost:12539
Response
{
"delta": null,
"intermediate": null,
"snapshot": null
}
Request
curl -X POST --data \
'{
"jsonrpc": "2.0",
"id": 1,
"method": "cfx_getStorageRoot",
"params": [
"CFXTEST:TYPE.USER:AATGGCS6J4VMKE5M10WY04SKDZ7D27RDX2CZXKDMY3",
"latest_confirmed"
]
}' \
-H "Content-Type: application/json" \
localhost:12539
Response
{
"delta": null,
"intermediate": null,
"snapshot": null
}
Request
curl -X POST --data \
'{
"jsonrpc": "2.0",
"id": 1,
"method": "cfx_getStorageRoot",
"params": [
"CFXTEST:TYPE.USER:AATGGCS6J4VMKE5M10WY04SKDZ7D27RDX2CZXKDMY3",
"latest_finalized"
]
}' \
-H "Content-Type: application/json" \
localhost:12539
Response
{
"delta": null,
"intermediate": null,
"snapshot": null
}
Request
curl -X POST --data \
'{
"jsonrpc": "2.0",
"id": 1,
"method": "cfx_getStorageRoot",
"params": [
"CFXTEST:TYPE.USER:AATGGCS6J4VMKE5M10WY04SKDZ7D27RDX2CZXKDMY3",
"latest_checkpoint"
]
}' \
-H "Content-Type: application/json" \
localhost:12539
Response
{
"code": -32016,
"message": "Error processing request: State for epoch (number=70500000 hash=0x3dc71e0aa01c258cc1a2415ba54a4fb36a53ba19be4ea3be6e566e879a42ddd0) does not exist: out-of-bound StateAvailabilityBoundary { synced_state_height: 0, lower_bound: 70580001, upper_bound: 70587163, optimistic_executed_height: Some(70587162) }"
}
Request
curl -X POST --data \
'{
"jsonrpc": "2.0",
"id": 1,
"method": "cfx_getStorageRoot",
"params": [
"CFXTEST:TYPE.NULL:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA6F0VRCSW",
"latest_mined"
]
}' \
-H "Content-Type: application/json" \
localhost:12539
Response
{
"code": -32602,
"message": "Invalid parameters: epoch_num",
"data": "\"Latest mined epoch is not executed\""
}
Request
curl -X POST --data \
'{
"jsonrpc": "2.0",
"id": 1,
"method": "cfx_getStorageRoot",
"params": [
"CFXTEST:TYPE.NULL:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA6F0VRCSW",
"earliest"
]
}' \
-H "Content-Type: application/json" \
localhost:12539
Response
{
"code": -32016,
"message": "Error processing request: State for epoch (number=0 hash=0x3fb9d350f95424c3c27fcf248d9a6f633a83c2a75c11ef887ea41540c85e7804) does not exist: out-of-bound StateAvailabilityBoundary { synced_state_height: 0, lower_bound: 70580001, upper_bound: 70587163, optimistic_executed_height: Some(70587162) }"
}