diff --git a/cmd/harmony/default.go b/cmd/harmony/default.go index 986a2f7f6..86ed4226a 100644 --- a/cmd/harmony/default.go +++ b/cmd/harmony/default.go @@ -192,6 +192,7 @@ var defaultStagedSyncConfig = harmonyconfig.StagedSyncConfig{ var ( defaultMainnetSyncConfig = harmonyconfig.SyncConfig{ Enabled: false, + SyncMode: 0, Downloader: false, StagedSync: false, StagedSyncCfg: defaultStagedSyncConfig, @@ -207,6 +208,7 @@ var ( defaultTestNetSyncConfig = harmonyconfig.SyncConfig{ Enabled: true, + SyncMode: 0, Downloader: false, StagedSync: false, StagedSyncCfg: defaultStagedSyncConfig, @@ -222,6 +224,7 @@ var ( defaultLocalNetSyncConfig = harmonyconfig.SyncConfig{ Enabled: true, + SyncMode: 0, Downloader: true, StagedSync: true, StagedSyncCfg: defaultStagedSyncConfig, @@ -237,6 +240,7 @@ var ( defaultPartnerSyncConfig = harmonyconfig.SyncConfig{ Enabled: true, + SyncMode: 0, Downloader: true, StagedSync: false, StagedSyncCfg: defaultStagedSyncConfig, @@ -252,6 +256,7 @@ var ( defaultElseSyncConfig = harmonyconfig.SyncConfig{ Enabled: true, + SyncMode: 0, Downloader: true, StagedSync: false, StagedSyncCfg: defaultStagedSyncConfig, diff --git a/cmd/harmony/main.go b/cmd/harmony/main.go index 549237d1c..a29698f40 100644 --- a/cmd/harmony/main.go +++ b/cmd/harmony/main.go @@ -1005,6 +1005,7 @@ func setupStagedSyncService(node *node.Node, host p2p.Host, hc harmonyconfig.Har sConfig := stagedstreamsync.Config{ ServerOnly: !hc.Sync.Downloader, + SyncMode: stagedstreamsync.SyncMode(hc.Sync.SyncMode), Network: nodeconfig.NetworkType(hc.Network.NetworkType), Concurrency: hc.Sync.Concurrency, MinStreams: hc.Sync.MinPeers, diff --git a/internal/configs/harmony/harmony.go b/internal/configs/harmony/harmony.go index 2fcb200c4..7ff250148 100644 --- a/internal/configs/harmony/harmony.go +++ b/internal/configs/harmony/harmony.go @@ -329,6 +329,7 @@ type PrometheusConfig struct { type SyncConfig struct { // TODO: Remove this bool after stream sync is fully up. 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 StagedSync bool // use staged sync StagedSyncCfg StagedSyncConfig // staged sync configurations