You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
945 B

  1. Subscribing to events via Websocket
  2. ===================================
  3. Tendermint emits different events, to which you can subscribe via `Websocket
  4. <https://en.wikipedia.org/wiki/WebSocket>`__. This can be useful for
  5. third-party applications (for analysys) or inspecting state.
  6. `List of events <https://godoc.org/github.com/tendermint/tendermint/types#pkg-constants>`__
  7. You can subscribe to any of the events above by calling ``subscribe`` RPC method via Websocket.
  8. ::
  9. {
  10. "jsonrpc": "2.0",
  11. "method": "subscribe",
  12. "id": "0",
  13. "params": {
  14. "query": "tm.event='NewBlock'"
  15. }
  16. }
  17. Check out `API docs <https://tendermint.github.io/slate/#subscribe>`__ for more
  18. information on query syntax and other options.
  19. You can also use tags, given you had included them into DeliverTx response, to
  20. query transaction results. See `Indexing transactions
  21. <./indexing-transactions.html>`__ for details.