Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Algocfg: Introduce new archival node algocfg profile. #5893

Merged
merged 1 commit into from
Jan 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 13 additions & 0 deletions cmd/algocfg/profileCommand.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,24 @@ var (
},
}

archival = configUpdater{
description: "Store the full chain history and support catchup.",
updateFunc: func(cfg config.Local) config.Local {
cfg.Archival = true
cfg.EnableLedgerService = true
cfg.EnableBlockService = true
cfg.NetAddress = ":4160"
cfg.EnableGossipService = false
return cfg
},
}

// profileNames are the supported pre-configurations of config values
profileNames = map[string]configUpdater{
"participation": participation,
"conduit": conduit,
"relay": relay,
"archival": archival,
"development": development,
}

Expand Down
11 changes: 11 additions & 0 deletions cmd/algocfg/profileCommand_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,15 @@ func Test_getConfigForArg(t *testing.T) {
require.NoError(t, err)
require.True(t, cfg.DisableAPIAuth)
})

t.Run("valid config test archival node", func(t *testing.T) {
t.Parallel()
cfg, err := getConfigForArg("archival")
require.NoError(t, err)
require.True(t, cfg.Archival)
require.True(t, cfg.EnableLedgerService)
require.True(t, cfg.EnableBlockService)
require.Equal(t, ":4160", cfg.NetAddress)
require.False(t, cfg.EnableGossipService)
})
}