mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-28 04:01:40 +00:00
28
docs/subscribing-to-events-via-websocket.rst
Normal file
28
docs/subscribing-to-events-via-websocket.rst
Normal file
@ -0,0 +1,28 @@
|
||||
Subscribing to events via Websocket
|
||||
===================================
|
||||
|
||||
Tendermint emits different events, to which you can subscribe via `Websocket
|
||||
<https://en.wikipedia.org/wiki/WebSocket>`__. This can be useful for
|
||||
third-party applications (for analysys) or inspecting state.
|
||||
|
||||
`List of events <https://godoc.org/github.com/tendermint/tendermint/types#pkg-constants>`__
|
||||
|
||||
You can subscribe to any of the events above by calling ``subscribe`` RPC method via Websocket.
|
||||
|
||||
::
|
||||
|
||||
{
|
||||
"jsonrpc": "2.0",
|
||||
"method": "subscribe",
|
||||
"id": "0",
|
||||
"params": {
|
||||
"query": "tm.event='NewBlock'"
|
||||
}
|
||||
}
|
||||
|
||||
Check out `API docs <https://tendermint.github.io/slate/#subscribe>`__ for more
|
||||
information on query syntax and other options.
|
||||
|
||||
You can also use tags, given you had included them into DeliverTx response, to
|
||||
query transaction results. See `Indexing transactions
|
||||
<./indexing-transactions.html>`__ for details.
|
Reference in New Issue
Block a user