Skip to content

Commit 6fc94d0

Browse files
committed
nodeOci: move context to container specific path and fix blank arg bug w/ filteredOpts
1 parent 75c8332 commit 6fc94d0

File tree

4 files changed

+12
-11
lines changed

4 files changed

+12
-11
lines changed

nix/docker/context/bin/run-node renamed to nix/docker/context/node/bin/run-node

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -92,19 +92,18 @@ cat << EOF > /usr/local/bin/env
9292
#!/usr/bin/env bash
9393
9494
# Docker run ENV vars
95-
CARDANO_CONFIG="$CARDANO_CONFIG"
96-
CARDANO_TOPOLOGY="$CARDANO_TOPOLOGY"
9795
CARDANO_BIND_ADDR="$CARDANO_BIND_ADDR"
98-
CARDANO_PORT=$CARDANO_PORT
96+
CARDANO_BLOCK_PRODUCER=$CARDANO_BLOCK_PRODUCER
97+
CARDANO_CONFIG="$CARDANO_CONFIG"
9998
CARDANO_DATABASE_PATH="$CARDANO_DATABASE_PATH"
100-
CARDANO_SOCKET_PATH="$CARDANO_SOCKET_PATH"
10199
CARDANO_LOG_DIR="$CARDANO_LOG_DIR"
100+
CARDANO_PORT=$CARDANO_PORT
101+
CARDANO_SOCKET_PATH="$CARDANO_SOCKET_PATH"
102+
CARDANO_TOPOLOGY="$CARDANO_TOPOLOGY"
102103
103104
CARDANO_PUBLIC_IP="$CARDANO_PUBLIC_IP"
104105
CARDANO_CUSTOM_PEERS="$CARDANO_CUSTOM_PEERS"
105106
106-
CARDANO_BLOCK_PRODUCER=$CARDANO_BLOCK_PRODUCER
107-
108107
# Mapping for topologyUpdater
109108
CNODE_HOSTNAME="$CARDANO_PUBLIC_IP"
110109
CNODE_PORT=$CARDANO_PORT
@@ -135,7 +134,7 @@ runRelayNode () {
135134
"--port" "$CARDANO_PORT"
136135
)
137136

138-
effopts+=("${options[@]}")
137+
effopts+=("${filteredOpts[@]}")
139138

140139
echo "cardano-node run ${effopts[*]}"
141140
exec /usr/local/bin/cardano-node run "${effopts[@]}"
@@ -159,7 +158,7 @@ runBlockProducerNode () {
159158
"--shelley-operational-certificate" "$CARDANO_SHELLEY_OPERATIONAL_CERTIFICATE"
160159
)
161160

162-
effopts+=("${options[@]}")
161+
effopts+=("${filteredOpts[@]}")
163162

164163
echo "cardano-node run ${effopts[*]}"
165164
exec /usr/local/bin/cardano-node run "${effopts[@]}"
@@ -169,7 +168,6 @@ runBlockProducerNode () {
169168
shift
170169

171170
# Override default values with explicit options
172-
173171
options=("$@")
174172

175173
for i in "${!options[@]}"
@@ -199,6 +197,9 @@ do
199197
fi
200198
done
201199

200+
# Filter blank args from match removal above
201+
filteredOpts=(); for arg in "${options[@]}"; do [[ $arg ]] && filteredOpts+=("$arg"); done
202+
202203
printRunEnv
203204
writeRootEnv
204205

nix/docker/default.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ let
9393
'';
9494

9595
# The docker context with static content
96-
context = ./context;
96+
context = ./context/node;
9797

9898
genCfgs = let
9999
environments' = lib.getAttrs [ "mainnet" "preprod" "preview" ] commonLib.environments;
@@ -113,7 +113,7 @@ let
113113
done
114114
115115
# Adjust genesis file, config and config-bp refs
116-
for i in config config-bp db-sync-config; do
116+
for i in config config-bp config-legacy config-bp-legacy db-sync-config; do
117117
if [ -f "$out/config/$ENV/$i.json" ]; then
118118
sed -i "s|\"$ENV-|\"|g" "$out/config/$ENV/$i.json"
119119
fi

0 commit comments

Comments
 (0)