admin

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Index

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

func (ah *Handlers) AddPrivateKey(pk []byte, curveSpec constants.CurveSpec) error

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) Close

func (ah *Handlers) Close()

Close shuts down all workers

func (*Handlers) GetKey

func (ah *Handlers) GetKey(kid []byte) ([]byte, error)

GetKey allows the admin handler to act as a key resolver for decrypting stored private keys

func (*Handlers) GetPrivK

func (ah *Handlers) GetPrivK(name []byte) ([]byte, error)

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

func (ah *Handlers) IsInitialized() bool

IsInitialized returns if the database has been initialized yet

func (*Handlers) IsSynchronized

func (ah *Handlers) IsSynchronized() bool

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

func (ah *Handlers) SetSynchronized(v bool)

SetSynchronized allows the BC monitor to set the sync state for ethereum

Jump to

Keyboard shortcuts

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