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.
* refactor: add js-libp2p-connection-manager to repo
Co-authored-by: David Dias <daviddias.p@gmail.com>
Co-authored-by: Jacob Heun <jacobheun@gmail.com>
Co-authored-by: Pedro Teixeira <i@pgte.me>
Co-authored-by: Vasco Santos <vasco.santos@ua.pt>
* test(conn-mgr): only run in node
* refactor: add js-libp2p-identify to repo
Co-authored-by: David Dias <daviddias.p@gmail.com>
Co-authored-by: Friedel Ziegelmayer <dignifiedquire@gmail.com>
Co-authored-by: Hugo Dias <hugomrdias@gmail.com>
Co-authored-by: Jacob Heun <jacobheun@gmail.com>
Co-authored-by: Maciej Krüger <mkg20001@gmail.com>
Co-authored-by: Richard Littauer <richard.littauer@gmail.com>
Co-authored-by: Vasco Santos <vasco.santos@moxy.studio>
Co-authored-by: Yusef Napora <yusef@protocol.ai>
Co-authored-by: ᴠɪᴄᴛᴏʀ ʙᴊᴇʟᴋʜᴏʟᴍ <victorbjelkholm@gmail.com>
* refactor: add libp2p-pnet to repo
Co-authored-by: Jacob Heun <jacobheun@gmail.com>
Co-authored-by: Vasco Santos <vasco.santos@moxy.studio>
* refactor: add libp2p-ping to repo
Co-authored-by: David Dias <daviddias.p@gmail.com>
Co-authored-by: Francisco Baio Dias <xicombd@gmail.com>
Co-authored-by: Friedel Ziegelmayer <dignifiedquire@gmail.com>
Co-authored-by: Hugo Dias <mail@hugodias.me>
Co-authored-by: Jacob Heun <jacobheun@gmail.com>
Co-authored-by: João Antunes <j.goncalo.antunes@gmail.com>
Co-authored-by: Richard Littauer <richard.littauer@gmail.com>
Co-authored-by: Vasco Santos <vasco.santos@moxy.studio>
Co-authored-by: Vasco Santos <vasco.santos@ua.pt>
Co-authored-by: ᴠɪᴄᴛᴏʀ ʙᴊᴇʟᴋʜᴏʟᴍ <victorbjelkholm@gmail.com>
* refactor: add libp2p-circuit to repo
Co-authored-by: David Dias <daviddias.p@gmail.com>
Co-authored-by: Dmitriy Ryajov <dryajov@gmail.com>
Co-authored-by: Friedel Ziegelmayer <dignifiedquire@gmail.com>
Co-authored-by: Hugo Dias <mail@hugodias.me>
Co-authored-by: Jacob Heun <jacobheun@gmail.com>
Co-authored-by: Maciej Krüger <mkg20001@gmail.com>
Co-authored-by: Oli Evans <oli@tableflip.io>
Co-authored-by: Pedro Teixeira <i@pgte.me>
Co-authored-by: Vasco Santos <vasco.santos@ua.pt>
Co-authored-by: Victor Bjelkholm <victorbjelkholm@gmail.com>
Co-authored-by: Yusef Napora <yusef@napora.org>
Co-authored-by: dirkmc <dirk@mccormick.cx>
* test(switch): avoid using instanceof
* chore(switch): update bignumber dep
* refactor(circuit): clean up tests
* refactor(switch): consolidate get peer utils
* test(identify): do deep checks of addresses
* test(identify): bump timeout for identify test
* test(switch): tidy up limit dialer test
* refactor(switch): remove redundant circuit tests
* chore: add coverage script
* refactor(circuit): consolidate get peer info
* docs: reference original repositories in each sub readme
* docs: fix comment
* refactor: clean up sub package.json files and readmes
* chore: update ws rendezvous dep
test(fix): fix tests with latest ws rendezvous server
* fix: promisification of libp2p methods
test: add tests to verify promisify support until async/await endeavor is complete
* chore: fix linting
* docs: update browser example pubsub
* docs: fix pubsub example config
* fix: make pubsub default to enabled
This allows for only adding the module to have it enabled. Previously you would have to supply and enable the module which is unncessary for users
BREAKING CHANGE: new configuration for deciding the implementation of pubsub to be used.
In this context, the experimental flags were also removed. See the README for the latest usage.
* feat: promisify all api methods that accept callbacks
This is a stop-gap until the full async/await migration can be
completed. It means we can refactor tests of other modules that
depend on this module without having to mix async flow control
strategies.
N.b. some methods that were previously callable without callbacks
(e.g. `node.start()`, `node.stop()`, etc) now require callbacks
otherwise a promise is returned which, if rejected, can cause
`unhandledPromiseRejection` events and lead to memory leaks.
* docs: add a global note to the api about promisify
* fix: update the logic for unsubscribe
* test(fix): correct pubsub unsubscribe usage for api change
* test(fix): update content routing tests for latest delegate version
createLibp2p is a new exported helper function that allows users to create a libp2p instance without worrying about creating a PeerInfo instance first.