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.
* 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>
* 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.
* 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
* 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
* 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>
* 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>