Documentation ¶
Index ¶
- type Handlers
- func (ah *Handlers) AddPrivateKey(pk []byte, curveSpec constants.CurveSpec) error
- func (ah *Handlers) AddSnapshot(bh *objs.BlockHeader, startingEthDKG bool) error
- func (ah *Handlers) AddValidatorSet(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, ...) error
- 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) error)
- func (ah *Handlers) SetSynchronized(v bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handlers ¶
type Handlers struct { sync.RWMutex RequestLock chan struct{} 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, startingEthDKG 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) 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 appmock.Application, ethPubk []byte) error
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) 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