nwaku/examples/v1
Ivan Folgueira Bande 665484c17b
refactor: proper use of setupNat (#1740)
Notice that I had to adapt to use 'rlpx_connected_peers' instead
of 'connected_peers' in 'wakunode1.nim' because due to the update
of the 'vendor/nim-eth', which adds the dependency-break with
'confutils' but also includes another changes.

Aside note: we cannot have 'confutils' dependency in 'nim-eth' because
that will prevent the generation of any waku dynamic library.
2023-05-17 18:32:53 +02:00
..
README.md And update example readme with correct make target 2020-10-09 09:32:05 +02:00
config_example.nim fix: replace TaintedString type deprecated in nim 1.5 2022-11-02 14:55:48 +01:00
example.nim refactor: proper use of setupNat (#1740) 2023-05-17 18:32:53 +02:00
nim.cfg chore: build rln dependecies only when building v2 2022-11-07 09:14:21 +01:00

README.md

Waku v1 example

Introduction

This is a basic Waku v1 example to show the Waku v1 API usage.

It can be run as a single node, in which case it will just post and receive its own messages.

Or multiple nodes can be started and can connect to each other, so that messages can be passed around.

How to build

make example1

How to run

Single node

# Lauch example node
./build/example

Messages will be posted and received.

Multiple nodes

# Launch first example node
./build/example

Now look for an INFO log containing the enode address, e.g.: enode://26..5b@0.0.0.0:30303 (but with full address)

Copy the full enode string of the first node and start the second node with that enode string as staticnode config option:

# Launch second example node, providing the enode address of the first node
./build/example --staticnode:enode://26..5b@0.0.0.0:30303 --ports-shift:1

Now both nodes will receive also messages from each other.