abci

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2022 License: MIT Imports: 24 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
	AccumulatorOptions
	// 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

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) OnFatal

func (app *Accumulator) OnFatal(f func(error))

FOR TESTING ONLY

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 AccumulatorOptions added in v0.4.0

type AccumulatorOptions struct {
	Chain   Chain
	DB      *database.Database
	Logger  log.Logger
	Network config.Network
	Address crypto.Address // This is the address of this node, and is used to determine if the node is the leader
}

type BeginBlockRequest

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

BeginBlockRequest is the input parameter to Chain.BeginBlock.

type BeginBlockResponse

type BeginBlockResponse struct{}

BeginBlockResponse is the return value of Chain.BeginBlock.

type Chain

type Chain interface {
	Query(q *apiQuery.Query, height int64, prove bool) (k, v []byte, err *protocol.Error)

	InitChain(state []byte, time time.Time, blockIndex int64) error

	BeginBlock(BeginBlockRequest) (BeginBlockResponse, error)
	CheckTx(*transactions.Envelope) (protocol.TransactionResult, *protocol.Error)
	DeliverTx(*transactions.Envelope) (protocol.TransactionResult, *protocol.Error)
	EndBlock(EndBlockRequest) EndBlockResponse
	Commit() ([]byte, error)
}

Chain is the interface for the Accumulate transaction (chain) validator.

type EndBlockRequest

type EndBlockRequest struct{}

EndBlockRequest is the input parameter to Chain.EndBlock

type EndBlockResponse added in v0.4.0

type EndBlockResponse struct {
	NewValidators []ed25519.PubKey
}

type SynthTxnReference

type SynthTxnReference struct {
	Type  uint64   `json:"type,omitempty" form:"type" query:"type" validate:"required"`
	Hash  [32]byte `json:"hash,omitempty" form:"hash" query:"hash" validate:"required"`
	Url   string   `json:"url,omitempty" form:"url" query:"url" validate:"required,acc-url"`
	TxRef [32]byte `json:"txRef,omitempty" form:"txRef" query:"txRef" validate:"required"`
}

SynthTxnReference is a reference to a produced synthetic transaction.

Jump to

Keyboard shortcuts

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