Skip to content

Commit

Permalink
chore: made PROTOCOL_STATE_CONTRACT and PROST_RPC_URL , and RELAYER_…
Browse files Browse the repository at this point in the history
…HOST_URL mandatory, remove default values
  • Loading branch information
xadahiya committed Sep 4, 2023
1 parent 0c6b019 commit 32c22a2
Showing 1 changed file with 19 additions and 20 deletions.
39 changes: 19 additions & 20 deletions snapshotter_autofill.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,25 @@ if [ -z "$SIGNER_ACCOUNT_PRIVATE_KEY" ]; then
exit 1;
fi

echo "Found SIGNER ACCOUNT ADDRESS ${SIGNER_ACCOUNT_ADDRESS}";

if [ "$PROST_RPC_URL" ]; then
echo "Found PROST_RPC_URL ${PROST_RPC_URL}";
if [ -z "$PROST_RPC_URL" ]; then
echo "PROST_RPC_URL not found, please set this in your .env!";
exit 1;
fi

if [ "$IPFS_URL" ]; then
echo "Found IPFS_URL ${IPFS_URL}";
if [ -z "$PROTOCOL_STATE_CONTRACT" ]; then
echo "PROTOCOL_STATE_CONTRACT not found, please set this in your .env!";
exit 1;
fi

if [ "$PROTOCOL_STATE_CONTRACT" ]; then
echo "Found PROTOCOL_STATE_CONTRACT ${PROTOCOL_STATE_CONTRACT}";
if [ -z "$RELAYER_HOST" ]; then
echo "RELAYER_HOST not found, please set this in your .env!";
exit 1;
fi

if [ "$RELAYER_HOST" ]; then
echo "Found RELAYER_HOST ${RELAYER_HOST}";
echo "Found SIGNER ACCOUNT ADDRESS ${SIGNER_ACCOUNT_ADDRESS}";

if [ "$IPFS_URL" ]; then
echo "Found IPFS_URL ${IPFS_URL}";
fi

if [ "$SLACK_REPORTING_URL" ]; then
Expand All @@ -48,15 +51,11 @@ fi
cp settings.example.json settings.json

export namespace=UNISWAPV2
export prost_rpc_url="${PROST_RPC_URL:-https://rpc-prost1b.powerloom.io}"

export ipfs_url="${IPFS_URL:-/dns/ipfs/tcp/5001}"
export ipfs_api_key="${IPFS_API_KEY:-}"
export ipfs_api_secret="${IPFS_API_SECRET:-}"

export protocol_state_contract="${PROTOCOL_STATE_CONTRACT:-0x102Af943b34FAC403a6ACB8e463f44bE164aa942}"
export relayer_host="${RELAYER_HOST:-https://relayer-prod1b.powerloom.io/75822d76fa4d497ab3b409b3f097f4fa}"

export slack_reporting_url="${SLACK_REPORTING_URL:-}"
export powerloom_reporting_url="${POWERLOOM_REPORTING_URL:-}"

Expand All @@ -69,18 +68,18 @@ if [ -z "$IPFS_URL" ]; then
fi

echo "Using Namespace: ${namespace}"
echo "Using Prost RPC URL: ${prost_rpc_url}"
echo "Using Prost RPC URL: ${PROST_RPC_URL}"
echo "Using IPFS URL: ${ipfs_url}"
echo "Using IPFS API KEY: ${ipfs_api_key}"
echo "Using protocol state contract: ${protocol_state_contract}"
echo "Using relayer host: ${relayer_host}"
echo "Using protocol state contract: ${PROTOCOL_STATE_CONTRACT}"
echo "Using relayer host: ${RELAYER_HOST}"
echo "Using slack reporting url: ${slack_reporting_url}"
echo "Using powerloom reporting url: ${powerloom_reporting_url}"
echo "Using web3 storage token: ${web3_storage_token}"

sed -i'.backup' "s#relevant-namespace#$namespace#" settings.json

sed -i'.backup' "s#https://prost-rpc-url#$prost_rpc_url#" settings.json
sed -i'.backup' "s#https://prost-rpc-url#$PROST_RPC_URL#" settings.json

sed -i'.backup' "s#ipfs-writer-url#$ipfs_url#" settings.json
sed -i'.backup' "s#ipfs-writer-key#$ipfs_api_key#" settings.json
Expand All @@ -91,14 +90,14 @@ sed -i'.backup' "s#ipfs-reader-key#$ipfs_api_key#" settings.json
sed -i'.backup' "s#ipfs-reader-secret#$ipfs_api_secret#" settings.json

sed -i'.backup' "s#web3-storage-token#$web3_storage_token#" settings.json
sed -i'.backup' "s#protocol-state-contract#$protocol_state_contract#" settings.json
sed -i'.backup' "s#protocol-state-contract#$PROTOCOL_STATE_CONTRACT#" settings.json

sed -i'.backup' "s#signer-account-address#$SIGNER_ACCOUNT_ADDRESS#" settings.json
sed -i'.backup' "s#signer-account-private-key#$SIGNER_ACCOUNT_PRIVATE_KEY#" settings.json

sed -i'.backup' "s#account-address#$SIGNER_ACCOUNT_ADDRESS#" settings.json

sed -i'.backup' "s#https://relayer-url#$relayer_host#" settings.json
sed -i'.backup' "s#https://relayer-url#$RELAYER_HOST#" settings.json
sed -i'.backup' "s#https://slack-reporting-url#$slack_reporting_url#" settings.json
sed -i'.backup' "s#https://powerloom-reporting-url#$powerloom_reporting_url#" settings.json

Expand Down

0 comments on commit 32c22a2

Please sign in to comment.