mirror of
https://github.com/waku-org/waku-simulator.git
synced 2025-02-28 23:40:35 +00:00
Upgrade to RLNv2 (#45)
This commit is contained in:
parent
a7de0823fa
commit
359db48e2d
@ -2,17 +2,34 @@
|
|||||||
|
|
||||||
set -e
|
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
|
curl -L https://foundry.paradigm.xyz | bash && . /root/.bashrc && foundryup && export PATH=$PATH:$HOME/.foundry/bin
|
||||||
|
|
||||||
#. 2. Clone and build waku-rln-contract repo
|
echo "installing pnpm..."
|
||||||
git clone https://github.com/waku-org/waku-rln-contract.git
|
npm install -g pnpm
|
||||||
cd /waku-rln-contract
|
|
||||||
forge install && yarn install && yarn compile
|
|
||||||
|
|
||||||
# 3. Create .env file with RPC_PROVIDER variable
|
# 2. Clone and build the repository
|
||||||
echo "creating .env file with RPC_PROVIDER=$RPC_URL"
|
if [ ! -d "waku-rlnv2-contract" ]; then
|
||||||
echo "RPC_PROVIDER=$RPC_URL" > .env
|
git clone https://github.com/waku-org/waku-rlnv2-contract.git
|
||||||
|
fi
|
||||||
|
|
||||||
# 3. Deploy the contracts
|
cd /waku-rlnv2-contract
|
||||||
yarn deploy localhost_integration
|
|
||||||
|
# 3. Compile
|
||||||
|
echo "forge install..."
|
||||||
|
forge install
|
||||||
|
echo "pnpm install..."
|
||||||
|
pnpm install
|
||||||
|
echo "forge build..."
|
||||||
|
forge build
|
||||||
|
|
||||||
|
# 4. Export environment variables
|
||||||
|
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
|
||||||
|
|
||||||
|
# 5. Deploy the contract
|
||||||
|
forge script script/Deploy.s.sol:Deploy --rpc-url $RPC_URL --broadcast -vv --private-key $PRIVATE_KEY --sender $ETH_FROM
|
@ -20,10 +20,10 @@ services:
|
|||||||
- anvil
|
- anvil
|
||||||
--port=8545
|
--port=8545
|
||||||
--host=0.0.0.0
|
--host=0.0.0.0
|
||||||
--chain-id=1337
|
|
||||||
--accounts=${NUM_NWAKU_NODES:-5}
|
--accounts=${NUM_NWAKU_NODES:-5}
|
||||||
--allow-origin=*
|
--allow-origin=*
|
||||||
--block-time=12
|
--block-time=12
|
||||||
|
--chain-id=1234
|
||||||
--silent
|
--silent
|
||||||
--config-out=/shared/anvil-config.txt
|
--config-out=/shared/anvil-config.txt
|
||||||
volumes:
|
volumes:
|
||||||
@ -36,7 +36,9 @@ services:
|
|||||||
labels:
|
labels:
|
||||||
com.centurylinklabs.watchtower.enable: '${WATCHTOWER_ENABLED:-false}'
|
com.centurylinklabs.watchtower.enable: '${WATCHTOWER_ENABLED:-false}'
|
||||||
environment:
|
environment:
|
||||||
|
- PRIVATE_KEY=${PRIVATE_KEY}
|
||||||
- RPC_URL=${RPC_URL:-http://foundry:8545}
|
- RPC_URL=${RPC_URL:-http://foundry:8545}
|
||||||
|
- ETH_FROM=${ETH_FROM}
|
||||||
entrypoint: sh
|
entrypoint: sh
|
||||||
command:
|
command:
|
||||||
- '/opt/deploy_rln_contract.sh'
|
- '/opt/deploy_rln_contract.sh'
|
||||||
@ -76,9 +78,11 @@ services:
|
|||||||
entrypoint: sh
|
entrypoint: sh
|
||||||
environment:
|
environment:
|
||||||
- RPC_URL=${RPC_URL:-http://foundry:8545}
|
- RPC_URL=${RPC_URL:-http://foundry:8545}
|
||||||
- RLN_CONTRACT_ADDRESS=0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0
|
- RLN_CONTRACT_ADDRESS=0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9
|
||||||
- RLN_CREDENTIAL_PATH=/keystore.json
|
- RLN_CREDENTIAL_PATH=/keystore.json
|
||||||
- RLN_CREDENTIAL_PASSWORD=passw123
|
- RLN_CREDENTIAL_PASSWORD=passw123
|
||||||
|
- RLN_RELAY_MSG_LIMIT=${RLN_RELAY_MSG_LIMIT:-10}
|
||||||
|
- RLN_RELAY_EPOCH_SEC=${RLN_RELAY_EPOCH_SEC:-60}
|
||||||
command:
|
command:
|
||||||
- '/opt/run_nwaku.sh'
|
- '/opt/run_nwaku.sh'
|
||||||
volumes:
|
volumes:
|
||||||
|
@ -108,7 +108,8 @@ else
|
|||||||
--rln-relay-eth-contract-address=$RLN_CONTRACT_ADDRESS \
|
--rln-relay-eth-contract-address=$RLN_CONTRACT_ADDRESS \
|
||||||
--rln-relay-cred-path=$RLN_CREDENTIAL_PATH \
|
--rln-relay-cred-path=$RLN_CREDENTIAL_PATH \
|
||||||
--rln-relay-cred-password=$RLN_CREDENTIAL_PASSWORD \
|
--rln-relay-cred-password=$RLN_CREDENTIAL_PASSWORD \
|
||||||
--log-level=INFO \
|
--rln-relay-user-message-limit=$RLN_RELAY_MSG_LIMIT \
|
||||||
|
--log-level=DEBUG \
|
||||||
--execute
|
--execute
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -136,12 +137,16 @@ exec /usr/bin/wakunode\
|
|||||||
--rest-admin=true\
|
--rest-admin=true\
|
||||||
--rest-private=true\
|
--rest-private=true\
|
||||||
--rest-address=0.0.0.0\
|
--rest-address=0.0.0.0\
|
||||||
|
--rest-port=8645\
|
||||||
--rln-relay=true\
|
--rln-relay=true\
|
||||||
--rln-relay-dynamic=true\
|
--rln-relay-dynamic=true\
|
||||||
--rln-relay-eth-client-address="$RPC_URL"\
|
--rln-relay-eth-client-address="$RPC_URL"\
|
||||||
--rln-relay-eth-contract-address=$RLN_CONTRACT_ADDRESS\
|
--rln-relay-eth-contract-address=$RLN_CONTRACT_ADDRESS\
|
||||||
--rln-relay-cred-path=$RLN_CREDENTIAL_PATH\
|
--rln-relay-cred-path=$RLN_CREDENTIAL_PATH\
|
||||||
--rln-relay-cred-password=$RLN_CREDENTIAL_PASSWORD\
|
--rln-relay-cred-password=$RLN_CREDENTIAL_PASSWORD\
|
||||||
|
--rln-relay-tree-path="rlnv2_tree1"\
|
||||||
|
--rln-relay-epoch-sec=$RLN_RELAY_EPOCH_SEC\
|
||||||
|
--rln-relay-user-message-limit=$RLN_RELAY_MSG_LIMIT\
|
||||||
--dns-discovery=true\
|
--dns-discovery=true\
|
||||||
--discv5-discovery=true\
|
--discv5-discovery=true\
|
||||||
--discv5-enr-auto-update=True\
|
--discv5-enr-auto-update=True\
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# Env variables for metal-01.he-eu-hel1.wakusim.misc host.
|
# Env variables for metal-01.he-eu-hel1.wakusim.misc host.
|
||||||
NWAKU_IMAGE=wakuorg/nwaku:latest
|
NWAKU_IMAGE=quay.io/wakuorg/nwaku-pr:2759-rln-v2
|
||||||
# Network scaling.
|
# Network scaling.
|
||||||
NUM_NWAKU_NODES=50
|
NUM_NWAKU_NODES=50
|
||||||
# Simulation traffic.
|
# Simulation traffic.
|
||||||
@ -10,3 +10,9 @@ TRAFFIC_DELAY_SECONDS=15
|
|||||||
WATCHTOWER_ENABLED=true
|
WATCHTOWER_ENABLED=true
|
||||||
# Anvil RPC Node external IP and port
|
# Anvil RPC Node external IP and port
|
||||||
RPC_URL=http://foundry:8545
|
RPC_URL=http://foundry:8545
|
||||||
|
# Contract-deployment
|
||||||
|
PRIVATE_KEY=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
|
||||||
|
ETH_FROM=0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266
|
||||||
|
# RLNv2 limits
|
||||||
|
RLN_RELAY_MSG_LIMIT=10
|
||||||
|
RLN_RELAY_EPOCH_SEC=60
|
Loading…
x
Reference in New Issue
Block a user