node

package
v0.0.0-...-ee95d54 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2023 License: GPL-3.0 Imports: 38 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAdaptedReDKG

func GetAdaptedReDKG(originalDKG *types.ReDKG) (*types.ReDKG, error)

Types

type BaseNodeService

type BaseNodeService struct {
	sync.Mutex

	Logger logger.Logger

	SkipCommKeysVerification bool
	// contains filtered or unexported fields
}

func (*BaseNodeService) ApproveParticipation

func (s *BaseNodeService) ApproveParticipation(dto *dto.OperationIdDTO) error

func (*BaseNodeService) GetLogger

func (s *BaseNodeService) GetLogger() logger.Logger

func (*BaseNodeService) GetPubKey

func (s *BaseNodeService) GetPubKey() ed25519.PublicKey

func (*BaseNodeService) GetSkipCommKeysVerification

func (s *BaseNodeService) GetSkipCommKeysVerification() bool

func (*BaseNodeService) GetStateOffset

func (s *BaseNodeService) GetStateOffset() (uint64, error)

func (*BaseNodeService) GetUsername

func (s *BaseNodeService) GetUsername() string

func (*BaseNodeService) Poll

func (s *BaseNodeService) Poll() error

Poll is a main node loop, which gets new messages from an append-only log and processes them

func (*BaseNodeService) ProcessMessage

func (s *BaseNodeService) ProcessMessage(message storage.Message) error

func (*BaseNodeService) ProcessOperation

func (s *BaseNodeService) ProcessOperation(dto *dto.OperationDTO) error

ProcessOperation handles an operation which was processed by the airgapped machine It checks that the operation exists in an operation pool, signs the operation, sends it to an append-only log and deletes it from the pool.

func (*BaseNodeService) ProposeSignMessages

func (s *BaseNodeService) ProposeSignMessages(dtoMsg *dto.ProposeSignBatchMessagesDTO) error

func (*BaseNodeService) ReInitDKG

func (s *BaseNodeService) ReInitDKG(dto *dto.ReInitDKGDTO) error

func (*BaseNodeService) SaveOffset

func (s *BaseNodeService) SaveOffset(dto *dto.StateOffsetDTO) error

func (*BaseNodeService) SendMessage

func (s *BaseNodeService) SendMessage(dto *dto.MessageDTO) error

func (*BaseNodeService) SetSkipCommKeysVerification

func (s *BaseNodeService) SetSkipCommKeysVerification(b bool)

func (*BaseNodeService) StartDKG

func (s *BaseNodeService) StartDKG(dto *dto.StartDkgDTO) error

type NodeService

type NodeService interface {
	Poll() error
	GetLogger() logger.Logger
	GetPubKey() ed25519.PublicKey
	GetUsername() string
	ApproveParticipation(dto *dto.OperationIdDTO) error
	SendMessage(dto *dto.MessageDTO) error
	ProcessMessage(message storage.Message) error
	ProcessOperation(dto *dto.OperationDTO) error
	StartDKG(dto *dto.StartDkgDTO) error
	ReInitDKG(dto *dto.ReInitDKGDTO) error
	SetSkipCommKeysVerification(bool)
	ProposeSignMessages(dto *dto.ProposeSignBatchMessagesDTO) error
	SaveOffset(dto *dto.StateOffsetDTO) error
	GetStateOffset() (uint64, error)
}

func NewNode

func NewNode(ctx context.Context, config *config.Config, sp *services.ServiceProvider) (NodeService, error)

Jump to

Keyboard shortcuts

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