Documentation ¶
Index ¶
- Variables
- type Parameter
- func WithChecker(checker checker.Service) Parameter
- func WithEncryptor(encryptor e2wtypes.Encryptor) Parameter
- func WithFetcher(fetcher fetcher.Service) Parameter
- func WithGenerationPassphrase(generationPassphrase []byte) Parameter
- func WithGenerationTimeout(generationTimeout time.Duration) Parameter
- func WithID(id uint64) Parameter
- func WithLogLevel(logLevel zerolog.Level) Parameter
- func WithMonitor(monitor metrics.ProcessMonitor) Parameter
- func WithPeers(peers peers.Service) Parameter
- func WithSender(sender sender.Service) Parameter
- func WithStores(stores []e2wtypes.Store) Parameter
- func WithUnlocker(unlocker unlocker.Service) Parameter
- type Service
- func (s *Service) OnAbort(ctx context.Context, _ uint64, account string) error
- func (s *Service) OnCommit(ctx context.Context, _ uint64, account string, confirmationData []byte) ([]byte, []byte, error)
- func (s *Service) OnContribute(ctx context.Context, sender uint64, account string, secret bls.SecretKey, ...) (bls.SecretKey, []bls.PublicKey, error)
- func (s *Service) OnExecute(ctx context.Context, sender uint64, account string) error
- func (s *Service) OnGenerate(ctx context.Context, credentials *checker.Credentials, account string, ...) ([]byte, []*core.Endpoint, error)
- func (s *Service) OnPrepare(ctx context.Context, sender uint64, account string, passphrase []byte, ...) error
Constants ¶
This section is empty.
Variables ¶
var ErrInProgress = errors.New("in progress")
ErrInProgress is returned when a generation is in progress.
var ErrNotCreated = errors.New("not created")
ErrNotCreated is returned when a key is not created.
var ErrNotFound = errors.New("not found")
ErrNotFound is returned when a generation is not found.
var ErrNotInProgress = errors.New("not in progress")
ErrNotInProgress is returned when a generation is not in progress.
Functions ¶
This section is empty.
Types ¶
type Parameter ¶
type Parameter interface {
// contains filtered or unexported methods
}
Parameter is the interface for service parameters.
func WithChecker ¶
WithChecker sets the checker for this module.
func WithEncryptor ¶ added in v0.9.0
WithEncryptor sets the encryptor for this module.
func WithFetcher ¶ added in v1.1.0
WithFetcher sets the account fetcher for this module.
func WithGenerationPassphrase ¶
WithGenerationPassphrase sets the generation passphrase for this module.
func WithGenerationTimeout ¶ added in v1.2.0
WithGenerationTimeout sets the generation timeout for this module.
func WithLogLevel ¶
WithLogLevel sets the log level for the module.
func WithMonitor ¶
func WithMonitor(monitor metrics.ProcessMonitor) Parameter
WithMonitor sets the monitor for this module.
func WithSender ¶
WithSender sets the sender for this module.
func WithStores ¶
WithStores sets the stores for this module.
func WithUnlocker ¶
WithUnlocker sets the unlocker for this module.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is used to manage the process of distributed key generation operations.
func (*Service) OnAbort ¶
OnAbort is called when we receive a request from the given participant to abort the given DKG.
func (*Service) OnCommit ¶
func (s *Service) OnCommit(ctx context.Context, _ uint64, account string, confirmationData []byte) ([]byte, []byte, error)
OnCommit is called when we receive a request from the given participant to commit the given DKG.
func (*Service) OnContribute ¶
func (s *Service) OnContribute(ctx context.Context, sender uint64, account string, secret bls.SecretKey, vVec []bls.PublicKey) (bls.SecretKey, []bls.PublicKey, error)
OnContribute is called when we need to swap contributions with another participant.
func (*Service) OnExecute ¶
OnExecute is called when we receive a request from the given participant to execute the given DKG.
func (*Service) OnGenerate ¶
func (s *Service) OnGenerate(ctx context.Context, credentials *checker.Credentials, account string, passphrase []byte, signingThreshold uint32, numParticipants uint32, ) ([]byte, []*core.Endpoint, error)
OnGenerate is called when an request to generate a new key is received.