service

package
v0.10.2 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2024 License: MIT Imports: 22 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDisabledService added in v0.9.8

func NewDisabledService(reg RegistrationService) *disabledService

func NewRound added in v0.9.2

func NewRound(datadir string, epoch uint, opts ...newRoundOptionFunc) (*round, error)

func WithConfig added in v0.9.2

func WithConfig(cfg Config) newServiceOptionFunc

func WithMembershipRoot added in v0.9.2

func WithMembershipRoot(root []byte) newRoundOptionFunc

Types

type ClosedRound added in v0.9.2

type ClosedRound struct {
	Epoch          uint
	MembershipRoot []byte
}

type Config

type Config struct {
	// Merkle-Tree related configuration:
	EstimatedLeavesPerSecond uint `long:"lps"              description:"Estimated number of leaves generated per second"`
	MemoryLayers             uint `long:"memory"           description:"Number of top Merkle tree layers to cache in-memory"`
	TreeFileBufferSize       uint `long:"tree-file-buffer" description:"The size of memory buffer for file-based tree layers"`
}

func DefaultConfig added in v0.9.2

func DefaultConfig() Config

type RegistrationService added in v0.9.2

type RegistrationService interface {
	RegisterForRoundClosed(ctx context.Context) <-chan ClosedRound
	NewProof(ctx context.Context, proof shared.NIP) error
}

type Service

type Service struct {
	// contains filtered or unexported fields
}

func New added in v0.9.2

func New(
	ctx context.Context,
	genesis time.Time,
	datadir string,
	registration RegistrationService,
	roundCfg roundConfig,
	opts ...newServiceOptionFunc,
) (*Service, error)

New creates a new instance of a worker service. It should be started with `Service::Run`.

func (*Service) Run added in v0.4.0

func (s *Service) Run(ctx context.Context) error

Run starts the Service's loop. It stops when the `ctx` is canceled.

Directories

Path Synopsis
Code generated by MockGen.
Code generated by MockGen.

Jump to

Keyboard shortcuts

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