Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
### Added

- Added `--preserve-timestamps` flag. When set, genesis file timestamps are kept as-is.

### Changed

- Timestamps in genesis files are now updated to the current date by default.
- The `--update-time` flag is now internal (hidden, kept for backward compatibility).

13 changes: 8 additions & 5 deletions cardano-testnet/src/Parsers/Cardano.hs
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,14 @@ pMainnetParams = OA.flag' OnChainParamsMainnet
)

pUpdateTimestamps :: Parser UpdateTimestamps
pUpdateTimestamps = OA.flag DontUpdateTimestamps UpdateTimestamps
( OA.long "update-time"
<> OA.help "Update the time stamps in genesis files to current date"
<> OA.showDefault
)
pUpdateTimestamps =
-- Default to UpdateTimestamps, because when using the two-step flow
-- (cardano-testnet create-env → cardano-testnet cardano --node-env),
-- genesis timestamps can become stale.
-- See https://github.com/IntersectMBO/cardano-node/issues/6455
OA.flag' UpdateTimestamps (OA.long "update-time" <> OA.help "Update the time stamps in genesis files to current date (default, kept for backward compatibility)" <> OA.internal)
<|> OA.flag' DontUpdateTimestamps (OA.long "preserve-timestamps" <> OA.help "Do not update the time stamps in genesis files to current date.")
<|> pure UpdateTimestamps

pEnvOutputDir :: Parser FilePath
pEnvOutputDir = OA.strOption
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Usage: cardano-testnet cardano [--num-pool-nodes COUNT]
[--slot-length SECONDS]
[--active-slots-coeff DOUBLE]
[--node-env FILEPATH]
[--update-time]
[--preserve-timestamps]
[--params-file FILEPATH | --params-mainnet]

Start a testnet and keep it running until stopped
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Usage: cardano-testnet cardano [--num-pool-nodes COUNT]
[--slot-length SECONDS]
[--active-slots-coeff DOUBLE]
[--node-env FILEPATH]
[--update-time]
[--preserve-timestamps]
[--params-file FILEPATH | --params-mainnet]

Start a testnet and keep it running until stopped
Expand Down Expand Up @@ -51,8 +51,8 @@ Available options:
otherwise). You can generate a default environment
with the 'create-env' command, then modify it and
pass it with this argument.
--update-time Update the time stamps in genesis files to current
date
--preserve-timestamps Do not update the time stamps in genesis files to
current date.
--params-file FILEPATH File containing custom on-chain parameters in
Blockfrost format:
https://docs.blockfrost.io/#tag/cardano--epochs/GET/epochs/latest/parameters
Expand Down
Loading