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.
* fix: upgrader should not need muxers
* chore: address review
* chore: apply suggestions from code review
Co-Authored-By: Jacob Heun <jacobheun@gmail.com>
* docs: fix spelling in api
* fix: dont create peerstore twice
* feat: add support for dial coalescing
* doc(fix): add setPeerValue to API TOC
* docs: add more jsdocs to dialer
* chore: remove old comment
* fix: ensure connections are closed
* fix: registrar.getConnections returns first open conn
* fix: directly set the closed status
* chore: remove unneeded log
* refactor: peerStore.put takes an options object
* refactor: initial refactor of the connection manager
* fix: start/stop issues
* fix: add tests and resolve pruning issues
* chore: fix lint
* test: move conn manager tests to node only for now
* chore: apply suggestions from code review
Co-Authored-By: Vasco Santos <vasco.santos@moxy.studio>
* fix: assert min max connection options
* test: fix assertion check for browser
* docs: add api and config docs for conn manager
* feat: discovery modules from transports should be added
* chore: apply suggestions from code review
Co-Authored-By: Jacob Heun <jacobheun@gmail.com>
* chore: address review
* chore: apply suggestions from code review
Co-Authored-By: Jacob Heun <jacobheun@gmail.com>
* docs: add initial notes on stats
* feat: initial refactor of stats to metrics
* feat: add support for placeholder metrics
This is helpful for tracking metrics prior to knowing the remote peers id
* fix: add metrics tests and fix issues
* fix: always clear the dial timeout timer
* docs: add metrics to api doc
* chore: apply suggestions from code review
Co-Authored-By: Vasco Santos <vasco.santos@moxy.studio>
* docs: update metrics docs
* fix: call metrics.onDisconnect
* docs(config): add example headers so they appear in the TOC
* docs(config): add metrics configuration
* docs(relay): fix relay configuration docs
* refactor: add dialing over relay support
* chore: fix lint
* fix: dont clear listeners on close
* fix: if dial errors already have codes, just rethrow them
* fix: clear the registrar when libp2p stops
* fix: improve connection maintenance with circuit
* chore: correct feedback
* test: use chai as promised
* test(fix): reset multiaddrs on dial test
* chore(deps): update connection and multistream
* feat: add basic dial support for addresses and peers
* test: automatically require all node test files
* fix: dont catch and log in the wrong place
* test: add direct spec test
fix: improve dial error consistency
* feat: add dial timeouts and concurrency
Queue timeouts will result in aborts of the dials
* chore: fix linting
* test: verify dialer defaults
* feat: add initial upgrader
* fix: add more test coverage and fix bugs
* feat: libp2p creates the upgrader
* feat: hook up handle to the upgrader
* feat: hook up the dialer to libp2p
test: add node dialer libp2p tests
* feat: add connection listeners to upgrader
* feat: emit connect and disconnect events
* chore: use libp2p-interfaces
* fix: address review feedback
* fix: correct import
* refactor: dedupe connection creation code
* test: remove all tests for a clean slate
The refactor will require a large number of updates to the tests. In order
to ensure we have done a decent deduplication, and have a cleaner suite of tests
we've removed all tests. This will also allow us to more easily see tests
for the refactored systems.
We have a record of the latest test suites in master, so we are not losing any history.
* chore: update tcp and websockets
* chore: remove other transports until they are converted
* chore: use mafmt and multiaddr async versions
* chore: add and fix dependencies
* chore: clean up travis file
* feat: add new transport manager
* docs: add constructor jsdocs
* refactor(config): check that transports exist
This also removes the other logic, it can be added when those subsystems are refactored
* chore(deps): use async peer-id and peer-info
* feat: wire up the transport manager with libp2p
* chore: remove superstruct dep