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
867 B

7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
  1. # Subscribing to events via Websocket
  2. Tendermint emits different events, to which you can subscribe via
  3. [Websocket](https://en.wikipedia.org/wiki/WebSocket). This can be useful
  4. for third-party applications (for analysys) or inspecting state.
  5. [List of events](https://godoc.org/github.com/tendermint/tendermint/types#pkg-constants)
  6. You can subscribe to any of the events above by calling `subscribe` RPC
  7. 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. ```
  18. Check out [API docs](https://tendermint.github.io/slate/#subscribe) for
  19. more information on query syntax and other options.
  20. You can also use tags, given you had included them into DeliverTx
  21. response, to query transaction results. See [Indexing
  22. transactions](./indexing-transactions.md) for details.