add SyncMode to configs

pull/4465/head
“GheisMohammadi” 1 year ago
parent 30de7c27e3
commit f10dd1eec2
No known key found for this signature in database
GPG Key ID: 15073AED3829FE90
  1. 5
      cmd/harmony/default.go
  2. 1
      cmd/harmony/main.go
  3. 1
      internal/configs/harmony/harmony.go

@ -192,6 +192,7 @@ var defaultStagedSyncConfig = harmonyconfig.StagedSyncConfig{
var ( var (
defaultMainnetSyncConfig = harmonyconfig.SyncConfig{ defaultMainnetSyncConfig = harmonyconfig.SyncConfig{
Enabled: false, Enabled: false,
SyncMode: 0,
Downloader: false, Downloader: false,
StagedSync: false, StagedSync: false,
StagedSyncCfg: defaultStagedSyncConfig, StagedSyncCfg: defaultStagedSyncConfig,
@ -207,6 +208,7 @@ var (
defaultTestNetSyncConfig = harmonyconfig.SyncConfig{ defaultTestNetSyncConfig = harmonyconfig.SyncConfig{
Enabled: true, Enabled: true,
SyncMode: 0,
Downloader: false, Downloader: false,
StagedSync: false, StagedSync: false,
StagedSyncCfg: defaultStagedSyncConfig, StagedSyncCfg: defaultStagedSyncConfig,
@ -222,6 +224,7 @@ var (
defaultLocalNetSyncConfig = harmonyconfig.SyncConfig{ defaultLocalNetSyncConfig = harmonyconfig.SyncConfig{
Enabled: true, Enabled: true,
SyncMode: 0,
Downloader: true, Downloader: true,
StagedSync: true, StagedSync: true,
StagedSyncCfg: defaultStagedSyncConfig, StagedSyncCfg: defaultStagedSyncConfig,
@ -237,6 +240,7 @@ var (
defaultPartnerSyncConfig = harmonyconfig.SyncConfig{ defaultPartnerSyncConfig = harmonyconfig.SyncConfig{
Enabled: true, Enabled: true,
SyncMode: 0,
Downloader: true, Downloader: true,
StagedSync: false, StagedSync: false,
StagedSyncCfg: defaultStagedSyncConfig, StagedSyncCfg: defaultStagedSyncConfig,
@ -252,6 +256,7 @@ var (
defaultElseSyncConfig = harmonyconfig.SyncConfig{ defaultElseSyncConfig = harmonyconfig.SyncConfig{
Enabled: true, Enabled: true,
SyncMode: 0,
Downloader: true, Downloader: true,
StagedSync: false, StagedSync: false,
StagedSyncCfg: defaultStagedSyncConfig, StagedSyncCfg: defaultStagedSyncConfig,

@ -1005,6 +1005,7 @@ func setupStagedSyncService(node *node.Node, host p2p.Host, hc harmonyconfig.Har
sConfig := stagedstreamsync.Config{ sConfig := stagedstreamsync.Config{
ServerOnly: !hc.Sync.Downloader, ServerOnly: !hc.Sync.Downloader,
SyncMode: stagedstreamsync.SyncMode(hc.Sync.SyncMode),
Network: nodeconfig.NetworkType(hc.Network.NetworkType), Network: nodeconfig.NetworkType(hc.Network.NetworkType),
Concurrency: hc.Sync.Concurrency, Concurrency: hc.Sync.Concurrency,
MinStreams: hc.Sync.MinPeers, MinStreams: hc.Sync.MinPeers,

@ -329,6 +329,7 @@ type PrometheusConfig struct {
type SyncConfig struct { type SyncConfig struct {
// TODO: Remove this bool after stream sync is fully up. // TODO: Remove this bool after stream sync is fully up.
Enabled bool // enable the stream sync protocol Enabled bool // enable the stream sync protocol
SyncMode uint32 // sync mode (default:Full sync, 1: Fast Sync, 2: Snap Sync(not implemented yet))
Downloader bool // start the sync downloader client Downloader bool // start the sync downloader client
StagedSync bool // use staged sync StagedSync bool // use staged sync
StagedSyncCfg StagedSyncConfig // staged sync configurations StagedSyncCfg StagedSyncConfig // staged sync configurations

Loading…
Cancel
Save