Deployment docker-compose files to deploy an nwaku node
Go to file
Ivan FB 2f40dfb138
Merge branch 'master' into patch-1
2024-09-11 11:09:16 +02:00
monitoring feat: nwaku dashboard with relay per shard, non-relay request rates and traffic panels (#99) 2024-08-28 16:17:14 +02:00
postgres_cfg Initial release of nwaku-compose 2023-08-09 12:36:03 +02:00
.env.example fix: eth related arguments have new `rln relay` prefix (#100) 2024-06-27 11:42:18 +10:00
.gitignore fix: include timestamp in curl command (#31) 2024-02-01 21:03:49 +01:00
ADVANCED.md fix: eth related arguments have new `rln relay` prefix (#100) 2024-06-27 11:42:18 +10:00
FAQ.md new faq item explaining how to migrate to a new server (#125) 2024-09-10 22:55:58 +02:00
README.md adding a FAQ page (#120) 2024-09-02 21:40:27 +02:00
chkhealth.sh Minor comment typos (#89) 2024-05-07 22:46:39 +02:00
docker-compose.yml chore: use dockerhub instead of harbor (#123) 2024-09-05 11:38:52 +10:00
register_rln.sh Merge branch 'master' into patch-1 2024-09-11 11:09:16 +02:00
run_node.sh fix: when guessing domain, double check domain returns right ip (#117) 2024-08-19 20:11:06 +10:00

README.md

nwaku-compose

Ready to use docker-compose to run your own nwaku full node:

  • nwaku node running relay and store protocols with RLN enabled.
  • Simple frontend to interact with your node and the network, to publish and receive messages.
  • Grafana dashboard for advanced users or node operators.
  • Requires docker-compose and git.

📝 0. Prerequisites

You need:

  • Ethereum Sepolia HTTP endpoint. Get one free from Infura.
  • Ethereum Sepolia account with some balance <0.01 Eth. Get some here.
  • A password to protect your rln membership.

docker-compose will read the ./.env file from the filesystem. There is .env.example available for you as a template to use for providing the above values. The process when working with .env files is to copy the .env.example, store it as .env and edit the values there.

cp .env.example .env
${EDITOR} .env

Make sure to NOT place any secrets into .env.example, as they might be unintentionally published in the Git repository.

🔑 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. 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. Note that if you just want to relay traffic (not publish), you don't need one.

./register_rln.sh

🖥️ 2. Start your node

Start all processes: nwaku node, database and grafana for metrics. Your RLN membership is loaded into nwaku under the hood.

docker-compose up -d

⚠️ The node might take ~5' the very first time it runs because it needs to build locally the RLN community membership tree.

🏄🏼‍♂️ 3. Interact with your nwaku node

📬 4. Use the REST API

Your nwaku node exposes a REST API to interact with it.

# get nwaku version
curl http://127.0.0.1:8645/debug/v1/version
# get nwaku info
curl http://127.0.0.1:8645/debug/v1/info

Publish a message to a contentTopic. Everyone subscribed to it will receive it. Note that payload is base64 encoded.

curl -X POST "http://127.0.0.1:8645/relay/v1/auto/messages" \
 -H "content-type: application/json" \
 -d '{"payload":"'$(echo -n "Hello Waku Network - from Anonymous User" | base64)'","contentTopic":"/my-app/2/chatroom-1/proto"}'

Get messages sent to a contentTopic. Note that any store node in the network is used to reply.

curl -X GET "http://127.0.0.1:8645/store/v1/messages?contentTopics=%2Fmy-app%2F2%2Fchatroom-1%2Fproto&pageSize=50&ascending=true" \
 -H "accept: application/json"

For advanced documentation, refer to ADVANCED.md.


How to update to latest version

We regularly announce new available versions in our Discord server.

If your last running version is v0.29 or older, you will need to delete both the keystore and rln_tree folders, and register your membership again before using the new version by running the following commands:

  1. cd nwaku-compose ( go into the root's repository folder )
  2. docker-compose down
  3. sudo rm -r keystore rln_tree
  4. git pull origin master
  5. ./register_rln.sh
  6. docker-compose up -d

For nodes running on v0.30 or newer, updating the node is as simple as running the following:

  1. cd nwaku-compose ( go into the root's repository folder )
  2. docker-compose down
  3. git pull origin master
  4. docker-compose up -d

FAQ

see