Documentation ¶
Index ¶
- type Handlers
- func (ah *Handlers) AddPrivateKey(pk []byte, curveSpec constants.CurveSpec) error
- func (ah *Handlers) AddSnapshot(bh *objs.BlockHeader, safeToProceedConsensus bool) error
- func (ah *Handlers) AddValidatorSet(v *objs.ValidatorSet) error
- func (ah *Handlers) AddValidatorSetEdgecase(txn *badger.Txn, v *objs.ValidatorSet) error
- func (ah *Handlers) Close()
- func (ah *Handlers) GetKey(kid []byte) ([]byte, error)
- func (ah *Handlers) GetPrivK(name []byte) ([]byte, error)
- func (ah *Handlers) Init(chainID uint32, database *db.Database, secret []byte, ...)
- func (ah *Handlers) InitializationMonitor(closeChan <-chan struct{})
- func (ah *Handlers) IsInitialized() bool
- func (ah *Handlers) IsSynchronized() bool
- func (ah *Handlers) RegisterSnapshotCallback(fn func(bh *objs.BlockHeader, numOfValidators, validatorIndex int) error)
- func (ah *Handlers) SetSynchronized(v bool)
- func (ah *Handlers) UpdateDynamicStorage(epoch uint32, rawDynamics []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handlers ¶
type Handlers struct { sync.RWMutex ReceiveLock chan interfaces.Lockable // contains filtered or unexported fields }
Handlers Is a private bus for internal service use. At this time the only reason to use this bus is to enable blockchain events to be fed into the system and for accusations to be fed out of the system and into the Ethereum blockchain.
func (*Handlers) AddPrivateKey ¶
AddPrivateKey stores a private key from an EthDKG run into an encrypted keystore in the DB.
func (*Handlers) AddSnapshot ¶
func (ah *Handlers) AddSnapshot(bh *objs.BlockHeader, safeToProceedConsensus bool) error
AddSnapshot stores a snapshot to the database.
func (*Handlers) AddValidatorSet ¶
func (ah *Handlers) AddValidatorSet(v *objs.ValidatorSet) error
AddValidatorSet adds a validator set to the db This function also creates the first block and initializes the genesis state when the first validator set is written.
func (*Handlers) AddValidatorSetEdgecase ¶
func (ah *Handlers) AddValidatorSetEdgecase(txn *badger.Txn, v *objs.ValidatorSet) error
AddValidatorSetEdgecase adds a validator set to the db if we have the expected block at the height 'v.NotBefore-1' (e.g syncing from the ethereum data). Otherwise, it will mark the change to happen in the future once we have the required block.
func (*Handlers) GetKey ¶
GetKey allows the admin handler to act as a key resolver for decrypting stored private keys.
func (*Handlers) GetPrivK ¶
GetPrivK returns an decrypted private key from an EthDKG run to the caller.
func (*Handlers) Init ¶
func (ah *Handlers) Init(chainID uint32, database *db.Database, secret []byte, appHandler interfaces.Application, ethPubk []byte, storage dynamics.StorageGetter)
Init creates all fields and binds external services.
func (*Handlers) InitializationMonitor ¶
func (ah *Handlers) InitializationMonitor(closeChan <-chan struct{})
InitializationMonitor polls the database for the existence of a snapshot It sets IsInitialized when one is found and returns.
func (*Handlers) IsInitialized ¶
IsInitialized returns if the database has been initialized yet.
func (*Handlers) IsSynchronized ¶
IsSynchronized returns if the ethereum BC has been/is synchronized.
func (*Handlers) RegisterSnapshotCallback ¶
func (ah *Handlers) RegisterSnapshotCallback(fn func(bh *objs.BlockHeader, numOfValidators, validatorIndex int) error)
RegisterSnapshotCallback allows a callback to be registered that will be called on snapshot blocks being added to the local db.
func (*Handlers) SetSynchronized ¶
SetSynchronized allows the BC monitor to set the sync state for ethereum.