Tendermint RPC
The Tendermint RPC allows you to query transactions, blocks, consensus state, broadcast transactions, etc. The latest Tendermint RPC documentations can be found here. Tendermint supports the following RPC protocols:- URI over HTTP
- JSON-RPC over HTTP
- JSON-RPC over Websockets
URI/HTTP
A GET request with arguments encoded as query parameters:RPC/HTTP
JSONRPC requests can be POST’d to the root RPC endpoint via HTTP. See the list of supported Tendermint RPC endpoints using Swagger here.RPC/Websocket
Cosmos and Tendermint Events
Events are objects that contain information about the execution of the application
and are triggered after a block is committed. They are mainly used by service providers
like block explorers and wallet to track the execution of various messages and index transactions.
You can get the full list of event categories and values here.
More on Events:
Subscribing to Events via Websocket
Tendermint Core provides a Websocket connection to subscribe or unsubscribe to TendermintEvents.
To start a connection with the Tendermint websocket you need to
define the address with the --rpc.laddr flag when starting the node
(default tcp://127.0.0.1:26657):
type and attribute value of the query allow you to filter the specific event you are
looking for. For example, an Ethereum transaction on Paxeer Network (MsgEthereumTx) triggers an event of type ethermint and
has sender and recipient as attributes. Subscribing to this event would be done like so:
hexAddress is an Ethereum hex address (eg: 0x1122334455667788990011223344556677889900).
The generic syntax looks like this:
List of Tendermint Events
The main events you can subscribe to are:NewBlock: Containseventstriggered duringBeginBlockandEndBlock.Tx: Containseventstriggered duringDeliverTx(i.e. transaction processing).ValidatorSetUpdates: Contains validator set updates for the block.
Events page to obtain the event list of each supported module on Paxeer Network.
:::
List of all Tendermint event keys:
| Event Type | Categories | |
|---|---|---|
| Subscribe to a specific event | "tm.event" | block |
| Subscribe to a specific transaction | "tx.hash" | block |
| Subscribe to transactions at a specific block height | "tx.height" | block |
Index BeginBlock and Endblock events | "block.height" | block |
Subscribe to ABCI BeginBlock events | "begin_block" | block |
Subscribe to ABCI EndBlock events | "end_block" | consensus |
tm.event type:
| Event Value | Categories | |
|---|---|---|
| New block | "NewBlock" | block |
| New block header | "NewBlockHeader" | block |
| New Byzantine Evidence | "NewEvidence" | block |
| New transaction | "Tx" | block |
| Validator set updated | "ValidatorSetUpdates" | block |
| Block sync status | "BlockSyncStatus" | consensus |
| lock | "Lock" | consensus |
| New consensus round | "NewRound" | consensus |
| Polka | "Polka" | consensus |
| Relock | "Relock" | consensus |
| State sync status | "StateSyncStatus" | consensus |
| Timeout propose | "TimeoutPropose" | consensus |
| Timeout wait | "TimeoutWait" | consensus |
| Unlock | "Unlock" | consensus |
| Block is valid | "ValidBlock" | consensus |
| Consensus vote | "Vote" | consensus |