Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding rln contract deployment script #30

Merged
merged 8 commits into from
Mar 26, 2024
18 changes: 18 additions & 0 deletions deploy_rln_contract.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/sh

set -e

# 1. Install foundry
curl -L https://foundry.paradigm.xyz | bash && . /root/.bashrc && foundryup && export PATH=$PATH:$HOME/.foundry/bin

alrevuelta marked this conversation as resolved.
Show resolved Hide resolved
#. 2. Clone and build waku-rln-contract repo
git clone https://github.com/waku-org/waku-rln-contract.git
cd /waku-rln-contract
forge install && yarn install && yarn compile

# 3. Create .env file with RPC_PROVIDER variable
echo "creating .env file with RPC_PROVIDER=$RPC_URL"
echo "RPC_PROVIDER=$RPC_URL" > .env

# 3. Deploy the contracts
yarn deploy localhost_integration
45 changes: 31 additions & 14 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,32 @@ services:
com.centurylinklabs.watchtower.enable: '${WATCHTOWER_ENABLED:-false}'
ports:
- 127.0.0.1:8545:8545
command: >
"anvil
--port=8545
--host=0.0.0.0
--chain-id=1337
--block-time=12
--accounts=1
--allow-origin=*
--silent"
command:
- anvil
--port=8545
--host=0.0.0.0
--chain-id=1337
--accounts=1
--allow-origin=*
--block-time=12
--silent
--config-out=anvil-config.txt
networks:
- simulation

contract-repo-deployer:
image: node:hydrogen-bullseye
labels:
com.centurylinklabs.watchtower.enable: '${WATCHTOWER_ENABLED:-false}'
environment:
- RPC_URL=${RPC_URL:-http://foundry:8545}
entrypoint: sh
command:
- '/opt/deploy_rln_contract.sh'
volumes:
- ./deploy_rln_contract.sh:/opt/deploy_rln_contract.sh
depends_on:
- foundry
networks:
- simulation

Expand All @@ -41,7 +58,7 @@ services:
- 127.0.0.1:8645:8645
entrypoint: sh
command:
- '/opt/run_bootstrap.sh'
- '/opt/run_bootstrap.sh'
volumes:
- ./run_bootstrap.sh:/opt/run_bootstrap.sh:Z
networks:
Expand All @@ -56,7 +73,7 @@ services:
replicas: ${NUM_NWAKU_NODES:-5}
entrypoint: sh
environment:
- RPC_URL=http://foundry:8545
- RPC_URL=${RPC_URL:-http://foundry:8545}
- PRIVATE_KEY=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
- RLN_CONTRACT_ADDRESS=0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0
- RLN_CREDENTIAL_PATH=/keystore.json
Expand All @@ -67,7 +84,7 @@ services:
- ./run_nwaku.sh:/opt/run_nwaku.sh:Z
depends_on:
- bootstrap
- foundry
- contract-repo-deployer
networks:
- simulation

Expand Down Expand Up @@ -165,7 +182,7 @@ services:
ports:
- 127.0.0.1:8090:8090
environment:
- NODE_ENDPOINT=http://foundry:8545
- NODE_ENDPOINT=${RPC_URL:-http://foundry:8545}
- MONGO_CLIENT_URI=mongodb://mongodb:27017
- REINDEX_ENDPOINT=http://ingestion/reindex/
- MONGO_DB_NAME=epirus
Expand Down Expand Up @@ -204,7 +221,7 @@ services:
ingestion:
image: web3labs/epirus-free-ingestion:latest
environment:
- NODE_ENDPOINT=http://foundry:8545
- NODE_ENDPOINT=${RPC_URL:-http://foundry:8545}
- MONGO_CLIENT_URI=mongodb://mongodb:27017
- MONGO_DB_NAME=epirus
- LIST_OF_METRICS_TO_CALCULATE_PER_MINUTE=hourly,daily,monthly,yearly
Expand Down
2 changes: 2 additions & 0 deletions wakusim.env
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ MSG_SIZE_KBYTES=10
TRAFFIC_DELAY_SECONDS=15
# Enable automatic Docker image updates.
WATCHTOWER_ENABLED=true
# Anvil RPC Node external IP and port
RPC_URL=http://foundry:8545