Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Download ¶
func Download( ctx context.Context, retryInterval time.Duration, logger *zap.Logger, db sql.StateDatabase, fetcher system.AtxFetcher, set []types.ATXID, ) error
Download specified set of atxs from peers in the network.
Actual retry interval will be between [retryInterval, 2*retryInterval].
Types ¶
type Config ¶ added in v1.4.0
type Config struct { // EpochInfoInterval between epoch info requests to the network. EpochInfoInterval time.Duration `mapstructure:"epoch-info-request-interval"` // EpochInfoPeers is the number of peers we will ask for epoch info, every epoch info requests interval. EpochInfoPeers int `mapstructure:"epoch-info-peers"` // RequestsLimit is the maximum number of requests for single activation. // // The purpose of it is to prevent peers from advertising invalid atx and disappearing. // Which will make node ask other peers for invalid atx. // It will be reset to 0 once atx advertised again. RequestsLimit int `mapstructure:"requests-limit"` // AtxsBatch is the maximum number of atxs to sync in a single request. AtxsBatch int `mapstructure:"atxs-batch"` // ProgressFraction will report progress every fraction from total is downloaded. ProgressFraction float64 `mapstructure:"progress-every-fraction"` // ProgressInterval will report progress every interval. ProgressInterval time.Duration `mapstructure:"progress-on-time"` }
func DefaultConfig ¶ added in v1.4.0
func DefaultConfig() Config
type Opt ¶ added in v1.4.0
type Opt func(*Syncer)
func WithConfig ¶ added in v1.4.0
func WithLogger ¶ added in v1.4.0
Click to show internal directories.
Click to hide internal directories.