Skip to content

Commit

Permalink
auto change checkpoint_contract env
Browse files Browse the repository at this point in the history
  • Loading branch information
wanwiset25 committed Jan 3, 2024
1 parent 2193b36 commit a70b3f2
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions docker/deploy_proxy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,24 @@ echo "PROXY_GATEWAY=$PROXY" >> config/common.env || echo 'config not mounted'

UPGRADE=$(npx hardhat run scripts/proxy/UpgradeCSC.js --network xdcparentnet | awk '{print $NF}')
FULL_CSC=$(echo $UPGRADE | cut -d' ' -f4)
FULL_CSC="FULL_CSC=$FULL_CSC"
echo $FULL_CSC >> config/common.env || echo 'config not mounted'
FULL_CSC_LINE="FULL_CSC=$FULL_CSC"
echo $FULL_CSC_LINE >> config/common.env || echo 'config not mounted'


LITE_CSC=$(echo $UPGRADE | cut -d' ' -f5)
LITE_CSC="LITE_CSC=$LITE_CSC"
echo $LITE_CSC >> config/common.env || echo 'config not mounted'
LITE_CSC_LINE="LITE_CSC=$LITE_CSC"
echo $LITE_CSC_LINE >> config/common.env || echo 'config not mounted'
echo "Upgraded Proxy Gateway with CSC"
echo "$FULL_CSC"
echo "$LITE_CSC"
echo "$FULL_CSC_LINE"
echo "$LITE_CSC_LINE"

if [[ $RELAYER_MODE == 'full' ]]; then
echo 'Relayer mode full, updating CHECKPOINT_CONTRACT'
cat /app/generated/common.env | sed -e "s/CHECKPOINT_CONTRACT.*/CHECKPOINT_CONTRACT=$FULL_CSC/" > temp.env
mv temp.env /app/generated/common.env
fi
if [[ $RELAYER_MODE == 'lite' ]]; then
echo 'Relayer mode lite, updating CHECKPOINT_CONTRACT'
cat /app/generated/common.env | sed -e "s/CHECKPOINT_CONTRACT.*/CHECKPOINT_CONTRACT=$LITE_CSC/" > temp.env
mv temp.env /app/generated/common.env
fi

0 comments on commit a70b3f2

Please sign in to comment.