waku-simulator/deploy_rln_contract.sh

39 lines
974 B
Bash
Raw Normal View History

#!/bin/sh
set -e
2024-06-07 08:13:45 +00:00
# 1. Install foundry and pnpm
curl -L https://foundry.paradigm.xyz | bash && . /root/.bashrc && foundryup && export PATH=$PATH:$HOME/.foundry/bin
2024-06-07 08:13:45 +00:00
echo "installing pnpm..."
npm install -g pnpm
2024-06-07 08:13:45 +00:00
# 2. Clone and build the repository
if [ ! -d "waku-rlnv2-contract" ]; then
git clone https://github.com/waku-org/waku-rlnv2-contract.git
fi
2024-06-07 08:13:45 +00:00
cd /waku-rlnv2-contract
#3. Replace the hardcoded MAX_MESSAGE_LIMIT
sed -i "s/\b20\b/${MAX_MESSAGE_LIMIT}/g" script/Deploy.s.sol
# 4. Compile
2024-06-07 08:13:45 +00:00
echo "forge install..."
forge install
echo "pnpm install..."
pnpm install
echo "forge build..."
forge build
# 5. Export environment variables
2024-06-07 08:13:45 +00:00
export RCL_URL=$RCL_URL
export PRIVATE_KEY=$PRIVATE_KEY
export ETH_FROM=$ETH_FROM
# Dummy values
export API_KEY_ETHERSCAN=123
export API_KEY_CARDONA=123
export API_KEY_LINEASCAN=123
2024-06-07 08:13:45 +00:00
# 6. Deploy the contract
2024-06-07 08:13:45 +00:00
forge script script/Deploy.s.sol:Deploy --rpc-url $RPC_URL --broadcast -vv --private-key $PRIVATE_KEY --sender $ETH_FROM