Documentation ¶
Index ¶
- Constants
- func BuildQueryBinary(args interface{}) (argsBytes []byte, err error)
- func ComputeAppHash(previous *types.Bytes32, validator *types.Bytes32, root *types.Bytes32) (*types.Bytes32, error)
- func Run(a store.Adapter, kv store.KeyValueStore, config *Config)
- type ABCIError
- type Block
- type Config
- type Info
- type LastBlock
- type State
- type TMPop
- func (t *TMPop) BeginBlock(req abci.RequestBeginBlock) abci.ResponseBeginBlock
- func (t *TMPop) CheckTx(tx []byte) abci.ResponseCheckTx
- func (t *TMPop) Commit() abci.ResponseCommit
- func (t *TMPop) ConnectTendermint(tmClient TendermintClient)
- func (t *TMPop) DeliverTx(tx []byte) abci.ResponseDeliverTx
- func (t *TMPop) GetCurrentHeader() *abci.Header
- func (t *TMPop) Info(req abci.RequestInfo) abci.ResponseInfo
- func (t *TMPop) Query(reqQuery abci.RequestQuery) (resQuery abci.ResponseQuery)
- func (t *TMPop) SetOption(req abci.RequestSetOption) abci.ResponseSetOption
- type TendermintClient
- type TendermintClientWrapper
- type Tx
- type TxType
Constants ¶
const ( // CodeTypeValidation is the ABCI error code for a validation error. CodeTypeValidation uint32 = 400 // CodeTypeInternalError is the ABCI error code for an internal error. CodeTypeInternalError uint32 = 500 // CodeTypeNotImplemented is the ABCI error code for a feature not yet implemented. CodeTypeNotImplemented uint32 = 501 )
const ( AddEvidence = "AddEvidence" FindSegments = "FindSegments" GetEvidences = "GetEvidences" GetInfo = "GetInfo" GetMapIDs = "GetMapIDs" GetSegment = "GetSegment" PendingEvents = "PendingEvents" )
Query types.
const ( // Name of the Tendermint Application. Name = "TMPop" // Description of this Tendermint Application. Description = "Agent Store in a Blockchain" )
Variables ¶
This section is empty.
Functions ¶
func BuildQueryBinary ¶
BuildQueryBinary outputs the marshalled Query.
func ComputeAppHash ¶ added in v0.2.0
func ComputeAppHash(previous *types.Bytes32, validator *types.Bytes32, root *types.Bytes32) (*types.Bytes32, error)
ComputeAppHash computes the app hash from its required parts If one of the parts is nil or empty, we'll pad with 0s so that we always hash a 96-bytes array
Types ¶
type ABCIError ¶ added in v0.2.0
ABCIError is a structured error used inside TMPoP. The error codes are close to standard http status codes.
type Block ¶ added in v0.2.0
Block contains the parts of a Tendermint block that TMPoP is interested in.
type Config ¶
type Config struct { // A version string that will be set in the store's information. Version string // A git commit hash that will be set in the store's information. Commit string // JSON schema rules definition ValidatorFilename string }
Config contains configuration options for the App.
type Info ¶
type Info struct { Name string `json:"name"` Description string `json:"description"` Version string `json:"version"` Commit string `json:"commit"` AdapterInfo interface{} `json:"adapterInfo"` }
Info is the info returned by GetInfo.
type LastBlock ¶ added in v0.2.0
LastBlock saves the information of the last block committed for Core/App Handshake on crash/restart.
func ReadLastBlock ¶ added in v0.2.0
func ReadLastBlock(kv store.KeyValueReader) (*LastBlock, error)
ReadLastBlock returns the last block committed by TMPop
type State ¶
type State struct {
// contains filtered or unexported fields
}
State represents the app states, separating the committed state (for queries) from the working state (for CheckTx and DeliverTx).
type TMPop ¶
type TMPop struct { abci.BaseApplication // contains filtered or unexported fields }
TMPop is the type of the application that implements github.com/tendermint/abci/types.Application, the tendermint socket protocol (ABCI).
func (*TMPop) BeginBlock ¶
func (t *TMPop) BeginBlock(req abci.RequestBeginBlock) abci.ResponseBeginBlock
BeginBlock implements github.com/tendermint/abci/types.Application.BeginBlock.
func (*TMPop) CheckTx ¶
func (t *TMPop) CheckTx(tx []byte) abci.ResponseCheckTx
CheckTx implements github.com/tendermint/abci/types.Application.CheckTx.
func (*TMPop) Commit ¶
func (t *TMPop) Commit() abci.ResponseCommit
Commit implements github.com/tendermint/abci/types.Application.Commit. It actually commits the current state in the Store.
func (*TMPop) ConnectTendermint ¶ added in v0.2.0
func (t *TMPop) ConnectTendermint(tmClient TendermintClient)
ConnectTendermint connects TMPoP to a Tendermint node
func (*TMPop) DeliverTx ¶
func (t *TMPop) DeliverTx(tx []byte) abci.ResponseDeliverTx
DeliverTx implements github.com/tendermint/abci/types.Application.DeliverTx.
func (*TMPop) GetCurrentHeader ¶ added in v0.2.0
GetCurrentHeader returns the current block header
func (*TMPop) Info ¶
func (t *TMPop) Info(req abci.RequestInfo) abci.ResponseInfo
Info implements github.com/tendermint/abci/types.Application.Info.
func (*TMPop) Query ¶
func (t *TMPop) Query(reqQuery abci.RequestQuery) (resQuery abci.ResponseQuery)
Query implements github.com/tendermint/abci/types.Application.Query.
func (*TMPop) SetOption ¶
func (t *TMPop) SetOption(req abci.RequestSetOption) abci.ResponseSetOption
SetOption implements github.com/tendermint/abci/types.Application.SetOption.
type TendermintClient ¶ added in v0.2.0
TendermintClient is a light interface to query Tendermint Core
type TendermintClientWrapper ¶ added in v0.2.0
type TendermintClientWrapper struct {
// contains filtered or unexported fields
}
TendermintClientWrapper implements TendermintClient
func NewTendermintClient ¶ added in v0.2.0
func NewTendermintClient(tmClient client.Client) *TendermintClientWrapper
NewTendermintClient creates a new TendermintClient
func (*TendermintClientWrapper) Block ¶ added in v0.2.0
func (c *TendermintClientWrapper) Block(height int) *Block
Block queries for a block at a specific height