Documentation ¶ Index ¶ Constants type Agent func New(overlay swarm.Address, backend ChainBackend, logger log.Logger, ...) *Agent func (a *Agent) Close() error func (s *Agent) Metrics() []prometheus.Collector type ChainBackend type Monitor type PhaseType func (p PhaseType) String() string type Sampler Constants ¶ View Source const ( DefaultBlocksPerRound = 152 DefaultBlocksPerPhase = DefaultBlocksPerRound / 4 ) Variables ¶ This section is empty. Functions ¶ This section is empty. Types ¶ type Agent ¶ type Agent struct { // contains filtered or unexported fields } func New ¶ func New( overlay swarm.Address, backend ChainBackend, logger log.Logger, monitor Monitor, contract redistribution.Contract, reserve postage.Storer, sampler Sampler, blockTime time.Duration, blocksPerRound, blocksPerPhase uint64) *Agent func (*Agent) Close ¶ func (a *Agent) Close() error func (*Agent) Metrics ¶ func (s *Agent) Metrics() []prometheus.Collector TODO: register metric type ChainBackend ¶ type ChainBackend interface { BlockNumber(context.Context) (uint64, error) } type Monitor ¶ type Monitor interface { IsFullySynced() bool } type PhaseType ¶ type PhaseType int func (PhaseType) String ¶ func (p PhaseType) String() string type Sampler ¶ type Sampler interface { ReserveSample(context.Context, []byte, uint8) (storage.Sample, error) } Source Files ¶ View all Source files agent.go events.go metrics.go Directories ¶ Show internal Expand all Path Synopsis redistribution staking mock Click to show internal directories. Click to hide internal directories.