mantlemint

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewConcurrentQueryClient

func NewConcurrentQueryClient(mtx *tmsync.RWMutex, app types.Application) abcicli.Client

NewConcurrentQueryClient creates a local client, which will be directly calling the methods of the given app. + uses RWMutex for reads

func NewConcurrentQueryClientCreator

func NewConcurrentQueryClientCreator(app types.Application) proxy.ClientCreator

func NewMantlemintExecutor

func NewMantlemintExecutor(
	db tmdb.DB,
	conn proxy.AppConnConsensus,
) *state.BlockExecutor

NewMantlemintExecutor creates stock tendermint block executor, with stubbed mempool and evidence pool

Types

type EventCollector

type EventCollector struct {
	Height             int64
	Block              *tm.Block
	ResponseBeginBlock *abci.ResponseBeginBlock
	ResponseEndBlock   *abci.ResponseEndBlock
	ResponseDeliverTxs []*abci.ResponseDeliverTx
}

func NewMantlemintEventCollector

func NewMantlemintEventCollector() *EventCollector

func (*EventCollector) PublishEventNewBlock

func (ev *EventCollector) PublishEventNewBlock(
	block tm.EventDataNewBlock,
) error

PublishEventNewBlock collects block, ResponseBeginBlock, ResponseEndBlock

func (*EventCollector) PublishEventNewBlockHeader

func (ev *EventCollector) PublishEventNewBlockHeader(
	_ tm.EventDataNewBlockHeader,
) error

PublishEventNewBlockHeader unused

func (*EventCollector) PublishEventNewEvidence

func (ev *EventCollector) PublishEventNewEvidence(_ tm.EventDataNewEvidence) error

PublishEventNewEvidence unused

func (*EventCollector) PublishEventTx

func (ev *EventCollector) PublishEventTx(
	txEvent tm.EventDataTx,
) error

PublishEventTx collect txResult in order

func (*EventCollector) PublishEventValidatorSetUpdates

func (ev *EventCollector) PublishEventValidatorSetUpdates(
	_ tm.EventDataValidatorSetUpdates,
) error

PublishEventValidatorSetUpdates unused

type Executor

type Executor interface {
	ApplyBlock(state.State, tendermint.BlockID, *tendermint.Block) (state.State, int64, error)
	SetEventBus(publisher tendermint.BlockEventPublisher)
}

type Instance

type Instance struct {
	// contains filtered or unexported fields
}

func (*Instance) GetCurrentBlock

func (mm *Instance) GetCurrentBlock() *tendermint.Block

func (*Instance) GetCurrentEventCollector

func (mm *Instance) GetCurrentEventCollector() *EventCollector

func (*Instance) GetCurrentHeight

func (mm *Instance) GetCurrentHeight() int64

func (*Instance) GetCurrentState

func (mm *Instance) GetCurrentState() state.State

func (*Instance) Init

func (mm *Instance) Init(genesis *tendermint.GenesisDoc) error

Init is port of ReplayBlocks() from tendermint, where it only handles initializing the chain.

func (*Instance) Inject

func (mm *Instance) Inject(block *tendermint.Block) error

func (*Instance) LoadInitialState

func (mm *Instance) LoadInitialState() error

func (*Instance) SetBlockExecutor

func (mm *Instance) SetBlockExecutor(nextBlockExecutor Executor)

type Mantlemint

type Mantlemint interface {
	Inject(*tendermint.Block) error
	Init(*tendermint.GenesisDoc) error
	LoadInitialState() error
	GetCurrentHeight() int64
	GetCurrentBlock() *tendermint.Block
	GetCurrentState() state.State
	GetCurrentEventCollector() *EventCollector
	SetBlockExecutor(executor Executor)
}

func NewMantlemint

func NewMantlemint(
	db tmdb.DB,
	conn proxy.AppConns,
	executor Executor,
	runBefore MantlemintCallbackBefore,
	runAfter MantlemintCallbackAfter,
) Mantlemint

type MantlemintCallbackAfter

type MantlemintCallbackAfter func(block *tendermint.Block, events *EventCollector) error

type MantlemintCallbackBefore

type MantlemintCallbackBefore func(block *tendermint.Block) error

Jump to

Keyboard shortcuts

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