Events are objects that contain information about the execution of the application. They are
mainly used by service providers like block explorers and wallet to track the execution of various
messages and index transactions.
# Pre-requisite Readings
# Subscribing to Events
# SDK and Tendermint Events
It is possible to subscribe to
Events via Tendermint's Websocket.
This is done by calling the
subscribe RPC method via Websocket:
eventCategory you can subscribe to are:
DeliverTx(i.e. transaction processing).
ValidatorSetUpdates: Contains validator set updates for the block.
These events are triggered from the
state package after a block is committed. You can get the full
here (opens new window).
attribute value of the
query allow you to filter the specific
event you are
looking for. For example, a
MsgEthereumTx transaction triggers an
event of type
attributes. Subscribing to this
event would be done like so:
hexAddress is an Ethereum hex address (eg:
# Ethereum JSON-RPC Events
Majestic StarChain also supports the Ethereum JSON-RPC (opens new window) filters calls to subscribe to state logs (opens new window), blocks (opens new window) or pending transactions (opens new window) changes.
Under the hood, it uses the Tendermint RPC client's event system to process subscriptions that are then formatted to Ethereum-compatible events.
Then you can check if the state changes with the
eth_getFilterChanges (opens new window) call: