Documentation ¶
Index ¶
- type Collection
- func (s *Collection) CleanAllShares() error
- func (s *Collection) GetAllValidatorsShare() ([]*Share, error)
- func (s *Collection) GetValidatorShare(key []byte) (*Share, bool, error)
- func (s *Collection) LoadFromConfig(options ShareOptions) (string, error)
- func (s *Collection) LoadMultipleFromConfig(items []ShareOptions)
- func (s *Collection) SaveValidatorShare(validator *Share) error
- type CollectionOptions
- type ICollection
- type PubKeys
- type Share
- func (s *Share) CommitteeSize() int
- func (s *Share) Deserialize(obj basedb.Obj) (*Share, error)
- func (s *Share) HasMetadata() bool
- func (s *Share) PartialThresholdSize() int
- func (s *Share) PubKeysByID(ids []uint64) (PubKeys, error)
- func (s *Share) Serialize() ([]byte, error)
- func (s *Share) ThresholdSize() int
- func (s *Share) VerifySignedMessage(msg *proto.SignedMessage) error
- type ShareOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Collection ¶
type Collection struct {
// contains filtered or unexported fields
}
Collection struct
func (*Collection) CleanAllShares ¶ added in v0.0.18
func (s *Collection) CleanAllShares() error
CleanAllShares cleans all existing shares from DB
func (*Collection) GetAllValidatorsShare ¶
func (s *Collection) GetAllValidatorsShare() ([]*Share, error)
GetAllValidatorsShare returns all shares
func (*Collection) GetValidatorShare ¶ added in v0.0.18
func (s *Collection) GetValidatorShare(key []byte) (*Share, bool, error)
GetValidatorShare by key
func (*Collection) LoadFromConfig ¶
func (s *Collection) LoadFromConfig(options ShareOptions) (string, error)
LoadFromConfig fetch validator share from config and save it to db
func (*Collection) LoadMultipleFromConfig ¶
func (s *Collection) LoadMultipleFromConfig(items []ShareOptions)
LoadMultipleFromConfig fetch multiple validators share from config and save it to db
func (*Collection) SaveValidatorShare ¶
func (s *Collection) SaveValidatorShare(validator *Share) error
SaveValidatorShare save validator share to db
type CollectionOptions ¶
CollectionOptions struct
type ICollection ¶
type ICollection interface { LoadMultipleFromConfig(items []ShareOptions) LoadFromConfig(options ShareOptions) (string, error) }
ICollection interface for validator storage
func NewCollection ¶
func NewCollection(options CollectionOptions) ICollection
NewCollection creates new share storage
type Share ¶
type Share struct {}
Share storage model
func (*Share) CommitteeSize ¶
CommitteeSize returns the IBFT committee size
func (*Share) Deserialize ¶
Deserialize key/value to Share model
func (*Share) HasMetadata ¶ added in v0.0.20
HasMetadata returns true if the validator metadata was fetched
func (*Share) PartialThresholdSize ¶ added in v0.0.14
PartialThresholdSize returns the minimum IBFT committee members that needs to sign for a partial quorum (F+1)
func (*Share) PubKeysByID ¶
PubKeysByID returns the public keys with the associated ids
func (*Share) ThresholdSize ¶
ThresholdSize returns the minimum IBFT committee members that needs to sign for a quorum (2F+1)
func (*Share) VerifySignedMessage ¶
func (s *Share) VerifySignedMessage(msg *proto.SignedMessage) error
VerifySignedMessage returns true of signed message verifies against pks
type ShareOptions ¶
type ShareOptions struct {}
ShareOptions - used to load validator share from config
func (*ShareOptions) ToShare ¶
func (options *ShareOptions) ToShare() (*Share, error)
ToShare creates a Share instance from ShareOptions