135 Commits

Author SHA1 Message Date
Rakesh Shrestha
3cfe4bbfac
docs: update auto relay example code usage (#1163)
Co-authored-by: aomini daiki <rakesh.shrestha@hazesoft.co>
2022-02-28 17:46:56 +01:00
Aleksei
6a3e37f250
chore: update js-interfaces URL in examples/transports README (#1150) 2022-02-01 10:11:19 +01:00
Alex Potsides
0264eb62ee
chore: update example tests (#1126)
Remove some of the redundancy in the example tests
2022-01-20 13:33:01 +00:00
Alex Potsides
978eb3676f
feat: async peerstore backed by datastores (#1058)
We have a peerstore that keeps all data for all observed peers in memory with no eviction.

This is fine when you don't discover many peers but when using the DHT you encounter a significant number of peers so our peer storage grows and grows over time.

We have a persistent peer store, but it just periodically writes peers into the datastore to be read at startup, still keeping them in memory.

It also means a restart doesn't give you any temporary reprieve from the memory leak as the previously observed peer data is read into memory at startup.

This change refactors the peerstore to use a datastore by default, reading and writing peer info as it arrives.  It can be configured with a MemoryDatastore if desired.

It was necessary to change the peerstore and *book interfaces to be asynchronous since the datastore api is asynchronous.

BREAKING CHANGE: `libp2p.handle`, `libp2p.registrar.register` and the peerstore methods have become async
2022-01-20 12:03:35 +00:00
Tim Daubenschütz
c3700f55d5
fix: import uint8arrays package in example (#1083) 2022-01-14 16:33:17 +01:00
Alex Potsides
5043cd5643
fix: cache build artefacts (#1091)
To speed up the build and make it more reliable, cache the node_modules
folder, dist, etc and re-use on each step.
2021-12-29 15:06:58 +01:00
Alan Smithee
51dabb1724
chore: pubsub example subscribe returns void (#1048)
Seems like the correct return type of `Libp2p.pubsub.subscribe` is `void`, so the `await` can be removed: ae21299ade/src/pubsub-adapter.js (L29)
2021-12-06 21:12:38 +01:00
Alex Potsides
9cbf36fcb5
chore: update peer id and libp2p crypto (#1042)
BREAKING CHANGE: requires node 15+
2021-12-02 10:11:23 +00:00
Alex Potsides
eacd7e8f76
chore: update deps (#1038) 2021-11-26 16:00:47 +00:00
Alex Potsides
2f598eba09
feat: update dht (#1009)
Changes dht creation to use factory function and updates docs

BREAKING CHANGE: libp2p-kad-dht has a new event-based API which is exposed as `_dht`
2021-11-25 16:32:19 +00:00
Alan Smithee
443a102528
docs: minor corrections to discovery-mechanisms readme (#1030) 2021-11-21 23:18:45 +01:00
Alex Potsides
3bed7b4cb2
chore: update aegir (#1027)
Updates aegir, fixes all new linting errors.
2021-11-19 08:02:24 +00:00
TheStarBoys
01a8b8da9b
chore: example docs for auto-relay with correct port 2021-11-12 10:50:11 +01:00
Vasco Santos
3d25ff7fd0 chore: use new libp2p-noise 2021-08-20 09:13:21 +02:00
Vasco Santos
0f389a7828 chore: update uint8arrays 2021-08-20 09:13:21 +02:00
Vasco Santos
3b33fb4b73 fix: browser example ci 2021-08-12 15:15:13 +02:00
Alex Potsides
13cf476148
chore: update to new multiformats (#948)
BREAKING CHANGE: uses the CID class from the new multiformats module

Co-authored-by: Vasco Santos <vasco.santos@moxy.studio>
2021-07-09 08:43:34 +02:00
Vasco Santos
755eb909f2 chore: update gossipsub dep for example 2021-06-13 21:42:36 +02:00
Vasco Santos
afe0f854e8 chore: use node 16 2021-06-13 21:42:36 +02:00
Vasco Santos
2c4b567b00 chore: restructure pubsub tests 2021-06-13 21:42:36 +02:00
Franck Royer
cd152f122f
chore: add secure websockets example (#930)
* Add Secure WebSockets example

* Make dial accept self-signed cert
2021-06-11 09:45:47 +02:00
Vasco Santos
d8ba284883
fix: chat example with new multiaddr (#946) 2021-05-28 13:46:08 +02:00
Franck Royer
6456a0fff8
chore: browser example dependencies must be installed at the root first (#921)
Fixes #920
2021-04-21 10:45:50 +02:00
Vasco Santos
8506414ea1
chore: config types and dependencies update (#904)
BREAKING CHANGES:

top level types were updated, multiaddr@9.0.0 is used, dialer and keychain internal property names changed and connectionManager minPeers is not supported anymore
2021-04-15 09:40:02 +02:00
Vasco Santos
5f702f3481
fix: conn mgr access to moving averages record object (#897)
* fix: conn mgr access to moving averages record object

* chore: remove node 12

* chore: add parcel workaround
2021-03-09 16:51:41 +01:00
Philipp Muens
03b34cac7d
docs: fix link to connection encryption example (#894) 2021-03-02 13:07:52 +01:00
Aleksei
9c67364caa
Add an example of webrtc-direct (#868)
Co-authored-by: Vasco Santos <vasco.santos@moxy.studio>
2021-02-25 16:34:02 +01:00
Miguel Mota
4ee3e1973b
chore: minor grammar fixes on discovery example (#890) 2021-02-18 11:36:35 +01:00
Vasco Santos
46cb46188a
chore: add discovery example with relay and pubsub discovery (#855) 2021-02-11 11:37:11 +01:00
Vasco Santos
1af8472dc6
chore: add transports example (#851) 2021-02-11 11:12:23 +01:00
Vasco Santos
f6a4cad827
chore: add pubsub example tests (#850) 2021-02-10 21:00:40 +01:00
Vasco Santos
b1079474de
chore: add protocol and stream muxing example tests (#849) 2021-02-10 15:40:19 +01:00
Vasco Santos
a150ea60c5
chore: add peer and content routing example tests (#848) 2021-02-08 11:03:42 +01:00
Kevin Lacker
f06e06a006
chore: update bootstrapers example url 2021-01-28 11:06:11 +01:00
Vasco Santos
748b552876
chore: pnet example test (#845) 2021-01-22 10:24:15 +01:00
Vasco Santos
67067c97d5
chore: connection encryption example test (#843) 2021-01-21 09:27:27 +01:00
Vasco Santos
f45cd1c4b5
chore: echo example test (#842) 2021-01-20 10:46:04 +01:00
Vasco Santos
0a02207116
chore: add discovery example tests (#841) 2021-01-19 11:02:56 +01:00
Vasco Santos
0b854a949f
chore: add browser example test (#846) 2021-01-19 09:57:56 +01:00
Vasco Santos
77e8273a64
chore: add chat example (#840) 2021-01-18 11:15:02 +01:00
Vasco Santos
f7e1426b9e chore: update pubsub example by disabled emit self (#823) 2020-12-16 13:56:41 +01:00
Vasco Santos
4448de8432 docs: auto relay example (#795)
* chore: auto relay example

* chore: update examples to use process arguments

* chore: add test setup for node tests and test for auto-relay

* chore: apply suggestions from code review

* chore: do not use promise for multiaddrs event on example
2020-12-16 13:56:41 +01:00
Michael Burns
8e3bb09279
chore: remove references to Solarnet (#820)
Co-authored-by: Vasco Santos <vasco.santos@ua.pt>
2020-12-01 19:10:47 +01:00
a1300
73204958ee
docs: use Libp2p.create() in examples (#811) (#814) 2020-11-30 11:15:09 +01:00
Vasco Santos
093c0ea13f
feat: resolve multiaddrs before dial (#782) 2020-11-04 13:54:50 +01:00
Cindy Wu
5f50054d94
docs: fix typo in transports example readme (#788) 2020-10-22 11:02:00 +02:00
Ethan Lam
d7d8439e71
docs: update transport example (#770) 2020-10-15 17:28:01 +02:00
Vasco Santos
2fd3b0a0e5
chore: examples not using secio (#747)
* chore: examples not using secio

* chore(docs): remove unused dep

* chore(docs): remove reference of secio in setup

* chore(docs): replace circuit secio reference with noise

Co-authored-by: Jacob Heun <jacobheun@gmail.com>
2020-10-07 16:16:36 +02:00
Vasco Santos
0087218194
chore: update getting started connect event (#752) 2020-09-14 13:23:28 +02:00
Jacob Heun
3c2a45a9d2
docs: update examples for 0.29 (#742)
* docs: update examples for 0.29

* fix: update examples/libp2p-in-the-browser/package.json

Co-authored-by: Vasco Santos <vasco.santos@moxy.studio>

Co-authored-by: Vasco Santos <vasco.santos@moxy.studio>
2020-08-27 18:13:38 +02:00