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 (
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,

@ -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,

@ -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

Loading…
Cancel
Save