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.

42 lines
2.6 KiB

  1. Application Architecture Guide
  2. ==============================
  3. Here we provide a brief guide on the recommended architecture of a Tendermint blockchain
  4. application.
  5. The following diagram provides a superb example:
  6. https://drive.google.com/open?id=1yR2XpRi9YCY9H9uMfcw8-RMJpvDyvjz9
  7. The end-user application here is the Cosmos Voyager, at the bottom left.
  8. Voyager communicates with a REST API exposed by a local Light-Client Daemon.
  9. The Light-Client Daemon is an application specific program that communicates with
  10. Tendermint nodes and verifies Tendermint light-client proofs through the Tendermint Core RPC.
  11. The Tendermint Core process communicates with a local ABCI application, where the
  12. user query or transaction is actually processed.
  13. The ABCI application must be a deterministic result of the Tendermint consensus - any external influence
  14. on the application state that didn't come through Tendermint could cause a
  15. consensus failure. Thus *nothing* should communicate with the application except Tendermint via ABCI.
  16. If the application is written in Go, it can be compiled into the Tendermint binary.
  17. Otherwise, it should use a unix socket to communicate with Tendermint.
  18. If it's necessary to use TCP, extra care must be taken to encrypt and authenticate the connection.
  19. All reads from the app happen through the Tendermint `/abci_query` endpoint.
  20. All writes to the app happen through the Tendermint `/broadcast_tx_*` endpoints.
  21. The Light-Client Daemon is what provides light clients (end users) with nearly all the security of a full node.
  22. It formats and broadcasts transactions, and verifies proofs of queries and transaction results.
  23. Note that it need not be a daemon - the Light-Client logic could instead be implemented in the same process as the end-user application.
  24. Note for those ABCI applications with weaker security requirements, the functionality of the Light-Client Daemon can be moved
  25. into the ABCI application process itself. That said, exposing the application process to anything besides Tendermint over ABCI
  26. requires extreme caution, as all transactions, and possibly all queries, should still pass through Tendermint.
  27. See the following for more extensive documentation:
  28. - [Interchain Standard for the Light-Client REST API](https://github.com/cosmos/cosmos-sdk/pull/1028)
  29. - [Tendermint RPC Docs](https://tendermint.github.io/slate/)
  30. - [Tendermint in Production](https://github.com/tendermint/tendermint/pull/1618)
  31. - [Tendermint Basics](https://tendermint.readthedocs.io/en/master/using-tendermint.html)
  32. - [ABCI spec](https://github.com/tendermint/abci/blob/master/specification.rst)