Commit Graph

251 Commits

Author SHA1 Message Date
b291bc06ec fix: dialer leaking resources after stopping (#947)
* fix: dialer leaking resources after stopping

* chore: add error code to test
2021-06-14 09:19:23 +02:00
50f7f32e53 chore: update branch 2021-06-13 21:42:36 +02:00
2c4b567b00 chore: restructure pubsub tests 2021-06-13 21:42:36 +02:00
2a6a635f13 chore: remove ipfs-utils dep (#953)
* chore: remove ipfs-utils dep

We only use it for the env detection, so use [wherearewe](https://www.npmjs.com/package/wherearewe)
instead which is that, but pulled out into a tiny module.

The `TextDecoder` class is global everywhere we support so we don't
need to pull it in from `ipfs-utils` and it's been removed from v8
anyway.

* chore: update ipfs-http-client
2021-06-11 10:01:40 +02:00
478963ad2d feat: keychain rotate passphrase (#944)
Co-authored-by: Vasco Santos <vasco.santos@ua.pt>
2021-05-27 10:30:19 +02:00
818d2b2a98 fix: store remote agent and protocol version during identify (#943) 2021-05-12 19:11:17 +02:00
a79c6b50d7 fix: peerRouting.findPeer() trying to find self (#941)
* throw error if node attempts to find itself

Co-authored-by: Vasco Santos <vasco.santos@ua.pt>
2021-05-12 16:46:20 +02:00
ac370fc967 fix: address book guarantees no replicated entries are added (#927) 2021-04-27 17:14:48 +02:00
ef4393649f chore: remove chai deps (#929) 2021-04-27 17:13:34 +02:00
cc1f4af879 fix: dht configuration selectors and validators (#919) 2021-04-21 13:28:37 +02:00
44463b9145 fix: address book should not emit peer event if no addresses are known #887 2021-04-21 09:14:01 +02:00
3ffeb4ebe6 chore: apply suggestions from code review
Co-authored-by: Irakli Gozalishvili <contact@gozala.io>
2021-04-20 11:41:50 +02:00
06e8f3dd42 fix: do not add abort signals to useless addresses (#913) 2021-04-20 09:31:16 +02:00
2af692fb4d fix: remove inline arg types from function definitions (#916)
Co-authored-by: Vasco Santos <vasco.santos@moxy.studio>
2021-04-19 14:08:00 +02:00
21c9aeecb1 fix: dial protocol should throw if no protocol is provided (#914)
BREAKING CHANGE: dialProtocol does not return connection when no protocols are provided
2021-04-16 15:49:57 +02:00
b4fb9b7bf2 fix: address book should not emit peer event if no addresses are known 2021-04-15 14:19:59 +02:00
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
c4cae29ef3 chore: do not look up external IP during test (#906)
The NAT manager test will throw if the current computer is behind a
double NAT as at runtime it won't be possible to map external ports.

We don't care about that during the test so configure a fake external
IP so the test will still test the shut-down functionality on a computer
that is behind a double NAT.
2021-03-27 13:15:35 +01:00
a7128f07ec fix: the API of es6-promisify is not the same as promisify-es6 (#905) 2021-03-26 18:13:07 +01:00
3f314d5e90 fix: transport manager fault tolerance should include tolerance to transport listen fail (#893) 2021-02-25 15:23:07 +01:00
a34d2bbcc3 fix: routers should only use dht if enabled (#885) 2021-02-11 14:37:34 +01:00
9941414a91 chore: update delegates config docs to use http client (#853) 2021-02-11 11:42:10 +01:00
1af8472dc6 chore: add transports example (#851) 2021-02-11 11:12:23 +01:00
0a6bc0d101 feat: add UPnP NAT manager (#810)
* feat: add uPnP nat manager

Adds a really basic nat manager that attempts to use UPnP to punch
a hole through your router for any IPV4 tcp addresses you have
configured.

Adds any configured addresses to the node's observed addresses list
and adds observed addresses to `libp2p.multiaddrs` so we exchange
them with peers when performing `identify` and people can dial you.

Adds configuration options under `config.nat`

Hole punching is async to not affect start up time.

Co-authored-by: Vasco Santos <vasco.santos@moxy.studio>
2021-01-27 14:55:26 +01:00
037c965a67 chore: update deps (#869) 2021-01-27 09:45:31 +01:00
45c33675a7 fix: store multiaddrs during content and peer routing queries (#865)
* fix: store provider multiaddrs during find providers

Changes the behaviour of `libp2p.contentRouting.findProviders` to store
the multiaddrs reported by the routers before yielding results to
the caller, so when they try to dial the provider, the multiaddrs are
already in the peer store's address book.

Also dedupes providers reported by routers but keeps all of the addresses
reported, even for duplicates.

Also, also fixes a performance bug where the previous implementation would
wait for any router to completely finish finding providers before sending
any results to the caller.  It'll now yield results as they come in which
makes it much, much faster.
2021-01-21 13:41:27 +01:00
a28c878f4a chore: fix close for ConnectionManager (#861) 2021-01-21 12:09:53 +01:00
169bb806a7 chore: add typedefs (#802) 2020-12-16 13:56:41 +01:00
baedf3fe5a feat: discover and connect to closest peers (#798) 2020-12-16 13:56:41 +01:00
4ebcdb085c chore: update websockets (#806)
* chore: update websockets
2020-12-16 13:56:41 +01:00
585ad52b4c feat: custom dialer addr sorter (#792)
* feat: custom dialer addr sorter

* chore: use libp2p utils sorter via addressBook getMultiaddrsForPeer

* chore: use new libp2p utils

* chore: apply suggestions from code review

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

Co-authored-by: Jacob Heun <jacobheun@gmail.com>
2020-12-16 13:56:41 +01:00
49fffda23c test: custom announce filter 2020-12-16 13:56:41 +01:00
689c35ed1c fix: remove test/dialing/utils extra file 2020-12-16 13:56:41 +01:00
5758db8ea9 chore: remove noAnnounce from address manager 2020-12-16 13:56:41 +01:00
ef9d3ca2c6 feat: custom announce filter 2020-12-16 13:56:41 +01:00
97e3633f47 chore: store self protocols in protobook (#760) 2020-12-16 13:56:41 +01:00
ee23fb9508 chore: apply suggestions from code review
Co-authored-by: Jacob Heun <jacobheun@gmail.com>
2020-12-16 13:56:41 +01:00
5c72424e57 chore: address review 2020-12-16 13:56:41 +01:00
0bf0b7cf89 feat: auto relay network query for new relays 2020-12-16 13:56:41 +01:00
bb83cacb5a chore: address review 2020-12-16 13:56:41 +01:00
447d0ed0dd chore: add identify test for multiaddr change 2020-12-16 13:56:41 +01:00
43eda43f06 chore: create signed peer record on new listen addresses in transport manager 2020-12-16 13:56:41 +01:00
7b93ece7f2 chore: use listening events to create self peer record on updates 2020-12-16 13:56:41 +01:00
4d1fcdb3d2 chore: auto relay multiaddr update push 2020-12-16 13:56:41 +01:00
caf66ea143 feat: auto relay (#723)
* feat: auto relay

* fix: leverage protoBook events to ask relay peers if they support hop

* chore: refactor disconnect

* chore: do not listen on a relayed conn

* chore: tweaks

* chore: improve _listenOnAvailableHopRelays logic

* chore: default value of 1 to maxListeners on auto-relay
2020-12-16 13:56:41 +01:00
8691465a52 feat: support custom listener options (#822)
* support custom listener options

* fix get listener options

* add doc to explain custom listener options

* add ut

* fix code style

* Apply suggestions from code review

Co-authored-by: Vasco Santos <vasco.santos@ua.pt>

* add missing comma

Co-authored-by: Vasco Santos <vasco.santos@ua.pt>
2020-12-09 16:31:17 +01:00
6350a187c7 fix: dial self (#826) 2020-12-09 16:13:25 +01:00
d0a9fada32 feat: custom and store self agent version + store self protocol version (#800)
* feat: custom and store self protocol and agent version

* fix: do not enable custom protocolVersion
2020-11-20 15:14:01 +01:00
093c0ea13f feat: resolve multiaddrs before dial (#782) 2020-11-04 13:54:50 +01:00
4c6be91588 fix: ensure streams are closed on connection close 2020-10-22 14:29:52 +02:00