diff --git a/stack-orchestrator/compose/docker-compose-laconic-faucet.yml b/stack-orchestrator/compose/docker-compose-laconic-faucet.yml index 67497f7..f171917 100644 --- a/stack-orchestrator/compose/docker-compose-laconic-faucet.yml +++ b/stack-orchestrator/compose/docker-compose-laconic-faucet.yml @@ -4,6 +4,7 @@ services: image: cerc/laconic-faucet:local environment: ${CERC_SCRIPT_DEBUG} + ${CERC_FAUCET_KEY} volumes: - ../config/laconic-faucet/start-server.sh:/start-server.sh ports: diff --git a/stack-orchestrator/config/laconic-faucet/start-server.sh b/stack-orchestrator/config/laconic-faucet/start-server.sh new file mode 100644 index 0000000..68f4fbd --- /dev/null +++ b/stack-orchestrator/config/laconic-faucet/start-server.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +set -e +if [ -n "$CERC_SCRIPT_DEBUG" ]; then + set -x +fi +set -u + +yarn install + +toml_file = "/app/environments/local.toml" + +# Set faucet key from env +faucet_key = ${CERC_FAUCET_KEY} + +# Update the faucetKey in local.toml +sed -i "s/faucetKey = \"\"/faucetKey = \"$faucet_key\"/" "$toml_file" +echo "Updated faucetKey in local.toml" + +# Start node-js server +yarn start-faucet diff --git a/stack-orchestrator/stacks/laconic-faucet/stack.yml b/stack-orchestrator/stacks/laconic-faucet/stack.yml index e7afede..0e33375 100644 --- a/stack-orchestrator/stacks/laconic-faucet/stack.yml +++ b/stack-orchestrator/stacks/laconic-faucet/stack.yml @@ -4,6 +4,6 @@ description: "Faucet for laconicd" repos: - github.com/deep-stack/laconic-testnet-faucet containers: - - + - cerc/laconic-faucet pods: - - + - laconic-faucet