nwaku/examples/v2
Aaryamann Challani 9ddf0fe1e2
feat(discv5): advertise custom multiaddresses (#1512)
* feat(discv5): allow custom multiaddr advertisement in discv5

feat(discv5): allow custom multiaddr advertisement in discv5

feat(discv5): move discv5 setup from wakunode2 to waku_node

fix(waku_node): def param

test(discv5): test for ext multiaddr

fix(discv5): address comments

fix(discv5): address comments

fix(wakunode2): discoveryconfig in var before init

fix(discv5): pass multiaddr to discv5 directly

fix(discv5): make multiaddrs optional

fix(test): discv5 init

fix(discv5): split discv5 mounting from waku_node

chore(discv5): s/WakuAddressMetadata/WakuNodeAddrMeta/g

* fix(waku_node): 1.25 max conns

* fix(discv5): s/WakuNodeAddrMeta/NetConfig/g

* fix(discv5): address reviews

* fix(discv5): smaller try-catches

* fix(discv5): missing arg

* fix: compile error
2023-02-07 18:36:50 +05:30
..
README.md chore(examples): add pubsub example with production env (#1333) 2022-11-04 13:40:24 +01:00
nim.cfg feat(wakunode2): support log format format selection 2022-12-07 12:30:32 +01:00
publisher.nim feat(discv5): advertise custom multiaddresses (#1512) 2023-02-07 18:36:50 +05:30
subscriber.nim feat(discv5): advertise custom multiaddresses (#1512) 2023-02-07 18:36:50 +05:30

README.md

# basic2

TODO

# publisher/subscriber

Within examples/v2 you can find a publisher and a subscriber. The first one publises messages to the default pubsub topic to a given content topic, and the second one runs forever listening to that pubsub topic and printing the content it receives.

Some notes:

  • These examples are meant to work even in if you are behind a firewall and you can't be discovered by discv5.
  • You only need to provide a reachable bootstrap peer (see our fleets)
  • The examples are meant to work out of the box.
  • Note that both services wait for some time until a given minimum amount of connections are reached. This is to ensure messages are gossiped.

Compile:

Make all examples.

make example2

Run:

Wait until the subscriber is ready.

./build/subscriber

And run a publisher

./build/publisher

See how the subscriber received the messages published by the publisher. Feel free to experiment from different machines in different locations.