0.8.28 • Published 6 days ago

@canvas-js/discovery v0.8.28

Weekly downloads
-
License
-
Repository
-
Last release
6 days ago

@canvas-js/discovery

This is a general-purpose discovery and presence service for Canvas peers.

Peer Discovery

Bootstrap peers, replication servers, and browser peers all use @canvas-js/discovery to identify other peers on the network and find each other.

The libp2p framework allows for different implementations of peer discovery mechanisms, like DHT queries (used by IPFS), fixed bootstrap lists, local network discovery, etc. However, DHTs are slow and computationally expensive to maintain.

We have implemented two forms of peer discovery which are suited to realtime applications:

  1. In passive discovery, peers use the libp2p fetch protocol to query their existing connections for additional peers
  2. In active discovery, peers broadcast regular heartbeat messages via GossipSub on a dedicated "discovery topic"

Peers run either passive discovery, or passive+active discovery.

Discovery Topics

You can enable active discovery by configuring a discoveryTopic.

You must provide your own discovery topic; there isn't a shared global topic across all Canvas applications. You can re-use an app topic for discovery, or might want to use a separate discovery topic for a family of related app topics.

If you use a shared discovery topic, presence information will be shared across applications. This is useful for seeing player count in different lobbies in a game, who is in adjacent rooms in a multi-user dungeon, etc.

Not all peers of an app have to be doing the same thing; it might make sense to have replication servers participate in active+passive discovery, and have browser peers only run passive discovery.

Presence

If you enable active discovery by setting a discoveryTopic, the active discovery service will make its best effort to compile a list of all browser and server peers on the network. If you filter this down to browser peers, you can use this to show realtime presence status of who else is using your application.

Presence status is exposed through join and leave events. For passive discovery, these only track local-neighborhood peers (ie they're only emitted for peers we directly connect to and disconnect from). For passive+active discovery, they track all peers through their heartbeats on the discovery topic.

0.8.28

6 days ago

0.8.27-patch.21

8 days ago

0.8.27-patch.14

19 days ago

0.8.27-patch.13

19 days ago

0.8.27-patch.16

19 days ago

0.8.27-patch.15

19 days ago

0.8.27-patch.10

19 days ago

0.8.27-patch.6

20 days ago

0.8.27-patch.7

20 days ago

0.8.27-patch.12

19 days ago

0.8.27-patch.8

20 days ago

0.8.27-patch.11

19 days ago

0.8.27-patch.9

20 days ago

0.8.27-patch.20

18 days ago

0.9.1

20 days ago

0.8.27-patch.18

18 days ago

0.8.27-patch.17

18 days ago

0.8.27-patch.19

18 days ago

0.8.27-patch.2

23 days ago

0.8.27-patch.3

23 days ago

0.8.27-patch.4

23 days ago

0.8.27-patch.5

23 days ago

0.8.27-patch.1

23 days ago

0.9.0

27 days ago

0.9.0-next.1

1 month ago

0.8.26-alpha.4

4 months ago

0.8.26-alpha.3

4 months ago

0.8.26-alpha.2

4 months ago

0.8.26

4 months ago

0.8.26-alpha.1

4 months ago

0.8.25

4 months ago

0.8.24

4 months ago

0.8.23

4 months ago

0.8.22

4 months ago

0.8.21

5 months ago

0.8.20

5 months ago

0.8.19

5 months ago

0.8.18

5 months ago

0.8.17

5 months ago

0.8.16

5 months ago

0.8.15

5 months ago

0.8.14-alpha.1

5 months ago

0.8.14

5 months ago

0.8.13

6 months ago

0.8.12

6 months ago

0.8.11

6 months ago

0.8.10

6 months ago

0.8.9

6 months ago

0.8.8

6 months ago

0.8.5

6 months ago

0.8.4

6 months ago

0.8.7

6 months ago

0.8.6

6 months ago

0.8.2-alpha.1

6 months ago

0.8.2-patch.1

6 months ago

0.8.3

6 months ago

0.8.2

6 months ago

0.7.2-alpha.1

6 months ago

0.7.2-alpha.2

6 months ago

0.7.2-alpha.3

6 months ago

0.7.2-alpha.4

6 months ago

0.7.2-alpha.5

6 months ago

0.7.2-alpha.6

6 months ago

0.7.2-alpha.7

6 months ago

0.8.1

6 months ago

0.7.2

6 months ago

0.8.0

6 months ago

0.7.1

6 months ago

0.7.3

6 months ago

0.7.0

6 months ago

0.6.1

6 months ago

0.6.0

6 months ago

0.5.1

7 months ago

0.5.0

7 months ago

0.6.0-alpha7

7 months ago

0.6.0-alpha6

8 months ago

0.6.0-alpha5

8 months ago

0.6.0-alpha4

8 months ago

0.6.0-alpha3

8 months ago

0.6.0-alpha2

8 months ago