Skip to content

Commit

Permalink
cmd/ronin/chaincmd: open ancient freezer when init genesis (#620)
Browse files Browse the repository at this point in the history
  • Loading branch information
Francesco4203 authored Oct 30, 2024
1 parent 8b18ecb commit eaa459d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmd/ronin/chaincmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ var (
utils.ForceOverrideChainConfigFlag,
utils.CachePreimagesFlag,
utils.StateSchemeFlag,
utils.AncientFlag,
},
Category: "BLOCKCHAIN COMMANDS",
Description: `
Expand Down Expand Up @@ -226,7 +227,7 @@ func initGenesis(ctx *cli.Context) error {
defer stack.Close()

for _, name := range []string{"chaindata", "lightchaindata"} {
chaindb, err := stack.OpenDatabase(name, 0, 0, "", false)
chaindb, err := stack.OpenDatabaseWithFreezer(name, 0, 0, ctx.String(utils.AncientFlag.Name), "", false)
if err != nil {
utils.Fatalf("Failed to open database: %v", err)
}
Expand Down
1 change: 1 addition & 0 deletions docker/chainnode/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ elif [[ "$FORCE_INIT" = "true" && "$INIT_FORCE_OVERRIDE_CHAIN_CONFIG" = "true" ]
elif [ "$FORCE_INIT" = "true" ]; then
echo "Forcing update chain config with $genesisPath, state_scheme $state_scheme ..."
ronin init $dbEngine --datadir $datadir --state.scheme $state_scheme $genesisPath
fi

# password file
if [[ ! -f $PASSWORD_FILE ]]; then
Expand Down

0 comments on commit eaa459d

Please sign in to comment.