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.

76 lines
3.2 KiB

8 years ago
9 years ago
8 years ago
8 years ago
8 years ago
8 years ago
9 years ago
8 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
  1. # Application BlockChain Interface (ABCI)
  2. [![CircleCI](https://circleci.com/gh/tendermint/abci.svg?style=svg)](https://circleci.com/gh/tendermint/abci)
  3. Blockchains are systems for multi-master state machine replication.
  4. **ABCI** is an interface that defines the boundary between the replication engine (the blockchain),
  5. and the state machine (the application).
  6. By using a socket protocol, we enable a consensus engine running in one process
  7. to manage an application state running in another.
  8. For background information on ABCI, motivations, and tendermint, please visit [the documentation](http://tendermint.readthedocs.io/en/master/).
  9. The two guides to focus on are the `Application Development Guide` and `Using ABCI-CLI`.
  10. Previously, the ABCI was referred to as TMSP.
  11. The community has provided a number of addtional implementations, see the [Tendermint Ecosystem](https://tendermint.com/ecosystem)
  12. ## Implementation
  13. We provide three implementations of the ABCI in Go:
  14. - Golang in-process
  15. - ABCI-socket
  16. - GRPC
  17. Note the GRPC version is maintained primarily to simplify onboarding and prototyping and is not receiving the same
  18. attention to security and performance as the others.
  19. ### In Process
  20. The simplest implementation just uses function calls within Go.
  21. This means ABCI applications written in Golang can be compiled with TendermintCore and run as a single binary.
  22. ### Socket (TSP)
  23. ABCI is best implemented as a streaming protocol.
  24. The socket implementation provides for asynchronous, ordered message passing over unix or tcp.
  25. Messages are serialized using Protobuf3 and length-prefixed.
  26. Protobuf3 doesn't have an official length-prefix standard, so we use our own. The first byte represents the length of the big-endian encoded length.
  27. For example, if the Protobuf3 encoded ABCI message is `0xDEADBEEF` (4 bytes), the length-prefixed message is `0x0104DEADBEEF`. If the Protobuf3 encoded ABCI message is 65535 bytes long, the length-prefixed message would be like `0x02FFFF...`.
  28. ### GRPC
  29. GRPC is an rpc framework native to Protocol Buffers with support in many languages.
  30. Implementing the ABCI using GRPC can allow for faster prototyping, but is expected to be much slower than
  31. the ordered, asynchronous socket protocol. The implementation has also not received as much testing or review.
  32. Note the length-prefixing used in the socket implementation does not apply for GRPC.
  33. ## Usage
  34. The `abci-cli` tool wraps an ABCI client and can be used for probing/testing an ABCI server.
  35. For instance, `abci-cli test` will run a test sequence against a listening server running the Counter application (see below).
  36. It can also be used to run some example applications.
  37. See [the documentation](http://tendermint.readthedocs.io/en/master/) for more details.
  38. ### Example Apps
  39. Multiple example apps are included:
  40. - the `abci-cli counter` application, which illustrates nonce checking in txs
  41. - the `abci-cli dummy` application, which illustrates a simple key-value Merkle tree
  42. - the `abci-cli dummy --persistent` application, which augments the dummy with persistence and validator set changes
  43. ### Install
  44. ```
  45. go get github.com/tendermint/abci
  46. cd $GOPATH/src/github.com/tendermint/abci
  47. make get_vendor_deps
  48. make install
  49. ```
  50. ## Specification
  51. See the [spec file](specification.rst) for more information.