NAV Navbar
shell go

Introduction

Tendermint supports the following RPC protocols:

Tendermint RPC is built using our own RPC library which contains its own set of documentation and tests. See it here: https://github.com/tendermint/tendermint/tree/master/rpc/lib

Configuration

RPC can be configured by tuning parameters under [rpc] table in the $TMHOME/config/config.toml file or by using the --rpc.X command-line flags.

Default rpc listen address is tcp://0.0.0.0:26657. To set another address, set the laddr config parameter to desired value. CORS (Cross-Origin Resource Sharing) can be enabled by setting cors_allowed_origins, cors_allowed_methods, cors_allowed_headers config parameters.

Arguments

Arguments which expect strings or byte arrays may be passed as quoted strings, like "abc" or as 0x-prefixed strings, like 0x616263.

URI/HTTP

curl 'localhost:26657/broadcast_tx_sync?tx="abc"'

Response:

{


    "error": "",
    "result": {
        "hash": "2B8EC32BA2579B3B8606E42C06DE2F7AFA2556EF",
        "log": "",
        "data": "",
        "code": "0"
    },
    "id": "",
    "jsonrpc": "2.0"

}

JSONRPC/HTTP

JSONRPC requests can be POST'd to the root RPC endpoint via HTTP (e.g. <a href="http://localhost:26657/">http://localhost:26657/</a>).

{


    "method": "broadcast_tx_sync",
    "jsonrpc": "2.0",
    "params": [ "abc" ],
    "id": "dontcare"

}

JSONRPC/websockets

JSONRPC requests can be made via websocket. The websocket endpoint is at /websocket, e.g. localhost:26657/websocket. Asynchronous RPC functions like event subscribe and unsubscribe are only available via websockets.

More Examples

See the various bash tests using curl in test/, and examples using the Go API in rpc/client/.

Get the list

An HTTP Get request to the root RPC endpoint shows a list of available endpoints.

curl 'localhost:26657'

Response:

Available endpoints:
/abci_info
/dump_consensus_state
/genesis
/net_info
/num_unconfirmed_txs
/status
/health
/unconfirmed_txs
/unsafe_flush_mempool
/unsafe_stop_cpu_profiler
/validators

Endpoints that require arguments:
/abci_query?path=_&data=_&prove=_
/block?height=_
/blockchain?minHeight=_&maxHeight=_
/broadcast_tx_async?tx=_
/broadcast_tx_commit?tx=_
/broadcast_tx_sync?tx=_
/commit?height=_
/dial_seeds?seeds=_
/dial_persistent_peers?persistent_peers=_
/subscribe?event=_
/tx?hash=_&prove=_
/unsafe_start_cpu_profiler?filename=_
/unsafe_write_heap_profile?filename=_
/unsubscribe?event=_

Endpoints

ABCIInfo

Get some info about the application.

curl 'localhost:26657/abci_info'
client := client.NewHTTP("tcp://0.0.0.0:26657", "/websocket")
info, err := client.ABCIInfo()

The above command returns JSON structured like this:

{


    "error": "",
    "result": {
        "response": {
            "data": "{\"size\":3}"
        }
    },
    "id": "",
    "jsonrpc": "2.0"

}

ABCIQuery

Query the application for some information.

curl 'localhost:26657/abci_query?path=""&data="abcd"&prove=false'
client := client.NewHTTP("tcp://0.0.0.0:26657", "/websocket")
result, err := client.ABCIQuery("", "abcd", true)

The above command returns JSON structured like this:

{


    "error": "",
    "result": {
        "response": {
            "log": "exists",
            "height": "0",
            "proof": "010114FED0DAD959F36091AD761C922ABA3CBF1D8349990101020103011406AA2262E2F448242DF2C2607C3CDC705313EE3B0001149D16177BC71E445476174622EA559715C293740C",
            "value": "61626364",
            "key": "61626364",
            "index": "-1",
            "code": "0"
        }
    },
    "id": "",
    "jsonrpc": "2.0"

}

Query Parameters

Parameter Type Default Required Description
path string false false Path to the data ("/a/b/c")
data []byte false true Data
height int64 0 false Height (0 means latest)
prove bool false false Includes proof if true

Block

Get block at a given height. If no height is provided, it will fetch the latest block.

curl 'localhost:26657/block?height=10'
client := client.NewHTTP("tcp://0.0.0.0:26657", "/websocket")
info, err := client.Block(10)

The above command returns JSON structured like this:

{


    "error": "",
    "result": {
      "block": {
        "last_commit": {
          "precommits": [
            {
              "signature": {
                "data": "12C0D8893B8A38224488DC1DE6270DF76BB1A5E9DB1C68577706A6A97C6EC34FFD12339183D5CA8BC2F46148773823DE905B7F6F5862FD564038BB7AE03BF50D",
                "type": "ed25519"
              },
              "block_id": {
                "parts": {
                  "hash": "3C78F00658E06744A88F24FF97A0A5011139F34A",
                  "total": "1"
                },
                "hash": "F70588DAB36BDA5A953D548A16F7D48C6C2DFD78"
              },
              "type": "2",
              "round": "0",
              "height": "9",
              "validator_index": "0",
              "validator_address": "E89A51D60F68385E09E716D353373B11F8FACD62"
            }
          ],
          "blockID": {
            "parts": {
              "hash": "3C78F00658E06744A88F24FF97A0A5011139F34A",
              "total": "1"
            },
            "hash": "F70588DAB36BDA5A953D548A16F7D48C6C2DFD78"
          }
        },
        "data": {
          "txs": []
        },
        "header": {
          "app_hash": "",
          "chain_id": "test-chain-6UTNIN",
          "height": "10",
          "time": "2017-05-29T15:05:53.877Z",
          "num_txs": "0",
          "last_block_id": {
            "parts": {
              "hash": "3C78F00658E06744A88F24FF97A0A5011139F34A",
              "total": "1"
            },
            "hash": "F70588DAB36BDA5A953D548A16F7D48C6C2DFD78"
          },
          "last_commit_hash": "F31CC4282E50B3F2A58D763D233D76F26D26CABE",
          "data_hash": "",
          "validators_hash": "9365FC80F234C967BD233F5A3E2AB2F1E4B0E5AA"
        }
      },
      "block_meta": {
        "header": {
          "app_hash": "",
          "chain_id": "test-chain-6UTNIN",
          "height": "10",
          "time": "2017-05-29T15:05:53.877Z",
          "num_txs": "0",
          "last_block_id": {
            "parts": {
              "hash": "3C78F00658E06744A88F24FF97A0A5011139F34A",
              "total": "1"
            },
            "hash": "F70588DAB36BDA5A953D548A16F7D48C6C2DFD78"
          },
          "last_commit_hash": "F31CC4282E50B3F2A58D763D233D76F26D26CABE",
          "data_hash": "",
          "validators_hash": "9365FC80F234C967BD233F5A3E2AB2F1E4B0E5AA"
        },
        "block_id": {
          "parts": {
            "hash": "277A4DBEF91483A18B85F2F5677ABF9694DFA40F",
            "total": "1"
          },
          "hash": "96B1D2F2D201BA4BC383EB8224139DB1294944E5"
        }
      }
    },
    "id": "",
    "jsonrpc": "2.0"

}

BlockResults

BlockResults gets ABCIResults at a given height. If no height is provided, it will fetch results for the latest block.

Results are for the height of the block containing the txs. Thus response.results[5] is the results of executing getBlock(h).Txs[5]

curl 'localhost:26657/block_results?height=10'
client := client.NewHTTP("tcp://0.0.0.0:26657", "/websocket")
info, err := client.BlockResults(10)

The above command returns JSON structured like this:

{


    "height": "10",
    "results": [
     {
      "code": "0",
      "data": "CAFE00F00D"
     },
     {
      "code": "102",
      "data": ""
     }
    ]

}

BlockchainInfo

Get block headers for minHeight <= height <= maxHeight. Block headers are returned in descending order (highest first).

curl 'localhost:26657/blockchain?minHeight=10&maxHeight=10'
client := client.NewHTTP("tcp://0.0.0.0:26657", "/websocket")
info, err := client.BlockchainInfo(10, 10)

The above command returns JSON structured like this:

{


    "error": "",
    "result": {
        "block_metas": [
            {
                "header": {
                    "app_hash": "",
                    "chain_id": "test-chain-6UTNIN",
                    "height": "10",
                    "time": "2017-05-29T15:05:53.877Z",
                    "num_txs": "0",
                    "last_block_id": {
                        "parts": {
                            "hash": "3C78F00658E06744A88F24FF97A0A5011139F34A",
                            "total": "1"
                        },
                        "hash": "F70588DAB36BDA5A953D548A16F7D48C6C2DFD78"
                    },
                    "last_commit_hash": "F31CC4282E50B3F2A58D763D233D76F26D26CABE",
                    "data_hash": "",
                    "validators_hash": "9365FC80F234C967BD233F5A3E2AB2F1E4B0E5AA"
                },
                "block_id": {
                    "parts": {
                        "hash": "277A4DBEF91483A18B85F2F5677ABF9694DFA40F",
                        "total": "1"
                    },
                    "hash": "96B1D2F2D201BA4BC383EB8224139DB1294944E5"
                }
            }
        ],
        "last_height": "5493"
    },
    "id": "",
    "jsonrpc": "2.0"

}

BroadcastTxAsync

Returns right away, with no response

curl 'localhost:26657/broadcast_tx_async?tx="123"'
client := client.NewHTTP("tcp://0.0.0.0:26657", "/websocket")
result, err := client.BroadcastTxAsync("123")

The above command returns JSON structured like this:

{


    "error": "",
    "result": {
        "hash": "E39AAB7A537ABAA237831742DCE1117F187C3C52",
        "log": "",
        "data": "",
        "code": "0"
    },
    "id": "",
    "jsonrpc": "2.0"

}

Query Parameters

Parameter Type Default Required Description
tx Tx nil true The transaction

BroadcastTxCommit

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.

curl 'localhost:26657/broadcast_tx_commit?tx="789"'
client := client.NewHTTP("tcp://0.0.0.0:26657", "/websocket")
result, err := client.BroadcastTxCommit("789")

The above command returns JSON structured like this:

{


    "error": "",
    "result": {
        "height": "26682",
        "hash": "75CA0F856A4DA078FC4911580360E70CEFB2EBEE",
        "deliver_tx": {
            "log": "",
            "data": "",
            "code": "0"
        },
        "check_tx": {
            "log": "",
            "data": "",
            "code": "0"
        }
    },
    "id": "",
    "jsonrpc": "2.0"

}

Query Parameters

Parameter Type Default Required Description
tx Tx nil true The transaction

BroadcastTxSync

Returns with the response from CheckTx.

curl 'localhost:26657/broadcast_tx_sync?tx="456"'
client := client.NewHTTP("tcp://0.0.0.0:26657", "/websocket")
result, err := client.BroadcastTxSync("456")

The above command returns JSON structured like this:

{


    "jsonrpc": "2.0",
    "id": "",
    "result": {
        "code": "0",
        "data": "",
        "log": "",
        "hash": "0D33F2F03A5234F38706E43004489E061AC40A2E"
    },
    "error": ""

}

Query Parameters

Parameter Type Default Required Description
tx Tx nil true The transaction

Commit

Get block commit at a given height. If no height is provided, it will fetch the commit for the latest block.

curl 'localhost:26657/commit?height=11'
client := client.NewHTTP("tcp://0.0.0.0:26657", "/websocket")
info, err := client.Commit(11)

The above command returns JSON structured like this:

{


    "error": "",
    "result": {
      "canonical": true,
      "commit": {
        "precommits": [
          {
            "signature": {
              "data": "00970429FEC652E9E21D106A90AE8C5413759A7488775CEF4A3F44DC46C7F9D941070E4FBE9ED54DF247FA3983359A0C3A238D61DE55C75C9116D72ABC9CF50F",
              "type": "ed25519"
            },
            "block_id": {
              "parts": {
                "hash": "9E37CBF266BC044A779E09D81C456E653B89E006",
                "total": "1"
              },
              "hash": "CC6E861E31CA4334E9888381B4A9137D1458AB6A"
            },
            "type": "2",
            "round": "0",
            "height": "11",
            "validator_index": "0",
            "validator_address": "E89A51D60F68385E09E716D353373B11F8FACD62"
          }
        ],
        "blockID": {
          "parts": {
            "hash": "9E37CBF266BC044A779E09D81C456E653B89E006",
            "total": "1"
          },
          "hash": "CC6E861E31CA4334E9888381B4A9137D1458AB6A"
        }
      },
      "header": {
        "app_hash": "",
        "chain_id": "test-chain-6UTNIN",
        "height": "11",
        "time": "2017-05-29T15:05:54.893Z",
        "num_txs": "0",
        "last_block_id": {
          "parts": {
            "hash": "277A4DBEF91483A18B85F2F5677ABF9694DFA40F",
            "total": "1"
          },
          "hash": "96B1D2F2D201BA4BC383EB8224139DB1294944E5"
        },
        "last_commit_hash": "3CE0C9727CE524BA9CB7C91E28F08E2B94001087",
        "data_hash": "",
        "validators_hash": "9365FC80F234C967BD233F5A3E2AB2F1E4B0E5AA"
      }
    },
    "id": "",
    "jsonrpc": "2.0"

}

ConsensusParams

Get the consensus parameters at the given block height. If no height is provided, it will fetch the current consensus params.

curl 'localhost:26657/consensus_params'
client := client.NewHTTP("tcp://0.0.0.0:26657", "/websocket")
state, err := client.ConsensusParams()

The above command returns JSON structured like this:

{


    "jsonrpc": "2.0",
    "id": "",
    "result": {
      "block_height": "1",
      "consensus_params": {
        "block_size_params": {
          "max_txs_bytes": "22020096",
          "max_gas": "-1"
        },
        "evidence_params": {
          "max_age": "100000"
        }
      }
    }

}

ConsensusState

ConsensusState returns a concise summary of the consensus state. UNSTABLE

curl 'localhost:26657/consensus_state'
client := client.NewHTTP("tcp://0.0.0.0:26657", "/websocket")
state, err := client.ConsensusState()

The above command returns JSON structured like this:

{


    "jsonrpc": "2.0",
    "id": "",
    "result": {
      "round_state": {
        "height/round/step": "9336/0/1",
        "start_time": "2018-05-14T10:25:45.72595357-04:00",
        "proposal_block_hash": "",
        "locked_block_hash": "",
        "valid_block_hash": "",
        "height_vote_set": [
          {
            "round": "0",
            "prevotes": [
              "nil-Vote"
            ],
            "prevotes_bit_array": "BA{1:_} 0/10 = 0.00",
            "precommits": [
              "nil-Vote"
            ],
            "precommits_bit_array": "BA{1:_} 0/10 = 0.00"
          }
        ]
      }
    }

}

DumpConsensusState

DumpConsensusState dumps consensus state. UNSTABLE

curl 'localhost:26657/dump_consensus_state'
client := client.NewHTTP("tcp://0.0.0.0:26657", "/websocket")
state, err := client.DumpConsensusState()

The above command returns JSON structured like this:

{


    "jsonrpc": "2.0",
    "id": "",
    "result": {
      "round_state": {
        "height": "7185",
        "round": "0",
        "step": "1",
        "start_time": "2018-05-12T13:57:28.440293621-07:00",
        "commit_time": "2018-05-12T13:57:27.440293621-07:00",
        "validators": {
          "validators": [
            {
              "address": "B5B3D40BE53982AD294EF99FF5A34C0C3E5A3244",
              "pub_key": {
                "type": "tendermint/PubKeyEd25519",
                "value": "SBctdhRBcXtBgdI/8a/alTsUhGXqGs9k5ylV1u5iKHg="
              },
              "voting_power": "10",
              "accum": "0"
            }
          ],
          "proposer": {
            "address": "B5B3D40BE53982AD294EF99FF5A34C0C3E5A3244",
            "pub_key": {
              "type": "tendermint/PubKeyEd25519",
              "value": "SBctdhRBcXtBgdI/8a/alTsUhGXqGs9k5ylV1u5iKHg="
            },
            "voting_power": "10",
            "accum": "0"
          }
        },
        "proposal": null,
        "proposal_block": null,
        "proposal_block_parts": null,
        "locked_round": "0",
        "locked_block": null,
        "locked_block_parts": null,
        "valid_round": "0",
        "valid_block": null,
        "valid_block_parts": null,
        "votes": [
          {
            "round": "0",
            "prevotes": "_",
            "precommits": "_"
          }
        ],
        "commit_round": "-1",
        "last_commit": {
          "votes": [
            "Vote{0:B5B3D40BE539 7184/00/2(Precommit) 14F946FA7EF0 /702B1B1A602A.../ @ 2018-05-12T20:57:27.342Z}"
          ],
          "votes_bit_array": "x",
          "peer_maj_23s": {}
        },
        "last_validators": {
          "validators": [
            {
              "address": "B5B3D40BE53982AD294EF99FF5A34C0C3E5A3244",
              "pub_key": {
                "type": "tendermint/PubKeyEd25519",
                "value": "SBctdhRBcXtBgdI/8a/alTsUhGXqGs9k5ylV1u5iKHg="
              },
              "voting_power": "10",
              "accum": "0"
            }
          ],
          "proposer": {
            "address": "B5B3D40BE53982AD294EF99FF5A34C0C3E5A3244",
            "pub_key": {
              "type": "tendermint/PubKeyEd25519",
              "value": "SBctdhRBcXtBgdI/8a/alTsUhGXqGs9k5ylV1u5iKHg="
            },
            "voting_power": "10",
            "accum": "0"
          }
        }
      },
      "peers": [
        {
          "node_address": "30ad1854af22506383c3f0e57fb3c7f90984c5e8@172.16.63.221:26656",
          "peer_state": {
            "round_state": {
              "height": "7185",
              "round": "0",
              "step": "1",
              "start_time": "2018-05-12T13:57:27.438039872-07:00",
              "proposal": false,
              "proposal_block_parts_header": {
                "total": "0",
                "hash": ""
              },
              "proposal_block_parts": null,
              "proposal_pol_round": "-1",
              "proposal_pol": "_",
              "prevotes": "_",
              "precommits": "_",
              "last_commit_round": "0",
              "last_commit": "x",
              "catchup_commit_round": "-1",
              "catchup_commit": "_"
            },
            "stats": {
              "last_vote_height": "7184",
              "votes": "255",
              "last_block_part_height": "7184",
              "block_parts": "255"
            }
          }
        }
      ]
    }

}

Genesis

Get genesis file.

curl 'localhost:26657/genesis'
client := client.NewHTTP("tcp://0.0.0.0:26657", "/websocket")
genesis, err := client.Genesis()

The above command returns JSON structured like this:

{


    "error": "",
    "result": {
        "genesis": {
            "app_hash": "",
            "validators": [
                {
                    "name": "",
                    "power": "10",
                    "pub_key": {
                        "data": "68DFDA7E50F82946E7E8546BED37944A422CD1B831E70DF66BA3B8430593944D",
                        "type": "ed25519"
                    }
                }
            ],
            "chain_id": "test-chain-6UTNIN",
            "genesis_time": "2017-05-29T15:05:41.671Z"
        }
    },
    "id": "",
    "jsonrpc": "2.0"

}

Health

Get node health. Returns empty result (200 OK) on success, no response - in case of an error.

curl 'localhost:26657/health'
client := client.NewHTTP("tcp://0.0.0.0:26657", "/websocket")
result, err := client.Health()

The above command returns JSON structured like this:

{


    "error": "",
    "result": {},
    "id": "",
    "jsonrpc": "2.0"

}

NetInfo

Get network info.

curl 'localhost:26657/net_info'
client := client.NewHTTP("tcp://0.0.0.0:26657", "/websocket")
info, err := client.NetInfo()

The above command returns JSON structured like this:

{


    "error": "",
    "result": {
        "n_peers": "0",
        "peers": [],
        "listeners": [
            "Listener(@10.0.2.15:26656)"
        ],
        "listening": true
    },
    "id": "",
    "jsonrpc": "2.0"

}

NumUnconfirmedTxs

Get number of unconfirmed transactions.

curl 'localhost:26657/num_unconfirmed_txs'
client := client.NewHTTP("tcp://0.0.0.0:26657", "/websocket")
result, err := client.UnconfirmedTxs()

The above command returns JSON structured like this:

{


    "error": "",
    "result": {
      "txs": null,
      "n_txs": "0"
    },
    "id": "",
    "jsonrpc": "2.0"

}

Status

Get Tendermint status including node info, pubkey, latest block hash, app hash, block height and time.

curl 'localhost:26657/status'
client := client.NewHTTP("tcp://0.0.0.0:26657", "/websocket")
result, err := client.Status()

The above command returns JSON structured like this:

{
"jsonrpc": "2.0",
"id": "",
"result": {


    "node_info": {
            "protocol_version": {
                "p2p": "4",
                "block": "7",
                "app": "0"
            },
            "id": "53729852020041b956e86685e24394e0bee4373f",
            "listen_addr": "10.0.2.15:26656",
            "network": "test-chain-Y1OHx6",
            "version": "0.24.0-2ce1abc2",
            "channels": "4020212223303800",
            "moniker": "ubuntu-xenial",
            "other": {
                "tx_index": "on",
                "rpc_addr": "tcp://0.0.0.0:26657"
            }
        },
        "sync_info": {
            "latest_block_hash": "F51538DA498299F4C57AC8162AAFA0254CE08286",
            "latest_app_hash": "0000000000000000",
            "latest_block_height": "18",
            "latest_block_time": "2018-09-17T11:42:19.149920551Z",
            "catching_up": false
        },
        "validator_info": {
            "address": "D9F56456D7C5793815D0E9AF07C3A355D0FC64FD",
            "pub_key": {
                "type": "tendermint/PubKeyEd25519",
                "value": "wVxKNtEsJmR4vvh651LrVoRguPs+6yJJ9Bz174gw9DM="
            },
            "voting_power": "10"
        }
    }

}

Subscribe

Subscribe for events via WebSocket.

To tell which events you want, you need to provide a query. query is a string, which has a form: "condition AND condition ..." (no OR at the moment). condition has a form: "key operation operand". key is a string with a restricted set of possible symbols ( \t\n\r\()"'=>< are not allowed). operation can be "=", "<", "<=", ">", ">=", "CONTAINS". operand can be a string (escaped with single quotes), number, date or time.

Examples:

tm.event = 'NewBlock' # new blocks tm.event = 'CompleteProposal' # node got a complete proposal tm.event = 'Tx' AND tx.hash = 'XYZ' # single transaction tm.event = 'Tx' AND tx.height = 5 # all txs of the fifth block tx.height = 5 # all txs of the fifth block

Tendermint provides a few predefined keys: tm.event, tx.hash and tx.height. Note for transactions, you can define additional keys by providing tags with DeliverTx response.

DeliverTx{ Tags: []*KVPair{ "agent.name": "K", } }

tm.event = 'Tx' AND agent.name = 'K' tm.event = 'Tx' AND account.created_at >= TIME 2013-05-03T14:45:00Z tm.event = 'Tx' AND contract.sign_date = DATE 2017-01-01 tm.event = 'Tx' AND account.owner CONTAINS 'Igor'

See list of all possible events here https://godoc.org/github.com/tendermint/tendermint/types#pkg-constants

For complete query syntax, check out https://godoc.org/github.com/tendermint/tendermint/libs/pubsub/query.

import "github.com/tendermint/tendermint/libs/pubsub/query"
import "github.com/tendermint/tendermint/types"

client := client.NewHTTP("tcp://0.0.0.0:26657", "/websocket")
ctx, cancel := context.WithTimeout(context.Background(), timeout)
defer cancel()
query := query.MustParse("tm.event = 'Tx' AND tx.height = 3")
txs := make(chan interface{})
err := client.Subscribe(ctx, "test-client", query, txs)

go func() {


      for e := range txs {
        fmt.Println("got ", e.(types.EventDataTx))
         }

}()

The above command returns JSON structured like this:

{


    "error": "",
    "result": {},
    "id": "",
    "jsonrpc": "2.0"

}

Query Parameters

Parameter Type Default Required Description
query string "" true Query

Tx

Tx allows you to query the transaction results. nil could mean the transaction is in the mempool, invalidated, or was not sent in the first place.

curl "localhost:26657/tx?hash=0x2B8EC32BA2579B3B8606E42C06DE2F7AFA2556EF"
client := client.NewHTTP("tcp://0.0.0.0:26657", "/websocket")
tx, err := client.Tx([]byte("2B8EC32BA2579B3B8606E42C06DE2F7AFA2556EF"), true)

The above command returns JSON structured like this:

{


    "error": "",
    "result": {
        "proof": {
            "Proof": {
                "aunts": []
            },
            "Data": "YWJjZA==",
            "RootHash": "2B8EC32BA2579B3B8606E42C06DE2F7AFA2556EF",
            "Total": "1",
            "Index": "0"
        },
        "tx": "YWJjZA==",
        "tx_result": {
            "log": "",
            "data": "",
            "code": "0"
        },
        "index": "0",
        "height": "52",
        "hash": "2B8EC32BA2579B3B8606E42C06DE2F7AFA2556EF"
    },
    "id": "",
    "jsonrpc": "2.0"

}

Returns a transaction matching the given transaction hash.

Query Parameters

Parameter Type Default Required Description
hash []byte nil true The transaction hash
prove bool false false Include a proof of the transaction inclusion in the block

Returns

TxSearch

TxSearch allows you to query for multiple transactions results. It returns a list of transactions (maximum ?per_page entries) and the total count.

curl "localhost:26657/tx_search?query=\"account.owner='Ivan'\"&prove=true"
client := client.NewHTTP("tcp://0.0.0.0:26657", "/websocket")
q, err := tmquery.New("account.owner='Ivan'")
tx, err := client.TxSearch(q, true)

The above command returns JSON structured like this:

{


      "jsonrpc": "2.0",
      "id": "",
      "result": {
           "txs": [
          {
            "proof": {
              "Proof": {
                "aunts": [
                  "J3LHbizt806uKnABNLwG4l7gXCA=",
                  "iblMO/M1TnNtlAefJyNCeVhjAb0=",
                  "iVk3ryurVaEEhdeS0ohAJZ3wtB8=",
                  "5hqMkTeGqpct51ohX0lZLIdsn7Q=",
                  "afhsNxFnLlZgFDoyPpdQSe0bR8g="
                ]
              },
              "Data": "mvZHHa7HhZ4aRT0xMDA=",
              "RootHash": "F6541223AA46E428CB1070E9840D2C3DF3B6D776",
              "Total": "32",
              "Index": "31"
            },
            "tx": "mvZHHa7HhZ4aRT0xMDA=",
            "tx_result": {},
            "index": "31",
            "height": "12",
            "hash": "2B8EC32BA2579B3B8606E42C06DE2F7AFA2556EF"
          }
        ],
        "total_count": "1"
      }

}

Query Parameters

Parameter Type Default Required Description
query string "" true Query
prove bool false false Include proofs of the transactions inclusion in the block
page int 1 false Page number (1-based)
per_page int 30 false Number of entries per page (max: 100)

Returns

UnconfirmedTxs

Get unconfirmed transactions (maximum ?limit entries) including their number.

curl 'localhost:26657/unconfirmed_txs'
client := client.NewHTTP("tcp://0.0.0.0:26657", "/websocket")
result, err := client.UnconfirmedTxs()

The above command returns JSON structured like this:

{


    "error": "",
    "result": {
      "txs": [],
      "n_txs": "0"
    },
    "id": "",
    "jsonrpc": "2.0"

}

### Query Parameters

| Parameter | Type | Default | Required | Description                          |
|-----------+------+---------+----------+--------------------------------------|
| limit     | int  | 30      | false    | Maximum number of entries (max: 100) |

UnsafeDialPeers

UnsafeDialSeeds

Unsubscribe

Unsubscribe from events via WebSocket.

client := client.NewHTTP("tcp://0.0.0.0:26657", "/websocket")
err := client.Unsubscribe("test-client", query)

The above command returns JSON structured like this:

{


    "error": "",
    "result": {},
    "id": "",
    "jsonrpc": "2.0"

}

Query Parameters

Parameter Type Default Required Description
query string "" true Query

UnsubscribeAll

Unsubscribe from all events via WebSocket.

client := client.NewHTTP("tcp://0.0.0.0:26657", "/websocket")
err := client.UnsubscribeAll("test-client")

The above command returns JSON structured like this:

{


    "error": "",
    "result": {},
    "id": "",
    "jsonrpc": "2.0"

}

Validators

Get the validator set at the given block height. If no height is provided, it will fetch the current validator set.

curl 'localhost:26657/validators'
client := client.NewHTTP("tcp://0.0.0.0:26657", "/websocket")
state, err := client.Validators()

The above command returns JSON structured like this:

{


    "error": "",
    "result": {
        "validators": [
            {
                "accum": "0",
                "voting_power": "10",
                "pub_key": {
                    "data": "68DFDA7E50F82946E7E8546BED37944A422CD1B831E70DF66BA3B8430593944D",
                    "type": "ed25519"
                },
                "address": "E89A51D60F68385E09E716D353373B11F8FACD62"
            }
        ],
        "block_height": "5241"
    },
    "id": "",
    "jsonrpc": "2.0"

}