Documentation
¶
Index ¶
- type Service
- func (s *Service) Forward(ctx context.Context) error
- func (s *Service) ListenToPolicies(ctx context.Context) error
- func (s *Service) Run(ctx context.Context)
- func (s *Service) ServeInstruction(_ context.Context, i *instruction.Instruction) (*pkgvoting.Receipt, error)
- func (s *Service) Statuses(instructionID common.Hash, rewardEpochID uint32) (*pkgvoting.Statuses, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service processes incoming instructions and manages threshold-based voting consensus.
func NewService ¶
func NewService(votingCfg *config.Voting, teeID common.Address, privKey *ecdsa.PrivateKey, policiesChan <-chan policy.SigningPolicy, aq *queue.ActionQueues, meta meta.Meta) Service
NewService creates a new instruction Service with the given voting config, TEE identity, signing key, and dependencies.
func (*Service) ListenToPolicies ¶
ListenToPolicies listens to policy channel and creates a new round when a new policy arrives.
func (*Service) ServeInstruction ¶
func (s *Service) ServeInstruction(_ context.Context, i *instruction.Instruction) (*pkgvoting.Receipt, error)
ServeInstruction accepts instruction, processes it, and returns the receipt.
It checks that:
- correct teeID is set
- has a valid opType, opCommand pair
Additional checks are done by the voting storage.
Click to show internal directories.
Click to hide internal directories.