Allora — Networks/Protocols supported, Information, Transactions, ABCI (3/3)
API reference for Allora. All methods ->
Transactions
broadcast_tx_sync
Returns with the response from
CheckTx. Does not wait forDeliverTxresult.
If you want to be sure that the transaction is included in a block, you can subscribe for the result using JSON-RPC via a websocket. See https://docs.cometbft.com/v0.34/core/subscription.html 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:
- A malicious node drops or pretends it has committed your tx.
- A malicious proposer (not necessary the one you're communicating with) drops transactions, which might become valid in the future (https://github.com/tendermint/tendermint/issues/3322).
Please refer to Tendermint docs for formatting/encoding rules.
Parameters
tx(string; required): the transaction.
Request example
- JSON-RPC
- REST
curl -X POST https://rpc.ankr.com/allora_testnet/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "broadcast_tx_sync",
"params": ["456"],
"id": 1
}'
curl https://rpc.ankr.com/http/allora_testnet/broadcast_tx_sync?tx=456
Response example
{
"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
CheckTxnorDeliverTxresults.
If you want to be sure that the transaction is included in a block, you can subscribe for the result using JSON-RPC via a websocket. See https://docs.cometbft.com/v0.34/core/subscription.html 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:
- A malicious node drops or pretends it has committed your tx.
- A malicious proposer (not necessary the one you're communicating with) drops transactions, which might become valid in the future (https://github.com/tendermint/tendermint/issues/3322).
- A node is offline.
Please refer to CometBFT docs for formatting/encoding rules.
Parameters
tx(string; required): the transaction.
Request example
- JSON-RPC
- REST
curl -X POST https://rpc.ankr.com/allora_testnet/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "broadcast_tx_async",
"params": ["123"],
"id": 1
}'
curl https://rpc.ankr.com/http/allora_testnet/broadcast_tx_async?tx=123
Response example
{
"jsonrpc": "2.0",
"id": 0,
"result": {
"code": "0",
"data": "",
"log": "",
"codespace": "ibc",
"hash": "0D33F2F03A5234F38706E43004489E061AC40A2E"
},
"error": ""
}
broadcast_tx_commit
Returns with the responses from
CheckTxandDeliverTx.
Use only for testing and development. In production, use BroadcastTxSync or BroadcastTxAsync. You can subscribe for the transaction result using JSON-RPC via a websocket (see CometBFT docs).
CONTRACT: only returns error if mempool.CheckTx() errs or if we timeout waiting for tx to commit.
If CheckTx or DeliverTx fails, no error will be returned, but the result will contain a non-OK ABCI code.
Please refer to CometBFT docs for formatting/encoding rules.
Parameters
tx(string; required): the transaction.
Request example
- JSON-RPC
- REST
curl -X POST https://rpc.ankr.com/allora_testnet/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "broadcast_tx_commit",
"params": ["785"],
"id": 1
}'
curl https://rpc.ankr.com/http/allora_testnet/broadcast_tx_commit?tx=785
Response example
{
"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 CometBFT docs for formatting/encoding rules.
Parameters
tx(string; required): the transaction.
Request example
- JSON-RPC
- REST
curl -X POST https://rpc.ankr.com/allora_testnet/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "check_tx",
"params": ["785"],
"id": 1
}'
curl https://rpc.ankr.com/http/allora_testnet/check_tx?tx=785
Response example
{
"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
Retrieves application info.
Parameters
None.
Returns
Application info.
Request example
- JSON-RPC
- REST
curl -X POST https://rpc.ankr.com/allora_testnet/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "abci_info",
"params": [],
"id": 1
}'
curl https://rpc.ankr.com/http/allora_testnet/abci_info
Response example
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"response": {
"data": "data-sample",
"version": "1.6.1",
"last_block_height": "7690381",
"last_block_app_hash": "J1tJC9R3q3cNzkDcI7ipyi9NuZ8XUVbMyy7B42TPWuc="
}
}
}
abci_query
Queries the application for particular information.
Parameters
path(string; required): a path to the data ("/a/b/c").data(string; required): the data.height(integer; default: 0): the height (0 means latest).prove(boolean; default: false): adds proofs of the transactions inclusion in the block.
Returns
Particular info according to the query submitted.
Request example
- JSON-RPC
- REST
curl -X POST https://rpc.ankr.com/allora_testnet/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "abci_query",
"params": ["a/b/c", "the_data", "1", true],
"id": 1
}'
curl https://rpc.ankr.com/http/allora_testnet/blockchain?path=%2Fa%2Fb%2Fc&data=the_data&height=1&prove=true
Response example
{
"error": "",
"result": {
"response": {
"log": "exists",
"height": "0",
"proof": "010114FED0DAD959F36091AD761C922ABA3CBF1D8349990101020103011406AA2262E2F448242DF2C2607C3CDC705313EE3B0001149D16177BC71E445476174622EA559715C293740C",
"value": "61626364",
"key": "61626364",
"index": "-1",
"code": "0"
}
},
"id": 0,
"jsonrpc": "2.0"
}