Documentation ¶
Index ¶
- Constants
- type Agent
- type ChainBackend
- type Monitor
- type PhaseType
- type RedistributionState
- func (r *RedistributionState) AddFee(ctx context.Context, txHash common.Hash)
- func (r *RedistributionState) CalculateWinnerReward(ctx context.Context) error
- func (r *RedistributionState) IsFullySynced(isSynced bool)
- func (r *RedistributionState) SetBalance(ctx context.Context) error
- func (r *RedistributionState) SetCurrentEvent(phase PhaseType, round uint64, block uint64)
- func (r *RedistributionState) SetFrozen(isFrozen bool, round uint64)
- func (r *RedistributionState) SetLastPlayedRound(round uint64)
- func (r *RedistributionState) SetLastWonRound(round uint64)
- func (r *RedistributionState) Status() (*Status, error)
- type Status
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, ethAddress common.Address, backend ChainBackend, logger log.Logger, monitor Monitor, contract redistribution.Contract, batchExpirer postagecontract.PostageBatchExpirer, redistributionStatuser staking.RedistributionStatuser, radius postage.RadiusChecker, sampler storage.Sampler, blockTime time.Duration, blocksPerRound, blocksPerPhase uint64, stateStore storage.StateStorer, erc20Service erc20.Service, tranService transaction.Service) (*Agent, error)
func (*Agent) HasEnoughFundsToPlay ¶ added in v1.13.0
type ChainBackend ¶
type RedistributionState ¶ added in v1.12.0
type RedistributionState struct {
// contains filtered or unexported fields
}
func NewRedistributionState ¶ added in v1.12.0
func NewRedistributionState(logger log.Logger, ethAddress common.Address, stateStore storage.StateStorer, erc20Service erc20.Service, contract transaction.Service) (*RedistributionState, error)
func (*RedistributionState) AddFee ¶ added in v1.12.0
func (r *RedistributionState) AddFee(ctx context.Context, txHash common.Hash)
AddFee sets the internal node status
func (*RedistributionState) CalculateWinnerReward ¶ added in v1.12.0
func (r *RedistributionState) CalculateWinnerReward(ctx context.Context) error
CalculateWinnerReward calculates the reward for the winner
func (*RedistributionState) IsFullySynced ¶ added in v1.12.0
func (r *RedistributionState) IsFullySynced(isSynced bool)
func (*RedistributionState) SetBalance ¶ added in v1.12.0
func (r *RedistributionState) SetBalance(ctx context.Context) error
func (*RedistributionState) SetCurrentEvent ¶ added in v1.12.0
func (r *RedistributionState) SetCurrentEvent(phase PhaseType, round uint64, block uint64)
func (*RedistributionState) SetFrozen ¶ added in v1.12.0
func (r *RedistributionState) SetFrozen(isFrozen bool, round uint64)
func (*RedistributionState) SetLastPlayedRound ¶ added in v1.12.0
func (r *RedistributionState) SetLastPlayedRound(round uint64)
func (*RedistributionState) SetLastWonRound ¶ added in v1.12.0
func (r *RedistributionState) SetLastWonRound(round uint64)
func (*RedistributionState) Status ¶ added in v1.12.0
func (r *RedistributionState) Status() (*Status, error)
Status returns the node status
Click to show internal directories.
Click to hide internal directories.