standard

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2023 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInProgress = errors.New("in progress")

ErrInProgress is returned when a generation is in progress.

View Source
var ErrNotCreated = errors.New("not created")

ErrNotCreated is returned when a key is not created.

View Source
var ErrNotFound = errors.New("not found")

ErrNotFound is returned when a generation is not found.

View Source
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

func WithChecker(checker checker.Service) Parameter

WithChecker sets the checker for this module.

func WithEncryptor added in v0.9.0

func WithEncryptor(encryptor e2wtypes.Encryptor) Parameter

WithEncryptor sets the encryptor for this module.

func WithFetcher added in v1.1.0

func WithFetcher(fetcher fetcher.Service) Parameter

WithFetcher sets the account fetcher for this module.

func WithGenerationPassphrase

func WithGenerationPassphrase(generationPassphrase []byte) Parameter

WithGenerationPassphrase sets the generation passphrase for this module.

func WithGenerationTimeout added in v1.2.0

func WithGenerationTimeout(generationTimeout time.Duration) Parameter

WithGenerationTimeout sets the generation timeout for this module.

func WithID

func WithID(id uint64) Parameter

WithID sets the ID for this module.

func WithLogLevel

func WithLogLevel(logLevel zerolog.Level) Parameter

WithLogLevel sets the log level for the module.

func WithMonitor

func WithMonitor(monitor metrics.ProcessMonitor) Parameter

WithMonitor sets the monitor for this module.

func WithPeers

func WithPeers(peers peers.Service) Parameter

WithPeers sets the peers for this module.

func WithSender

func WithSender(sender sender.Service) Parameter

WithSender sets the sender for this module.

func WithStores

func WithStores(stores []e2wtypes.Store) Parameter

WithStores sets the stores for this module.

func WithUnlocker

func WithUnlocker(unlocker unlocker.Service) Parameter

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 New

func New(_ context.Context, params ...Parameter) (*Service, error)

New creates a new process service.

func (*Service) OnAbort

func (s *Service) OnAbort(ctx context.Context, _ uint64, account string) error

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

func (s *Service) OnExecute(ctx context.Context, sender uint64, account string) error

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.

func (*Service) OnPrepare

func (s *Service) OnPrepare(ctx context.Context,
	sender uint64,
	account string,
	passphrase []byte,
	threshold uint32,
	participants []*core.Endpoint,
) error

OnPrepare is called when we receive a request from the given participant to prepare for DKG.

Jump to

Keyboard shortcuts

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