#!/bin/bash set -e set -u if [ -n "$CERC_SCRIPT_DEBUG" ]; then set -x fi config_template=$(cat environments/config-template.toml) local_config="./environments/local.toml" # Set faucet key from env faucet_key=${CERC_FAUCET_KEY} rpc_endpoint=${CERC_RPC_ENDPOINT} echo "The RPC endpoint is $rpc_endpoint" FAUCET_CONFIG=$(echo "$config_template" | \ sed -E "s|REPLACE_WITH_CERC_FAUCET_KEY|${faucet_key}|; s|REPLACE_WITH_RPC_ENDPOINT|${rpc_endpoint}|") echo "$FAUCET_CONFIG" > $local_config echo "Updated config file" echo "Config.toml:" cat $local_config # Start node-js server echo "Starting faucet..." yarn start-faucet