Git Product home page Git Product logo

go-waku-compose's Introduction

go-waku-compose

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

  • 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.
  • Grafana dashboard for advanced users or node operators.
  • Requires docker-compose and git.

๐Ÿ“ 0. Prerequisites

You need:

  • Ethereum Sepolia WebSocket 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.

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 go-waku 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: go-waku node, database and grafana for metrics. Your RLN membership is loaded into go-waku under the hood.

docker-compose up -d

๐Ÿ„๐Ÿผโ€โ™‚๏ธ 3. Interact with your go-waku node

๐Ÿ“ฌ 4. Use the REST API

Your go-waku node exposes a REST API to interact with it.

# get go-waku version
curl http://127.0.0.1:8645/debug/v1/version
# get go-waku 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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.