An open API service indexing awesome lists of open source software.

https://github.com/ringsnetwork/rings-wasm-p2p

This example shows how rings network works in wasm and browser envirement.
https://github.com/ringsnetwork/rings-wasm-p2p

Last synced: 11 months ago
JSON representation

This example shows how rings network works in wasm and browser envirement.

Awesome Lists containing this project

README

          


Rings Network

An Example of WASM based P2P (browser oriented)
====

# TL;DR

This example shows how rings network (https://github.com/RingsNetwork/rings-node) works with wasm in browser envirement. In the example, you can create arbitrary nodes, and connect them together by manually SDP handshaking or by relay handshaking.

This example is using Rings-node v0.3.0, you can visit it via:

https://rings.rs/rings-wasm-p2p/

# Explain

This demo is designed for testing handshakes as well as sending and receiving messages. The implementation is straightforward: you import client, init client, and then client.listen(). All features are implemented through client.request. You can review the details in the button.on_click handlers.

The following documents may be helpful for you:
how handshake works:
https://rings.gitbook.io/rings-network/advanced-topic/handshake
https://rings.gitbook.io/rings-network/advanced-topic/exchange-sdp
and API list (you can call json apis via `client.request(`method`, []):
https://rings.gitbook.io/rings-network/advanced-topic/jsonrpc