Runs without .env customization, Added Hackres-README

This commit is contained in:
NagyZoltanPeter 2025-03-17 15:49:10 +01:00
parent db2a07c18e
commit 7d48c87458
No known key found for this signature in database
GPG Key ID: 16EADB9673B65368
4 changed files with 111 additions and 11 deletions

102
Hackers-README.md Normal file
View File

@ -0,0 +1,102 @@
# waku-simulator
Check 📖 [The Waku Simulator Book](https://waku-org.github.io/waku-simulator/)📖
## Quickstart
```
git clone https://github.com/waku-org/waku-simulator.git
cd waku-simulator
git checkout hackers-playground
```
Configure the simulation parameters. You can place the env variable in an `.env` file.
```
export NWAKU_IMAGE=quay.io/wakuorg/nwaku-pr:2759-rln-v2
export NUM_NWAKU_NODES=5
export PRIVATE_KEY=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
export ETH_FROM=0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266
export RLN_RELAY_EPOCH_SEC=10
export RLN_RELAY_MSG_LIMIT=2
export MAX_MESSAGE_LIMIT=100 # Contract's message limit. Needs to be higher or equal than RLN_RELAY_MSG_LIMIT, otherwise nodes won't start correctly.
```
Run the following command
```
docker compose up -d
```
(tested with Docker Compose version v2.28.1. Notice that we don't support docker compose v1)
## Warning
In case arp tables are overflowing:
```
sysctl net.ipv4.neigh.default.gc_thresh3=32000
```
# Hackers playground
This branch is for hacking on the simulator. It is not meant to be deployed to production, but good for testing out different scenarios and setups.
## Modifications from the original waku-simulator setup
This setup is intended to provide an out of the box local test network for waku and applications on test with it. So it extends the supported node included right into the simulator - there is no need to attach them from outside.
RLN support remained as it was originally supported by the simulator.
# Network cluster and shard
- Cluster-id: 66
- Shard: 0
- Pubsub-topic: /waku/2/rs66/0
# Bootstrap node
It has now fixed IP and ENR.
#### Accessing the bootstrap node
> Bootnode IP: 10.2.0.100
>
>Bootnode Multiaddr: "/ip4/10.2.0.100/tcp/60000/p2p/16Uiu2HAmGNtM2rQ8abySFNhqPDFY4cmfAEpfo9Z9fD3NekoFR2ip"
>
>Bootnode ENR: "enr:-LG4QK3uc1orOi79J5eAprzwyfj4QcYaR_oamz1YY0U3PmaRY807UrJTkQJiSDT8PNmIPwxIw9POrel-sf1OOTlcK9UCgmlkgnY0gmlwhAoCAGSKbXVsdGlhZGRyc4oACAQKAgBkBupggnJzhQBCAQAAiXNlY3AyNTZrMaEDN06qX-XhZ-Cc7ZuIAdGNCVUicscmbFvEEfkFOQ2W_j2DdGNwgupgg3VkcIIjKIV3YWt1MgA"
#### Rest api enabled
> http://127.0.0.1:8646
# Nwaku Service Node
A full featrued relay service node is added to the network - similar to nwaku-compose setup.
It has filter, lightpush and store mounted on it.
#### Accessing the service node
> Service node IP: 10.2.0.101
>
>Service node Multiaddr: "/ip4/10.2.0.101/tcp/60001/p2p/16Uiu2HAkyte8uj451tGkbww4Mjcg6DRnmAHxNeWyF4zp23RbpG3n"
>
>Service node Websocket Multiaddr: "/ip4/10.2.0.101/tcp/8000/ws/p2p/16Uiu2HAkyte8uj451tGkbww4Mjcg6DRnmAHxNeWyF4zp23RbpG3n"
>
>Service node ENR: "enr:-LO4QDhRxZ-YJBeiriq07BkSiA-qSJCcy3Kz7bAWXeop48dIPpsQK2QNuDX7umonw3Wu0zFXXoMxGrIFmpQiJ1mBd_sBgmlkgnY0gmlwhAoCAGWKbXVsdGlhZGRyc4wACgQKAgBlBh9A3QOCcnOFAEIBAACJc2VjcDI1NmsxoQJCV1iKpD3kj-6EDB8QIiRtUZE3-g0OK1QbmXL2OoziNYN0Y3CC6mCDdWRwgiMohXdha3UyDw"
#### Rest api enabled
> http://127.0.0.1:8645
# NWaku Edge node
A light/edge node is added with only lightpush-client, filter-client and store-client mounted on it.
Relay is disabled. Discover is switched of but directly linked to the service node.
#### Accessing the edge node
> Edge node IP: 10.2.0.102
>
>Edge node Multiaddr: "/ip4/10.2.0.102/tcp/60002/p2p/16Uiu2HAm5tojCrfxXrum5VxAVtCQk6h1jkA2Ecy447rQkKwwgf51"
>
>Edge node ENR: "enr:-KC4QAsSQM0tP9Zs8UxbHl3pe7HKE_0xLNA2P5LLVCbzCArsATKeH6EK43hhQJznAKjaMcpzqbMcd3UEjYJSkahMyg4BgmlkgnY0gmlwhAoCAGaKbXVsdGlhZGRyc4CCcnOFAEIBAACJc2VjcDI1NmsxoQKbiE_1i7pL24P02qgEFs0jHaso1XPo8HmcXAfqJPjGeIN0Y3CC6mKFd2FrdTIA"
#### Rest api enabled
> http://127.0.0.1:8644

View File

@ -54,7 +54,7 @@ services:
foundry:
image: ghcr.io/foundry-rs/foundry:nightly-9b73e06e1fe376738b92ae081107620291d50188
labels:
com.centurylinklabs.watchtower.enable: '${WATCHTOWER_ENABLED:-false}'
com.centurylinklabs.watchtower.enable: '${WATCHTOWER_ENABLED:-true}'
ports:
- 0.0.0.0:8545:8545
command:
@ -75,12 +75,12 @@ services:
contract-repo-deployer:
image: node:hydrogen-bullseye
labels:
com.centurylinklabs.watchtower.enable: '${WATCHTOWER_ENABLED:-false}'
com.centurylinklabs.watchtower.enable: '${WATCHTOWER_ENABLED:-true}'
environment:
- RLN_CONTRACT_REPO_COMMIT=${RLN_CONTRACT_REPO_COMMIT:-64df4593c6a14e43b8b0e9b396d2f4772bb08b34}
- PRIVATE_KEY=${PRIVATE_KEY}
- PRIVATE_KEY=${PRIVATE_KEY:-0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80}
- RPC_URL=${RPC_URL:-http://foundry:8545}
- ETH_FROM=${ETH_FROM}
- ETH_FROM=${ETH_FROM:-0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266}
- MAX_MESSAGE_LIMIT=${MAX_MESSAGE_LIMIT:-20}
entrypoint: sh
command:
@ -96,7 +96,7 @@ services:
image: ${NWAKU_IMAGE:-wakuorg/nwaku:latest}
restart: on-failure
labels:
com.centurylinklabs.watchtower.enable: '${WATCHTOWER_ENABLED:-false}'
com.centurylinklabs.watchtower.enable: '${WATCHTOWER_ENABLED:-true}'
# TODO: expose some ports to inject traffic
ports:
- 127.0.0.1:60000:60000
@ -116,7 +116,7 @@ services:
image: ${NWAKU_IMAGE:-wakuorg/nwaku:latest}
restart: on-failure
labels:
com.centurylinklabs.watchtower.enable: '${WATCHTOWER_ENABLED:-false}'
com.centurylinklabs.watchtower.enable: '${WATCHTOWER_ENABLED:-true}'
ports:
- 127.0.0.1:60001:60001/tcp
- 127.0.0.1:60001:60001/udp
@ -148,7 +148,7 @@ services:
image: ${NWAKU_IMAGE:-wakuorg/nwaku:latest}
restart: on-failure
labels:
com.centurylinklabs.watchtower.enable: '${WATCHTOWER_ENABLED:-false}'
com.centurylinklabs.watchtower.enable: '${WATCHTOWER_ENABLED:-true}'
deploy:
replicas: ${NUM_NWAKU_NODES:-5}
entrypoint: sh

View File

@ -36,7 +36,7 @@ exec /usr/bin/wakunode\
--rest-admin=true\
--rest-address=0.0.0.0\
--rest-port=8645\
--rest-allow-origin="waku-org.github.io"\
--rest-allow-origin="waku-org.github.iLightPushResponse.relayPeerCount.typeo"\
--rest-allow-origin="localhost:*"\
--log-level=INFO\
--metrics-server=True\
@ -45,5 +45,4 @@ exec /usr/bin/wakunode\
--tcp-port:60002\
--pubsub-topic=/waku/2/rs/66/0\
--cluster-id=66\
--nodekey=5358f02c157accb30a6c1d5920e778604de12e23d6009512be44f72f1a64d828\
--relay-service-ratio="0:100"
--nodekey=5358f02c157accb30a6c1d5920e778604de12e23d6009512be44f72f1a64d828

View File

@ -1,4 +1,3 @@
# Env variables for metal-01.he-eu-hel1.misc.wakusim host.
NWAKU_IMAGE=harbor.status.im/wakuorg/nwaku:latest
# Network scaling.
NUM_NWAKU_NODES=5