Skip to content

Commit

Permalink
Merge pull request #46 from PowerLoom/phase2
Browse files Browse the repository at this point in the history
Dynamic Namespace, and Prost Chain Id Selection from Environment
  • Loading branch information
xadahiya authored Nov 28, 2023
2 parents eebc0c9 + 5573520 commit 5d39e16
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
release:
types: ['published']
push:
branches: [ "dockerify" ]
branches: [ "dockerify", "phase2"]
# Publish semver tags as releases.
tags: [ 'v*.*.*' ]
pull_request:
Expand Down
2 changes: 1 addition & 1 deletion settings.example.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
"domain": {
"name": "PowerloomProtocolContract",
"version": "0.1",
"chainId": "102",
"chainId": "prost-chain-id",
"verifyingContract": "protocol-state-contract"
},
"accountAddress": "signer-account-address",
Expand Down
14 changes: 13 additions & 1 deletion snapshotter_autofill.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,21 @@ if [ "$WEB3_STORAGE_TOKEN" ]; then
echo "Found WEB3_STORAGE_TOKEN ${WEB3_STORAGE_TOKEN}";
fi

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

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

cp settings.example.json settings.json

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

export prost_chain_id="${PROST_CHAIN_ID:-103}"

export ipfs_url="${IPFS_URL:-/dns/ipfs/tcp/5001}"
export ipfs_api_key="${IPFS_API_KEY:-}"
export ipfs_api_secret="${IPFS_API_SECRET:-}"
Expand All @@ -70,6 +80,7 @@ fi

echo "Using Namespace: ${namespace}"
echo "Using Prost RPC URL: ${prost_rpc_url}"
echo "Using Prost Chain ID: ${prost_chain_id}"
echo "Using IPFS URL: ${ipfs_url}"
echo "Using IPFS API KEY: ${ipfs_api_key}"
echo "Using protocol state contract: ${protocol_state_contract}"
Expand All @@ -81,6 +92,7 @@ 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#prost-chain-id#$prost_chain_id#" 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 Down

0 comments on commit 5d39e16

Please sign in to comment.