tripod

package
v1.2.19 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TripodInjectTag = "tripod"
	BronzeInjectTag = "bronze"
	OmitEmpty       = "omitempty"
)

Functions

func InjectToBronze added in v1.2.0

func InjectToBronze(land *Land, bronzeInstance any) error

InjectToBronze injects bronze into bronze.

func InjectToTripod added in v1.2.0

func InjectToTripod(tripodInstance any) error

InjectToTripod injects tripod/bronze into tripod.

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 Bronze added in v1.2.0

type Bronze struct {
	*env.ChainEnv
	*Land

	Instance any
	// contains filtered or unexported fields
}

func NewBronze added in v1.2.0

func NewBronze() *Bronze

func NewBronzeWithName added in v1.2.0

func NewBronzeWithName(name string) *Bronze

func ResolveBronze added in v1.2.0

func ResolveBronze(v any) *Bronze

func (*Bronze) Name added in v1.2.0

func (b *Bronze) Name() string

func (*Bronze) SetChainEnv added in v1.2.0

func (b *Bronze) SetChainEnv(env *env.ChainEnv)

func (*Bronze) SetInstance added in v1.2.0

func (b *Bronze) SetInstance(bronzeInstance any)

func (*Bronze) SetLand added in v1.2.0

func (b *Bronze) SetLand(land *Land)

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 {
	// contains filtered or unexported fields
}

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) SetBronzes added in v1.2.0

func (l *Land) SetBronzes(bronzes ...*Bronze)

func (*Land) SetTripods

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

type PreTxnHandler

type PreTxnHandler interface {
	PreHandleTxn(*SignedTxn) error
}

type Tripod

type Tripod struct {
	*env.ChainEnv
	*Land

	BlockVerifier BlockVerifier
	TxnChecker    types.TxnChecker

	Init       Init
	BlockCycle BlockCycle

	PreTxnHandler PreTxnHandler

	Committer Committer

	Instance any

	// key: p2p-handler type code
	P2pHandlers map[int]dev.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() (*types.Block, error)

func (*Tripod) GetCurrentCompactBlock

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

func (*Tripod) GetFinalized

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

func (*Tripod) GetReading

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

func (*Tripod) GetReadingFromLand

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

func (*Tripod) GetWriting

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

func (*Tripod) GetWritingFromLand

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

func (*Tripod) HandleError

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

func (*Tripod) HandleEvent

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

func (*Tripod) HandleReceipt

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

func (*Tripod) Name

func (t *Tripod) Name() string

func (*Tripod) NextTxn

func (t *Tripod) NextTxn()

func (*Tripod) PostExecute

func (t *Tripod) PostExecute(block *types.Block, receipts map[common.Hash]*types.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 *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 dev.P2pHandler) *Tripod

func (*Tripod) SetPreTxnHandler

func (t *Tripod) SetPreTxnHandler(pth PreTxnHandler)

func (*Tripod) SetReadings

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

func (*Tripod) SetTxnChecker

func (t *Tripod) SetTxnChecker(tc types.TxnChecker)

func (*Tripod) SetWritings

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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