Documentation
¶
Index ¶
- func RunAllVerifications() error
- func VerifyCompliance() error
- func VerifyTypeCompatibility() error
- type Application
- func (app *Application) ApplySnapshotChunk(ctx context.Context, req *cmtabci.RequestApplySnapshotChunk) (*cmtabci.ResponseApplySnapshotChunk, error)
- func (app *Application) CheckTx(ctx context.Context, req *cmtabci.RequestCheckTx) (*cmtabci.ResponseCheckTx, error)
- func (app *Application) Commit(ctx context.Context, req *cmtabci.RequestCommit) (*cmtabci.ResponseCommit, error)
- func (app *Application) ExtendVote(ctx context.Context, req *cmtabci.RequestExtendVote) (*cmtabci.ResponseExtendVote, error)
- func (app *Application) FinalizeBlock(ctx context.Context, req *cmtabci.RequestFinalizeBlock) (*cmtabci.ResponseFinalizeBlock, error)
- func (app *Application) GetAppHash() []byte
- func (app *Application) GetHeight() int64
- func (app *Application) GetState() map[string][]byte
- func (app *Application) Info(ctx context.Context, req *cmtabci.RequestInfo) (*cmtabci.ResponseInfo, error)
- func (app *Application) InitChain(ctx context.Context, req *cmtabci.RequestInitChain) (*cmtabci.ResponseInitChain, error)
- func (app *Application) ListSnapshots(ctx context.Context, req *cmtabci.RequestListSnapshots) (*cmtabci.ResponseListSnapshots, error)
- func (app *Application) LoadSnapshotChunk(ctx context.Context, req *cmtabci.RequestLoadSnapshotChunk) (*cmtabci.ResponseLoadSnapshotChunk, error)
- func (app *Application) OfferSnapshot(ctx context.Context, req *cmtabci.RequestOfferSnapshot) (*cmtabci.ResponseOfferSnapshot, error)
- func (app *Application) PrepareProposal(ctx context.Context, req *cmtabci.RequestPrepareProposal) (*cmtabci.ResponsePrepareProposal, error)
- func (app *Application) ProcessProposal(ctx context.Context, req *cmtabci.RequestProcessProposal) (*cmtabci.ResponseProcessProposal, error)
- func (app *Application) Query(ctx context.Context, req *cmtabci.RequestQuery) (*cmtabci.ResponseQuery, error)
- func (app *Application) VerifyVoteExtension(ctx context.Context, req *cmtabci.RequestVerifyVoteExtension) (*cmtabci.ResponseVerifyVoteExtension, error)
- type MyApp
- func (app *MyApp) CheckTx(ctx context.Context, req *types.CheckTxRequest) (*types.CheckTxResponse, error)
- func (app *MyApp) Commit(ctx context.Context, req *types.CommitRequest) (*types.CommitResponse, error)
- func (app *MyApp) Echo(ctx context.Context, req *types.EchoRequest) (*types.EchoResponse, error)
- func (app *MyApp) FinalizeBlock(ctx context.Context, req *types.FinalizeBlockRequest) (*types.FinalizeBlockResponse, error)
- func (app *MyApp) Info(ctx context.Context, req *types.InfoRequest) (*types.InfoResponse, error)
- func (app *MyApp) InitChain(ctx context.Context, req *types.InitChainRequest) (*types.InitChainResponse, error)
- func (app *MyApp) Query(ctx context.Context, req *types.QueryRequest) (*types.QueryResponse, error)
- type SimpleGasMeter
- func (gm *SimpleGasMeter) ConsumeGas(amount int64, descriptor string) error
- func (gm *SimpleGasMeter) GasConsumed() int64
- func (gm *SimpleGasMeter) GasLimit() int64
- func (gm *SimpleGasMeter) IsOutOfGas() bool
- func (gm *SimpleGasMeter) RefundGas(amount int64, descriptor string)
- func (gm *SimpleGasMeter) Reset()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RunAllVerifications ¶
func RunAllVerifications() error
RunAllVerifications runs all verification checks
func VerifyCompliance ¶
func VerifyCompliance() error
VerifyCompliance checks that all implementations comply with the ABCI interface
func VerifyTypeCompatibility ¶
func VerifyTypeCompatibility() error
VerifyTypeCompatibility checks that all types are compatible with CometBFT
Types ¶
type Application ¶
type Application struct {
cmtabci.BaseApplication
// contains filtered or unexported fields
}
Application implements the ABCI application interface for CometBFT v0.38.17
func NewApplication ¶
func NewApplication() *Application
NewApplication creates a new ABCI application instance
func (*Application) ApplySnapshotChunk ¶
func (app *Application) ApplySnapshotChunk(ctx context.Context, req *cmtabci.RequestApplySnapshotChunk) (*cmtabci.ResponseApplySnapshotChunk, error)
ApplySnapshotChunk applies a snapshot chunk
func (*Application) CheckTx ¶
func (app *Application) CheckTx(ctx context.Context, req *cmtabci.RequestCheckTx) (*cmtabci.ResponseCheckTx, error)
CheckTx validates a transaction for the mempool
func (*Application) Commit ¶
func (app *Application) Commit(ctx context.Context, req *cmtabci.RequestCommit) (*cmtabci.ResponseCommit, error)
Commit commits the current state
func (*Application) ExtendVote ¶
func (app *Application) ExtendVote(ctx context.Context, req *cmtabci.RequestExtendVote) (*cmtabci.ResponseExtendVote, error)
ExtendVote extends a vote with application-specific data
func (*Application) FinalizeBlock ¶
func (app *Application) FinalizeBlock(ctx context.Context, req *cmtabci.RequestFinalizeBlock) (*cmtabci.ResponseFinalizeBlock, error)
FinalizeBlock processes all transactions in a block
func (*Application) GetAppHash ¶
func (app *Application) GetAppHash() []byte
GetAppHash returns the current app hash (for testing)
func (*Application) GetHeight ¶
func (app *Application) GetHeight() int64
GetHeight returns the current height (for testing)
func (*Application) GetState ¶
func (app *Application) GetState() map[string][]byte
GetState returns the current application state (for testing)
func (*Application) Info ¶
func (app *Application) Info(ctx context.Context, req *cmtabci.RequestInfo) (*cmtabci.ResponseInfo, error)
Info returns application information
func (*Application) InitChain ¶
func (app *Application) InitChain(ctx context.Context, req *cmtabci.RequestInitChain) (*cmtabci.ResponseInitChain, error)
InitChain initializes the blockchain
func (*Application) ListSnapshots ¶
func (app *Application) ListSnapshots(ctx context.Context, req *cmtabci.RequestListSnapshots) (*cmtabci.ResponseListSnapshots, error)
ListSnapshots lists available snapshots
func (*Application) LoadSnapshotChunk ¶
func (app *Application) LoadSnapshotChunk(ctx context.Context, req *cmtabci.RequestLoadSnapshotChunk) (*cmtabci.ResponseLoadSnapshotChunk, error)
LoadSnapshotChunk loads a snapshot chunk
func (*Application) OfferSnapshot ¶
func (app *Application) OfferSnapshot(ctx context.Context, req *cmtabci.RequestOfferSnapshot) (*cmtabci.ResponseOfferSnapshot, error)
OfferSnapshot offers a snapshot to the application
func (*Application) PrepareProposal ¶
func (app *Application) PrepareProposal(ctx context.Context, req *cmtabci.RequestPrepareProposal) (*cmtabci.ResponsePrepareProposal, error)
PrepareProposal prepares a block proposal
func (*Application) ProcessProposal ¶
func (app *Application) ProcessProposal(ctx context.Context, req *cmtabci.RequestProcessProposal) (*cmtabci.ResponseProcessProposal, error)
ProcessProposal validates a block proposal
func (*Application) Query ¶
func (app *Application) Query(ctx context.Context, req *cmtabci.RequestQuery) (*cmtabci.ResponseQuery, error)
Query handles queries to the application state
func (*Application) VerifyVoteExtension ¶
func (app *Application) VerifyVoteExtension(ctx context.Context, req *cmtabci.RequestVerifyVoteExtension) (*cmtabci.ResponseVerifyVoteExtension, error)
VerifyVoteExtension verifies a vote extension
type MyApp ¶
type MyApp struct {
types.BaseApplication
// contains filtered or unexported fields
}
MyApp is an example ABCI application implementation
func (*MyApp) CheckTx ¶
func (app *MyApp) CheckTx(ctx context.Context, req *types.CheckTxRequest) (*types.CheckTxResponse, error)
CheckTx validates a transaction for the mempool
func (*MyApp) Commit ¶
func (app *MyApp) Commit(ctx context.Context, req *types.CommitRequest) (*types.CommitResponse, error)
Commit commits the current state and returns the app hash
func (*MyApp) Echo ¶
func (app *MyApp) Echo(ctx context.Context, req *types.EchoRequest) (*types.EchoResponse, error)
Echo returns the same message for testing
func (*MyApp) FinalizeBlock ¶
func (app *MyApp) FinalizeBlock(ctx context.Context, req *types.FinalizeBlockRequest) (*types.FinalizeBlockResponse, error)
FinalizeBlock processes all transactions in a block
func (*MyApp) Info ¶
func (app *MyApp) Info(ctx context.Context, req *types.InfoRequest) (*types.InfoResponse, error)
Info returns application information
func (*MyApp) InitChain ¶
func (app *MyApp) InitChain(ctx context.Context, req *types.InitChainRequest) (*types.InitChainResponse, error)
InitChain initializes the blockchain
func (*MyApp) Query ¶
func (app *MyApp) Query(ctx context.Context, req *types.QueryRequest) (*types.QueryResponse, error)
Query handles queries to the application state
type SimpleGasMeter ¶
type SimpleGasMeter struct {
// contains filtered or unexported fields
}
SimpleGasMeter is a basic gas meter implementation
func NewSimpleGasMeter ¶
func NewSimpleGasMeter(limit int64) *SimpleGasMeter
func (*SimpleGasMeter) ConsumeGas ¶
func (gm *SimpleGasMeter) ConsumeGas(amount int64, descriptor string) error
func (*SimpleGasMeter) GasConsumed ¶
func (gm *SimpleGasMeter) GasConsumed() int64
func (*SimpleGasMeter) GasLimit ¶
func (gm *SimpleGasMeter) GasLimit() int64
func (*SimpleGasMeter) IsOutOfGas ¶
func (gm *SimpleGasMeter) IsOutOfGas() bool
func (*SimpleGasMeter) RefundGas ¶
func (gm *SimpleGasMeter) RefundGas(amount int64, descriptor string)
func (*SimpleGasMeter) Reset ¶
func (gm *SimpleGasMeter) Reset()
Directories
¶
| Path | Synopsis |
|---|---|
|
mocks
Manual mock for ABCI Client interface
|
Manual mock for ABCI Client interface |
|
cmd
|
|
|
abci-cli
command
|
|
|
demo
command
|
|
|
counter
command
|
|
|
Package server is used to start a new ABCI server.
|
Package server is used to start a new ABCI server. |
|
benchmarks/parallel
command
|
|
|
benchmarks/simple
command
|
|
|
test_app
command
|
|