558 Commits

Author SHA1 Message Date
Jacob Heun
7c2fefda46 refactor: PER_PEER_LIMIT is now MAX_PER_PEER_DIALS 2020-01-24 14:40:40 +01:00
Jacob Heun
2788982c53 chore: apply suggestions from code review
Co-Authored-By: Vasco Santos <vasco.santos@moxy.studio>
Co-Authored-By: Alan Shaw <alan.shaw@protocol.ai>
2020-01-24 14:40:40 +01:00
Jacob Heun
76ec1ccd21 chore: remove commented code 2020-01-24 14:40:40 +01:00
Jacob Heun
e445a17278 feat: add token based dialer 2020-01-24 14:40:40 +01:00
Jacob Heun
2329ef3ea3 doc: add initial dialer readme 2020-01-24 14:40:40 +01:00
Jacob Heun
ce8e60bb0d fix: correct release readme 2020-01-24 14:40:40 +01:00
Jacob Heun
12fc069873 fix: clean up peer discovery flow (#494)
* fix: clean up peer discovery flow

* test(fix): let libp2p start after connecting

* test(fix): dont auto dial in disco tests
2020-01-24 14:40:40 +01:00
Vasco Santos
9a6e07d70b chore: update pubsub implementations (#493) 2020-01-24 14:40:40 +01:00
Vasco Santos
8da9fc97d4 feat: support peer-id instances in peer store operations (#491) 2020-01-24 14:40:40 +01:00
Vasco Santos
a020db183a refactor: async routing (#489)
* feat: async routing

* chore: put dht extra api commands under content routing

* chore: add default option to createPeerInfo

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

* chore: address review

* chore: rm dlv
2020-01-24 14:40:40 +01:00
Jacob Heun
f77ce39484 refactor: circuit relay to async (#477)
* 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
2020-01-24 14:40:40 +01:00
Vasco Santos
18a062ed12 feat: discovery modules (#486)
* feat: discovery modules

* chore: address review
2020-01-24 14:40:40 +01:00
dirkmc
1999606ecc fix: replace peerInfo addresses with listen addresses (#485)
* feat: replace peer info addresses with listen addresses

* test: add listening test

* chore: fix linting
2020-01-24 14:40:40 +01:00
dirkmc
472e14f2b4 refactor(docs): async await version of examples/chat (#482)
* fix: performance bottleneck in stat.js (#463)

Array.shift seems to be very slow, perhaps linear, on some
engines, resulting in  _update consuming a lot of CPU.

* docs(fix): correct docs and example for pnet (#464)

* docs(fix): correct docs and example for pnet

* docs(fix): correct pnet docs

* docs(fix): update README.md language (#468)

* docs: reciprocate (#474)

* docs(example): fix ipfs cat (#475)

`ipfs.files.cat` is incorrect. the correct function is `ipfs.cat`

* fix: async-await example chat

* fix: move handler before start

* fix: examples readme typos (#481)

* fix: simplify libp2p bundle for echo example

* chore: remove unused vars
2020-01-24 14:40:40 +01:00
dirkmc
953d185c39 refactor(docs): async await version of examples/echo (#483)
* fix: performance bottleneck in stat.js (#463)

Array.shift seems to be very slow, perhaps linear, on some
engines, resulting in  _update consuming a lot of CPU.

* docs(fix): correct docs and example for pnet (#464)

* docs(fix): correct docs and example for pnet

* docs(fix): correct pnet docs

* docs(fix): update README.md language (#468)

* docs: reciprocate (#474)

* docs(example): fix ipfs cat (#475)

`ipfs.files.cat` is incorrect. the correct function is `ipfs.cat`

* fix: async await examples/echo

* fix: examples readme typos (#481)

* fix: simplify libp2p bundle for echo example
2020-01-24 14:40:40 +01:00
Vasco Santos
c563e06a60 refactor: dht async/await (#480)
* refactor: core async (#478)

* refactor: cleanup core

test: auto dial on startup

* fix: make hangup work properly

* chore: fix lint

* chore: apply suggestions from code review

Co-Authored-By: Vasco Santos <vasco.santos@moxy.studio>

* fix: provide libp2p dialer to the dht

* chore: use dht release
2020-01-24 14:40:40 +01:00
Jacob Heun
f28b09fc0d refactor: update secio and tests to use it (#484)
* refactor: use async secio

* test: add secio to most test suites

* chore: update secio version
2020-01-24 14:40:40 +01:00
Jacob Heun
2104578924 refactor: core async (#478)
* refactor: cleanup core

test: auto dial on startup

* fix: make hangup work properly

* chore: fix lint

* chore: apply suggestions from code review

Co-Authored-By: Vasco Santos <vasco.santos@moxy.studio>
2020-01-24 14:40:40 +01:00
Vasco Santos
bcad60995e chore: use gossipsub release (#479) 2020-01-24 14:40:40 +01:00
Vasco Santos
432b0997ae refactor: pubsub (#467)
* feat: peer-store v0

* chore: apply suggestions from code review

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

* chore: address review

* refactor: pubsub subsystem

* chore: address review

* chore: use topology interface

* chore: address review

* chore: address review

* chore: simplify tests
2020-01-24 14:40:40 +01:00
Jacob Heun
2afdbb71b2 chore: update it-length-prefixed (#476)
fix: decode.fromReader usage
2020-01-24 14:40:40 +01:00
Jacob Heun
c7a54f34f7 refactor: async identify and identify push (#473)
* chore: add missing dep

* feat: import from identify push branch

https://github.com/libp2p/js-libp2p-identify/tree/feat/identify-push

* feat: add the connection to stream handlers

* refactor: identify to async/await

* chore: fix lint

* test: add identify tests

* refactor: add identify to the dialer flow

* feat: connect identify to the registrar

* fix: resolve review feedback

* fix: perform identify push when our protocols change
2020-01-24 14:40:40 +01:00
Vasco Santos
9d52b80c45 feat: registrar (#471)
* feat: peer-store v0

* feat: registrar

* chore: apply suggestions from code review

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

* chore: address review

* chore: support multiple conns

* chore: address review

* fix: no remote peer from topology on disconnect
2020-01-24 14:40:40 +01:00
Vasco Santos
582094a834 feat: peer store (#470)
* feat: peer-store v0

* chore: apply suggestions from code review

Co-Authored-By: Jacob Heun <jacobheun@gmail.com>
2020-01-24 14:40:40 +01:00
Jacob Heun
fe2a8eddbb refactor: crypto and pnet (#469)
* feat: add initial plaintext 2 module

* refactor: initial refactor of pnet

* chore: fix lint

* fix: update plaintext api usage

* test: use plaintext for test crypto

* chore: update deps

test: update dialer suite scope

* feat: add connection protection to the upgrader

* refactor: cleanup and lint fix

* chore: remove unncessary transforms

* chore: temporarily disable bundlesize

* chore: add missing dep

* fix: use it-handshake to prevent overreading

* chore(fix): PR feedback updates

* chore: apply suggestions from code review

Co-Authored-By: Vasco Santos <vasco.santos@moxy.studio>
2020-01-24 14:40:40 +01:00
Jacob Heun
5e1dbc21a2 refactor(async): add dialer and upgrader (#462)
* 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
2020-01-24 14:40:40 +01:00
Jacob Heun
b37ccc7279 docs: add stream wrapping example (#466)
* docs: add duplex wrapping example

docs: add iterable types from @alanshaw's gist

* docs(fix): add feedback fix

Co-Authored-By: Vasco Santos <vasco.santos@moxy.studio>

* docs: clean up based on feedback
2020-01-24 14:40:40 +01:00
Jacob Heun
440fbf0c04 refactor(async): update transports subsystem (#461)
* 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
2020-01-24 14:40:40 +01:00
Jacob Heun
0cef51d4c2 Add streaming iterables guide (#459)
* docs: add streaming iterables guide placeholder

* chore: move peer discovery readme to doc fold:wqer

* docs: add link to async refactor issue
2020-01-24 14:40:40 +01:00
David Dias
b277b26043 docs: add missing ones 2019-12-11 10:52:13 +01:00
David Dias
bc071ce7d7 docs: fix gossipsub link 2019-12-11 10:52:13 +01:00
David Dias
01730214d6 docs: fix js-interfaces badge 2019-12-11 10:52:13 +01:00
David Dias
0826531e31 docs: update the package table for my pepz :) 2019-12-11 10:52:13 +01:00
dirkmc
35ac02dcb5 fix: examples readme typos (#481) 2019-11-26 05:56:19 -06:00
phillmac
b73348078d docs(example): fix ipfs cat (#475)
`ipfs.files.cat` is incorrect. the correct function is `ipfs.cat`
2019-11-11 13:22:59 +01:00
David Dias
21cd9c67bc docs: reciprocate (#474) 2019-11-04 19:10:17 +01:00
Ryan Bell
0fc4537a5e docs(fix): update README.md language (#468) 2019-10-24 10:52:40 +02:00
Jacob Heun
6a05f3e6e7
docs(fix): correct docs and example for pnet (#464)
* docs(fix): correct docs and example for pnet

* docs(fix): correct pnet docs
2019-10-16 17:27:31 +02:00
Didrik Nordström
93a1e42ef3 fix: performance bottleneck in stat.js (#463)
Array.shift seems to be very slow, perhaps linear, on some
engines, resulting in  _update consuming a lot of CPU.
2019-10-14 12:19:51 +02:00
Alex Potsides
35aa45ce92 chore: update required libp2p-crypto version (#457)
So as to only pull in libp2p-crypto version with updated `node-forge` dep
2019-09-25 12:12:36 +02:00
Jacob Heun
b11c6fc7e9
chore: release version v0.26.2 v0.26.2 2019-09-24 14:10:58 +02:00
Jacob Heun
ebedd3510b
chore: update contributors 2019-09-24 14:10:57 +02:00
Alex Potsides
ae6af20e8e fix: pubsub promisify (#456)
* fix: allow pubsub sub/unsub via promises

* chore: fix linting errors
2019-09-24 14:02:07 +02:00
swedneck
2a80618740 docs: add bridged chats (#454) 2019-09-23 11:39:47 +02:00
Vasco Santos
5b1bd389f8 docs: update packages table (#265)
* docs: update packages table

* docs: removed not implemented packages
2019-09-03 10:29:03 +02:00
Fei Liu
3e31c2d0df docs: remove dead link from readme (#450) 2019-08-27 17:07:21 +02:00
Jacob Heun
8079c2078b
chore: release version v0.26.1 v0.26.1 2019-08-21 19:51:51 +02:00
Jacob Heun
80cf0777b5
chore: update contributors 2019-08-21 19:51:50 +02:00
Jacob Heun
60b0cbc179
fix: reject rather than throw in get peer info (#410)
The get peer info util consolidation from #400 exposed an issue
with how bad values are being handled. Throwing the error can cause
issues when promises are being used. Rejecting resolves this.
I added a test case to validate the change.
2019-08-21 19:08:56 +02:00
Jacob Heun
3eef695bc0
fix: improve config defaults (#409)
This removes defaults from superstruct and instead uses
mergeOptions to deeply set the defaults on configuration.
This ensures that defaults are properly set.

This is a step toward removing superstruct altogether, #406,
but it is still being used for basic type validation.
2019-08-21 16:44:30 +02:00