mirror of
https://github.com/logos-messaging/go-waku-compose.git
synced 2026-01-02 04:53:09 +00:00
feat: changes to make compose work with go-waku
This commit is contained in:
parent
7d9bcac50b
commit
b60a99f858
@ -6,9 +6,9 @@ Information for advances users
|
|||||||
|
|
||||||
There are multiple environment variables you can configure to modify behaviour of the Waku node:
|
There are multiple environment variables you can configure to modify behaviour of the Waku node:
|
||||||
|
|
||||||
* `NWAKU_IMAGE` - the image you want to use for the nwaku container (e.g. `NWAKU_IMAGE=statusteam/nim-waku:v0.19.0-rc.0`). You can see the available tags in [docker hub](https://hub.docker.com/r/waku-org/nwaku).
|
* `GO_WAKU_IMAGE` - the image you want to use for the go-waku container (e.g. `GO_WAKU_IMAGE=wakuorg/go-waku:v0.9.0`). You can see the available tags in [docker hub](https://hub.docker.com/r/waku-org/go-waku).
|
||||||
* `DOMAIN` - domain name pointing to the IP address of your node, when configured the run script will request SSL certs from Let's Encrypt and run Waku node with WebSockets Secure (WSS) options enabled (e.g. `DOMAIN=waku.example.com`)
|
* `DOMAIN` - domain name pointing to the IP address of your node, when configured the run script will request SSL certs from Let's Encrypt and run Waku node with WebSockets Secure (WSS) options enabled (e.g. `DOMAIN=waku.example.com`)
|
||||||
* `NODEKEY` - this env variable allows you to provide a node key as described in [operators documentation](https://github.com/waku-org/nwaku/blob/master/docs/operators/how-to/configure-key.md) (e.g. `NODEKEY=9f439983aa4851346cfe6e17585e426f482871a43626812e23490895cd602c11`)
|
* `NODEKEY` - this env variable allows you to provide a node key as described in [operators documentation](https://github.com/waku-org/go-waku/blob/master/docs/operators/how-to/configure-key.md) (e.g. `NODEKEY=9f439983aa4851346cfe6e17585e426f482871a43626812e23490895cd602c11`)
|
||||||
* `RLN_RELAY_CONTRACT_ADDRESS` - address of the RLN Relay Contract. It defaults to a Sepolia testnet address
|
* `RLN_RELAY_CONTRACT_ADDRESS` - address of the RLN Relay Contract. It defaults to a Sepolia testnet address
|
||||||
* `ETH_CLIENT_ADDRESS` (**mandatory**) - URL to a WebSockets Ethereum node URL on the same network as the contract address. If you're not running your own node, you can get the URL at Infura with the following [instructions](https://docs.infura.io/networks/ethereum/how-to/choose-a-network)
|
* `ETH_CLIENT_ADDRESS` (**mandatory**) - URL to a WebSockets Ethereum node URL on the same network as the contract address. If you're not running your own node, you can get the URL at Infura with the following [instructions](https://docs.infura.io/networks/ethereum/how-to/choose-a-network)
|
||||||
* `RLN_RELAY_CRED_PATH` - path for peristing rln-relay credential
|
* `RLN_RELAY_CRED_PATH` - path for peristing rln-relay credential
|
||||||
@ -23,10 +23,10 @@ To ensure the proper functioning of the container, it is strongly recommended to
|
|||||||
|
|
||||||
To check the status of the node, visit [http://localhost:8003/health](http://localhost:8003/health)
|
To check the status of the node, visit [http://localhost:8003/health](http://localhost:8003/health)
|
||||||
|
|
||||||
For real-time logs of the 'nwaku' service, use the following command:
|
For real-time logs of the 'go-waku' service, use the following command:
|
||||||
|
|
||||||
```console
|
```console
|
||||||
docker-compose logs -f nwaku
|
docker-compose logs -f go-waku
|
||||||
```
|
```
|
||||||
|
|
||||||
In general, to view logs of any service running on Docker Compose, execute:
|
In general, to view logs of any service running on Docker Compose, execute:
|
||||||
|
|||||||
22
README.md
22
README.md
@ -1,7 +1,7 @@
|
|||||||
# nwaku-compose
|
# go-waku-compose
|
||||||
|
|
||||||
Ready to use docker-compose to run your own [nwaku](https://github.com/waku-org/nwaku) full node:
|
Ready to use docker-compose to run your own [go-waku](https://github.com/waku-org/go-waku) full node:
|
||||||
* nwaku node running relay and store protocols with RLN enabled.
|
* go-waku node running relay and store protocols with RLN enabled.
|
||||||
* Simple frontend to interact with your node and the network, to publish and receive messages.
|
* Simple frontend to interact with your node and the network, to publish and receive messages.
|
||||||
* Grafana dashboard for advanced users or node operators.
|
* Grafana dashboard for advanced users or node operators.
|
||||||
* Requires `docker-compose` and `git`.
|
* Requires `docker-compose` and `git`.
|
||||||
@ -22,7 +22,7 @@ export KEYSTORE_PASSWORD=PICK_A_PASSWORD
|
|||||||
|
|
||||||
**🔑 1. Register RLN membership**
|
**🔑 1. Register RLN membership**
|
||||||
|
|
||||||
The RLN membership is your access key to The Waku Network. Its registration is done onchain, and allows your nwaku node to publish messages in a decentralized and private way, respecting some [rate limits](https://rfc.vac.dev/spec/64/#rate-limit-exceeded).
|
The RLN membership is your access key to The Waku Network. Its registration is done onchain, and allows your go-waku node to publish messages in a decentralized and private way, respecting some [rate limits](https://rfc.vac.dev/spec/64/#rate-limit-exceeded).
|
||||||
Messages exceeding the rate limit won't be relayed by other peers.
|
Messages exceeding the rate limit won't be relayed by other peers.
|
||||||
|
|
||||||
This command will register your membership and store it in `keystore/keystore.json`.
|
This command will register your membership and store it in `keystore/keystore.json`.
|
||||||
@ -34,23 +34,23 @@ Note that if you just want to relay traffic (not publish), you don't need one.
|
|||||||
|
|
||||||
**🖥️ 2. Start your node**
|
**🖥️ 2. Start your node**
|
||||||
|
|
||||||
Start all processes: nwaku node, database and grafana for metrics. Your RLN membership is loaded into nwaku under the hood.
|
Start all processes: go-waku node, database and grafana for metrics. Your RLN membership is loaded into go-waku under the hood.
|
||||||
```console
|
```console
|
||||||
docker-compose up -d
|
docker-compose up -d
|
||||||
```
|
```
|
||||||
|
|
||||||
**🏄🏼♂️ 3. Interact with your nwaku node**
|
**🏄🏼♂️ 3. Interact with your go-waku node**
|
||||||
* See [http://localhost:3000/d/yns_4vFVk/nwaku-monitoring](http://localhost:3000/d/yns_4vFVk/nwaku-monitoring) for node metrics.
|
* See [http://localhost:3000/d/yns_4vFVk/go-waku-monitoring](http://localhost:3000/d/yns_4vFVk/go-waku-monitoring) for node metrics.
|
||||||
* See [localhost:4000](http://localhost:4000). Under development 🚧
|
* See [localhost:4000](http://localhost:4000). Under development 🚧
|
||||||
|
|
||||||
**📬 4. Use the REST API**
|
**📬 4. Use the REST API**
|
||||||
|
|
||||||
Your nwaku node exposes a [REST API](https://waku-org.github.io/waku-rest-api/) to interact with it.
|
Your go-waku node exposes a [REST API](https://waku-org.github.io/waku-rest-api/) to interact with it.
|
||||||
|
|
||||||
```
|
```
|
||||||
# get nwaku version
|
# get go-waku version
|
||||||
curl http://127.0.0.1:8645/debug/v1/version
|
curl http://127.0.0.1:8645/debug/v1/version
|
||||||
# get nwaku info
|
# get go-waku info
|
||||||
curl http://127.0.0.1:8645/debug/v1/info
|
curl http://127.0.0.1:8645/debug/v1/info
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -68,4 +68,4 @@ curl -X GET "http://127.0.0.1:8645/store/v1/messages?contentTopics=%2Fmy-app%2F2
|
|||||||
-H "accept: application/json"
|
-H "accept: application/json"
|
||||||
```
|
```
|
||||||
|
|
||||||
For advanced documentation, refer to [ADVANCED.md](https://github.com/waku-org/nwaku-compose/blob/master/ADVANCED.md).
|
For advanced documentation, refer to [ADVANCED.md](https://github.com/waku-org/go-waku-compose/blob/master/ADVANCED.md).
|
||||||
|
|||||||
@ -30,8 +30,8 @@ x-pg-exporter-env: &pg_exp_env
|
|||||||
|
|
||||||
# Services definitions
|
# Services definitions
|
||||||
services:
|
services:
|
||||||
nwaku:
|
go-waku:
|
||||||
image: ${NWAKU_IMAGE:-wakuorg/nwaku:v0.22.0-rc.0}
|
image: ${GO_WAKU_IMAGE:-wakuorg/go-waku:v0.9.0}
|
||||||
restart: on-failure
|
restart: on-failure
|
||||||
ports:
|
ports:
|
||||||
- 30304:30304/tcp
|
- 30304:30304/tcp
|
||||||
@ -74,7 +74,7 @@ services:
|
|||||||
# - 127.0.0.1:4000:3000
|
# - 127.0.0.1:4000:3000
|
||||||
# restart: on-failure:5
|
# restart: on-failure:5
|
||||||
# depends_on:
|
# depends_on:
|
||||||
# - nwaku
|
# - go-waku
|
||||||
|
|
||||||
prometheus:
|
prometheus:
|
||||||
image: docker.io/prom/prometheus:latest
|
image: docker.io/prom/prometheus:latest
|
||||||
@ -87,7 +87,7 @@ services:
|
|||||||
restart: on-failure:5
|
restart: on-failure:5
|
||||||
depends_on:
|
depends_on:
|
||||||
- postgres-exporter
|
- postgres-exporter
|
||||||
- nwaku
|
- go-waku
|
||||||
|
|
||||||
grafana:
|
grafana:
|
||||||
image: docker.io/grafana/grafana:latest
|
image: docker.io/grafana/grafana:latest
|
||||||
|
|||||||
@ -551,7 +551,7 @@
|
|||||||
},
|
},
|
||||||
"editorMode": "builder",
|
"editorMode": "builder",
|
||||||
"exemplar": false,
|
"exemplar": false,
|
||||||
"expr": "waku_version{instance=\"nwaku:8003\"}",
|
"expr": "waku_version{instance=\"go-waku:8003\"}",
|
||||||
"format": "table",
|
"format": "table",
|
||||||
"instant": true,
|
"instant": true,
|
||||||
"legendFormat": "__auto",
|
"legendFormat": "__auto",
|
||||||
@ -786,7 +786,7 @@
|
|||||||
"include": {
|
"include": {
|
||||||
"names": [
|
"names": [
|
||||||
"Time",
|
"Time",
|
||||||
"{__name__=\"routing_table_nodes\", instance=\"nwaku:8003\", job=\"nwaku\"}"
|
"{__name__=\"routing_table_nodes\", instance=\"go-waku:8003\", job=\"go-waku\"}"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -977,7 +977,7 @@
|
|||||||
"uid": "PBFA97CFB590B2093"
|
"uid": "PBFA97CFB590B2093"
|
||||||
},
|
},
|
||||||
"editorMode": "code",
|
"editorMode": "code",
|
||||||
"expr": "process_start_time_seconds{job=\"nwaku\"}*1000",
|
"expr": "process_start_time_seconds{job=\"go-waku\"}*1000",
|
||||||
"legendFormat": "__auto",
|
"legendFormat": "__auto",
|
||||||
"range": true,
|
"range": true,
|
||||||
"refId": "A"
|
"refId": "A"
|
||||||
@ -4736,7 +4736,7 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"timezone": "browser",
|
"timezone": "browser",
|
||||||
"title": "nwaku-monitoring",
|
"title": "go-waku-monitoring",
|
||||||
"uid": "yns_4vFVk",
|
"uid": "yns_4vFVk",
|
||||||
"version": 1,
|
"version": 1,
|
||||||
"weekStart": ""
|
"weekStart": ""
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
instance_name = nwaku dashboard
|
instance_name = go-waku dashboard
|
||||||
|
|
||||||
;[dashboards.json]
|
;[dashboards.json]
|
||||||
;enabled = true
|
;enabled = true
|
||||||
|
|||||||
@ -6,12 +6,11 @@ if test -f ./keystore/keystore.json; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# TODO: Set nwaku release when ready instead of quay
|
# TODO: Set go-waku release when ready
|
||||||
|
|
||||||
docker run -v $(pwd)/keystore:/keystore/:Z wakuorg/nwaku:v0.21.3 generateRlnKeystore \
|
docker run -v $(pwd)/keystore:/keystore/:Z wakuorg/go-waku:v0.9.0 generate-rln-credentials \
|
||||||
--rln-relay-eth-client-address=${ETH_CLIENT_ADDRESS} \
|
--eth-client-address=${ETH_CLIENT_ADDRESS} \
|
||||||
--rln-relay-eth-private-key=${ETH_TESTNET_KEY} \
|
--eth-account-private-key=${ETH_TESTNET_KEY} \
|
||||||
--rln-relay-eth-contract-address=0xF471d71E9b1455bBF4b85d475afb9BB0954A29c4 \
|
--eth-contract-address=0xF471d71E9b1455bBF4b85d475afb9BB0954A29c4 \
|
||||||
--rln-relay-cred-path=/keystore/keystore.json \
|
--cred-path=/keystore/keystore.json \
|
||||||
--rln-relay-cred-password=${KEYSTORE_PASSWORD} \
|
--cred-password=${KEYSTORE_PASSWORD}
|
||||||
--execute
|
|
||||||
@ -1,6 +1,6 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
echo "I am a nwaku node"
|
echo "I am a go-waku node"
|
||||||
|
|
||||||
if [ -z "${ETH_CLIENT_ADDRESS}" ]; then
|
if [ -z "${ETH_CLIENT_ADDRESS}" ]; then
|
||||||
echo "Missing Eth client address, please refer to README.md for detailed instructions"
|
echo "Missing Eth client address, please refer to README.md for detailed instructions"
|
||||||
@ -54,7 +54,7 @@ if [ -n "${RLN_RELAY_CRED_PASSWORD}" ]; then
|
|||||||
RLN_RELAY_CRED_PASSWORD=--rln-relay-cred-password=${RLN_RELAY_CRED_PASSWORD}
|
RLN_RELAY_CRED_PASSWORD=--rln-relay-cred-password=${RLN_RELAY_CRED_PASSWORD}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exec /usr/bin/wakunode\
|
exec /usr/bin/waku\
|
||||||
--relay=true\
|
--relay=true\
|
||||||
--pubsub-topic=/waku/2/rs/1/0\
|
--pubsub-topic=/waku/2/rs/1/0\
|
||||||
--pubsub-topic=/waku/2/rs/1/1\
|
--pubsub-topic=/waku/2/rs/1/1\
|
||||||
@ -67,7 +67,6 @@ exec /usr/bin/wakunode\
|
|||||||
--filter=true\
|
--filter=true\
|
||||||
--lightpush=true\
|
--lightpush=true\
|
||||||
--rpc-admin=true\
|
--rpc-admin=true\
|
||||||
--keep-alive=true\
|
|
||||||
--max-connections=150\
|
--max-connections=150\
|
||||||
--cluster-id=1\
|
--cluster-id=1\
|
||||||
--discv5-bootstrap-node="enr:-QESuEC1p_s3xJzAC_XlOuuNrhVUETmfhbm1wxRGis0f7DlqGSw2FM-p2Ugl_r25UHQJ3f1rIRrpzxJXSMaJe4yk1XFSAYJpZIJ2NIJpcISygI2rim11bHRpYWRkcnO4XAArNiZub2RlLTAxLmRvLWFtczMud2FrdS50ZXN0LnN0YXR1c2ltLm5ldAZ2XwAtNiZub2RlLTAxLmRvLWFtczMud2FrdS50ZXN0LnN0YXR1c2ltLm5ldAYfQN4DgnJzkwABCAAAAAEAAgADAAQABQAGAAeJc2VjcDI1NmsxoQJATXRSRSUyTw_QLB6H_U3oziVQgNRgrXpK7wp2AMyNxYN0Y3CCdl-DdWRwgiMohXdha3UyDw"\
|
--discv5-bootstrap-node="enr:-QESuEC1p_s3xJzAC_XlOuuNrhVUETmfhbm1wxRGis0f7DlqGSw2FM-p2Ugl_r25UHQJ3f1rIRrpzxJXSMaJe4yk1XFSAYJpZIJ2NIJpcISygI2rim11bHRpYWRkcnO4XAArNiZub2RlLTAxLmRvLWFtczMud2FrdS50ZXN0LnN0YXR1c2ltLm5ldAZ2XwAtNiZub2RlLTAxLmRvLWFtczMud2FrdS50ZXN0LnN0YXR1c2ltLm5ldAYfQN4DgnJzkwABCAAAAAEAAgADAAQABQAGAAeJc2VjcDI1NmsxoQJATXRSRSUyTw_QLB6H_U3oziVQgNRgrXpK7wp2AMyNxYN0Y3CCdl-DdWRwgiMohXdha3UyDw"\
|
||||||
@ -76,7 +75,7 @@ exec /usr/bin/wakunode\
|
|||||||
--discv5-discovery=true\
|
--discv5-discovery=true\
|
||||||
--discv5-udp-port=9005\
|
--discv5-udp-port=9005\
|
||||||
--discv5-enr-auto-update=True\
|
--discv5-enr-auto-update=True\
|
||||||
--log-level=DEBUG\
|
--log-level=INFO\
|
||||||
--rpc-port=8545\
|
--rpc-port=8545\
|
||||||
--rpc-address=0.0.0.0\
|
--rpc-address=0.0.0.0\
|
||||||
--tcp-port=30304\
|
--tcp-port=30304\
|
||||||
@ -89,7 +88,7 @@ exec /usr/bin/wakunode\
|
|||||||
--nat=extip:"${MY_EXT_IP}"\
|
--nat=extip:"${MY_EXT_IP}"\
|
||||||
--store=true\
|
--store=true\
|
||||||
--store-message-db-url="postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/postgres"\
|
--store-message-db-url="postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/postgres"\
|
||||||
--store-message-retention-policy=time:86400\
|
--store-message-retention-time=24h0m0s\
|
||||||
--rln-relay=true\
|
--rln-relay=true\
|
||||||
--rln-relay-dynamic=true\
|
--rln-relay-dynamic=true\
|
||||||
--rln-relay-eth-contract-address="${RLN_RELAY_CONTRACT_ADDRESS}"\
|
--rln-relay-eth-contract-address="${RLN_RELAY_CONTRACT_ADDRESS}"\
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user