Browse Source

Reorder README

pull/1780/head
Jae Kwon 7 years ago
parent
commit
3798f9fa8e
2 changed files with 57 additions and 59 deletions
  1. +57
    -58
      README.md
  2. +0
    -1
      types/types.proto

+ 57
- 58
README.md View File

@ -59,7 +59,7 @@ See [the documentation](http://tendermint.readthedocs.io/en/master/) for more de
Multiple example apps are included:
- the `abci-cli counter` application, which illustrates nonce checking in txs
- the `abci-cli dummy` application, which illustrates a simple key-value merkle tree
- the `abci-cli dummy` application, which illustrates a simple key-value Merkle tree
- the `abci-cli dummy --persistent` application, which augments the dummy with persistence and validator set changes
### Install
@ -91,59 +91,17 @@ ABCI requests/responses are defined as simple Protobuf messages in [this schema
TendermintCore sends the requests, and the ABCI application sends the responses.
Here, we describe the requests and responses as function arguments and return values, and make some notes about usage:
#### DeliverTx
* __Arguments__:
* `Data ([]byte)`: The request transaction bytes
* __Returns__:
* `Code (uint32)`: Response code
* `Data ([]byte)`: Result bytes, if any
* `Log (string)`: Debug or error message
* `Tags ([]*KVPair)`: Optional tags for indexing
* __Usage__:<br/>
Append and run a transaction. If the transaction is valid, returns CodeType.OK
#### CheckTx
#### Echo
* __Arguments__:
* `Data ([]byte)`: The request transaction bytes
* `Message (string)`: A string to echo back
* __Returns__:
* `Code (uint32)`: Response code
* `Data ([]byte)`: Result bytes, if any
* `Log (string)`: Debug or error message
* `Gas (int64)`: Amount of gas consumed by transaction
* `Fee (int64)`: Fee paid by transaction
* `Message (string)`: The input string
* __Usage__:<br/>
Validate a mempool transaction, prior to broadcasting or proposing. This message should not mutate the main state, but application
developers may want to keep a separate CheckTx state that gets reset upon Commit.
CheckTx can happen interspersed with DeliverTx, but they happen on different ABCI connections - CheckTx from the mempool connection, and DeliverTx from the consensus connection. During Commit, the mempool is locked, so you can reset the mempool state to the latest state after running all those DeliverTxs, and then the mempool will re-run whatever txs it has against that latest mempool state.
Transactions are first run through CheckTx before broadcast to peers in the mempool layer.
You can make CheckTx semi-stateful and clear the state upon `Commit` or `BeginBlock`,
to allow for dependent sequences of transactions in the same block.
* Echo a string to test an abci client/server implementation
#### Commit
* __Returns__:
* `Data ([]byte)`: The Merkle root hash
* `Log (string)`: Debug or error message
#### Flush
* __Usage__:<br/>
Return a Merkle root hash of the application state.
#### Query
* __Arguments__:
* `Data ([]byte)`: Raw query bytes. Can be used with or in lieu of Path.
* `Path (string)`: Path of request, like an HTTP GET path. Can be used with or in liue of Data.
* Apps MUST interpret '/store' as a query by key on the underlying store. The key SHOULD be specified in the Data field.
* Apps SHOULD allow queries over specific types like '/accounts/...' or '/votes/...'
* `Height (int64)`: The block height for which you want the query (default=0 returns data for the latest committed block). Note that this is the height of the block containing the application's Merkle root hash, which represents the state as it was after committing the block at Height-1
* `Prove (bool)`: Return Merkle proof with response if possible
* __Returns__:
* `Code (uint32)`: Response code
* `Key ([]byte)`: The key of the matching data
* `Value ([]byte)`: The value of the matching data
* `Proof ([]byte)`: Proof for the data, if requested
* `Height (int64)`: The block height from which data was derived. Note that this is the height of the block containing the application's Merkle root hash, which represents the state as it was after committing the block at Height-1
* `Log (string)`: Debug or error message
*Please note* The current implementation of go-merkle doesn't support querying proofs from past blocks, so for the present moment, any height other than 0 will return an error (recall height=0 defaults to latest block). Hopefully this will be improved soon(ish)
* 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.
#### Info
* __Returns__:
@ -172,6 +130,22 @@ Here, we describe the requests and responses as function arguments and return va
* __Usage__:<br/>
Called once upon genesis
#### Query
* __Arguments__:
* `Data ([]byte)`: Raw query bytes. Can be used with or in lieu of Path.
* `Path (string)`: Path of request, like an HTTP GET path. Can be used with or in liue of Data.
* Apps MUST interpret '/store' as a query by key on the underlying store. The key SHOULD be specified in the Data field.
* Apps SHOULD allow queries over specific types like '/accounts/...' or '/votes/...'
* `Height (int64)`: The block height for which you want the query (default=0 returns data for the latest committed block). Note that this is the height of the block containing the application's Merkle root hash, which represents the state as it was after committing the block at Height-1
* `Prove (bool)`: Return Merkle proof with response if possible
* __Returns__:
* `Code (uint32)`: Response code
* `Key ([]byte)`: The key of the matching data
* `Value ([]byte)`: The value of the matching data
* `Proof ([]byte)`: Proof for the data, if requested
* `Height (int64)`: The block height from which data was derived. Note that this is the height of the block containing the application's Merkle root hash, which represents the state as it was after committing the block at Height-1
* `Log (string)`: Debug or error message
#### BeginBlock
* __Arguments__:
* `Hash ([]byte)`: The block's hash. This can be derived from the block header.
@ -181,6 +155,36 @@ Here, we describe the requests and responses as function arguments and return va
* __Usage__:<br/>
Signals the beginning of a new block. Called prior to any DeliverTxs. The header is expected to at least contain the Height. The `AbsentValidators` and `ByzantineValidators` can be used to determine rewards and punishments for the validators.
#### CheckTx
* __Arguments__:
* `Data ([]byte)`: The request transaction bytes
* __Returns__:
* `Code (uint32)`: Response code
* `Data ([]byte)`: Result bytes, if any
* `Log (string)`: Debug or error message
* `Gas (int64)`: Amount of gas consumed by transaction
* `Fee (int64)`: Fee paid by transaction
* __Usage__:<br/>
Validate a mempool transaction, prior to broadcasting or proposing. This message should not mutate the main state, but application
developers may want to keep a separate CheckTx state that gets reset upon Commit.
CheckTx can happen interspersed with DeliverTx, but they happen on different ABCI connections - CheckTx from the mempool connection, and DeliverTx from the consensus connection. During Commit, the mempool is locked, so you can reset the mempool state to the latest state after running all those DeliverTxs, and then the mempool will re-run whatever txs it has against that latest mempool state.
Transactions are first run through CheckTx before broadcast to peers in the mempool layer.
You can make CheckTx semi-stateful and clear the state upon `Commit` or `BeginBlock`,
to allow for dependent sequences of transactions in the same block.
#### DeliverTx
* __Arguments__:
* `Data ([]byte)`: The request transaction bytes
* __Returns__:
* `Code (uint32)`: Response code
* `Data ([]byte)`: Result bytes, if any
* `Log (string)`: Debug or error message
* `Tags ([]*KVPair)`: Optional tags for indexing
* __Usage__:<br/>
Append and run a transaction. If the transaction is valid, returns CodeType.OK
#### EndBlock
* __Arguments__:
* `Height (int64)`: The block height that ended
@ -190,15 +194,10 @@ Here, we describe the requests and responses as function arguments and return va
* __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
#### Commit
* __Returns__:
* `Message (string)`: The input string
* __Usage__:<br/>
* Echo a string to test an abci client/server implementation
#### Flush
* `Data ([]byte)`: The Merkle root hash
* `Log (string)`: Debug or error message
* __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.
Return a Merkle root hash of the application state.

+ 0
- 1
types/types.proto View File

@ -3,7 +3,6 @@ package types;
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
// This file is copied from http://github.com/tendermint/abci
//----------------------------------------


Loading…
Cancel
Save