2024-03-26 08:41:52 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2024-06-07 08:13:45 +00:00
|
|
|
# 1. Install foundry and pnpm
|
2024-03-26 08:41:52 +00:00
|
|
|
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-03-26 08:41:52 +00:00
|
|
|
|
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-03-26 08:41:52 +00:00
|
|
|
|
2024-06-07 08:13:45 +00:00
|
|
|
cd /waku-rlnv2-contract
|
|
|
|
|
2024-06-20 13:39:19 +00:00
|
|
|
#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
|
|
|
|
|
2024-06-20 13:39:19 +00:00
|
|
|
# 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
|
|
|
|
|
2024-06-20 13:39:19 +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
|