diff --git a/doc/building-running.md b/doc/building-running.md index 3adaa3c89..08cbe09f7 100644 --- a/doc/building-running.md +++ b/doc/building-running.md @@ -39,7 +39,6 @@ nix-build -A cardano-db-sync -o db-sync-node scripts/postgresql-setup.sh --createdb PGPASSFILE=config/pgpass db-sync-node/bin/cardano-db-sync \ --config config/mainnet-config.yaml \ - --genesis-file ../cardano-node/configuration/mainnet-genesis.json \ --socket-path ../cardano-node/state-node-mainnet/node.socket \ --schema-dir schema/ ``` @@ -61,13 +60,11 @@ and then the two `db-sync` process run as: ``` PGPASSFILE=config/pgpass ./cardano-db-sync-extended-exe \ --config config/mainnet-config.yaml \ - --genesis-file ../cardano-node/mainnet-genesis.json \ --socket-path ../cardano-node/state-node-mainnet/node.socket --schema-dir schema/ ``` and ``` PGPASSFILE=config/pgpass-testnet ./cardano-db-sync-extended-exe \ --config config/testnet-config.yaml \ - --genesis-file ../cardano-node/configuration/mainnet-ci/testnet-genesis.json \ --socket-path ../cardano-node/state-node-testnet/node.socket --schema-dir schema/ ``` diff --git a/nix/docker.nix b/nix/docker.nix index 46c779b2c..2ea6b8a4e 100644 --- a/nix/docker.nix +++ b/nix/docker.nix @@ -5,31 +5,21 @@ # # docker load -i $(nix-build -A dockerImage --no-out-link) # -# cardano-db-sync and cardano-db-sync-extended are interchangeable in the following: -# -# To launch with provided mainnet or testnet configuration +# To launch with pre-loaded configuration, using the NETWORK env. # # docker run \ # -v $PATH_TO/node-ipc:/node-ipc \ # -v $PATH_TO/pgpass:/configuration/pgpass \ # -e NETWORK=mainnet|testnet \ # -# To launch the extended service: +# Provide an (almost) complete command otherwise: # -# docker run \ -# -v $PATH_TO/node-ipc:/node-ipc \ -# -v $PATH_TO/pgpass:/configuration/pgpass \ -# -e NETWORK=mainnet|testnet \ -# -e EXTENDED=true -# -# To launch with custom configuration, mount a dir containing configuration.yaml, genesis.json, -# and pgpass into /configuration -# -# docker run \ -# -v $PATH_TO/node-ipc:/node-ipc \ -# -v $PATH_TO/configuration:/configuration \ -# inputoutput/cardano-db-sync: +# docker run -v $PWD/configuration/defaults/byron-mainnet:/configuration \ +# inputoutput/cardano-db-sync run \ +# --config /configuration/configuration.yaml \ +# --socket-path /node-ipc/node.socket \ # +# To launch the extended service include -e EXTENDED=true # See the docker-compose.yml for demonstration of using Docker secrets instead of mounting a pgpass # ############################################################################ @@ -140,7 +130,7 @@ let export PGPASSFILE=/configuration/pgpass # set up /tmp (override with TMPDIR variable) mkdir -p -m 1777 tmp - if [[ -f /configuration/configuration.yaml ]]; then + if [[ -z "$NETWORK" ]]; then echo "Connecting to network specified in configuration.yaml" if [[ ! -z "''${EXTENDED}" ]] && [[ "''${EXTENDED}" == true ]] then @@ -149,14 +139,10 @@ let DBSYNC=${cardano-db-sync}/bin/cardano-db-sync fi exec $DBSYNC \ - --socket-path /node-ipc/node.socket \ - --genesis-file /configuration/genesis.json \ - --config /configuration/configuration.yaml \ - --schema-dir ${../schema} + --schema-dir ${../schema} $@ ${clusterStatements} else - echo "Please set a NETWORK environment variable to one of: mainnet/testnet" - echo "Or mount a /configuration volume containing: configuration.yaml, genesis.json, pgpass" + echo "Managed configuration for network "$NETWORK" does not exist" fi ''; in dockerTools.buildImage { diff --git a/nix/nixos/cardano-db-sync-service.nix b/nix/nixos/cardano-db-sync-service.nix index 3388fe8fd..3b9fdcaa8 100644 --- a/nix/nixos/cardano-db-sync-service.nix +++ b/nix/nixos/cardano-db-sync-service.nix @@ -112,7 +112,6 @@ in { mkdir -p log-dir exec ${exec} \ --config ${configFile} \ - --genesis-file ${envConfig.genesisFile} \ --socket-path "$CARDANO_NODE_SOCKET_PATH" \ --schema-dir ${../../schema} '';