Alchemy Tendermint API
Here you will find a list of all the methods Alchemy supports for Tendermint.
There might be methods supported by Crypto.org nodes but not by Alchemy. See the full list of Tendermint API methods on the official documentation .
RPC Protocols
There are two RPC protocols that are supported for Alchemy Tendermint.
URI/HTTP
A REST like interface.
Copy curl https://cro-croeseid.alchemyapi.io/your-api-key/tendermint/block?height=5
JSONRPC/HTTP
JSONRPC requests can be POST'd to the root RPC endpoint via HTTP.
Copy curl --header "Content-Type: application/json" --request POST --data '{"method": "block", "params": ["5"], "id": 1}' https://cro-croeseid.alchemyapi.io/your-api-key/tendermint/
API Key
We've created an API key called your-api-key
so you can easily copy and paste these sample requests above and below. However, you should replace your-api-key
with your own API key when developing.
Arguments
Arguments which expect strings or byte arrays may be passed as quoted strings, like "abc
" or as 0x
- prefixed strings like 0x616263
Error Codes
Unlike direct Crypto.org nodes, Alchemy will return a 200
response for every request served. This means even requests that resulted in an error will get back a 200
response and the corresponding error message. If the request was unable to be served by the nodes at all, users will receive a 500
response error code.
Information
Calls to get information related to the Node API.
health
Get node health.
Parameters
none
Returns
none
Example
Request
URI JSON-RPC
Copy curl https://cro-croeseid.alchemyapi.io/your-api-key/tendermint/health
Copy curl --header "Content-Type: application/json" --request POST --data '{"method": "health", "params": [], "id": 1}' https://cro-croeseid.alchemyapi.io/your-api-key/tendermint
Result
Copy {
"jsonrpc" : "2.0" ,
"id" : 1 ,
"result" : {}
}
Example requests below have not been updated. When making requests please use:
Copy https://cro-croeseid.alchemyapi.io/your-api-key/tendermint
status
Get Tendermint status including node info, pubkey, latest block hash, app hash, block height and time.
Parameters
none
Returns
Status of the node
Example
Request
URI JSON-RPC
Copy curl cro-croeseid.alchemyapi.io/your-api-key/tendermint/status
Copy curl --header "Content-Type: application/json" --request POST --data '{"method": "status", "params": [], "id": 0}' cro-croeseid.alchemyapi.io/your-api-key/tendermint
Result
Copy {
"id" : 0 ,
"jsonrpc" : "2.0" ,
"result" : {
"node_info" : {
"protocol_version" : {
"p2p" : "7" ,
"block" : "10" ,
"app" : "0"
} ,
"id" : "5576458aef205977e18fd50b274e9b5d9014525a" ,
"listen_addr" : "tcp:0.0.0.0:26656" ,
"network" : "cosmoshub-2" ,
"version" : "0.32.1" ,
"channels" : "4020212223303800" ,
"moniker" : "moniker-node" ,
"other" : {
"tx_index" : "on" ,
"rpc_address" : "tcp:0.0.0.0:26657"
}
} ,
"sync_info" : {
"latest_block_hash" : "790BA84C3545FCCC49A5C629CEE6EA58A6E875C3862175BDC11EE7AF54703501" ,
"latest_app_hash" : "C9AEBB441B787D9F1D846DE51F3826F4FD386108B59B08239653ABF59455C3F8" ,
"latest_block_height" : "1262196" ,
"latest_block_time" : "2019-08-01T11:52:22.818762194Z" ,
"earliest_block_hash" : "790BA84C3545FCCC49A5C629CEE6EA58A6E875C3862175BDC11EE7AF54703501" ,
"earliest_app_hash" : "C9AEBB441B787D9F1D846DE51F3826F4FD386108B59B08239653ABF59455C3F8" ,
"earliest_block_height" : "1262196" ,
"earliest_block_time" : "2019-08-01T11:52:22.818762194Z" ,
"catching_up" : false
} ,
"validator_info" : {
"address" : "5D6A51A8E9899C44079C6AF90618BA0369070E6E" ,
"pub_key" : {
"type" : "tendermint/PubKeyEd25519" ,
"value" : "A6DoBUypNtUAyEHWtQ9bFjfNg8Bo9CrnkUGl6k6OHN4="
} ,
"voting_power" : "0"
}
}
}
blockchain
Get block headers (max: 20) for minHeight
<= height <= maxHeight
. If maxHeight
does not yet exist, blocks up to the current height will be returned. If minHeight
does not exist (due to pruning), earliest existing height will be used.
At most 20 items will be returned. Block headers are returned in descending order (highest first).
Parameters
minHeight
- integer, minimum block height to return
maxHeight
- integer, maximum block height to return
Returns
Block headers, returned in descending order (highest first).
Example
Request
URI JSON-RPC
Copy curl cro-croeseid.alchemyapi.io/your-api-key/tendermint/blockchain?minHeight= 1 & maxHeight = 2
Copy curl --header "Content-Type: application/json" --request POST --data '{"method": "blockchain", "params": ["1", "2"], "id": 0}' cro-croeseid.alchemyapi.io/your-api-key/tendermint
Result
Copy {
"id" : 0 ,
"jsonrpc" : "2.0" ,
"result" : {
"last_height" : "1276718" ,
"block_metas" : [
{
"block_id" : {
"hash" : "112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7" ,
"parts" : {
"total" : 1 ,
"hash" : "38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD"
}
} ,
"block_size" : 1000000 ,
"header" : {
"version" : {
"block" : "10" ,
"app" : "0"
} ,
"chain_id" : "cosmoshub-2" ,
"height" : "12" ,
"time" : "2019-04-22T17:01:51.701356223Z" ,
"last_block_id" : {
"hash" : "112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7" ,
"parts" : {
"total" : 1 ,
"hash" : "38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD"
}
} ,
"last_commit_hash" : "21B9BC845AD2CB2C4193CDD17BFC506F1EBE5A7402E84AD96E64171287A34812" ,
"data_hash" : "970886F99E77ED0D60DA8FCE0447C2676E59F2F77302B0C4AA10E1D02F18EF73" ,
"validators_hash" : "D658BFD100CA8025CFD3BECFE86194322731D387286FBD26E059115FD5F2BCA0" ,
"next_validators_hash" : "D658BFD100CA8025CFD3BECFE86194322731D387286FBD26E059115FD5F2BCA0" ,
"consensus_hash" : "0F2908883A105C793B74495EB7D6DF2EEA479ED7FC9349206A65CB0F9987A0B8" ,
"app_hash" : "223BF64D4A01074DC523A80E76B9BBC786C791FB0A1893AC5B14866356FCFD6C" ,
"last_results_hash" : "" ,
"evidence_hash" : "" ,
"proposer_address" : "D540AB022088612AC74B287D076DBFBC4A377A2E"
} ,
"num_txs" : "54"
}
]
}
}
block
Get block at a specified height.
Parameters
height
- integer, height to return. If no height is provided, it will fetch the latest block. Default value = 0
Returns
Network info.
Example
Request
URI JSON-RPC
Copy curl cro-croeseid.alchemyapi.io/your-api-key/tendermint/block?height= 1
Copy curl --header "Content-Type: application/json" --request POST --data '{"method": "block", "params": ["1"], "id": 0}' cro-croeseid.alchemyapi.io/your-api-key/tendermint
Result
Copy {
"id" : 0 ,
"jsonrpc" : "2.0" ,
"result" : {
"block_id" : {
"hash" : "112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7" ,
"parts" : {
"total" : 1 ,
"hash" : "38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD"
}
} ,
"block" : {
"header" : {
"version" : {
"block" : "10" ,
"app" : "0"
} ,
"chain_id" : "cosmoshub-2" ,
"height" : "12" ,
"time" : "2019-04-22T17:01:51.701356223Z" ,
"last_block_id" : {
"hash" : "112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7" ,
"parts" : {
"total" : 1 ,
"hash" : "38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD"
}
} ,
"last_commit_hash" : "21B9BC845AD2CB2C4193CDD17BFC506F1EBE5A7402E84AD96E64171287A34812" ,
"data_hash" : "970886F99E77ED0D60DA8FCE0447C2676E59F2F77302B0C4AA10E1D02F18EF73" ,
"validators_hash" : "D658BFD100CA8025CFD3BECFE86194322731D387286FBD26E059115FD5F2BCA0" ,
"next_validators_hash" : "D658BFD100CA8025CFD3BECFE86194322731D387286FBD26E059115FD5F2BCA0" ,
"consensus_hash" : "0F2908883A105C793B74495EB7D6DF2EEA479ED7FC9349206A65CB0F9987A0B8" ,
"app_hash" : "223BF64D4A01074DC523A80E76B9BBC786C791FB0A1893AC5B14866356FCFD6C" ,
"last_results_hash" : "" ,
"evidence_hash" : "" ,
"proposer_address" : "D540AB022088612AC74B287D076DBFBC4A377A2E"
} ,
"data" : [
"yQHwYl3uCkKoo2GaChRnd+THLQ2RM87nEZrE19910Z28ABIUWW/t8AtIMwcyU0sT32RcMDI9GF0aEAoFdWF0b20SBzEwMDAwMDASEwoNCgV1YXRvbRIEMzEwMRCd8gEaagom61rphyEDoJPxlcjRoNDtZ9xMdvs+lRzFaHe2dl2P5R2yVCWrsHISQKkqX5H1zXAIJuC57yw0Yb03Fwy75VRip0ZBtLiYsUqkOsPUoQZAhDNP+6LY+RUwz/nVzedkF0S29NZ32QXdGv0="
] ,
"evidence" : [
{
"type" : "string" ,
"height" : 0 ,
"time" : 0 ,
"total_voting_power" : 0 ,
"validator" : {
"pub_key" : {
"type" : "tendermint/PubKeyEd25519" ,
"value" : "A6DoBUypNtUAyEHWtQ9bFjfNg8Bo9CrnkUGl6k6OHN4="
} ,
"voting_power" : 0 ,
"address" : "string"
}
}
] ,
"last_commit" : {
"height" : 0 ,
"round" : 0 ,
"block_id" : {
"hash" : "112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7" ,
"parts" : {
"total" : 1 ,
"hash" : "38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD"
}
} ,
"signatures" : [
{
"type" : 2 ,
"height" : "1262085" ,
"round" : 0 ,
"block_id" : {
"hash" : "112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7" ,
"parts" : {
"total" : 1 ,
"hash" : "38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD"
}
} ,
"timestamp" : "2019-08-01T11:39:38.867269833Z" ,
"validator_address" : "000001E443FD237E4B616E2FA69DF4EE3D49A94F" ,
"validator_index" : 0 ,
"signature" : "DBchvucTzAUEJnGYpNvMdqLhBAHG4Px8BsOBB3J3mAFCLGeuG7uJqy+nVngKzZdPhPi8RhmE/xcw/M9DOJjEDg=="
}
]
}
}
}
}
block_by_hash
Get block by hash.
Parameters
hash
- string, block hash
Returns
Block information.
Example
Request
URI JSON-RPC
Copy curl cro-croeseid.alchemyapi.io/your-api-key/tendermint/block_by_hash?hash= 0xD70952032620CC4E2737EB8AC379806359D8E0B17B0488F627997A0B043ABDED
Copy curl --header "Content-Type: application/json" --request POST --data '{"method": "block_by_hash", "params": ["0xD70952032620CC4E2737EB8AC379806359D8E0B17B0488F627997A0B043ABDED"], "id": 0}' cro-croeseid.alchemyapi.io/your-api-key/tendermint
Result
Copy {
"id" : 0 ,
"jsonrpc" : "2.0" ,
"result" : {
"block_id" : {
"hash" : "112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7" ,
"parts" : {
"total" : 1 ,
"hash" : "38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD"
}
} ,
"block" : {
"header" : {
"version" : {
"block" : "10" ,
"app" : "0"
} ,
"chain_id" : "cosmoshub-2" ,
"height" : "12" ,
"time" : "2019-04-22T17:01:51.701356223Z" ,
"last_block_id" : {
"hash" : "112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7" ,
"parts" : {
"total" : 1 ,
"hash" : "38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD"
}
} ,
"last_commit_hash" : "21B9BC845AD2CB2C4193CDD17BFC506F1EBE5A7402E84AD96E64171287A34812" ,
"data_hash" : "970886F99E77ED0D60DA8FCE0447C2676E59F2F77302B0C4AA10E1D02F18EF73" ,
"validators_hash" : "D658BFD100CA8025CFD3BECFE86194322731D387286FBD26E059115FD5F2BCA0" ,
"next_validators_hash" : "D658BFD100CA8025CFD3BECFE86194322731D387286FBD26E059115FD5F2BCA0" ,
"consensus_hash" : "0F2908883A105C793B74495EB7D6DF2EEA479ED7FC9349206A65CB0F9987A0B8" ,
"app_hash" : "223BF64D4A01074DC523A80E76B9BBC786C791FB0A1893AC5B14866356FCFD6C" ,
"last_results_hash" : "" ,
"evidence_hash" : "" ,
"proposer_address" : "D540AB022088612AC74B287D076DBFBC4A377A2E"
} ,
"data" : [
"yQHwYl3uCkKoo2GaChRnd+THLQ2RM87nEZrE19910Z28ABIUWW/t8AtIMwcyU0sT32RcMDI9GF0aEAoFdWF0b20SBzEwMDAwMDASEwoNCgV1YXRvbRIEMzEwMRCd8gEaagom61rphyEDoJPxlcjRoNDtZ9xMdvs+lRzFaHe2dl2P5R2yVCWrsHISQKkqX5H1zXAIJuC57yw0Yb03Fwy75VRip0ZBtLiYsUqkOsPUoQZAhDNP+6LY+RUwz/nVzedkF0S29NZ32QXdGv0="
] ,
"evidence" : [
{
"type" : "string" ,
"height" : 0 ,
"time" : 0 ,
"total_voting_power" : 0 ,
"validator" : {
"pub_key" : {
"type" : "tendermint/PubKeyEd25519" ,
"value" : "A6DoBUypNtUAyEHWtQ9bFjfNg8Bo9CrnkUGl6k6OHN4="
} ,
"voting_power" : 0 ,
"address" : "string"
}
}
] ,
"last_commit" : {
"height" : 0 ,
"round" : 0 ,
"block_id" : {
"hash" : "112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7" ,
"parts" : {
"total" : 1 ,
"hash" : "38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD"
}
} ,
"signatures" : [
{
"type" : 2 ,
"height" : "1262085" ,
"round" : 0 ,
"block_id" : {
"hash" : "112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7" ,
"parts" : {
"total" : 1 ,
"hash" : "38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD"
}
} ,
"timestamp" : "2019-08-01T11:39:38.867269833Z" ,
"validator_address" : "000001E443FD237E4B616E2FA69DF4EE3D49A94F" ,
"validator_index" : 0 ,
"signature" : "DBchvucTzAUEJnGYpNvMdqLhBAHG4Px8BsOBB3J3mAFCLGeuG7uJqy+nVngKzZdPhPi8RhmE/xcw/M9DOJjEDg=="
}
]
}
}
}
}
block_results
Get block results at a specified height.
Parameters
height
- integer, height to return. If no height is provided, it will fetch informations regarding the latest block. Default value = 0
Returns
Block results.
Example
Request
URI JSON-RPC
Copy curl cro-croeseid.alchemyapi.io/your-api-key/tendermint/block_results?height= 1
Copy curl --header "Content-Type: application/json" --request POST --data '{"method": "block_results", "params": ["1"], "id": 0}' cro-croeseid.alchemyapi.io/your-api-key/tendermint
Result
Copy {
"jsonrpc" : "2.0" ,
"id" : 0 ,
"result" : {
"height" : "12" ,
"txs_results" : [
{
"code" : "0" ,
"data" : "" ,
"log" : "not enough gas" ,
"info" : "" ,
"gas_wanted" : "100" ,
"gas_used" : "100" ,
"events" : [
{
"type" : "app" ,
"attributes" : [
{
"key" : "YWN0aW9u" ,
"value" : "c2VuZA==" ,
"index" : false
}
]
}
] ,
"codespace" : "ibc"
}
] ,
"begin_block_events" : [
{
"type" : "app" ,
"attributes" : [
{
"key" : "YWN0aW9u" ,
"value" : "c2VuZA==" ,
"index" : false
}
]
}
] ,
"end_block" : [
{
"type" : "app" ,
"attributes" : [
{
"key" : "YWN0aW9u" ,
"value" : "c2VuZA==" ,
"index" : false
}
]
}
] ,
"validator_updates" : [
{
"pub_key" : {
"type" : "tendermint/PubKeyEd25519" ,
"value" : "9tK9IT+FPdf2qm+5c2qaxi10sWP+3erWTKgftn2PaQM="
} ,
"power" : "300"
}
] ,
"consensus_params_updates" : {
"block" : {
"max_bytes" : "22020096" ,
"max_gas" : "1000" ,
"time_iota_ms" : "1000"
} ,
"evidence" : {
"max_age" : "100000"
} ,
"validator" : {
"pub_key_types" : [
"ed25519"
]
}
}
}
}
commit
Get commit results at a specified height.
Parameters
height
- integer, height to return. If no height is provided, it will fetch commit information regarding the latest block. Default value = 0
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
Example
Request
URI JSON-RPC
Copy curl cro-croeseid.alchemyapi.io/your-api-key/tendermint/commit?height= 1
Copy curl --header "Content-Type: application/json" --request POST --data '{"method": "commit", "params": ["1"], "id": 0}' cro-croeseid.alchemyapi.io/your-api-key/tendermint
Result
Copy {
"jsonrpc" : "2.0" ,
"id" : 0 ,
"result" : {
"signed_header" : {
"header" : {
"version" : {
"block" : "10" ,
"app" : "0"
} ,
"chain_id" : "cosmoshub-2" ,
"height" : "12" ,
"time" : "2019-04-22T17:01:51.701356223Z" ,
"last_block_id" : {
"hash" : "112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7" ,
"parts" : {
"total" : 1 ,
"hash" : "38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD"
}
} ,
"last_commit_hash" : "21B9BC845AD2CB2C4193CDD17BFC506F1EBE5A7402E84AD96E64171287A34812" ,
"data_hash" : "970886F99E77ED0D60DA8FCE0447C2676E59F2F77302B0C4AA10E1D02F18EF73" ,
"validators_hash" : "D658BFD100CA8025CFD3BECFE86194322731D387286FBD26E059115FD5F2BCA0" ,
"next_validators_hash" : "D658BFD100CA8025CFD3BECFE86194322731D387286FBD26E059115FD5F2BCA0" ,
"consensus_hash" : "0F2908883A105C793B74495EB7D6DF2EEA479ED7FC9349206A65CB0F9987A0B8" ,
"app_hash" : "223BF64D4A01074DC523A80E76B9BBC786C791FB0A1893AC5B14866356FCFD6C" ,
"last_results_hash" : "" ,
"evidence_hash" : "" ,
"proposer_address" : "D540AB022088612AC74B287D076DBFBC4A377A2E"
} ,
"commit" : {
"height" : "1311801" ,
"round" : 0 ,
"block_id" : {
"hash" : "112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7" ,
"parts" : {
"total" : 1 ,
"hash" : "38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD"
}
} ,
"signatures" : [
{
"block_id_flag" : 2 ,
"validator_address" : "000001E443FD237E4B616E2FA69DF4EE3D49A94F" ,
"timestamp" : "2019-04-22T17:01:58.376629719Z" ,
"signature" : "14jaTQXYRt8kbLKEhdHq7AXycrFImiLuZx50uOjs2+Zv+2i7RTG/jnObD07Jo2ubZ8xd7bNBJMqkgtkd0oQHAw=="
}
]
}
} ,
"canonical" : true
}
}
validators
Get validator set at a specified height. Validators are sorted first by voting power (descending), then by address (ascending).
Parameters
height
- integer, height to return. If no height is provided, it will fetch validator set which corresponds to the latest block. Default value = 0
page
- integer, page number (1-based). Default value = 1
per_page
- integer, number of entries per page (max: 100). Default value: 30
Returns
Commit results.
Example
Request
URI JSON-RPC
Copy curl cro-croeseid.alchemyapi.io/your-api-key/tendermint/validators?height= 1 & page = 1 & per_page = 30
Copy curl --header "Content-Type: application/json" --request POST --data '{"method": "validators", "params": ["1","1","30"], "id": 0}' cro-croeseid.alchemyapi.io/your-api-key/tendermint
Result
Copy {
"jsonrpc" : "2.0" ,
"id" : 0 ,
"result" : {
"block_height" : "55" ,
"validators" : [
{
"address" : "000001E443FD237E4B616E2FA69DF4EE3D49A94F" ,
"pub_key" : {
"type" : "tendermint/PubKeyEd25519" ,
"value" : "9tK9IT+FPdf2qm+5c2qaxi10sWP+3erWTKgftn2PaQM="
} ,
"voting_power" : "239727" ,
"proposer_priority" : "-11896414"
}
] ,
"count" : "1" ,
"total" : "25"
}
}
genesis
Get genesis.
Parameters
none
Returns
Genesis results.
Example
Request
URI JSON-RPC
Copy curl cro-croeseid.alchemyapi.io/your-api-key/tendermint/genesis
Copy curl --header "Content-Type: application/json" --request POST --data '{"method": "genesis", "params": [], "id": 0}' cro-croeseid.alchemyapi.io/your-api-key/tendermint
Result
Copy {
"jsonrpc" : "2.0" ,
"id" : 0 ,
"result" : {
"genesis" : {
"genesis_time" : "2019-04-22T17:00:00Z" ,
"chain_id" : "cosmoshub-2" ,
"initial_height" : "2" ,
"consensus_params" : {
"block" : {
"max_bytes" : "22020096" ,
"max_gas" : "1000" ,
"time_iota_ms" : "1000"
} ,
"evidence" : {
"max_age" : "100000"
} ,
"validator" : {
"pub_key_types" : [
"ed25519"
]
}
} ,
"validators" : [
{
"address" : "B00A6323737F321EB0B8D59C6FD497A14B60938A" ,
"pub_key" : {
"type" : "tendermint/PubKeyEd25519" ,
"value" : "cOQZvh/h9ZioSeUMZB/1Vy1Xo5x2sjrVjlE/qHnYifM="
} ,
"power" : "9328525" ,
"name" : "Certus One"
}
] ,
"app_hash" : "" ,
"app_state" : {}
}
}
}
unconfirmed_txs
Get the list of unconfirmed transactions.
Parameters
limit
- integer, Maximum number of unconfirmed transactions to return (max 100). Default value 30
Returns
List of unconfirmed transactions.
Example
Request
URI JSON-RPC
Copy curl cro-croeseid.alchemyapi.io/your-api-key/tendermint/unconfirmed_txs?limit= 1
Copy curl --header "Content-Type: application/json" --request POST --data '{"method": "unconfirmed_txs", "params": ["1"], "id": 0}' cro-croeseid.alchemyapi.io/your-api-key/tendermint
Result
Copy {
"jsonrpc" : "2.0" ,
"id" : 0 ,
"result" : {
"n_txs" : "82" ,
"total" : "82" ,
"total_bytes" : "19974" ,
"txs" : [
"gAPwYl3uCjCMTXENChSMnIkb5ZpYHBKIZqecFEV2tuZr7xIUA75/FmYq9WymsOBJ0XSJ8yV8zmQKMIxNcQ0KFIyciRvlmlgcEohmp5wURXa25mvvEhQbrvwbvlNiT+Yjr86G+YQNx7kRVgowjE1xDQoUjJyJG+WaWBwSiGannBRFdrbma+8SFK2m+1oxgILuQLO55n8mWfnbIzyPCjCMTXENChSMnIkb5ZpYHBKIZqecFEV2tuZr7xIUQNGfkmhTNMis4j+dyMDIWXdIPiYKMIxNcQ0KFIyciRvlmlgcEohmp5wURXa25mvvEhS8sL0D0wwgGCItQwVowak5YB38KRIUCg4KBXVhdG9tEgUxMDA1NBDoxRgaagom61rphyECn8x7emhhKdRCB2io7aS/6Cpuq5NbVqbODmqOT3jWw6kSQKUresk+d+Gw0BhjiggTsu8+1voW+VlDCQ1GRYnMaFOHXhyFv7BCLhFWxLxHSAYT8a5XqoMayosZf9mANKdXArA="
]
}
}
num_unconfirmed_txs
Get data about unconfirmed transactions.
Parameters
none
Returns
Status about unconfirmed transactions.
Example
Request
URI JSON-RPC
Copy curl cro-croeseid.alchemyapi.io/your-api-key/tendermint/num_unconfirmed_txs
Copy curl --header "Content-Type: application/json" --request POST --data '{"method": "num_unconfirmed_txs", "params": [], "id": 0}' cro-croeseid.alchemyapi.io/your-api-key/tendermint
Result
Copy {
"jsonrpc" : "2.0" ,
"id" : 0 ,
"result" : {
"n_txs" : "31" ,
"total" : "82" ,
"total_bytes" : "19974"
}
}
tx_search
Search for transactions with their results.
Parameters
query
- string, required query.
prove
- boolean, include proofs of the transactions inclusion in the block. Default value = false
page
- integer, page number (1-based). Default value = 1
per_page
- integer, number of entries per page (max: 100). Default value = 30
.
order_by
- string, Order in which transactions are sorted ("asc
" or "desc
"), by height & index. If empty, default sorting will be still applied. Default value = asc
Returns
List of unconfirmed transactions.
Example
Request
URI JSON-RPC
Copy curl cro-croeseid.alchemyapi.io/your-api-key/tendermint/tx_search?query=tx.height%3D1000 & prove = true & page = 1 & per_page = 30 & order_by = asc
Copy curl --header "Content-Type: application/json" --request POST --data '{"method": "tx_search", "params": ["3D1000", "true", "1", "30", "asc"], "id": 0}' cro-croeseid.alchemyapi.io/your-api-key/tendermint
Result
Copy {
"jsonrpc" : "2.0" ,
"id" : 0 ,
"result" : {
"txs" : [
{
"hash" : "D70952032620CC4E2737EB8AC379806359D8E0B17B0488F627997A0B043ABDED" ,
"height" : "1000" ,
"index" : 0 ,
"tx_result" : {
"log" : "[{\"msg_index\":\"0\",\"success\":true,\"log\":\"\"}]" ,
"gas_wanted" : "200000" ,
"gas_used" : "28596" ,
"tags" : {
"key" : "YWN0aW9u" ,
"value" : "c2VuZA==" ,
"index" : false
}
} ,
"tx" : "5wHwYl3uCkaoo2GaChQmSIu8hxpJxLcCuIi8fiHN4TMwrRIU/Af1cEG7Rcs/6LjTl7YjRSymJfYaFAoFdWF0b20SCzE0OTk5OTk1MDAwEhMKDQoFdWF0b20SBDUwMDAQwJoMGmoKJuta6YchAwswBShaB1wkZBctLIhYqBC3JrAI28XGzxP+rVEticGEEkAc+khTkKL9CDE47aDvjEHvUNt+izJfT4KVF2v2JkC+bmlH9K08q3PqHeMI9Z5up+XMusnTqlP985KF+SI5J3ZOIhhNYWRlIGJ5IENpcmNsZSB3aXRoIGxvdmU=" ,
"proof" : {
"RootHash" : "72FE6BF6D4109105357AECE0A82E99D0F6288854D16D8767C5E72C57F876A14D" ,
"Data" : "5wHwYl3uCkaoo2GaChQmSIu8hxpJxLcCuIi8fiHN4TMwrRIU/Af1cEG7Rcs/6LjTl7YjRSymJfYaFAoFdWF0b20SCzE0OTk5OTk1MDAwEhMKDQoFdWF0b20SBDUwMDAQwJoMGmoKJuta6YchAwswBShaB1wkZBctLIhYqBC3JrAI28XGzxP+rVEticGEEkAc+khTkKL9CDE47aDvjEHvUNt+izJfT4KVF2v2JkC+bmlH9K08q3PqHeMI9Z5up+XMusnTqlP985KF+SI5J3ZOIhhNYWRlIGJ5IENpcmNsZSB3aXRoIGxvdmU=" ,
"Proof" : {
"total" : "2" ,
"index" : "0" ,
"leaf_hash" : "eoJxKCzF3m72Xiwb/Q43vJ37/2Sx8sfNS9JKJohlsYI=" ,
"aunts" : [
"eWb+HG/eMmukrQj4vNGyFYb3nKQncAWacq4HF5eFzDY="
]
}
}
}
] ,
"total_count" : "2"
}
}
tx
Get transactions by hash.
Parameters
hash
- string, required transaction hash to retrieve
prove
- boolean, include proofs of the transactions inclusion in the block. Default value = false
Returns
Transaction info.
Example
Request
URI JSON-RPC
Copy curl cro-croeseid.alchemyapi.io/your-api-key/tendermint/tx?hash= 0xD70952032620CC4E2737EB8AC379806359D8E0B17B0488F627997A0B043ABDED & prove = true
Copy curl --header "Content-Type: application/json" --request POST --data '{"method": "tx", "params": ["0xD70952032620CC4E2737EB8AC379806359D8E0B17B0488F627997A0B043ABDED", "true"], "id": 0}' cro-croeseid.alchemyapi.io/your-api-key/tendermint
Result
Copy {
"jsonrpc" : "2.0" ,
"id" : 0 ,
"result" : {
"hash" : "D70952032620CC4E2737EB8AC379806359D8E0B17B0488F627997A0B043ABDED" ,
"height" : "1000" ,
"index" : 0 ,
"tx_result" : {
"log" : "[{\"msg_index\":\"0\",\"success\":true,\"log\":\"\"}]" ,
"gas_wanted" : "200000" ,
"gas_used" : "28596" ,
"tags" : [
{
"key" : "YWN0aW9u" ,
"value" : "c2VuZA==" ,
"index" : false
}
]
} ,
"tx" : "5wHwYl3uCkaoo2GaChQmSIu8hxpJxLcCuIi8fiHN4TMwrRIU/Af1cEG7Rcs/6LjTl7YjRSymJfYaFAoFdWF0b20SCzE0OTk5OTk1MDAwEhMKDQoFdWF0b20SBDUwMDAQwJoMGmoKJuta6YchAwswBShaB1wkZBctLIhYqBC3JrAI28XGzxP+rVEticGEEkAc+khTkKL9CDE47aDvjEHvUNt+izJfT4KVF2v2JkC+bmlH9K08q3PqHeMI9Z5up+XMusnTqlP985KF+SI5J3ZOIhhNYWRlIGJ5IENpcmNsZSB3aXRoIGxvdmU="
}
}
Transactions
Methods for broadcasting transactions.
broadcast_tx_sync
Returns with the response from check_tx , does not wait for DeliverTx result.
WebSocket Subscription
If you want to be sure that the transaction is included in a block, you can subscribe for the result using JSONRPC via a websocket. However, Alchemy does not currently support WebSocket subscriptions for crypto.org nodes.
You can view how to use websockets on the Tendermint docs . If you haven't received anything after a couple of blocks, resend it. If the same happens again, send it to some other node. A few reasons why it could happen:
malicious node can drop or pretend it had committed your tx
malicious proposer (not necessary the one you're communicating with) can drop transactions, which might become valid in the future
Please refer to this page for formatting/encoding rules.
Parameters
tx
- string, the transaction
Returns
none
Example
Request
URI JSON-RPC
Copy curl cro-croeseid.alchemyapi.io/your-api-key/tendermint/broadcast_tx_sync?tx= 456
Copy curl --header "Content-Type: application/json" --request POST --data '{"method": "broadcast_tx_sync", "params": ["456"], "id": 0}' cro-croeseid.alchemyapi.io/your-api-key/tendermint
Result
Copy {
"jsonrpc" : "2.0" ,
"id" : 0 ,
"result" : {
"code" : "0" ,
"data" : "" ,
"log" : "" ,
"codespace" : "ibc" ,
"hash" : "0D33F2F03A5234F38706E43004489E061AC40A2E"
} ,
"error" : ""
}
broadcast_tx_async
Returns right away, with no response, does not wait for check_tx nor DeliverTx result.
Parameters
tx
- string, the transaction
Returns
none
Example
Request
URI JSON-RPC
Copy curl cro-croeseid.alchemyapi.io/your-api-key/tendermint/broadcast_tx_async?tx= 123
Copy curl --header "Content-Type: application/json" --request POST --data '{"method": "broadcast_tx_async", "params": ["123"], "id": 0}' cro-croeseid.alchemyapi.io/your-api-key/tendermint
Result
Copy {
"jsonrpc" : "2.0" ,
"id" : 0 ,
"result" : {
"code" : "0" ,
"data" : "" ,
"log" : "" ,
"codespace" : "ibc" ,
"hash" : "0D33F2F03A5234F38706E43004489E061AC40A2E"
} ,
"error" : ""
}
broadcast_tx_commit
Returns with the responses from CheckTX and DeliverTx.
IMPORTANT: use only for testing and development. In production, use broadcast_tx_sync
or broadcast_tx_async
.
CONTRACT : only returns error if mempool.CheckTx() errs or if we timeout waiting for tx to commit.
If CheckTx or DeliverTx fail, no error will be returned, but the returned result will contain a non-OK ABCI code.
Please refer to the Tendermint documentation for formatting/encoding rules
Parameters
tx
- string, required transaction
Returns
none
Example
Request
URI JSON-RPC
Copy curl cro-croeseid.alchemyapi.io/your-api-key/tendermint/broadcast_tx_commit?tx= 785
Copy curl --header "Content-Type: application/json" --request POST --data '{"method": "broadcast_tx_commit", "params": ["785"], "id": 0}' cro-croeseid.alchemyapi.io/your-api-key/tendermint
Result
Copy {
"error" : "" ,
"result" : {
"height" : "26682" ,
"hash" : "75CA0F856A4DA078FC4911580360E70CEFB2EBEE" ,
"deliver_tx" : {
"log" : "" ,
"data" : "" ,
"code" : "0"
} ,
"check_tx" : {
"log" : "" ,
"data" : "" ,
"code" : "0"
}
} ,
"id" : 0 ,
"jsonrpc" : "2.0"
}
check_tx
Checks the transaction without executing it. the transaction won't be added to the mempool. Please refer to the Tendermint documentation for formatting/encoding rules.
Parameters
tx
- string, required transaction
Returns
ABCI application's CheckTx response.
Example
Request
URI JSON-RPC
Copy curl cro-croeseid.alchemyapi.io/your-api-key/tendermint/check_tx?tx= 785
Copy curl --header "Content-Type: application/json" --request POST --data '{"method": "check_tx", "params": ["785"], "id": 0}' cro-croeseid.alchemyapi.io/your-api-key/tendermint
Result
Copy {
"error" : "" ,
"result" : {
"code" : "0" ,
"data" : "" ,
"log" : "" ,
"info" : "" ,
"gas_wanted" : "1" ,
"gas_used" : "0" ,
"events" : [
{
"type" : "app" ,
"attributes" : [
{
"key" : "YWN0aW9u" ,
"value" : "c2VuZA==" ,
"index" : false
}
]
}
] ,
"codespace" : "bank"
} ,
"id" : 0 ,
"jsonrpc" : "2.0"
}
ABCI
abci_info
Get some info about the application.
Parameters
none
Returns
Information about the application.
Example
Request
URI JSON-RPC
Copy curl cro-croeseid.alchemyapi.io/your-api-key/tendermint/abci_info
Copy curl --header "Content-Type: application/json" --request POST --data '{"method": "abci_info", "params": [], "id": 0}' cro-croeseid.alchemyapi.io/your-api-key/tendermint
Result
Copy {
"jsonrpc" : "2.0" ,
"id" : 0 ,
"result" : {
"response" : {
"data" : "{\"size\":0}" ,
"version" : "0.16.1" ,
"app_version" : "1314126"
}
}
}
abci_query
Query the application for some information.
Parameters
path
- string, required path to the data ("a/b/c"
height
- integer, Hieght. Default value = 0
(latest)
prove
- boolean, include proofs of the transactions inclusion in the block. Default value = false
.
Returns
Response of the submitted query.
Example
Request
URI JSON-RPC
Copy curl cro-croeseid.alchemyapi.io/your-api-key/tendermint/abci_query?path=%2Fa%2Fb%2Fc & data = IHAVENOIDEA & height = 1 & prove = true
Copy curl --header "Content-Type: application/json" --request POST --data '{"method": "abci_query", "params": ["a/b/c", "IHAVENOIDEA", "1", "true"], "id": 0}' cro-croeseid.alchemyapi.io/your-api-key/tendermint
Result
Copy {
"error" : "" ,
"result" : {
"response" : {
"log" : "exists" ,
"height" : "0" ,
"proof" : "010114FED0DAD959F36091AD761C922ABA3CBF1D8349990101020103011406AA2262E2F448242DF2C2607C3CDC705313EE3B0001149D16177BC71E445476174622EA559715C293740C" ,
"value" : "61626364" ,
"key" : "61626364" ,
"index" : "-1" ,
"code" : "0"
}
} ,
"id" : 0 ,
"jsonrpc" : "2.0"
}