Skip to content

Commit

Permalink
Algocfg: Introduce new archival node algocfg profile. (algorand#5893)
Browse files Browse the repository at this point in the history
  • Loading branch information
gmalouf authored Jan 8, 2024
1 parent 21eec2d commit 71fff6d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
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)
})
}

0 comments on commit 71fff6d

Please sign in to comment.