testnet-laconicd-stack/stack-orchestrator/config/laconic-shopify-faucet/start-faucet.sh
nabarun d92a1febed Add stack for shopify faucet (#33)
Part of [Service provider auctions for web deployments](https://www.notion.so/Service-provider-auctions-for-web-deployments-104a6b22d47280dbad51d28aa3a91d75)

Co-authored-by: Shreerang Kale <shreerangkale@gmail.com>
Reviewed-on: cerc-io/testnet-laconicd-stack#33
2024-10-28 07:21:59 +00:00

30 lines
895 B
Bash
Executable File

#!/bin/bash
set -e
set -u
if [ -n "$CERC_SCRIPT_DEBUG" ]; then
set -x
fi
config_template=$(cat environments/config-template.toml)
target_config="./environments/local.toml"
# Check if faucet key is set
if [ -z "${CERC_FAUCET_KEY:-}" ]; then
echo "Error: CERC_FAUCET_KEY is not set. Exiting..."
exit 1
fi
echo "Using laconicd RPC endpoint: $CERC_LACONICD_RPC_ENDPOINT"
FAUCET_CONFIG=$(echo "$config_template" | \
sed -E "s|REPLACE_WITH_CERC_FAUCET_KEY|${CERC_FAUCET_KEY}|g; \
s|REPLACE_WITH_CERC_LACONICD_CHAIN_ID|${CERC_LACONICD_CHAIN_ID}|g; \
s|REPLACE_WITH_CERC_LACONICD_PREFIX|${CERC_LACONICD_PREFIX}|g; \
s|REPLACE_WITH_CERC_LACONICD_GAS_PRICE|${CERC_LACONICD_GAS_PRICE}|g; \
s|REPLACE_WITH_CERC_LACONICD_RPC_ENDPOINT|${CERC_LACONICD_RPC_ENDPOINT}|g; ")
echo "$FAUCET_CONFIG" > $target_config
echo "Starting faucet..."
node dist/index.js