0G — Information, Transactions, ABCI, Methods (1/3)
API reference for 0G. All methods ->
Information
blockchain
Retrieves block headers for
minHeight <= height <= maxHeight.
At most 20 items will return for the minHeight or maxHeight parameters specified. If maxHeight does not yet exist, the blocks up to the current height will return. If minHeight does not exist (pruning), the earliest existing height will be used.
Parameters
minHeight(integer): the minimum block height to return.maxHeight(integer): the maximum block height to return.
Returns
Block headers, in descending order (highest first).
Request example
- JSON-RPC
- REST
curl -X POST https://rpc.ankr.com/0g_galileo_testnet_tendermint/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "blockchain",
"params": ["1", "2"],
"id": 1
}'
curl https://rpc.ankr.com/http/0g_galileo_testnet_tendermint/blockchain?minHeight=1&maxHeight=2
Response example
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"last_height": "2564978",
"block_metas": [
{
"block_id": {
"hash": "ED3BF22DDEAABE5B194ECE00FC97B73B31D6B6E381946054ADF248FADA65FD4F",
"parts": {
"total": 1,
"hash": "268422F8D294840DBC5B24FB031F976357E8478F72C16B66E7B7388C2429D18F"
}
},
"block_size": "830",
"header": {
"version": {
"block": "11"
},
"chain_id": "zgtendermint_16600-2",
"height": "2",
"time": "2024-06-24T07:25:41.380275895Z",
"last_block_id": {
"hash": "A3052C548269F770727A7E74EE90FCDAE6C4AEB5C0F0C614DA0621790D479B89",
"parts": {
"total": 1,
"hash": "E2CF5FEEBCCDA872FB23EA228B82937C4620A887071E9B68AE77CB62F431F2BA"
}
},
"last_commit_hash": "5148301A7ABA311392D676C3C967F299F85A1AD48D74E96AF083DA4787FF9C2D",
"data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855",
"validators_hash": "EC4FD9C58AB322D57FD67299FC64AE10459BDAA2652BFC1CC989C66F8B9B6EA1",
"next_validators_hash": "EC4FD9C58AB322D57FD67299FC64AE10459BDAA2652BFC1CC989C66F8B9B6EA1",
"consensus_hash": "81BA6261D0077795E489737675DE120CC9170ADCCAAD805E12EF2708A2E21453",
"app_hash": "21181DF7C886CEE14012C07031E55BF04428BF77979015F2869ED1EACABAD22E",
"last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855",
"evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855",
"proposer_address": "CDFF531A3AFA255BC193D52721027366935F9BF8"
},
"num_txs": "0"
},
{
"block_id": {
"hash": "A3052C548269F770727A7E74EE90FCDAE6C4AEB5C0F0C614DA0621790D479B89",
"parts": {
"total": 1,
"hash": "E2CF5FEEBCCDA872FB23EA228B82937C4620A887071E9B68AE77CB62F431F2BA"
}
},
"block_size": "353",
"header": {
"version": {
"block": "11"
},
"chain_id": "zgtendermint_16600-2",
"height": "1",
"time": "2024-06-24T07:24:31.526533772Z",
"last_block_id": {
"hash": "",
"parts": {
"total": 0,
"hash": ""
}
},
"last_commit_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855",
"data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855",
"validators_hash": "EC4FD9C58AB322D57FD67299FC64AE10459BDAA2652BFC1CC989C66F8B9B6EA1",
"next_validators_hash": "EC4FD9C58AB322D57FD67299FC64AE10459BDAA2652BFC1CC989C66F8B9B6EA1",
"consensus_hash": "81BA6261D0077795E489737675DE120CC9170ADCCAAD805E12EF2708A2E21453",
"app_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855",
"last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855",
"evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855",
"proposer_address": "13E845BC0B362D63BC7D4817279EDE51BEB7F9AD"
},
"num_txs": "0"
}
]
}
}
block
Retrieves a block at a specified height.
Parameters
height(integer; default: 0): the height to return. If no height is provided, the latest block is to be fetched.
Returns
Block information.
Request example
- JSON-RPC
- REST
curl -X POST https://rpc.ankr.com/0g_galileo_testnet_tendermint/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "block",
"params": ["1"],
"id": 1
}'
curl https://rpc.ankr.com/http/0g_galileo_testnet_tendermint/blockchain?height=1
Response example
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"block_id": {
"hash": "A3052C548269F770727A7E74EE90FCDAE6C4AEB5C0F0C614DA0621790D479B89",
"parts": {
"total": 1,
"hash": "E2CF5FEEBCCDA872FB23EA228B82937C4620A887071E9B68AE77CB62F431F2BA"
}
},
"block": {
"header": {
"version": {
"block": "11"
},
"chain_id": "zgtendermint_16600-2",
"height": "1",
"time": "2024-06-24T07:24:31.526533772Z",
"last_block_id": {
"hash": "",
"parts": {
"total": 0,
"hash": ""
}
},
"last_commit_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855",
"data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855",
"validators_hash": "EC4FD9C58AB322D57FD67299FC64AE10459BDAA2652BFC1CC989C66F8B9B6EA1",
"next_validators_hash": "EC4FD9C58AB322D57FD67299FC64AE10459BDAA2652BFC1CC989C66F8B9B6EA1",
"consensus_hash": "81BA6261D0077795E489737675DE120CC9170ADCCAAD805E12EF2708A2E21453",
"app_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855",
"last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855",
"evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855",
"proposer_address": "13E845BC0B362D63BC7D4817279EDE51BEB7F9AD"
},
"data": {
"txs": []
},
"evidence": {
"evidence": []
},
"last_commit": {
"height": "0",
"round": 0,
"block_id": {
"hash": "",
"parts": {
"total": 0,
"hash": ""
}
},
"signatures": []
}
}
}
}
block_by_hash
Retrieves a block by hash.
Parameters
hash(string; required): the Base64-encoded block hash.
Returns
Block information.
Request example
- JSON-RPC
- REST
curl -X POST https://rpc.ankr.com/0g_galileo_testnet_tendermint/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "block_by_hash",
"params": {
"hash": "zNX/NZMiC0tZQVr5hlXJ9K/oIlcMzjVoXdXll630i0E="
},
"id": 1
}'
curl "https://rpc.ankr.com/http/0g_galileo_testnet_tendermint/block_by_hash?hash=0xccd5ff3593220b4b59415af98655c9f4afe822570cce35685dd5e597adf48b41"
Response example
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"block_id": {
"hash": "CCD5FF3593220B4B59415AF98655C9F4AFE822570CCE35685DD5E597ADF48B41",
"parts": {
"total": 1,
"hash": "24E75E2F1D225490E8890316E7E0C0D382579EF0BD8DB3DE4D41A4B92E9D9223"
}
},
"block": {
"header": {
"version": {
"block": "11"
},
"chain_id": "zgtendermint_16600-2",
"height": "2564904",
"time": "2024-12-26T12:10:47.144809998Z",
"last_block_id": {
"hash": "994AA199E4DCDAD2F085FE4B41D20085A0ED12BE557E88D4D9566C314D5A3486",
"parts": {
"total": 1,
"hash": "EBF9742D10789704AC87037D05DC7F445E79DAE4AB01ACB80C99D18ED6D77D11"
}
},
"last_commit_hash": "2D35D340C71BD0ACDA481585236B717C98C31EDD9B7577CB4C40D23E2B16CE27",
"data_hash": "080CF08012B3EDE6D0C7D9092D2B6919EA7A74C6B1F78D3732A43ABBA17A4E2C",
"validators_hash": "50A4F72C26AE3EBF51D521B7BA99D263BBA2E1686CB1B710CD10EF3B81F70282",
"next_validators_hash": "50A4F72C26AE3EBF51D521B7BA99D263BBA2E1686CB1B710CD10EF3B81F70282",
"consensus_hash": "81BA6261D0077795E489737675DE120CC9170ADCCAAD805E12EF2708A2E21453",
"app_hash": "8F7D4C95F3F405A5274DA79833223A8AAA50A25DF68994324296DA3EBD66F0A2",
"last_results_hash": "865B5DC7B13DACE27EEFA0B4617F44946B2A3BEA44541E928859F002DCE466AF",
"evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855",
"proposer_address": "CB78E69FD887112E9C3DBD9490B8A51A3EE4E318"
},
"data": {
"txs": [
"CssCCpcCCh8vZXRoZXJtaW50LmV2bS52MS5Nc2dFdGhlcmV1bVR4EvMBCqwBChovZXRoZXJtaW50LmV2bS52MS5MZWdhY3lUeBKNAQj/1QISAjIwGIikASIqMHg4Qjc1MmU4N2RjZTMwNjI2YTYwNjg3MzkxMWFlOGM2ODFiOUZDZTE1KgsxMDAwMDAwMDAwMDoCgdRCICKTguwyMeC0CnN5ejfXSYKT76jiJ7JyunyeFhz73HJsSiA/9hhgI3rQRu81GgjlJ5f9uTZ52PcMV22ed2S5IJlkexpCMHgyMzRmOGRkZmUxMGNhOGEyYmRhMDk2OThhN2VkODk0M2YzZmNiODNhYjgxZTE3NGNmYjg5MDg0Mzg3OTQyZWZl+j8uCiwvZXRoZXJtaW50LmV2bS52MS5FeHRlbnNpb25PcHRpb25zRXRoZXJldW1UeBIYEhYKEAoGbmV1cm9uEgY0MjAwMDAQiKQB, ..."
]
},
"evidence": {
"evidence": []
},
"last_commit": {
"height": "2564903",
"round": 0,
"block_id": {
"hash": "994AA199E4DCDAD2F085FE4B41D20085A0ED12BE557E88D4D9566C314D5A3486",
"parts": {
"total": 1,
"hash": "EBF9742D10789704AC87037D05DC7F445E79DAE4AB01ACB80C99D18ED6D77D11"
}
},
"signatures": [
{
"block_id_flag": 2,
"validator_address": "13E845BC0B362D63BC7D4817279EDE51BEB7F9AD",
"timestamp": "2024-12-26T12:10:47.182829723Z",
"signature": "tc9915ID/XmkBPg1R+aeew0MDkGLgpTpcpo8VqpYqq17RIdwkcQ5rlZxnJuIL9G0skmOrIIXrzri2EhsudW+AQ=="
}
]
}
}
}
}
block_results
Retrieves block results at a specified height.
Parameters
height(integer; default: 0): the height to return. If no height is provided, the latest block info is to be fetched.
Returns
Block results.
Request example
- JSON-RPC
- REST
curl -X POST https://rpc.ankr.com/0g_galileo_testnet_tendermint/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "block_results",
"params": ["1"],
"id": 1
}'
curl https://rpc.ankr.com/http/0g_galileo_testnet_tendermint/block_results?height=1
Response example
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"height": "1",
"txs_results": null,
"begin_block_events": [
{
"type": "coin_received",
"attributes": [
{
"key": "receiver",
"value": "0g1m3h30wlvsf8llruxtpukdvsy0km2kum85yn938",
"index": true
},
{
"key": "amount",
"value": "38487598u0g",
"index": true
}
]
},
{
"type": "block_gas",
"attributes": [
{
"key": "height",
"value": "1",
"index": true
},
{
"key": "amount",
"value": "0",
"index": true
}
]
}
],
"validator_updates": null,
"consensus_param_updates": {
"block": {
"max_bytes": "200000",
"max_gas": "20000000"
},
"evidence": {
"max_age_num_blocks": "1000000",
"max_age_duration": "6000000000000000",
"max_bytes": "50000"
},
"validator": {
"pub_key_types": [
"ed25519"
]
}
}
}
}
commit
Retrieves commit results at a specified height.
Parameters
height(integer; default: 0): the height to return. If no height is provided, the latest block commit info is to be fetched.
Returns
Commit results. Canonical switches from false to true for block H once block H+1 has been committed, until then it's subjective and only reflects what this node has seen so far.
Request example
- JSON-RPC
- REST
curl -X POST https://rpc.ankr.com/0g_galileo_testnet_tendermint/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "commit",
"params": ["1"],
"id": 1
}'
curl https://rpc.ankr.com/http/0g_galileo_testnet_tendermint/commit?height=1
Response example
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"signed_header": {
"header": {
"version": {
"block": "11"
},
"chain_id": "zgtendermint_16600-2",
"height": "1",
"time": "2024-06-24T07:24:31.526533772Z",
"last_block_id": {
"hash": "",
"parts": {
"total": 0,
"hash": ""
}
},
"last_commit_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855",
"data_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855",
"validators_hash": "EC4FD9C58AB322D57FD67299FC64AE10459BDAA2652BFC1CC989C66F8B9B6EA1",
"next_validators_hash": "EC4FD9C58AB322D57FD67299FC64AE10459BDAA2652BFC1CC989C66F8B9B6EA1",
"consensus_hash": "81BA6261D0077795E489737675DE120CC9170ADCCAAD805E12EF2708A2E21453",
"app_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855",
"last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855",
"evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855",
"proposer_address": "13E845BC0B362D63BC7D4817279EDE51BEB7F9AD"
},
"commit": {
"height": "1",
"round": 0,
"block_id": {
"hash": "A3052C548269F770727A7E74EE90FCDAE6C4AEB5C0F0C614DA0621790D479B89",
"parts": {
"total": 1,
"hash": "E2CF5FEEBCCDA872FB23EA228B82937C4620A887071E9B68AE77CB62F431F2BA"
}
},
"signatures": [
{
"block_id_flag": 2,
"validator_address": "13E845BC0B362D63BC7D4817279EDE51BEB7F9AD",
"timestamp": "2024-06-24T07:25:41.481185893Z",
"signature": "VtIJZ4q7ooX/Bcy5uNojugXaWSxnW2K0hYcqHdZTAhFEURZFCuwqWYKpFCr2Tu95QQR9ROrCVVC9/3UNlPTYDQ=="
},
{
"block_id_flag": 1,
"validator_address": "",
"timestamp": "0001-01-01T00:00:00Z",
"signature": null
}
]
}
},
"canonical": true
}
}
validators
Retrieves a validator set at a specified height.
Validators are sorted by voting power.
Parameters
height(integer; default: 0): the height to return. If no height is provided, the validator set corresponding to the latest block is to be fetched.page(integer; default: 1): a page number (1-based).per_page(integer; default: 30; max: 100): a number of entries per page.
Returns
Commit results.
Request example
- JSON-RPC
- REST
curl -X POST https://rpc.ankr.com/0g_galileo_testnet_tendermint/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "validators",
"params": ["1","1","30"],
"id": 1
}'
curl "https://rpc.ankr.com/http/0g_galileo_testnet_tendermint/validators?height=1&page=1&per_page=30"
Response example
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"block_height": "1",
"validators": [
{
"address": "13E845BC0B362D63BC7D4817279EDE51BEB7F9AD",
"pub_key": {
"type": "tendermint/PubKeyEd25519",
"value": "Cu7jYSsTcNgCfi4upLVfH1ak5OM7A4OEFHJiXQe6lR8="
},
"voting_power": "5000000",
"proposer_priority": "-15000000"
},
{
"address": "542977517E9B10F6D51792A92BCC5F5B9C1DC74A",
"pub_key": {
"type": "tendermint/PubKeyEd25519",
"value": "sa0J8aTS4tscdWI0On+JEhWjs+szgH49i4jhzAcyh40="
},
"voting_power": "5000000",
"proposer_priority": "5000000"
},
{
"address": "CDFF531A3AFA255BC193D52721027366935F9BF8",
"pub_key": {
"type": "tendermint/PubKeyEd25519",
"value": "kyAfOOxIQSLf2WXQLB8D3gqItZiOHiSeHGjfhhDtlyQ="
},
"voting_power": "5000000",
"proposer_priority": "5000000"
},
{
"address": "FAD365F3FF137C1F70CBA4E3B3E61F4EFD2CDF02",
"pub_key": {
"type": "tendermint/PubKeyEd25519",
"value": "ZJGhAhqDwuq1MUsUqT32mGnjlqtjlH7MHzOv8ezK7cg="
},
"voting_power": "5000000",
"proposer_priority": "5000000"
}
],
"count": "4",
"total": "4"
}
}
genesis_chunked
Retrieves Genesis in multiple chunks.
Gets genesis document in multiple chunks to make it easier to iterate through larger genesis structures. Each chunk is produced by converting the genesis document to JSON and then splitting the resulting payload into 16MB blocks, and then Base64-encoding each block.
Parameters
chunk(integer; default: 0): a sequence number of the chunk to download.
Returns
A Genesis chunk response.
Request example
- JSON-RPC
- REST
curl -X POST https://rpc.ankr.com/0g_galileo_testnet_tendermint/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "genesis_chunked",
"params": ["0"],
"id": 1
}'
curl https://rpc.ankr.com/http/0g_galileo_testnet_tendermint/genesis_chunked?chunk=0
Response example
{
"jsonrpc": "2.0",
"id": -1,
"result": {
"chunk": "0",
"total": "1",
"data": "eyJnZW5lc2lzX3RpbWUiOiIyMDI0LTA2LTI0VDA3OjI0OjMxLjUyNjUzMzc3MloiLCJjaGFpbl9pZCI6InpndGVuZGVybWludF8xNjYwMC0yIiwiaW5pdGlhbF9oZWlnaHQiOiIxIiwiY29uc2Vuc3VzX3BhcmFtcyI6eyJibG9jayI6eyJtYXhfYnl0ZXMiOiIyMjAyMD..."
}
}