Deployment docker-compose files to deploy an nwaku node
Go to file
Vaclav Pavlin 1e5e465b10
Merge pull request #13 from waku-org/fix/use-volume-for-pg
fix: use volume for PG data
2023-10-26 10:17:17 +02:00
monitoring grafana.ini: making sure the credentials window appears & update README.md 2023-08-09 16:27:57 +02:00
postgres_cfg Initial release of nwaku-compose 2023-08-09 12:36:03 +02:00
.gitignore Initial release of nwaku-compose 2023-08-09 12:36:03 +02:00
README.md chore: adding maximum of 5 retries on failure 2023-10-03 15:34:52 +03:00
docker-compose.yml fix: use volume for PG data 2023-10-18 14:40:03 +02:00
run_node.sh Update run_node.sh 2023-10-02 15:07:23 +02:00

README.md

nwaku-compose

Ready to use docker-compose that runs a nwaku node and monitors it with already set up and configured postgres, grafana and prometheus instances. All in just a few steps.

Instructions

Note that you must have installed docker-compose and git.

Get the code:

git clone git@github.com:waku-org/nwaku-compose.git
cd nwaku-compose

Edit the environment variables present at the beginning of the docker-compose.yml file.

Start everything: nwaku, postgres, prometheus, and grafana.

docker-compose up -d

Go to http://localhost:3000/d/yns_4vFVk/nwaku-monitoring?orgId=1, type the credentials (by default,"admin", "admin") and after some seconds, your node metrics will be live there, just like in the picture. As simple as that.

grafana-dashboard

Notes:

  • Feel free to change the image you are using statusteam/nim-waku:xxx. You can see the available tags in docker hub.
  • If you want to access grafana from outside your machine, feel free to remove 127.0.0.1 and open the port, but in that case you may want to set up a password to your grafana.

Configuration

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)
  • 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 (e.g. NODEKEY=9f439983aa4851346cfe6e17585e426f482871a43626812e23490895cd602c11)
  • EXTRA_ARGS - this variable allows you to specify additional or overriding CLI option for the Waku node which will be appended to the wakunode2 command. (e.g. EXTRA_ARGS="--store=false --max-connections=3000)

Log monitoring and troubleshooting

When running the container in detached mode, it's important to note that while notifications about successful container startup are received, any errors occurring during runtime won't be printed to the terminal.

To ensure the proper functioning of the container, it is strongly recommended to monitor the logs. Pay special attention during the first minute of runtime to confirm that the node has spun up successfully.

To check the status of the node, visit http://localhost:8003/health

For real-time logs of the 'nwaku' service, use the following command:

docker-compose logs nwaku -f

In general, to view logs of any service running on Docker Compose, execute:

docker-compose logs <service> -f

To identify different services currently running, refer to the "SERVICE" column displayed when executing:

docker-compose ps

services