tripod

package
v1.0.15 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2024 License: GPL-3.0 Imports: 12 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	InjectTag = "tripod"
	OmitEmpty = "omitempty"
)

Functions

func Inject

func Inject(tripodInterface interface{}) error

Types

type BlockCycle

type BlockCycle interface {
	StartBlock(block *Block)
	EndBlock(block *Block)
	FinalizeBlock(block *Block)
}

type BlockVerifier

type BlockVerifier interface {
	VerifyBlock(block *Block) error
}

type Committer

type Committer interface {
	Commit(ctx *Block)
}

type DefaultBlockCycle

type DefaultBlockCycle struct{}

func (*DefaultBlockCycle) EndBlock

func (*DefaultBlockCycle) EndBlock(*Block)

func (*DefaultBlockCycle) FinalizeBlock

func (*DefaultBlockCycle) FinalizeBlock(*Block)

func (*DefaultBlockCycle) StartBlock

func (*DefaultBlockCycle) StartBlock(*Block)

type DefaultBlockVerifier

type DefaultBlockVerifier struct{}

func (*DefaultBlockVerifier) VerifyBlock

func (*DefaultBlockVerifier) VerifyBlock(*Block) error

type DefaultCommitter

type DefaultCommitter struct{}

func (*DefaultCommitter) Commit

func (*DefaultCommitter) Commit(*Block)

type DefaultInit

type DefaultInit struct{}

func (*DefaultInit) InitChain

func (*DefaultInit) InitChain(*Block)

type DefaultPreTxnHandler

type DefaultPreTxnHandler struct{}

func (*DefaultPreTxnHandler) PreHandleTxn

func (*DefaultPreTxnHandler) PreHandleTxn(*SignedTxn) error

type DefaultTxnChecker

type DefaultTxnChecker struct{}

func (*DefaultTxnChecker) CheckTxn

func (*DefaultTxnChecker) CheckTxn(*SignedTxn) error

type GrpcLand

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

func NewGrpcLand

func NewGrpcLand(land *Land) *GrpcLand

type Init

type Init interface {
	InitChain(block *Block)
}

type Land

type Land struct {
	OrderedTripods []*Tripod
	// Key: the Name of Tripod
	TripodsMap map[string]*Tripod
}

func NewLand

func NewLand() *Land

func (*Land) GetReading

func (l *Land) GetReading(tripodName, rdName string) (Reading, error)

func (*Land) GetTripod

func (l *Land) GetTripod(name string) *Tripod

func (*Land) GetTripodInstance

func (l *Land) GetTripodInstance(name string) interface{}

func (*Land) GetWriting

func (l *Land) GetWriting(tripodName, wrName string) (Writing, error)

func (*Land) RangeList

func (l *Land) RangeList(fn func(*Tripod) error) error

func (*Land) RangeMap

func (l *Land) RangeMap(fn func(string, *Tripod) error) error

func (*Land) SetTripods

func (l *Land) SetTripods(Tripods ...*Tripod)

type PreTxnHandler

type PreTxnHandler interface {
	PreHandleTxn(*SignedTxn) error
}

type Tripod

type Tripod struct {
	*ChainEnv
	*Land

	BlockVerifier BlockVerifier
	TxnChecker    TxnChecker

	Init       Init
	BlockCycle BlockCycle

	PreTxnHandler PreTxnHandler

	Committer Committer

	Instance interface{}

	// key: p2p-handler type code
	P2pHandlers map[int]P2pHandler
	// contains filtered or unexported fields
}

func NewTripod

func NewTripod() *Tripod

func NewTripodWithName

func NewTripodWithName(name string) *Tripod

func ResolveTripod

func ResolveTripod(v interface{}) *Tripod

func (*Tripod) AllReadingNames

func (t *Tripod) AllReadingNames() []string

func (*Tripod) AllWritingNames

func (t *Tripod) AllWritingNames() []string

func (*Tripod) CommitState

func (t *Tripod) CommitState() (common.Hash, error)

func (*Tripod) Delete

func (t *Tripod) Delete(key []byte)

func (*Tripod) Discard

func (t *Tripod) Discard()

func (*Tripod) DiscardAll

func (t *Tripod) DiscardAll()

func (*Tripod) Exist

func (t *Tripod) Exist(key []byte) bool

func (*Tripod) ExistWriting

func (t *Tripod) ExistWriting(name string) bool

func (*Tripod) Get

func (t *Tripod) Get(key []byte) ([]byte, error)

func (*Tripod) GetByBlockHash

func (t *Tripod) GetByBlockHash(key []byte, block *types.Block) ([]byte, error)

func (*Tripod) GetCurrentBlock

func (t *Tripod) GetCurrentBlock() (*Block, error)

func (*Tripod) GetCurrentCompactBlock

func (t *Tripod) GetCurrentCompactBlock() (*CompactBlock, error)

func (*Tripod) GetFinalized

func (t *Tripod) GetFinalized(key []byte) ([]byte, error)

func (*Tripod) GetReading

func (t *Tripod) GetReading(name string) Reading

func (*Tripod) GetReadingFromLand

func (t *Tripod) GetReadingFromLand(tripodName, funcName string) (Reading, error)

func (*Tripod) GetWriting

func (t *Tripod) GetWriting(name string) Writing

func (*Tripod) GetWritingFromLand

func (t *Tripod) GetWritingFromLand(tripodName, funcName string) (Writing, error)

func (*Tripod) HandleError

func (t *Tripod) HandleError(err error, ctx *context.WriteContext, block *Block, stxn *SignedTxn) *Receipt

func (*Tripod) HandleEvent

func (t *Tripod) HandleEvent(ctx *context.WriteContext, block *Block, stxn *SignedTxn) *Receipt

func (*Tripod) HandleReceipt

func (t *Tripod) HandleReceipt(ctx *context.WriteContext, receipt *Receipt, block *Block, stxn *SignedTxn)

func (*Tripod) Name

func (t *Tripod) Name() string

func (*Tripod) NextTxn

func (t *Tripod) NextTxn()

func (*Tripod) PostExecute

func (t *Tripod) PostExecute(block *Block, receipts map[Hash]*Receipt) error

func (*Tripod) Set

func (t *Tripod) Set(key, value []byte)

func (*Tripod) SetBlockCycle

func (t *Tripod) SetBlockCycle(bc BlockCycle)

func (*Tripod) SetBlockVerifier

func (t *Tripod) SetBlockVerifier(bv BlockVerifier)

func (*Tripod) SetChainEnv

func (t *Tripod) SetChainEnv(env *ChainEnv)

func (*Tripod) SetCommitter

func (t *Tripod) SetCommitter(c Committer)

func (*Tripod) SetInit

func (t *Tripod) SetInit(init Init)

func (*Tripod) SetInstance

func (t *Tripod) SetInstance(tripodInstance any)

func (*Tripod) SetLand

func (t *Tripod) SetLand(land *Land)

func (*Tripod) SetP2pHandler

func (t *Tripod) SetP2pHandler(code int, handler P2pHandler) *Tripod

func (*Tripod) SetPreTxnHandler

func (t *Tripod) SetPreTxnHandler(pth PreTxnHandler)

func (*Tripod) SetReadings

func (t *Tripod) SetReadings(readings ...Reading)

func (*Tripod) SetTxnChecker

func (t *Tripod) SetTxnChecker(tc TxnChecker)

func (*Tripod) SetWritings

func (t *Tripod) SetWritings(wrs ...Writing)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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