deployment rln contract script updated for waku-rlnv2-contract repo

This commit is contained in:
stubbsta 2024-05-30 14:52:09 +02:00
parent 800790f078
commit 372bebab87
No known key found for this signature in database
3 changed files with 25 additions and 61 deletions

View File

@ -2,29 +2,31 @@
set -e
# 1. Install foundry
# 1. Install foundry and pnpm
curl -L https://foundry.paradigm.xyz | bash && . /root/.bashrc && foundryup && export PATH=$PATH:$HOME/.foundry/bin
#. 2. Clone and build waku-rln-contract repo
if [ -d "/waku-rln-contract" ]; then
echo "waku-rln-contract directory already exists."
else
git clone https://github.com/waku-org/waku-rln-contract.git
echo "installing pnpm..."
npm install -g pnpm
# 2. Clone and build the repository
if [ ! -d "waku-rlnv2-contract" ]; then
git clone https://github.com/waku-org/waku-rlnv2-contract.git
fi
cd /waku-rln-contract
git checkout rln-v2
cd /waku-rlnv2-contract
# 3. Compile
echo "forge install..."
forge install
echo "yarn install..."
yarn install
echo "yarn compile..."
yarn compile
forge install
echo "pnpm install..."
pnpm install
echo "forge build..."
forge build
# 3. Create .env file with RPC_PROVIDER variable
echo "creating .env file with RPC_PROVIDER=$RPC_URL"
echo "RPC_PROVIDER=$RPC_URL" > .env
# 4. Export environment variables
export API_KEY_ETHERSCAN=123
export RCL_URL=$RCL_URL
export PRIVATE_KEY=$PRIVATE_KEY
# 4. Deploy the contracts
yarn deploy localhost_integration
# 5. Deploy the contract
forge script script/Deploy.s.sol:Deploy --broadcast --fork-url $RPC_URL --private-key $PRIVATE_KEY

View File

@ -1,40 +0,0 @@
#!/bin/sh
set -e
# 2. Install pnpm
echo "installing pnpm..."
npm install -g -d pnpm
# curl -L -o /usr/local/bin/pnpm https://github.com/pnpm/pnpm/releases/download/v9.1.3/pnpm-linux-x64
# PNPM_HOME=/usr/local/bin/
# chmod +x /usr/local/bin/pnpm
# 1. Install foundry
echo "installing foundry..."
curl -L https://foundry.paradigm.xyz | bash && . /root/.bashrc && foundryup && export PATH=$PATH:$HOME/.foundry/bin
# 3. Clone and build waku-rln-contract repo
if [ -d "/waku-rln-contract" ]; then
echo "waku-rln-contract directory already exists."
else
git clone https://github.com/waku-org/waku-rlnv2-contract.git
fi
cd /waku-rlnv2-contract
echo "forge install..."
forge install
echo "pnpm install..."
pnpm install
echo "forge build..."
forge build
# 4. Create .env file with RPC_PROVIDER variable
echo "creating .env file with RPC_PROVIDER=$RPC_URL"
echo "RPC_PROVIDER=$RPC_URL" > .env
# 5. Deploy the contracts
forge script script/Deploy.s.sol --broadcast --fork-url $RPC_URL

View File

@ -20,10 +20,10 @@ services:
- anvil
--port=8545
--host=0.0.0.0
--chain-id=1337
--accounts=${NUM_NWAKU_NODES:-5}
--allow-origin=*
--block-time=12
--chain-id=1234
--silent
--config-out=/shared/anvil-config.txt
volumes:
@ -36,12 +36,14 @@ services:
labels:
com.centurylinklabs.watchtower.enable: '${WATCHTOWER_ENABLED:-false}'
environment:
- PRIVATE_KEY=${PRIVATE_KEY}
- RLNV2=${RLNV2}
- RPC_URL=${RPC_URL:-http://foundry:8545}
entrypoint: sh
command:
- '/opt/deploy_rlnv2_contract.sh'
- '/opt/deploy_rln_contract.sh'
volumes:
- ./deploy_rlnv2_contract.sh:/opt/deploy_rlnv2_contract.sh
- ./deploy_rln_contract.sh:/opt/deploy_rln_contract.sh
depends_on:
- foundry
networks: