Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNotExist indicates certain item does not exist in Blockchain database ErrNotExist = errors.New("not exist in DB") // ErrAlreadyExist indicates certain item already exists in Blockchain database ErrAlreadyExist = errors.New("already exist in DB") // ErrUnimplemented indicates a method is not implemented yet ErrUnimplemented = errors.New("method is unimplemented") )
Functions ¶
func GetEpochHeight ¶
GetEpochHeight gets the start height of an epoch
Types ¶
type Account ¶
type Account struct { // InitBalanceMap is the address and initial balance mapping before the first block. InitBalanceMap map[string]string `yaml:"initBalances"` }
Account contains the configs for account protocol
type BlockHandler ¶
BlockHandler ishte interface of handling block
type Genesis ¶
type Genesis struct {
Account `yaml:"account"`
}
Genesis defines the genesis configurations that should be recorded by the corresponding protocol before indexing the first block
type Protocol ¶
type Protocol interface { BlockHandler CreateTables(context.Context) error Initialize(context.Context, *sql.Tx, *Genesis) error }
Protocol defines the protocol interfaces for block indexer
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry is the hub of all protocols deployed on the chain
func (*Registry) ForceRegister ¶
ForceRegister registers the protocol with a unique ID and force replacing the previous protocol if it exists
Click to show internal directories.
Click to hide internal directories.