abci

package
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 2, 2021 License: MIT Imports: 20 Imported by: 0

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

View Source
const Version uint64 = 0x1

Version is the version of the ABCI applications.

Variables

This section is empty.

Functions

This section is empty.

Types

type Accumulator

type Accumulator struct {
	abci.BaseApplication
	// contains filtered or unexported fields
}

Accumulator is an ABCI application that accumulates validated transactions in a hash tree.

func NewAccumulator

func NewAccumulator(db State, address crypto.Address, chain Chain, logger log.Logger) (*Accumulator, error)

NewAccumulator returns a new Accumulator.

func (*Accumulator) ApplySnapshotChunk

ApplySnapshotChunk implements github.com/tendermint/tendermint/abci/types.Application.

func (*Accumulator) BeginBlock

BeginBlock implements github.com/tendermint/tendermint/abci/types.Application.

func (*Accumulator) CheckTx

func (app *Accumulator) CheckTx(req abci.RequestCheckTx) (rct abci.ResponseCheckTx)

CheckTx implements github.com/tendermint/tendermint/abci/types.Application.

Verifies the transaction is sane.

func (*Accumulator) Commit

func (app *Accumulator) Commit() (resp abci.ResponseCommit)

Commit implements github.com/tendermint/tendermint/abci/types.Application.

Commits the transaction block to the chains.

func (*Accumulator) DeliverTx

func (app *Accumulator) DeliverTx(req abci.RequestDeliverTx) (rdt abci.ResponseDeliverTx)

DeliverTx implements github.com/tendermint/tendermint/abci/types.Application.

Verifies the transaction is valid.

func (*Accumulator) EndBlock

func (app *Accumulator) EndBlock(req abci.RequestEndBlock) (resp abci.ResponseEndBlock)

EndBlock implements github.com/tendermint/tendermint/abci/types.Application.

func (*Accumulator) Info

func (app *Accumulator) Info(req abci.RequestInfo) abci.ResponseInfo

Info implements github.com/tendermint/tendermint/abci/types.Application.

func (*Accumulator) InitChain

InitChain implements github.com/tendermint/tendermint/abci/types.Application.

Called when a chain is created.

func (*Accumulator) ListSnapshots

ListSnapshots implements github.com/tendermint/tendermint/abci/types.Application.

func (*Accumulator) LoadSnapshotChunk

LoadSnapshotChunk implements github.com/tendermint/tendermint/abci/types.Application.

func (*Accumulator) OfferSnapshot

OfferSnapshot implements github.com/tendermint/tendermint/abci/types.Application.

func (*Accumulator) Query

func (app *Accumulator) Query(reqQuery abci.RequestQuery) (resQuery abci.ResponseQuery)

Query implements github.com/tendermint/tendermint/abci/types.Application.

Exposed as Tendermint RPC /abci_query.

type BeginBlockRequest

type BeginBlockRequest struct {
	IsLeader bool
	Height   int64
	Time     time.Time
}

type Chain

type Chain interface {
	Query(*apiQuery.Query) (k, v []byte, err error)

	BeginBlock(BeginBlockRequest)
	CheckTx(*transactions.GenTransaction) error
	DeliverTx(*transactions.GenTransaction) (*protocol.TxResult, error)
	EndBlock(EndBlockRequest)
	Commit() ([]byte, error)
}

type EndBlockRequest

type EndBlockRequest struct{}

type State

type State interface {
	// BlockIndex returns the current block index/height of the chain
	BlockIndex() int64

	// RootHash returns the root hash of the chain
	RootHash() []byte

	// AddStateEntry only used for genesis
	AddStateEntry(chainId *types.Bytes32, txHash *types.Bytes32, object *state.Object)

	// TODO I think this can be removed
	EnsureRootHash() []byte
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL