Skip to content

Commit

Permalink
Hack some env var usage in
Browse files Browse the repository at this point in the history
  • Loading branch information
noonio committed Sep 11, 2024
1 parent 6c30e32 commit 4a7377a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/network-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
sleep 5
# :tear: socket permissions.
sudo chown runner:docker devnet/node.socket
./export-tx-id-and-pparams.sh
DEVNET_DIR=devnet HYDRA_NODE_CMD="nix run .#hydra-node --" ./export-tx-id-and-pparams.sh
# Specify two docker compose yamls; the second one overrides the
# images to use the netem ones specifically
docker compose -f docker-compose.yaml -f docker-compose-netem.yaml up -d hydra-node-{1,2,3}
Expand Down
13 changes: 11 additions & 2 deletions demo/export-tx-id-and-pparams.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ SCRIPT_DIR=${SCRIPT_DIR:-$(realpath $(dirname $(realpath $0)))}
NETWORK_ID=42

CCLI_CMD=
DEVNET_DIR=/devnet
DEVNET_DIR="${DEVNET_DIR:-/devnet}"
if [[ -n ${1} ]]; then
echo >&2 "Using provided cardano-cli command: ${1}"
$(${1} version > /dev/null)
CCLI_CMD=${1}
DEVNET_DIR=${SCRIPT_DIR}/devnet
fi

HYDRA_NODE_CMD=
HYDRA_NODE_CMD="${HYDRA_NODE_CMD}"
if [[ -n ${2} ]]; then
echo >&2 "Using provided hydra-node command: ${2}"
${2} --version > /dev/null
Expand All @@ -41,6 +41,15 @@ function publishReferenceScripts() {
--cardano-signing-key devnet/credentials/faucet.sk
}

DOCKER_COMPOSE_CMD=
if [[ ! -x ${CCLI_CMD} ]]; then
if docker compose --version > /dev/null 2>&1; then
DOCKER_COMPOSE_CMD="docker compose"
else
DOCKER_COMPOSE_CMD="docker-compose"
fi
fi

# Invoke cardano-cli in running cardano-node container or via provided cardano-cli
function ccli() {
ccli_ ${@} --testnet-magic ${NETWORK_ID}
Expand Down

0 comments on commit 4a7377a

Please sign in to comment.