Documentation
¶
Index ¶
- Constants
- type IOperatorStorage
- type IbftStorage
- func (i *IbftStorage) GetCurrentInstance(pk []byte) (*proto.State, error)
- func (i *IbftStorage) GetDecided(pk []byte, seqNumber uint64) (*proto.SignedMessage, error)
- func (i *IbftStorage) GetHighestDecidedInstance(pk []byte) (*proto.SignedMessage, error)
- func (i *IbftStorage) SaveCurrentInstance(pk []byte, state *proto.State) error
- func (i *IbftStorage) SaveDecided(signedMsg *proto.SignedMessage) error
- func (i *IbftStorage) SaveHighestDecidedInstance(signedMsg *proto.SignedMessage) error
- type Iibft
- type OperatorStorage
Constants ¶
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 (*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