diff --git a/cli/server_dump.go b/cli/server_dump.go index 7a3666b883..6d2b2cefc6 100644 --- a/cli/server_dump.go +++ b/cli/server_dump.go @@ -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) } diff --git a/cli/start.go b/cli/start.go index dfe2abba90..fc1339d710 100644 --- a/cli/start.go +++ b/cli/start.go @@ -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")), } @@ -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{