mirror of https://github.com/waku-org/waku-lab.git
91d692747d | ||
---|---|---|
.. | ||
README.md | ||
favicon.ico | ||
favicon.png | ||
index.html | ||
index.js | ||
manifest.json | ||
package-lock.json | ||
package.json | ||
style.css | ||
webpack.config.js |
README.md
Direct WebRTC connection for Waku Relay
Demonstrates:
- Waku Relay node with direct WebRTC connection
- Pure Javascript/HTML.
This example uses WebRTC transport and Waku Relay to exchange messages.
To test the example run npm install
and then npm start
.
The master
branch's HEAD is deployed at https://lab.waku.org/relay-direct-chat/
Steps to run an example:
- Get a Waku node that implements
/libp2p/circuit/relay/0.2.0/hop
and/libp2p/circuit/relay/0.2.0/stop
1.1. Findgo-waku
node or 1.2. Build and then rungo-waku
node with following command:./build/waku --ws true --relay true --circuit-relay true
- Copy node's multiaddr (e.g
/ip4/192.168.0.101/tcp/60001/ws/p2p/16Uiu2HAm9w2xeDWFJm5eeGLZfJdaPtkNatQD1xrzK5EFWSeXdFvu
) - In
relay-chat
example's folder runnpm install
and thennpm start
- Use
go-waku
's multiaddr for Remote node multiaddr and press dial. Repeat in two more tabs. - In
tab2
copy Local Peer Id and use as WebRTC Peer intab1
and press dial. - In
tab1
ortab2
press Ensure WebRTC Relay connection - In
tab1
press Drop non WebRTC connections - In
tab1
enter Nickname and Message and send. - See the message in
tab3
which was connected only togo-waku
node.