179 Commits

Author SHA1 Message Date
Alex Potsides
8c56ec0d23
fix: allow certain keychain operations without a password (#726)
* fix: allow certain keychain operations without a password

Listing, removing, renaming etc keys do not require a password so
the user should not be required to provide one.

This means we don't have to prompt the user to create a password
when they aren't going to do any operations that require a password.

* fix: make keychain pass optional

* fix: support libp2p creation without keychain pass

Co-authored-by: Jacob Heun <jacobheun@gmail.com>
2020-08-05 19:03:11 +02:00
Jacob Heun
51d7ca44c1
feat(keychain): add support for ed25519 and secp keys (#725)
* feat(keychain): add support for ed25519 and secp keys

* chore: bump crypto

* refactor: cleanup keychain usage
2020-08-05 18:19:10 +02:00
Jacob Heun
726a746479
fix(identify): make agentversion dynamic and add it to the peerstore (#724) 2020-08-04 18:39:05 +02:00
Vasco Santos
2440c872df
fix: ping multiaddr from peer not previously stored in peerstore (#719) 2020-07-27 10:53:23 +02:00
Vasco Santos
7da9ad44ab
fix: create dial target for peer with no known addrs (#715) 2020-07-20 14:54:03 +02:00
Vasco Santos
9ccab40fc8
fix: not dial all known peers in parallel on startup (#698)
* fix: not dial all known peers on startup

* feat: connection manager should proactively connect to peers from peerStore

* chore: increase bundle size

* fix: do connMgr proactive dial on an interval

* chore: address review

* chore: use retimer reschedule

* chore: address review

* fix: use minConnections in default config

* chore: minPeers to minConnections everywhere
2020-07-14 16:05:26 +02:00
Jacob Heun
51da8874d8
test: add pubsub reconnect test (#693)
* test: add pubsub reconnect test

* chore: dep bump

* chore: remove temp pubsub dep

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

Co-authored-by: Vasco Santos <vasco.santos@moxy.studio>
2020-07-07 18:31:51 +02:00
Vasco Santos
f4898eb883
chore: add test for pubsub on reconnect (#691)
* chore: add test for pubsub on reconnect

* chore: update interface dep

Co-authored-by: Jacob Heun <jacobheun@gmail.com>
2020-07-03 16:08:37 +02:00
Jacob Heun
b621fbdfdc revert: "fix: throw if no conn encryption module provided (#665)"
This reverts commit c038550fad5b285528d87427fc5fa37ba2b0ba3f.
2020-06-15 12:45:49 +02:00
Vasco Santos
c038550fad
fix: throw if no conn encryption module provided (#665)
* fix: throw if no conn encryption module provided

* chore: address review

* chore: apply suggestions from code review

Co-authored-by: Jacob Heun <jacobheun@gmail.com>

Co-authored-by: Jacob Heun <jacobheun@gmail.com>
2020-06-11 12:49:32 +02:00
Alex Potsides
d60a3215d0
chore: update interface datastore (#663)
* chore: update interface datastore

Updates to v1.x.x to not have multiple versions of this module in the ipfs browser bundle.

* fix: let batch commits complete before continuing tests

Batch commits are async but the tests weren't waiting for them to complete,
mainly because they are triggered by events.

There's no way that I can see of waiting for the batch commit to finish so
I've added delays to the tests. Not great but a start.

* chore: use error log

* test: wait for commit spies to complete

* chore: bump interface-datastore

Co-authored-by: Jacob Heun <jacobheun@gmail.com>
2020-06-10 23:39:40 +02:00
Jacob Heun
52a615f922 fix: expose the muxed stream interface on inbound streams 2020-05-28 12:37:48 +02:00
Vasco Santos
698c1df1b4 feat: support dial only on transport manager to tolerate errors (#643)
* feat: support dial only on transport manager to tolerate errors

* chore: address review

* chore: add jsdoc to transport manager tolerance errors
2020-05-28 12:37:48 +02:00
Vasco Santos
84b935f682 feat: metadata book (#638)
* feat: metadata book

* chore: address review

* chore: address review
2020-05-28 12:37:48 +02:00
Vasco Santos
aaa1155633 chore: uncomment local peer public key after connect test 2020-05-28 12:37:48 +02:00
Vasco Santos
0be74e6a61 chore: apply suggestions from code review
Co-authored-by: Jacob Heun <jacobheun@gmail.com>
2020-05-28 12:37:48 +02:00
Vasco Santos
6065923356 chore: integrate libp2p-keychain into js-libp2p (#633)
Integrates the libp2p-keychain codebase into this repo
2020-05-28 12:37:48 +02:00
Vasco Santos
2b45fee0ed fix: onConnect should not add addr to the addressBook 2020-05-28 12:37:48 +02:00
Vasco Santos
8bf5a70bb8 chore: integrate libp2p-keychain into js-libp2p (#633)
Integrates the libp2p-keychain codebase into this repo

Co-authored-by: David Dias <daviddias.p@gmail.com>
Co-authored-by: Richard Schneider <makaretu@gmail.com>
Co-authored-by: Maciej Krüger <mkg20001@gmail.com>
Co-authored-by: Victor Bjelkholm <victorbjelkholm@gmail.com>
Co-authored-by: Masahiro Saito <camelmasa@gmail.com>
Co-authored-by: Alan Shaw <alan.shaw@protocol.ai>
Co-authored-by: Hugo Dias <mail@hugodias.me>
Co-authored-by: Alberto Elias <hi@albertoelias.me>
Co-authored-by: Alex Potsides <alex@achingbrain.net>
Co-authored-by: Jacob Heun <jacobheun@gmail.com>
2020-05-28 12:37:48 +02:00
Vasco Santos
6627278a87 chore: apply suggestions from code review
Co-authored-by: Jacob Heun <jacobheun@gmail.com>
2020-05-28 12:37:48 +02:00
Vasco Santos
65e87460b0 chore: add keys to keybook on connection upgraded 2020-05-28 12:37:48 +02:00
Vasco Santos
7b8d01697d chore: apply suggestions from code review
Co-authored-by: Jacob Heun <jacobheun@gmail.com>
2020-05-28 12:37:48 +02:00
Vasco Santos
ce38033c10 feat: keybook 2020-05-28 12:37:48 +02:00
Vasco Santos
48a9a3eecc refactor: peristent peer-store extended class and disabled by defaul 2020-05-28 12:37:48 +02:00
Vasco Santos
9ea9287bea chore: persist delete with test 2020-05-28 12:37:48 +02:00
Vasco Santos
5123a8357b feat: peerStore persistence 2020-05-28 12:37:48 +02:00
Vasco Santos
43630f1e0b test: use libp2p-noise (#585)
* chore: use libp2p-noise

* chore: address review
2020-05-28 12:37:48 +02:00
Vasco Santos
aaf62a40ec fix: libp2p connections getter 2020-05-28 12:37:48 +02:00
Vasco Santos
7fbd1556e8 fix: use libp2p.multiaddrs instead of listen
Co-Authored-By: Jacob Heun <jacobheun@gmail.com>
2020-05-28 12:37:48 +02:00
Vasco Santos
51474c334a chore: rename address functions and apply suggestions from code review
Co-Authored-By: Jacob Heun <jacobheun@gmail.com>
2020-05-28 12:37:48 +02:00
Vasco Santos
2a7967c1cc feat: address manager 2020-05-28 12:37:48 +02:00
Vasco Santos
d3a4bf0a3f chore: refactor connection manager and registrar 2020-05-28 12:37:48 +02:00
Vasco Santos
c215339a27 chore: rename peer-store properties 2020-05-28 12:37:48 +02:00
Vasco Santos
12e48adafa chore: remove peer-info usage
BREAKING CHANGE: all API methods with peer-info parameters or return values were changed. You can check the API.md document, in order to check the new values to use
2020-05-28 12:37:48 +02:00
Vasco Santos
ed6d5bb4b4 chore: deprecate old peer store api (#598)
* chore: deprecate old peer-store api

BREAKING CHANGE: the peer-store api changed. Check the API docs for the new specification.

* chore: apply suggestions from code review

Co-Authored-By: Jacob Heun <jacobheun@gmail.com>

* chore: apply suggestions from code review

Co-Authored-By: Jacob Heun <jacobheun@gmail.com>

Co-authored-by: Jacob Heun <jacobheun@gmail.com>
2020-05-28 12:37:48 +02:00
Vasco Santos
e9d225c9dc feat: address and proto books (#590)
* feat: address and proto books

* chore: apply suggestions from code review

Co-Authored-By: Jacob Heun <jacobheun@gmail.com>

* chore: minor fixes and initial tests added

* chore: integrate new peer-store with code using adapters for other modules

* chore: do not use peerstore.put on get-peer-info

* chore: apply suggestions from code review

Co-Authored-By: Jacob Heun <jacobheun@gmail.com>

* chore: add new peer store tests

* chore: apply suggestions from code review

Co-Authored-By: Jacob Heun <jacobheun@gmail.com>

Co-authored-by: Jacob Heun <jacobheun@gmail.com>
2020-05-28 12:37:48 +02:00
Hugo Dias
9b13fe321a
fix: remove node global (#587)
* fix: use new libp2p-crypto

* fix: remove node globals and reduce size

- adds buffer require
- adds globalThis where needed
- streaming-iterables was remove and new utils created, this will be consolidated in `ipfs-utils` and backported here to normalize all these iterator helper functions
- latency-monitor was copied inside the repo
- iso-random-stream is now used instead of node crypto
- the test `should ignore self on discovery` was moved to node only

Size: 172.97KB
47.03KB below the 220KB limit.

`aegir build --node false` and `aegir test -t browser --node false` now work 🎉

* fix: fix require path

* fix: feedback

* fix: update deps and bundle size

* chore: bump interfaces

* chore: update size
2020-04-24 17:10:40 +02:00
robertkiel
c940f2d384
fix: add null check in libp2p.hangUp()
test: add hangup test and fix linting
2020-04-15 14:49:47 +02:00
Jacob Heun
e192eb6508
fix: make circuit relay listening addresses more forgiving (#604)
* test: dont be strict on nock mocking

* fix: be more forgiving with circuit listening addresses
2020-04-14 12:37:52 +02:00
Jacob Heun
0fd5188176
test: dont use mdns in browser tests (#602)
* test(fix): dont use mdns in browser tests

* refactor: use async await consistently for _setupPeerDiscovery
2020-04-06 13:22:12 +02:00
Jacob Heun
9e35fbc316
fix: pass libp2p to discovery services (#597)
* fix: include libp2p in the options passed to discovery creation

* fix: handle multiple peer addresses in get multiaddrs for peers

* test(peer-store): add test to verify returned relay multiaddrs
2020-03-31 13:43:27 +02:00
Jacob Heun
f4ec35573e
fix(test): improve flakey random walk discovery test (#574)
* test: improve stability of dht discovery test

* test: isolate who is random walking
2020-02-28 15:30:43 +01:00
Jacob Heun
a317a8b011
fix: dont allow multiaddr dials without a peer id (#558)
* fix: require peer ids when dialing multiaddrs

* chore: fix lint

* docs: add more info about multiaddr peer ids
2020-02-11 16:32:40 +01:00
Jacob Heun
f662fdcf36
fix: ensure identify streams are closed (#551)
* fix: ensure identify streams are closed

* fix: call connection.addStream properly

* chore: simplify stream closure

* test: improve durability of identify push test
2020-02-05 17:35:27 +01:00
Alex Potsides
be8fc9daf1
fix: stop stream after first pong received (#545)
When connecting to go-IPFS from a webworker, the stream opened by
the ping protocol is never closed.

The change here uses `take` to only receive one buffer from the
remote node before closing the stream.
2020-02-03 15:50:40 +01:00
Jacob Heun
29a96690ad test(fix): fix listening test for ci 2020-01-24 14:40:40 +01:00
Jacob Heun
c1038bec92 fix: use toB58String everywhere to be consistent (#537)
* chore: update deps

* fix: consistently use b58 peerid string

The migration to base32 will happen at a later date
2020-01-24 14:40:40 +01:00
Vasco Santos
bb2e56e6c7 fix: registrar should filter the disconnected conn (#532)
* fix: registrar on disconnect only when no connections

* chore: add test
2020-01-24 14:40:40 +01:00
Alan Shaw
4222c49556 fix: stop discoveries (#530)
* fix: stop discoveries

* test: add discovery stop test

* chore: fix lint

Co-authored-by: Jacob Heun <jacobheun@gmail.com>
2020-01-24 14:40:40 +01:00
Jacob Heun
c339be10ee feat: allow transport options to be passed on creation (#524)
* feat: allow transport options to be passed on creation

* fix: only add circuit transport if enabled

* chore: fix lint
2020-01-24 14:40:40 +01:00