Documentation
¶
Index ¶
- Variables
- type Application
- type BaseApplication
- func (BaseApplication) BeginBlock(req RequestBeginBlock) ResponseBeginBlock
- func (BaseApplication) CheckTx(req RequestCheckTx) ResponseCheckTx
- func (BaseApplication) Close() error
- func (BaseApplication) Commit() ResponseCommit
- func (BaseApplication) DeliverTx(req RequestDeliverTx) ResponseDeliverTx
- func (BaseApplication) EndBlock(req RequestEndBlock) ResponseEndBlock
- func (BaseApplication) Info(req RequestInfo) ResponseInfo
- func (BaseApplication) InitChain(req RequestInitChain) ResponseInitChain
- func (BaseApplication) Query(req RequestQuery) ResponseQuery
- func (BaseApplication) SetOption(req RequestSetOption) ResponseSetOption
- type BlockParams
- type CheckTxType
- type ConsensusParams
- type Error
- type Event
- type EventString
- type Header
- type LastCommitInfo
- type MockHeader
- type Request
- type RequestBase
- type RequestBeginBlock
- type RequestCheckTx
- type RequestCommit
- type RequestDeliverTx
- type RequestEcho
- type RequestEndBlock
- type RequestFlush
- type RequestInfo
- type RequestInitChain
- type RequestQuery
- type RequestSetOption
- type Response
- type ResponseBase
- type ResponseBeginBlock
- type ResponseCheckTx
- type ResponseCommit
- type ResponseDeliverTx
- type ResponseEcho
- type ResponseEndBlock
- type ResponseException
- type ResponseFlush
- type ResponseInfo
- type ResponseInitChain
- type ResponseQuery
- type ResponseSetOption
- type StringError
- type ValidatorParams
- type ValidatorUpdate
- type ValidatorUpdates
- type VoteInfo
Constants ¶
This section is empty.
Variables ¶
View Source
var Package = amino.RegisterPackage(amino.NewPackage( "github.com/gnolang/gno/tm2/pkg/bft/abci/types", "abci", amino.GetCallersDirname(), ). WithGoPkgName("abci"). WithDependencies( merkle.Package, ). WithTypes( RequestBase{}, RequestEcho{}, RequestFlush{}, RequestInfo{}, RequestSetOption{}, RequestInitChain{}, RequestQuery{}, RequestBeginBlock{}, RequestCheckTx{}, RequestDeliverTx{}, RequestEndBlock{}, RequestCommit{}, ResponseBase{}, ResponseException{}, ResponseEcho{}, ResponseFlush{}, ResponseInfo{}, ResponseSetOption{}, ResponseInitChain{}, ResponseQuery{}, ResponseBeginBlock{}, ResponseCheckTx{}, ResponseDeliverTx{}, ResponseEndBlock{}, ResponseCommit{}, StringError(""), ConsensusParams{}, BlockParams{}, ValidatorParams{}, ValidatorUpdate{}, LastCommitInfo{}, VoteInfo{}, EventString(""), MockHeader{}, ))
Functions ¶
This section is empty.
Types ¶
type Application ¶
type Application interface { // Info/Query Connection Info(RequestInfo) ResponseInfo // Return application info SetOption(RequestSetOption) ResponseSetOption // Set application option Query(RequestQuery) ResponseQuery // Query for state // Mempool Connection CheckTx(RequestCheckTx) ResponseCheckTx // Validate a tx for the mempool // Consensus Connection InitChain(RequestInitChain) ResponseInitChain // Initialize blockchain with validators and other info from TendermintCore BeginBlock(RequestBeginBlock) ResponseBeginBlock // Signals the beginning of a block DeliverTx(RequestDeliverTx) ResponseDeliverTx // Deliver a tx for full processing EndBlock(RequestEndBlock) ResponseEndBlock // Signals the end of a block, returns changes to the validator set Commit() ResponseCommit // Commit the state and return the application Merkle root hash // Cleanup Close() error }
Application is an interface that enables any finite, deterministic state machine to be driven by a blockchain-based replication engine via the ABCI. All methods take a RequestXxx argument and return a ResponseXxx argument, except CheckTx/DeliverTx, which take `tx []byte`, and `Commit`, which takes nothing.
type BaseApplication ¶
type BaseApplication struct{}
func NewBaseApplication ¶
func NewBaseApplication() *BaseApplication
func (BaseApplication) BeginBlock ¶
func (BaseApplication) BeginBlock(req RequestBeginBlock) ResponseBeginBlock
func (BaseApplication) CheckTx ¶
func (BaseApplication) CheckTx(req RequestCheckTx) ResponseCheckTx
func (BaseApplication) Close ¶
func (BaseApplication) Close() error
func (BaseApplication) Commit ¶
func (BaseApplication) Commit() ResponseCommit
func (BaseApplication) DeliverTx ¶
func (BaseApplication) DeliverTx(req RequestDeliverTx) ResponseDeliverTx
func (BaseApplication) EndBlock ¶
func (BaseApplication) EndBlock(req RequestEndBlock) ResponseEndBlock
func (BaseApplication) Info ¶
func (BaseApplication) Info(req RequestInfo) ResponseInfo
func (BaseApplication) InitChain ¶
func (BaseApplication) InitChain(req RequestInitChain) ResponseInitChain
func (BaseApplication) Query ¶
func (BaseApplication) Query(req RequestQuery) ResponseQuery
func (BaseApplication) SetOption ¶
func (BaseApplication) SetOption(req RequestSetOption) ResponseSetOption
type BlockParams ¶
type CheckTxType ¶
type CheckTxType int
const ( CheckTxTypeNew CheckTxType = 0 CheckTxTypeRecheck = iota )
type ConsensusParams ¶
type ConsensusParams struct { Block *BlockParams Validator *ValidatorParams }
Parameters that need to be negotiated between the app and consensus.
func (ConsensusParams) Hash ¶
func (params ConsensusParams) Hash() []byte
func (ConsensusParams) Update ¶
func (params ConsensusParams) Update(params2 ConsensusParams) ConsensusParams
type Error ¶
type Error interface { AssertABCIError() Error() string }
func ABCIErrorOrStringError ¶
type EventString ¶
type EventString string
func (EventString) AssertABCIEvent ¶
func (EventString) AssertABCIEvent()
func (EventString) Event ¶
func (err EventString) Event() string
type LastCommitInfo ¶
type MockHeader ¶
type MockHeader struct { Version string `json:"version"` ChainID string `json:"chain_id"` Height int64 `json:"height"` Time time.Time `json:"time"` NumTxs int64 `json:"num_txs"` TotalTxs int64 `json:"total_txs"` }
Only used for tests.
func (MockHeader) AssertABCIHeader ¶
func (MockHeader) AssertABCIHeader()
func (MockHeader) GetChainID ¶
func (mh MockHeader) GetChainID() string
func (MockHeader) GetHeight ¶
func (mh MockHeader) GetHeight() int64
func (MockHeader) GetTime ¶
func (mh MockHeader) GetTime() time.Time
type RequestBase ¶
type RequestBase struct{}
func (RequestBase) AssertRequest ¶
func (RequestBase) AssertRequest()
type RequestBeginBlock ¶
type RequestBeginBlock struct { RequestBase Hash []byte Header Header LastCommitInfo *LastCommitInfo }
type RequestCheckTx ¶
type RequestCheckTx struct { RequestBase Tx []byte Type CheckTxType }
type RequestCommit ¶
type RequestCommit struct {
RequestBase
}
type RequestDeliverTx ¶
type RequestDeliverTx struct { RequestBase Tx []byte }
type RequestEcho ¶
type RequestEcho struct { RequestBase Message string }
type RequestEndBlock ¶
type RequestEndBlock struct { RequestBase Height int64 }
type RequestFlush ¶
type RequestFlush struct {
RequestBase
}
type RequestInfo ¶
type RequestInfo struct {
RequestBase
}
type RequestInitChain ¶
type RequestInitChain struct { RequestBase Time time.Time ChainID string ConsensusParams *ConsensusParams Validators []ValidatorUpdate AppState interface{} }
type RequestQuery ¶
type RequestQuery struct { RequestBase Data []byte Path string Height int64 Prove bool }
type RequestSetOption ¶
type RequestSetOption struct { RequestBase Key string Value string }
nondeterministic
type ResponseBase ¶
type ResponseBase struct { Error Error Data []byte Events []Event Log string // nondeterministic Info string // nondeterministic }
func (ResponseBase) AssertResponse ¶
func (ResponseBase) AssertResponse()
func (ResponseBase) EncodeEvents ¶
func (r ResponseBase) EncodeEvents() []byte
func (ResponseBase) IsErr ¶
func (r ResponseBase) IsErr() bool
func (ResponseBase) IsOK ¶
func (r ResponseBase) IsOK() bool
type ResponseBeginBlock ¶
type ResponseBeginBlock struct {
ResponseBase
}
type ResponseCheckTx ¶
type ResponseCheckTx struct { ResponseBase GasWanted int64 // nondeterministic GasUsed int64 }
type ResponseCommit ¶
type ResponseCommit struct {
ResponseBase
}
type ResponseDeliverTx ¶
type ResponseDeliverTx struct { ResponseBase GasWanted int64 GasUsed int64 }
type ResponseEcho ¶
type ResponseEcho struct { ResponseBase Message string }
type ResponseEndBlock ¶
type ResponseEndBlock struct { ResponseBase ValidatorUpdates []ValidatorUpdate ConsensusParams *ConsensusParams Events []Event }
type ResponseFlush ¶
type ResponseFlush struct {
ResponseBase
}
type ResponseInfo ¶
type ResponseInfo struct { ResponseBase ABCIVersion string AppVersion string LastBlockHeight int64 LastBlockAppHash []byte }
type ResponseInitChain ¶
type ResponseInitChain struct { ResponseBase ConsensusParams *ConsensusParams Validators []ValidatorUpdate }
type ResponseQuery ¶
type StringError ¶
type StringError string
func (StringError) AssertABCIError ¶
func (StringError) AssertABCIError()
func (StringError) Error ¶
func (err StringError) Error() string
type ValidatorParams ¶
type ValidatorParams struct {
PubKeyTypeURLs []string
}
func (ValidatorParams) IsValidPubKeyTypeURL ¶
func (params ValidatorParams) IsValidPubKeyTypeURL(pubKeyTypeURL string) bool
type ValidatorUpdate ¶
func (ValidatorUpdate) Equals ¶
func (vu ValidatorUpdate) Equals(vu2 ValidatorUpdate) bool
type ValidatorUpdates ¶
type ValidatorUpdates []ValidatorUpdate
ValidatorUpdates is a list of validators that implements the Sort interface
func (ValidatorUpdates) Len ¶
func (v ValidatorUpdates) Len() int
func (ValidatorUpdates) Less ¶
func (v ValidatorUpdates) Less(i, j int) bool
func (ValidatorUpdates) Swap ¶
func (v ValidatorUpdates) Swap(i, j int)
Click to show internal directories.
Click to hide internal directories.