Skip to content

Commit

Permalink
PR(RESOLVE-MERGE): Config refactor clashes
Browse files Browse the repository at this point in the history
  • Loading branch information
shahzadlone committed Feb 23, 2024
1 parent 5ac3820 commit b34d21d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
6 changes: 1 addition & 5 deletions cli/server_dump.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,7 @@ func MakeServerDumpCmd() *cobra.Command {
if err != nil {
return err
}
db, err := db.NewDB(
cmd.Context(),
rootstore,
db.WithACPModule(cfg.Rootdir),
)
db, err := db.NewDB(cmd.Context(), rootstore)
if err != nil {
return errors.Wrap("failed to initialize database", err)
}
Expand Down
16 changes: 10 additions & 6 deletions cli/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,6 @@ func MakeStartCommand() *cobra.Command {
cfg := mustGetContextConfig(cmd)

dbOpts := []db.Option{
// Infuture when we add support for the --no-acp flag when admin signatures are in,
// we can allow starting of db without acp. Currently that can only be done programmatically.
// https://github.com/sourcenetwork/defradb/issues/2271
db.WithACPModule(cfg.Rootdir),
db.WithUpdateEvents(),
db.WithMaxRetries(cfg.GetInt("datastore.MaxTxnRetries")),
}
Expand Down Expand Up @@ -88,12 +84,20 @@ func MakeStartCommand() *cobra.Command {
// Running with memory store mode will always generate a random key.
// Adding support for an ephemeral mode and moving the key to the
// config would solve both of these issues.
rootdir := mustGetContextRootDir(cmd)
key, err := loadOrGeneratePrivateKey(filepath.Join(rootdir, "data", "key"))
rootDir := mustGetContextRootDir(cmd)
key, err := loadOrGeneratePrivateKey(filepath.Join(rootDir, "data", "key"))
if err != nil {
return err
}
netOpts = append(netOpts, net.WithPrivateKey(key))

// Infuture when we add support for the --no-acp flag when admin signatures are in,
// we can allow starting of db without acp. Currently that can only be done programmatically.
// https://github.com/sourcenetwork/defradb/issues/2271
dbOpts = append(dbOpts, db.WithACPModule(rootDir))
} else {
// TODO-ACP: Better in-mem acp module startup (this is not nice due to some config merge conflicts).
dbOpts = append(dbOpts, db.WithACPModule(""))
}

opts := []node.NodeOpt{
Expand Down

0 comments on commit b34d21d

Please sign in to comment.