github.com/iotexproject/iotex-core@v1.14.1-rc1/blocksync/config.go (about) 1 // Copyright (c) 2022 IoTeX Foundation 2 // This source code is provided 'as is' and no warranties are given as to title or non-infringement, merchantability 3 // or fitness for purpose and, to the extent permitted by law, all liability for your use of the code is disclaimed. 4 // This source code is governed by Apache License 2.0 that can be found in the LICENSE file. 5 6 package blocksync 7 8 import "time" 9 10 // Config is the config struct for the BlockSync 11 type Config struct { 12 Interval time.Duration `yaml:"interval"` // update duration 13 ProcessSyncRequestTTL time.Duration `yaml:"processSyncRequestTTL"` 14 BufferSize uint64 `yaml:"bufferSize"` 15 IntervalSize uint64 `yaml:"intervalSize"` 16 // MaxRepeat is the maximal number of repeat of a block sync request 17 MaxRepeat int `yaml:"maxRepeat"` 18 // RepeatDecayStep is the step for repeat number decreasing by 1 19 RepeatDecayStep int `yaml:"repeatDecayStep"` 20 } 21 22 // DefaultConfig is the default config 23 var DefaultConfig = Config{ 24 Interval: 30 * time.Second, 25 ProcessSyncRequestTTL: 10 * time.Second, 26 BufferSize: 200, 27 IntervalSize: 20, 28 MaxRepeat: 3, 29 RepeatDecayStep: 1, 30 }