mirror of
https://github.com/logos-messaging/logos-messaging-simulator.git
synced 2026-01-05 23:43:11 +00:00
Adding rln contract deployment script (#30)
* chore: add rln registry deploy script * removed local variables, now passed via docker enviroment * foundry service now also running contract deploy script * replaced hardcoded contract bytecode with bytecode retrieved from github * fixed variable naming * Added Anvil RPC_URL to env file * new docker service to get waku-rln-contract repo, build it and deploy * added entrypoint: sh to contract-repo-deployer and deploy script now has bash/sh --------- Co-authored-by: rymnc <43716372+rymnc@users.noreply.github.com>
This commit is contained in:
parent
d6fb3e56e5
commit
5c7909eb92
18
deploy_rln_contract.sh
Normal file
18
deploy_rln_contract.sh
Normal file
@ -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
|
||||||
|
|
||||||
|
#. 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
|
||||||
@ -16,15 +16,32 @@ services:
|
|||||||
com.centurylinklabs.watchtower.enable: '${WATCHTOWER_ENABLED:-false}'
|
com.centurylinklabs.watchtower.enable: '${WATCHTOWER_ENABLED:-false}'
|
||||||
ports:
|
ports:
|
||||||
- 127.0.0.1:8545:8545
|
- 127.0.0.1:8545:8545
|
||||||
command: >
|
command:
|
||||||
"anvil
|
- anvil
|
||||||
--port=8545
|
--port=8545
|
||||||
--host=0.0.0.0
|
--host=0.0.0.0
|
||||||
--chain-id=1337
|
--chain-id=1337
|
||||||
--block-time=12
|
--accounts=1
|
||||||
--accounts=1
|
--allow-origin=*
|
||||||
--allow-origin=*
|
--block-time=12
|
||||||
--silent"
|
--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:
|
networks:
|
||||||
- simulation
|
- simulation
|
||||||
|
|
||||||
@ -41,7 +58,7 @@ services:
|
|||||||
- 127.0.0.1:8645:8645
|
- 127.0.0.1:8645:8645
|
||||||
entrypoint: sh
|
entrypoint: sh
|
||||||
command:
|
command:
|
||||||
- '/opt/run_bootstrap.sh'
|
- '/opt/run_bootstrap.sh'
|
||||||
volumes:
|
volumes:
|
||||||
- ./run_bootstrap.sh:/opt/run_bootstrap.sh:Z
|
- ./run_bootstrap.sh:/opt/run_bootstrap.sh:Z
|
||||||
networks:
|
networks:
|
||||||
@ -56,7 +73,7 @@ services:
|
|||||||
replicas: ${NUM_NWAKU_NODES:-5}
|
replicas: ${NUM_NWAKU_NODES:-5}
|
||||||
entrypoint: sh
|
entrypoint: sh
|
||||||
environment:
|
environment:
|
||||||
- RPC_URL=http://foundry:8545
|
- RPC_URL=${RPC_URL:-http://foundry:8545}
|
||||||
- PRIVATE_KEY=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
|
- PRIVATE_KEY=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
|
||||||
- RLN_CONTRACT_ADDRESS=0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0
|
- RLN_CONTRACT_ADDRESS=0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0
|
||||||
- RLN_CREDENTIAL_PATH=/keystore.json
|
- RLN_CREDENTIAL_PATH=/keystore.json
|
||||||
@ -67,7 +84,7 @@ services:
|
|||||||
- ./run_nwaku.sh:/opt/run_nwaku.sh:Z
|
- ./run_nwaku.sh:/opt/run_nwaku.sh:Z
|
||||||
depends_on:
|
depends_on:
|
||||||
- bootstrap
|
- bootstrap
|
||||||
- foundry
|
- contract-repo-deployer
|
||||||
networks:
|
networks:
|
||||||
- simulation
|
- simulation
|
||||||
|
|
||||||
@ -165,7 +182,7 @@ services:
|
|||||||
ports:
|
ports:
|
||||||
- 127.0.0.1:8090:8090
|
- 127.0.0.1:8090:8090
|
||||||
environment:
|
environment:
|
||||||
- NODE_ENDPOINT=http://foundry:8545
|
- NODE_ENDPOINT=${RPC_URL:-http://foundry:8545}
|
||||||
- MONGO_CLIENT_URI=mongodb://mongodb:27017
|
- MONGO_CLIENT_URI=mongodb://mongodb:27017
|
||||||
- REINDEX_ENDPOINT=http://ingestion/reindex/
|
- REINDEX_ENDPOINT=http://ingestion/reindex/
|
||||||
- MONGO_DB_NAME=epirus
|
- MONGO_DB_NAME=epirus
|
||||||
@ -204,7 +221,7 @@ services:
|
|||||||
ingestion:
|
ingestion:
|
||||||
image: web3labs/epirus-free-ingestion:latest
|
image: web3labs/epirus-free-ingestion:latest
|
||||||
environment:
|
environment:
|
||||||
- NODE_ENDPOINT=http://foundry:8545
|
- NODE_ENDPOINT=${RPC_URL:-http://foundry:8545}
|
||||||
- MONGO_CLIENT_URI=mongodb://mongodb:27017
|
- MONGO_CLIENT_URI=mongodb://mongodb:27017
|
||||||
- MONGO_DB_NAME=epirus
|
- MONGO_DB_NAME=epirus
|
||||||
- LIST_OF_METRICS_TO_CALCULATE_PER_MINUTE=hourly,daily,monthly,yearly
|
- LIST_OF_METRICS_TO_CALCULATE_PER_MINUTE=hourly,daily,monthly,yearly
|
||||||
|
|||||||
@ -10,3 +10,5 @@ MSG_SIZE_KBYTES=10
|
|||||||
TRAFFIC_DELAY_SECONDS=15
|
TRAFFIC_DELAY_SECONDS=15
|
||||||
# Enable automatic Docker image updates.
|
# Enable automatic Docker image updates.
|
||||||
WATCHTOWER_ENABLED=true
|
WATCHTOWER_ENABLED=true
|
||||||
|
# Anvil RPC Node external IP and port
|
||||||
|
RPC_URL=http://foundry:8545
|
||||||
Loading…
x
Reference in New Issue
Block a user