collections

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2021 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// EntryNotFoundError is an error for a storage entry not found
	EntryNotFoundError = "EntryNotFoundError"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type IOperatorStorage

type IOperatorStorage interface {
	GetPrivateKey() (*rsa.PrivateKey, error)
	SetupPrivateKey(operatorKey string) error
}

IOperatorStorage interface that managing all operator settings

type IbftStorage

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

IbftStorage struct instanceType is what separates different iBFT eth2 duty types (attestation, proposal and aggregation)

func NewIbft

func NewIbft(db basedb.IDb, logger *zap.Logger, instanceType string) IbftStorage

NewIbft create new ibft storage

func (*IbftStorage) GetCurrentInstance

func (i *IbftStorage) GetCurrentInstance(pk []byte) (*proto.State, error)

GetCurrentInstance func implementation

func (*IbftStorage) GetDecided

func (i *IbftStorage) GetDecided(pk []byte, seqNumber uint64) (*proto.SignedMessage, error)

GetDecided returns a signed message for an ibft instance which decided by identifier

func (*IbftStorage) GetHighestDecidedInstance

func (i *IbftStorage) GetHighestDecidedInstance(pk []byte) (*proto.SignedMessage, error)

GetHighestDecidedInstance gets a signed message for an ibft instance which is the highest

func (*IbftStorage) SaveCurrentInstance

func (i *IbftStorage) SaveCurrentInstance(pk []byte, state *proto.State) error

SaveCurrentInstance func implementation

func (*IbftStorage) SaveDecided

func (i *IbftStorage) SaveDecided(signedMsg *proto.SignedMessage) error

SaveDecided func implementation

func (*IbftStorage) SaveHighestDecidedInstance

func (i *IbftStorage) SaveHighestDecidedInstance(signedMsg *proto.SignedMessage) error

SaveHighestDecidedInstance saves a signed message for an ibft instance which is currently highest

type Iibft

type Iibft interface {
	// SaveCurrentInstance saves the state for the current running (not yet decided) instance
	SaveCurrentInstance(pk []byte, state *proto.State) error
	// GetCurrentInstance returns the state for the current running (not yet decided) instance
	GetCurrentInstance(pk []byte) (*proto.State, error)
	// SaveDecided saves a signed message for an ibft instance with decided justification
	SaveDecided(signedMsg *proto.SignedMessage) error
	// GetDecided returns a signed message for an ibft instance which decided by identifier
	GetDecided(pk []byte, seqNumber uint64) (*proto.SignedMessage, error)
	// SaveHighestDecidedInstance saves a signed message for an ibft instance which is currently highest
	SaveHighestDecidedInstance(signedMsg *proto.SignedMessage) error
	// GetHighestDecidedInstance gets a signed message for an ibft instance which is the highest
	GetHighestDecidedInstance(pk []byte) (*proto.SignedMessage, error)
}

Iibft is an interface for persisting chain data

type OperatorStorage

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

OperatorStorage implement IOperatorStorage

func NewOperatorStorage

func NewOperatorStorage(db basedb.IDb, logger *zap.Logger) OperatorStorage

NewOperatorStorage init new instance of operator storage

func (OperatorStorage) GetPrivateKey

func (o OperatorStorage) GetPrivateKey() (*rsa.PrivateKey, error)

GetPrivateKey return rsa private key

func (OperatorStorage) SetupPrivateKey

func (o OperatorStorage) SetupPrivateKey(operatorKeyBase64 string) error

SetupPrivateKey setup operator private key at the init of the node and set OperatorPublicKey config

Jump to

Keyboard shortcuts

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