233 Commits

Author SHA1 Message Date
Alex Potsides
a7128f07ec
fix: the API of es6-promisify is not the same as promisify-es6 (#905) 2021-03-26 18:13:07 +01:00
Vasco Santos
3f314d5e90
fix: transport manager fault tolerance should include tolerance to transport listen fail (#893) 2021-02-25 15:23:07 +01:00
Vasco Santos
a34d2bbcc3
fix: routers should only use dht if enabled (#885) 2021-02-11 14:37:34 +01:00
Vasco Santos
9941414a91
chore: update delegates config docs to use http client (#853) 2021-02-11 11:42:10 +01:00
Vasco Santos
1af8472dc6
chore: add transports example (#851) 2021-02-11 11:12:23 +01:00
Alex Potsides
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
Vasco Santos
037c965a67
chore: update deps (#869) 2021-01-27 09:45:31 +01:00
Alex Potsides
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
Samlior
a28c878f4a
chore: fix close for ConnectionManager (#861) 2021-01-21 12:09:53 +01:00
Vasco Santos
169bb806a7 chore: add typedefs (#802) 2020-12-16 13:56:41 +01:00
Vasco Santos
baedf3fe5a feat: discover and connect to closest peers (#798) 2020-12-16 13:56:41 +01:00
Vasco Santos
4ebcdb085c chore: update websockets (#806)
* chore: update websockets
2020-12-16 13:56:41 +01:00
Vasco Santos
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
Vasco Santos
49fffda23c test: custom announce filter 2020-12-16 13:56:41 +01:00
Vasco Santos
689c35ed1c fix: remove test/dialing/utils extra file 2020-12-16 13:56:41 +01:00
Vasco Santos
5758db8ea9 chore: remove noAnnounce from address manager 2020-12-16 13:56:41 +01:00
Vasco Santos
ef9d3ca2c6 feat: custom announce filter 2020-12-16 13:56:41 +01:00
Vasco Santos
97e3633f47 chore: store self protocols in protobook (#760) 2020-12-16 13:56:41 +01:00
Vasco Santos
ee23fb9508 chore: apply suggestions from code review
Co-authored-by: Jacob Heun <jacobheun@gmail.com>
2020-12-16 13:56:41 +01:00
Vasco Santos
5c72424e57 chore: address review 2020-12-16 13:56:41 +01:00
Vasco Santos
0bf0b7cf89 feat: auto relay network query for new relays 2020-12-16 13:56:41 +01:00
Vasco Santos
bb83cacb5a chore: address review 2020-12-16 13:56:41 +01:00
Vasco Santos
447d0ed0dd chore: add identify test for multiaddr change 2020-12-16 13:56:41 +01:00
Vasco Santos
43eda43f06 chore: create signed peer record on new listen addresses in transport manager 2020-12-16 13:56:41 +01:00
Vasco Santos
7b93ece7f2 chore: use listening events to create self peer record on updates 2020-12-16 13:56:41 +01:00
Vasco Santos
4d1fcdb3d2 chore: auto relay multiaddr update push 2020-12-16 13:56:41 +01:00
Vasco Santos
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
Smite Chow
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
Vasco Santos
6350a187c7
fix: dial self (#826) 2020-12-09 16:13:25 +01:00
Vasco Santos
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
Vasco Santos
093c0ea13f
feat: resolve multiaddrs before dial (#782) 2020-11-04 13:54:50 +01:00
Jacob Heun
4c6be91588 fix: ensure streams are closed on connection close 2020-10-22 14:29:52 +02:00
Vasco Santos
0d48fc4f5a
test: use ed25519 keys in tests (#669)
* chore: use ed25519 keys in tests

* fix: persisted keybook recheck keybook content for delete

* chore: only store if key not inline

* chore: update peer id

* chore: identify wait for closed streams
2020-10-07 14:50:01 +02:00
Vasco Santos
60d437f595
fix: flakey identify test firefox (#774) 2020-10-06 15:37:01 +02:00
Vasco Santos
96df4b7dc4
chore: update aegir and jsdocs for eslint changes (#773) 2020-10-06 14:59:43 +02:00
Vasco Santos
fb4b2734d3
chore: update delegate deps (#753) 2020-09-15 12:47:16 +02:00
Vasco Santos
28b79a76a8
test: fix pubsub intermittent test (#741) 2020-08-27 16:42:07 +02:00
Jacob Heun
93dda74085 fix: peer record interop with go (#739)
* test: add go peer record interop test

* fix: correct the payload type of peer records

* chore: fix linting

* test: fix envelope test
2020-08-27 15:38:01 +02:00
Vasco Santos
55c9bfac44 feat: gossipsub 1.1 (#733)
* feat: gossipsub 1.1

BREAKING CHANGE: pubsub implementation is now directly exposed and its API was updated according to the new pubsub interface in js-libp2p-interfaces repo

* chore: use gossipsub branch with src added

* fix: add pubsub handlers adapter

* chore: fix deps

* chore: update pubsub docs and examples

* chore: apply suggestions from code review

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

* chore: use new floodsub

* chore: change validator doc set

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

* chore: add new gossipsub src

Co-authored-by: Jacob Heun <jacobheun@gmail.com>
2020-08-27 15:38:01 +02:00
Alex Potsides
1e869717ff fix: replace node buffers with uint8arrays (#730)
* fix: replace node buffers with uint8arrays

Upgrades all deps and replaces all use of node Buffers with Uint8Arrays

BREAKING CHANGES:

- All deps used by this module now use Uint8Arrays in place of node Buffers

* chore: browser fixes

* chore: remove .only

* chore: stringify uint8array before parsing

* chore: update interop suite

* chore: remove ts from build command

* chore: update deps

* fix: update records to use uint8array

* chore: fix lint

* chore: update deps

Co-authored-by: Jacob Heun <jacobheun@gmail.com>
2020-08-27 15:38:01 +02:00
Vasco Santos
f574e82a5d chore: apply suggestions from code review 2020-08-27 15:38:01 +02:00
Vasco Santos
15613ccf19 fix: do not return self on peerstore.peers 2020-08-27 15:38:01 +02:00
Vasco Santos
d437defede chore: rename isEqual to equals in tests 2020-08-27 15:38:01 +02:00
Vasco Santos
74d414c21f chore: add certified peer records to persisted peer store 2020-08-27 15:38:01 +02:00
Vasco Santos
8f2e69048f feat: cerified addressbook 2020-08-27 15:38:01 +02:00
Vasco Santos
3158366579 fix: revert new identify protocol versions 2020-08-27 15:38:01 +02:00
Vasco Santos
1d318e12d8 chore: address review 2020-08-27 15:38:01 +02:00
Vasco Santos
8a97dded26 feat: create self peer record in identify 2020-08-27 15:38:01 +02:00
Vasco Santos
e50f0eeb7b feat: exchange signed peer records in identify 2020-08-27 15:38:01 +02:00
Vasco Santos
89658dd655 chore: address review 2020-08-27 15:38:01 +02:00