commit
c1f5a96382
61
README.md
61
README.md
|
@ -8,14 +8,15 @@ and the state machine (the application).
|
|||
By using a socket protocol, we enable a consensus engine running in one process
|
||||
to manage an application state running in another.
|
||||
|
||||
For more information on ABCI, motivations, and tutorials, please visit [our blog post](https://tendermint.com/blog/tmsp-the-tendermint-socket-protocol).
|
||||
For more information on ABCI, motivations, and tutorials, please visit [our blog post](https://tendermint.com/blog/abci-the-application-blockchain-interface),
|
||||
and the more detailed [application developer's guide](https://tendermint.com/docs/guides/app-development).
|
||||
|
||||
Previously, the ABCI was just referred to as TMSP.
|
||||
|
||||
Other implementations:
|
||||
* [cpp-tmsp](https://github.com/mdyring/cpp-tmsp) by Martin Dyring-Andersen
|
||||
* [js-tmsp](https://github.com/tendermint/js-tmsp)
|
||||
* [jTMSP](https://github.com/jTMSP/) for Java
|
||||
* [jABCI](https://github.com/jTendermint/jabci) for Java
|
||||
|
||||
# Specification
|
||||
|
||||
|
@ -30,6 +31,47 @@ TendermintCore runs a client, and the ABCI application runs a server. There are
|
|||
2. GRPC: Synchronous (slow) implementation using GRPC.
|
||||
3. Golang in-process: If the ABCI appliation is written in Golang, it is possible to compile both TendermintCore and the application as one binary.
|
||||
|
||||
```golang
|
||||
// Applications
|
||||
type Application interface {
|
||||
|
||||
// Latest state
|
||||
Info() ResponseInfo
|
||||
|
||||
// Initialization
|
||||
SetOption(key string, value string) (log string)
|
||||
InitChain(validators []*Validator)
|
||||
|
||||
// Apply a block
|
||||
BeginBlock(hash []byte, header *Header)
|
||||
DeliverTx(tx []byte) Result
|
||||
EndBlock(height uint64) ResponseEndBlock
|
||||
Commit() Result
|
||||
|
||||
// Check validity
|
||||
CheckTx(tx []byte) Result
|
||||
|
||||
// Query for state
|
||||
Query(query []byte) Result
|
||||
}
|
||||
|
||||
type Result struct {
|
||||
Code CodeType
|
||||
Data []byte
|
||||
Log string // Can be non-deterministic
|
||||
}
|
||||
|
||||
type ResponseInfo struct {
|
||||
Data string
|
||||
Version string
|
||||
LastBlockHeight uint64
|
||||
LastBlockAppHash []byte
|
||||
}
|
||||
|
||||
type ResponseEndBlock struct {
|
||||
Diffs []*Validator
|
||||
}
|
||||
|
||||
_TODO: merge information from https://tendermint.com/blog/tendermint-0-8-release_
|
||||
|
||||
## Message Types
|
||||
|
@ -128,6 +170,19 @@ ABCI requests/responses are simple Protobuf messages. Check out the [schema fil
|
|||
* __Usage__:<br/>
|
||||
Signals the end of a block. Called prior to each Commit after all transactions. Validator set is updated with the result.
|
||||
|
||||
#### Echo
|
||||
* __Arguments__:
|
||||
* `Message (string)`: A string to echo back
|
||||
* __Returns__:
|
||||
* `Message (string)`: The input string
|
||||
* __Usage__:<br/>
|
||||
* Echo a string to test an abci client/server implementation
|
||||
|
||||
|
||||
#### Flush
|
||||
* __Usage__:<br/>
|
||||
* Signals that messages queued on the client should be flushed to the server. It is called periodically by the client implementation to ensure asynchronous requests are actually sent, and is called immediately to make a synchronous request, which returns when the Flush response comes back.
|
||||
|
||||
|
||||
# Implementations
|
||||
|
||||
|
@ -157,7 +212,7 @@ Note the length-prefixing used in the socket implementation does not apply for G
|
|||
# Tools and Apps
|
||||
|
||||
The `abci-cli` tool wraps any ABCI client and can be used for probing/testing an ABCI application.
|
||||
See the [tutorial](https://tendermint.com/intro/getting-started/first-tmsp) for more details.
|
||||
See the [tutorial](https://tendermint.com/intro/getting-started/first-abci) for more details.
|
||||
|
||||
Multiple example apps are included:
|
||||
- the `counter` application, which illustrates nonce checking in txs
|
||||
|
|
Loading…
Reference in New Issue