Only a few JSONRPC APIs have been tested.
new RPC:
# mainnet
RPC="https://new.xdcrpc.com/"
# testnet
RPC="https://apothem.xdcrpc.com/"
Findings
- does not support module XDPoS
- supports some features of geth v1.17.x, eg:
- eth_getTransactionByHash returns timestamp in response
- bug: eth_simulateV1 crash on mainnet rcp
- a lot of methods are not in the public allowlist on testnet rpc
Module eth
Method eth_config
Request:
curl -s -X POST -H "Content-Type: application/json" ${RPC} -d '{
"jsonrpc": "2.0",
"id": 1,
"method": "eth_config",
"params": []
}' | jq
Response:
mainnet:
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"current": null,
"next": null,
"last": null
}
}
tesnet:
{
"jsonrpc": "2.0",
"id": 1,
"error": {
"code": -32004,
"message": "method 'eth_config' is not in the public allowlist"
}
}
Method eth_getBlockByNumber
Request:
curl -s -X POST -H "Content-Type: application/json" ${RPC} -d '{
"jsonrpc": "2.0",
"id": 1,
"method": "eth_getBlockByNumber",
"params": [
"latest",
false
]
}' | jq
Response:
mainnet:
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"baseFeePerGas": "0x2e90edd00",
"difficulty": "0x1",
"gasLimit": "0x1908b100",
"gasUsed": "0x0",
"hash": "0x0817159980348542bcc2c99f0b64f89045026e3c9a850da618976dbce211b3c9",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"miner": "0xd2fefdd118aa2bea5991dc079fd341d3e7a92caf",
"mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"nonce": "0x0000000000000000",
"number": "0x638cf58",
"parentHash": "0xdf89d6490e3ab62651f5c7e2649bb9eb0a8712faad29c42cd60c35ba6d215e00",
"receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"size": "0x15a9",
"stateRoot": "0xb858c779bcb521cfeb3c472b8b3ab8c9c07b6bb3c9b9ff0a348db9a43ae0cfee",
"timestamp": "0x6a44738f",
"transactions": [],
"transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"uncles": []
}
}
tesnet:
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"baseFeePerGas": "0x2e90edd00",
"difficulty": "0x1",
"gasLimit": "0x1908b100",
"gasUsed": "0x0",
"hash": "0x881257407eba135ed469a33e1f1109f5310c98eb88c35d5d012b7a097bf80fb0",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"miner": "0x40964fcdd7cd130d6938976b06885d1a914480b4",
"mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"nonce": "0x0000000000000000",
"number": "0x4fd6369",
"parentHash": "0x93f96df53e3448d03b2e05f88ce0c014b17894d92f2f47164154ceb7a00b1878",
"receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"size": "0x701",
"stateRoot": "0x727ac0fdd44dfded514650f8a96dad80d70b3ac523c96e8fb1b3ecae48ed5ed0",
"timestamp": "0x6a447447",
"transactions": [],
"transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"uncles": []
}
}
Method eth_getTransactionByHash
# mainnet
hash="0x6317626e4dd852ccb4b5db4bc0b9e782c67f65a378490d14852b3992ee1c64fc"
# testnet
hash="0xcab346091b7552673b4a882f173cbf2605329c661e10ba44b81a9f55d978cbf0"
curl -s -X POST -H "Content-Type: application/json" ${RPC} -d '{
"jsonrpc": "2.0",
"id": 5001,
"method": "eth_getTransactionByHash",
"params": [
"'"${hash}"'"
]
}' | jq
Response:
mainnet:
{
"jsonrpc": "2.0",
"id": 5001,
"result": {
"blockHash": "0x5a631d4139253caa97f2921e21810db8ab386ac65dde0aae6113d0fd1a8a80dc",
"blockNumber": "0x638d111",
"blockTimestamp": "0x6a4477ef",
"from": "0x32530e32c573681d2075f0b0202972f91bf914a5",
"gas": "0x30d40",
"gasPrice": "0x0",
"hash": "0x6317626e4dd852ccb4b5db4bc0b9e782c67f65a378490d14852b3992ee1c64fc",
"input": "0xe341eaa4000000000000000000000000000000000000000000000000000000000638d10e0c6d9944c574b3f6d93366cb4280b52353ae98e2c09336f44f89d9e110cac6d1",
"nonce": "0x2ce7",
"to": "0x0000000000000000000000000000000000000089",
"transactionIndex": "0x0",
"value": "0x0",
"type": "0x0",
"chainId": "0x32",
"v": "0x87",
"r": "0xcfd42c827493e6e3d873aa100ba51c27464ba0b26e8549b66c5cf8412f97557f",
"s": "0x45e98027873a402de259895bea0731222d4579dcbb435a1cabb51c4d9faa9697"
}
}
testnet:
{
"jsonrpc": "2.0",
"id": 5001,
"result": {
"blockHash": "0x8eb1dcfb293460b5ea519f46bda60624809b27bde82ab8589f9eb6b9bc8faf8b",
"blockNumber": "0x4fd654e",
"blockTimestamp": "0x6a447821",
"from": "0xcd13ed39d35ffdcf3c6d982cfd75883517f392fb",
"gas": "0x30d40",
"gasPrice": "0x0",
"hash": "0xcab346091b7552673b4a882f173cbf2605329c661e10ba44b81a9f55d978cbf0",
"input": "0xe341eaa40000000000000000000000000000000000000000000000000000000004fd654d3acee6cb512394c130ffc3aa6057d872bce823ba2b01a9bb93671897b477ff95",
"nonce": "0x1ac91c",
"to": "0x0000000000000000000000000000000000000089",
"transactionIndex": "0x0",
"value": "0x0",
"type": "0x0",
"chainId": "0x33",
"v": "0x89",
"r": "0x1b11de8a8dd63cf3382b1808cf1a2c01b9e1b6d43abe9231ae13e6c0b3223fd",
"s": "0x67d00ff50cb229a6822d32ed4c31770280a61dfebd21c2774ed4ffcd7775c2a5"
}
}
Method eth_maxPriorityFeePerGas
Request:
curl -s -X POST -H "Content-Type: application/json" ${RPC} -d '{
"jsonrpc": "2.0",
"id": 1,
"method": "eth_maxPriorityFeePerGas",
"params": []
}' | jq
Response:
mainnet:
{
"jsonrpc": "2.0",
"id": 1002,
"result": "0x3dc5d3d80"
}
testnet:
{
"jsonrpc": "2.0",
"id": 1002,
"result": "0xf4240"
}
Method eth_gasPrice
Request:
curl -s -X POST -H "Content-Type: application/json" ${RPC} -d '{
"jsonrpc": "2.0",
"id": 1,
"method": "eth_gasPrice",
"params": []
}' | jq
Response:
mainnet:
{
"jsonrpc": "2.0",
"id": 1003,
"result": "0x6c56c1a80"
}
testnet:
{
"jsonrpc": "2.0",
"id": 1003,
"result": "0x2e91e1f40"
}
Method eth_feeHistory
Request:
curl -s -X POST -H "Content-Type: application/json" ${RPC} -d '{
"jsonrpc": "2.0",
"id": 1004,
"method": "eth_feeHistory",
"params": [
"0x3",
"latest",
[20,50]
]
}' | jq
Response:
mainnet:
{
"jsonrpc": "2.0",
"id": 1004,
"result": {
"oldestBlock": "0x638d07d",
"reward": [
[
"0x0",
"0x0"
],
[
"0x0",
"0x0"
],
[
"0x8c122780",
"0x8c122780"
]
],
"baseFeePerGas": [
"0x2e90edd00",
"0x2e90edd00",
"0x2e90edd00",
"0x2e90edd00"
],
"gasUsedRatio": [
0.01255987380952381,
0.002998242857142857,
0.0038277738095238096
],
"baseFeePerBlobGas": [
"0x0",
"0x0",
"0x0",
"0x0"
],
"blobGasUsedRatio": [
0,
0,
0
]
}
}
testnet:
{
"jsonrpc": "2.0",
"id": 1004,
"result": {
"oldestBlock": "0x4fd6475",
"reward": [
[
"0x0",
"0x0"
],
[
"0x0",
"0x0"
],
[
"0x0",
"0x0"
]
],
"baseFeePerGas": [
"0x2e90edd00",
"0x2e90edd00",
"0x2e90edd00",
"0x2e90edd00"
],
"gasUsedRatio": [
0,
0,
0
],
"baseFeePerBlobGas": [
"0x0",
"0x0",
"0x0",
"0x0"
],
"blobGasUsedRatio": [
0,
0,
0
]
}
}
Method eth_getLogs
Request:
curl -s -X POST -H "Content-Type: application/json" ${RPC} -d '{
"jsonrpc": "2.0",
"id": 1,
"method": "eth_getLogs",
"params": [
{
"fromBlock":"0x1",
"toBlock":"latest",
"topics":[]
}
]
}' | jq
Response:
mainnet:
{
"jsonrpc": "2.0",
"id": 1,
"error": {
"code": -32002,
"message": "request timed out"
}
}
testnet:
{
"jsonrpc": "2.0",
"id": 1,
"error": {
"code": -32002,
"message": "request timed out"
}
}
Method eth_simulateV1
Request:
curl -s -X POST -H "Content-Type: application/json" ${RPC} -d '{
"jsonrpc": "2.0",
"id": 1,
"method": "eth_simulateV1",
"params": [
{
"blockStateCalls": [
{
"calls": [
{
"from": "0xD4CE02705041F04135f1949Bc835c1Fe0885513c",
"to": "0xdAC17F958D2ee523a2206206994597C13D831ec7",
"value": "0x0"
}
]
}
],
"validation": false,
"traceTransfers": false
},
"latest"
]
}' | jq
Response:
mainnet:
{
"jsonrpc": "2.0",
"id": 1,
"error": {
"code": -32603,
"message": "method handler crashed"
}
}
testnet:
{
"jsonrpc": "2.0",
"id": 1,
"error": {
"code": -32004,
"message": "method 'eth_simulateV1' is not in the public allowlist"
}
}
Method eth_getStorageValues
Request:
curl -s -X POST -H "Content-Type: application/json" ${RPC} -d '{
"jsonrpc": "2.0",
"id": 1,
"method": "eth_getStorageValues",
"params": [
{
"0x0000000000000000000000000000000000000088": [
"0x0000000000000000000000000000000000000000000000000000000000000001",
"0x0000000000000000000000000000000000000000000000000000000000000002",
"0x0000000000000000000000000000000000000000000000000000000000000003",
"0x0000000000000000000000000000000000000000000000000000000000000004",
"0x0000000000000000000000000000000000000000000000000000000000000005",
"0x0000000000000000000000000000000000000000000000000000000000000006",
"0x0000000000000000000000000000000000000000000000000000000000000007",
"0x0000000000000000000000000000000000000000000000000000000000000008"
],
"0x0000000000000000000000000000000000000090": [
"0x0000000000000000000000000000000000000000000000000000000000000009",
"0x0000000000000000000000000000000000000000000000000000000000000001"
]
},
"latest"
]
}' | jq
Response:
mainnet:
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"0x0000000000000000000000000000000000000088": [
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x00000000000000000000000000000000000000000000000000000000000000e5",
"0x0000000000000000000000000000000000000000000000000000000000000226"
],
"0x0000000000000000000000000000000000000090": [
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000"
]
}
}
tesnet:
{
"jsonrpc": "2.0",
"id": 1,
"error": {
"code": -32004,
"message": "method 'eth_getStorageValues' is not in the public allowlist"
}
}
Module web3
Method web3_clientVersion
Request:
curl -s -X POST -H "Content-Type: application/json" ${RPC} -d '{
"jsonrpc": "2.0",
"id": 1,
"method": "web3_clientVersion",
"params": []
}' | jq
Response:
mainnet:
{
"jsonrpc": "2.0",
"id": 9007,
"result": "XDC/v1.17.3-stable-92291e95/linux-amd64/go1.24.0"
}
testnet:
{
"jsonrpc": "2.0",
"id": 1,
"result": "XDC/v1.17.3-stable/linux-amd64/go1.24.0"
}
Module XDPoS
Method XDPoS_getConfig
Request:
curl -s -X POST -H "Content-Type: application/json" ${RPC} -d '{
"jsonrpc": "2.0",
"id": 1001,
"method": "XDPoS_getConfig"
}' | jq
Request:
mainnet:
{
"jsonrpc": "2.0",
"id": 1001,
"error": {
"code": -32601,
"message": "the method XDPoS_getConfig does not exist/is not available"
}
}
Method XDPoS_getBlockInfoByEpochNum
Request:
epoch=89300
curl -s -X POST -H "Content-Type: application/json" ${RPC} -d '{
"jsonrpc": "2.0",
"id": 1,
"method": "XDPoS_getBlockInfoByEpochNum",
"params": [
'"${epoch}"'
]
}' | jq
Response:
mainnet:
{
"jsonrpc": "2.0",
"id": 1,
"error": {
"code": -32601,
"message": "the method XDPoS_getBlockInfoByEpochNum does not exist/is not available"
}
}
Method XDPoS_getEpochNumbersBetween
Request:
curl -s -X POST -H "Content-Type: application/json" ${RPC} -d '{
"jsonrpc": "2.0",
"id": 1,
"method": "XDPoS_getEpochNumbersBetween",
"params": [
"0x5439860",
"0x5439c48"
]
}' | jq
Respons:
mainnet:
{
"jsonrpc": "2.0",
"id": 1,
"error": {
"code": -32601,
"message": "the method XDPoS_getEpochNumbersBetween does not exist/is not available"
}
}
Method XDPoS_getLatestPoolStatus
Request:
curl -s -X POST -H "Content-Type: application/json" ${RPC} -d '{
"jsonrpc": "2.0",
"id": 1,
"method": "XDPoS_getLatestPoolStatus"
}' | jq
Request:
mainnet:
{
"jsonrpc": "2.0",
"id": 1,
"error": {
"code": -32601,
"message": "the method XDPoS_getLatestPoolStatus does not exist/is not available"
}
}
Method XDPoS_getMasternodesByNumber
Request:
curl -s -X POST -H "Content-Type: application/json" ${RPC} -d '{
"jsonrpc": "2.0",
"id": 1,
"method": "XDPoS_getMasternodesByNumber",
"params": [
"latest"
]
}' | jq
Request:
mainnet:
{
"jsonrpc": "2.0",
"id": 1,
"error": {
"code": -32601,
"message": "the method XDPoS_getMasternodesByNumber does not exist/is not available"
}
}
Method XDPoS_getMissedRoundsInEpochByBlockNum
Request:
curl -s -X POST -H "Content-Type: application/json" ${RPC} -d '{
"jsonrpc": "2.0",
"id": 1,
"method": "XDPoS_getMissedRoundsInEpochByBlockNum",
"params": [
"latest"
]
}' | jq
Request:
mainnet:
{
"jsonrpc": "2.0",
"id": 1,
"error": {
"code": -32601,
"message": "the method XDPoS_getMissedRoundsInEpochByBlockNum does not exist/is not available"
}
}
Method XDPoS_getSigners
Request:
curl -s -X POST -H "Content-Type: application/json" ${RPC} -d '{
"jsonrpc": "2.0",
"id": 1,
"method": "XDPoS_getSigners",
"params": [
"latest"
]
}' | jq
Request:
mainnet:
{
"jsonrpc": "2.0",
"id": 1,
"error": {
"code": -32601,
"message": "the method XDPoS_getSigners does not exist/is not available"
}
}
Method XDPoS_getSignersAtHash
Request:
hash=0x5a701a8ba642a9b53475bb19cb9a313829f7afb4287caa76bebaea02f0219f89
curl -s -X POST -H "Content-Type: application/json" ${RPC} -d '{
"jsonrpc": "2.0",
"id": 1,
"method": "XDPoS_getSignersAtHash",
"params": [
"'"${hash}"'"
]
}' | jq
Request:
mainnet:
{
"jsonrpc": "2.0",
"id": 1,
"error": {
"code": -32601,
"message": "the method XDPoS_getSignersAtHash does not exist/is not available"
}
}
Method XDPoS_getSnapshot
Request:
curl -s -X POST -H "Content-Type: application/json" ${RPC} -d '{
"jsonrpc": "2.0",
"id": 1,
"method": "XDPoS_getSnapshot",
"params": [
"latest"
]
}' | jq
Request:
mainnet:
{
"jsonrpc": "2.0",
"id": 1,
"error": {
"code": -32601,
"message": "the method XDPoS_getSnapshot does not exist/is not available"
}
}
Method XDPoS_getSnapshotAtHash
Request:
hash=0x5a701a8ba642a9b53475bb19cb9a313829f7afb4287caa76bebaea02f0219f89
curl -s -X POST -H "Content-Type: application/json" ${RPC} -d '{
"jsonrpc": "2.0",
"id": 1,
"method": "XDPoS_getSnapshotAtHash",
"params": [
"'"${hash}"'"
]
}' | jq
Request:
mainnet:
{
"jsonrpc": "2.0",
"id": 1,
"error": {
"code": -32601,
"message": "the method XDPoS_getSnapshotAtHash does not exist/is not available"
}
}
Method XDPoS_getV2BlockByHash
Request:
hash=0x5a701a8ba642a9b53475bb19cb9a313829f7afb4287caa76bebaea02f0219f89
curl -s -X POST -H "Content-Type: application/json" ${RPC} -d '{
"jsonrpc": "2.0",
"id": 1,
"method": "XDPoS_getV2BlockByHash",
"params": [
"'"${hash}"'"
]
}' | jq
Request:
mainnet:
{
"jsonrpc": "2.0",
"id": 1,
"error": {
"code": -32601,
"message": "the method XDPoS_getV2BlockByHash does not exist/is not available"
}
}
Method XDPoS_getV2BlockByNumber
Request:
curl -s -X POST -H "Content-Type: application/json" ${RPC} -d '{
"jsonrpc": "2.0",
"id": 1,
"method": "XDPoS_getV2BlockByNumber",
"params": [
"latest"
]
}' | jq
Request:
mainnet:
{
"jsonrpc": "2.0",
"id": 1,
"error": {
"code": -32601,
"message": "the method XDPoS_getV2BlockByNumber does not exist/is not available"
}
}
Method XDPoS_getRewardByAccount
Request:
curl -s -X POST -H "Content-Type: application/json" ${RPC} -d '{
"jsonrpc": "2.0",
"id": 1,
"method": "XDPoS_getRewardByAccount",
"params": [
"0x0000000000000000000000000000000000000000",
"latest",
"latest"
]
}' | jq
Request:
mainnet:
{
"jsonrpc": "2.0",
"id": 1,
"error": {
"code": -32601,
"message": "the method XDPoS_getRewardByAccount does not exist/is not available"
}
}
Method XDPoS_getBlockInfoByV2EpochNum
Request:
curl -s -X POST -H "Content-Type: application/json" ${RPC} -d '{
"jsonrpc": "2.0",
"id": 1,
"method": "XDPoS_getBlockInfoByV2EpochNum",
"params": [
89300
]
}' | jq
Request:
mainnet:
{
"jsonrpc": "2.0",
"id": 1,
"error": {
"code": -32601,
"message": "the method XDPoS_getBlockInfoByV2EpochNum does not exist/is not available"
}
}
Method XDPoS_calculateBlockInfoByV1EpochNum
Request:
curl -s -X POST -H "Content-Type: application/json" ${RPC} -d '{
"jsonrpc": "2.0",
"id": 1,
"method": "XDPoS_calculateBlockInfoByV1EpochNum",
"params": [
100
]
}' | jq
Request:
mainnet:
{
"jsonrpc": "2.0",
"id": 1,
"error": {
"code": -32601,
"message": "the method XDPoS_calculateBlockInfoByV1EpochNum does not exist/is not available"
}
}
Method XDPoS_networkInformation
Request:
curl -s -X POST -H "Content-Type: application/json" ${RPC} -d '{
"jsonrpc": "2.0",
"id": 1,
"method": "XDPoS_networkInformation"
}' | jq
Request:
mainnet:
{
"jsonrpc": "2.0",
"id": 1,
"error": {
"code": -32601,
"message": "the method XDPoS_networkInformation does not exist/is not available"
}
}
Discussion (0)