-
Notifications
You must be signed in to change notification settings - Fork 156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow to run docker with DISABLE_LEDGER (#1430) #1436
Allow to run docker with DISABLE_LEDGER (#1430) #1436
Conversation
b0ce3a2
to
2f1b8e8
Compare
nix/docker.nix
Outdated
exec $DBSYNC \ | ||
--schema-dir ${../schema} \ | ||
--state-dir ${scripts.mainnet.db-sync.passthru.service.stateDir} $@ | ||
if [[ -n "$DISABLE_LEDGER" ]]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand you just want to check whether DISABLE_LEDGER
is set or not but, given you write DISABLE_LEDGER=true
in the documentation above, I am worried someone will do DISABLE_LEDGER=false
😂.
Maybe checking for an explicit value of DISABLE_LEDGER
(e.g. "true" or 1) could be a safer option?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good point. After looking around it, it looks like there's an existing pattern (RECREATE_DB=Y
), so I think it would make sense to follow that pattern. Source: https://github.com/input-output-hk/cardano-db-sync/blob/master/scripts/postgresql-setup.sh#L311
@@ -177,6 +185,20 @@ in { | |||
(if (cfg.environment.nodeConfig.RequiresNetworkMagic == "RequiresNoMagic" ) | |||
then "--mainnet" | |||
else "--testnet-magic $(jq '.networkMagic' ${cfg.environment.nodeConfig.ShelleyGenesisFile})"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a thought, could we get the networkMagic in nix rather than going through jq
?
f9dcec0
to
ee5f8f1
Compare
ee5f8f1
to
a2b36e6
Compare
Description
Fixes #1430. This change allows users to pass an environment variable
DISABLE_LEDGER
to the docker container (and the NixOS module). If this flag is non-empty, it will pass--disable-ledger
and omit the--state-dir ...
option.Note that even when
services.cardano-db-sync.disableLedger
is true,stateDir
is still defaulted and required, because we writepgpass
there.Checklist
fourmolu
(which can be run withscripts/fourmolize.sh
Migrations
If there is a breaking change, especially a big one, please add a justification here. Please elaborate
more what the migration achieves, what it cannot achieve or why a migration is not possible.