Documentation ¶
Overview ¶
Package abci implements the Accumulate ABCI applications.
Transaction Processing ¶
Tendermint processes transactions in the following phases:
- BeginBlock
- [CheckTx]
- [DeliverTx]
- EndBlock
- Commit
Index ¶
- Constants
- func AdjustStatusIDs(messages []messaging.Message, st []*protocol.TransactionStatus)
- func ListSnapshots(cfg *config.Config) ([]*snapshot.Header, error)
- func ListSnapshots2(snapDir string) ([]*snapshot.Header, error)
- type Accumulator
- func (app *Accumulator) ApplySnapshotChunk(_ context.Context, req *abci.RequestApplySnapshotChunk) (*abci.ResponseApplySnapshotChunk, error)
- func (app *Accumulator) CheckTx(_ context.Context, req *abci.RequestCheckTx) (rct *abci.ResponseCheckTx, err error)
- func (app *Accumulator) Commit(_ context.Context, req *abci.RequestCommit) (*abci.ResponseCommit, error)
- func (app *Accumulator) CurrentBlock() execute.Block
- func (app *Accumulator) CurrentBlockState() execute.BlockState
- func (app *Accumulator) FinalizeBlock(_ context.Context, req *abci.RequestFinalizeBlock) (*abci.ResponseFinalizeBlock, error)
- func (app *Accumulator) Info(context.Context, *abci.RequestInfo) (*abci.ResponseInfo, error)
- func (app *Accumulator) InitChain(_ context.Context, req *abci.RequestInitChain) (*abci.ResponseInitChain, error)
- func (app *Accumulator) LastBlock() (*execute.BlockParams, [32]byte, error)
- func (app *Accumulator) ListSnapshots(_ context.Context, req *abci.RequestListSnapshots) (*abci.ResponseListSnapshots, error)
- func (app *Accumulator) LoadSnapshotChunk(_ context.Context, req *abci.RequestLoadSnapshotChunk) (*abci.ResponseLoadSnapshotChunk, error)
- func (app *Accumulator) OfferSnapshot(_ context.Context, req *abci.RequestOfferSnapshot) (*abci.ResponseOfferSnapshot, error)
- func (app *Accumulator) OnFatal(f func(error))
- func (app *Accumulator) PrepareProposal(ctx context.Context, req *abci.RequestPrepareProposal) (*abci.ResponsePrepareProposal, error)
- func (app *Accumulator) ProcessProposal(ctx context.Context, req *abci.RequestProcessProposal) (*abci.ResponseProcessProposal, error)
- func (app *Accumulator) Query(_ context.Context, reqQuery *abci.RequestQuery) (*abci.ResponseQuery, error)
- type AccumulatorOptions
- type RequestBeginBlock
- type ResponseEndBlock
Constants ¶
const Version uint64 = 0x2
Version is the version of the ABCI applications.
Variables ¶
This section is empty.
Functions ¶
func AdjustStatusIDs ¶ added in v1.3.0
func AdjustStatusIDs(messages []messaging.Message, st []*protocol.TransactionStatus)
AdjustStatusIDs corrects for the fact that the block anchor's ID method was bad and has been changed.
func ListSnapshots ¶
ListSnapshots queries the node for available snapshots.
Types ¶
type Accumulator ¶
type Accumulator struct { abci.BaseApplication AccumulatorOptions // DisableLateCommit - DO NOT USE IN PRODUCTION - disables the late-commit // logic that prevents consensus failures from being committed. DisableLateCommit bool // contains filtered or unexported fields }
Accumulator is an ABCI application that accumulates validated transactions in a hash tree.
func NewAccumulator ¶
func NewAccumulator(opts AccumulatorOptions) *Accumulator
NewAccumulator returns a new Accumulator.
func (*Accumulator) ApplySnapshotChunk ¶
func (app *Accumulator) ApplySnapshotChunk(_ context.Context, req *abci.RequestApplySnapshotChunk) (*abci.ResponseApplySnapshotChunk, error)
ApplySnapshotChunk applies a snapshot to this node. This is called for each chunk of the snapshot. The receiver is responsible for assembling the chunks and determining when they have all been received.
This is one of four ABCI functions we have to implement for Tendermint/CometBFT.
func (*Accumulator) CheckTx ¶
func (app *Accumulator) CheckTx(_ context.Context, req *abci.RequestCheckTx) (rct *abci.ResponseCheckTx, err error)
CheckTx implements github.com/cometbft/cometbft/abci/types.Application.
Verifies the transaction is sane.
func (*Accumulator) Commit ¶
func (app *Accumulator) Commit(_ context.Context, req *abci.RequestCommit) (*abci.ResponseCommit, error)
Commit implements github.com/cometbft/cometbft/abci/types.Application.
Commits the transaction block to the chains.
func (*Accumulator) CurrentBlock ¶ added in v1.1.1
func (app *Accumulator) CurrentBlock() execute.Block
func (*Accumulator) CurrentBlockState ¶ added in v1.1.1
func (app *Accumulator) CurrentBlockState() execute.BlockState
func (*Accumulator) FinalizeBlock ¶ added in v1.2.5
func (app *Accumulator) FinalizeBlock(_ context.Context, req *abci.RequestFinalizeBlock) (*abci.ResponseFinalizeBlock, error)
func (*Accumulator) Info ¶
func (app *Accumulator) Info(context.Context, *abci.RequestInfo) (*abci.ResponseInfo, error)
Info implements github.com/cometbft/cometbft/abci/types.Application.
func (*Accumulator) InitChain ¶
func (app *Accumulator) InitChain(_ context.Context, req *abci.RequestInitChain) (*abci.ResponseInitChain, error)
InitChain implements github.com/cometbft/cometbft/abci/types.Application.
Called when a chain is created.
func (*Accumulator) LastBlock ¶ added in v1.1.1
func (app *Accumulator) LastBlock() (*execute.BlockParams, [32]byte, error)
func (*Accumulator) ListSnapshots ¶
func (app *Accumulator) ListSnapshots(_ context.Context, req *abci.RequestListSnapshots) (*abci.ResponseListSnapshots, error)
ListSnapshots returns a list of snapshot metadata objects.
This is one of four ABCI functions we have to implement for Tendermint/CometBFT.
func (*Accumulator) LoadSnapshotChunk ¶
func (app *Accumulator) LoadSnapshotChunk(_ context.Context, req *abci.RequestLoadSnapshotChunk) (*abci.ResponseLoadSnapshotChunk, error)
LoadSnapshotChunk queries the node for the body of a snapshot, to be offered to another node.
This is one of four ABCI functions we have to implement for Tendermint/CometBFT.
func (*Accumulator) OfferSnapshot ¶
func (app *Accumulator) OfferSnapshot(_ context.Context, req *abci.RequestOfferSnapshot) (*abci.ResponseOfferSnapshot, error)
OfferSnapshot offers a snapshot to this node. This initiates the snapshot sync process on the receiver.
This is one of four ABCI functions we have to implement for Tendermint/CometBFT.
func (*Accumulator) PrepareProposal ¶ added in v1.2.12
func (app *Accumulator) PrepareProposal(ctx context.Context, req *abci.RequestPrepareProposal) (*abci.ResponsePrepareProposal, error)
func (*Accumulator) ProcessProposal ¶ added in v1.2.12
func (app *Accumulator) ProcessProposal(ctx context.Context, req *abci.RequestProcessProposal) (*abci.ResponseProcessProposal, error)
func (*Accumulator) Query ¶
func (app *Accumulator) Query(_ context.Context, reqQuery *abci.RequestQuery) (*abci.ResponseQuery, error)
Query implements github.com/cometbft/cometbft/abci/types.Application.
Exposed as Tendermint RPC /abci_query.
type AccumulatorOptions ¶
type AccumulatorOptions struct { ID string // For debugging Tracer trace.Tracer Executor execute.Executor EventBus *events.Bus Logger log.Logger Snapshots *config.Snapshots Database coredb.Beginner Address crypto.Address // This is the address of this node, and is used to determine if the node is the leader Genesis node.GenesisDocProvider Partition string RootDir string AnalysisLog config.AnalysisLog MaxEnvelopesPerBlock int }
type RequestBeginBlock ¶ added in v1.2.5
type RequestBeginBlock struct { Header *abci.RequestFinalizeBlock LastCommitInfo abci.CommitInfo ByzantineValidators []abci.Misbehavior }
type ResponseEndBlock ¶ added in v1.2.5
type ResponseEndBlock struct {
ValidatorUpdates []abci.ValidatorUpdate
}