Skip to content

Commit

Permalink
Add EnableFutureGenesis to db-sync config
Browse files Browse the repository at this point in the history
Fixes #1674
  • Loading branch information
kderme committed Apr 18, 2024
1 parent ed3dc8b commit a7646cd
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
4 changes: 4 additions & 0 deletions cardano-db-sync/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Revision history for cardano-db-sync

## 13.2.0.2
* Support node 8.9.x
* Add a new db-sync config field `EnableFutureGenesis`. When false or missing, the conway genesis file is ignored

## 13.2.0.1
* Added a new table `epoch_stake_progress` which indicates when `epoch_stake` is completed
* Uses the cache for the computation of `epoch` table when following
Expand Down
9 changes: 7 additions & 2 deletions cardano-db-sync/src/Cardano/DbSync/Config.hs
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,13 @@ coalesceConfig pcfg ncfg adjustGenesisPath = do
, dncAlonzoGenesisFile = adjustGenesisFilePath adjustGenesisPath (ncAlonzoGenesisFile ncfg)
, dncAlonzoGenesisHash = ncAlonzoGenesisHash ncfg
, dncConwayGenesisFile =
adjustGenesisFilePath adjustGenesisPath <$> ncConwayGenesisFile ncfg
, dncConwayGenesisHash = ncConwayGenesisHash ncfg
if pcEnableFutureGenesis pcfg
then adjustGenesisFilePath adjustGenesisPath <$> ncConwayGenesisFile ncfg
else Nothing
, dncConwayGenesisHash =
if pcEnableFutureGenesis pcfg
then ncConwayGenesisHash ncfg
else Nothing
, dncByronProtocolVersion = ncByronProtocolVersion ncfg
, dncShelleyHardFork = ncShelleyHardFork ncfg
, dncAllegraHardFork = ncAllegraHardFork ncfg
Expand Down
2 changes: 2 additions & 0 deletions cardano-db-sync/src/Cardano/DbSync/Config/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ data SyncPreConfig = SyncPreConfig
{ pcNetworkName :: !NetworkName
, pcLoggingConfig :: !Logging.Representation
, pcNodeConfigFile :: !NodeConfigFile
, pcEnableFutureGenesis :: !Bool
, pcEnableLogging :: !Bool
, pcEnableMetrics :: !Bool
, pcPrometheusPort :: !Int
Expand Down Expand Up @@ -197,6 +198,7 @@ parseGenSyncNodeConfig o =
<$> fmap NetworkName (o .: "NetworkName")
<*> parseJSON (Object o)
<*> fmap NodeConfigFile (o .: "NodeConfigFile")
<*> fmap (fromMaybe False) (o .:? "EnableFutureGenesis")
<*> o .: "EnableLogging"
<*> o .: "EnableLogMetrics"
<*> fmap (fromMaybe 8080) (o .:? "PrometheusPort")
Expand Down

0 comments on commit a7646cd

Please sign in to comment.