Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The APIs dont match: Constructor in readme "(_config)", constructor in src/ "(_modules, _peerInfo, _peerBook, _options)" #217

Closed
mkg20001 opened this issue Jul 4, 2018 · 2 comments

Comments

@mkg20001
Copy link
Member

mkg20001 commented Jul 4, 2018

  • Version: 0.20.4
  • Platform: Ubuntu 16.04 x64
  • Subsystem: js-libp2p

Type: bug

Severity: high

Description: The APIs dont match: Constructor in readme "(_config)", constructor in src/ "(_modules, _peerInfo, _peerBook, _options)"

Steps to reproduce the error:

  1. Follow the docs on the README (on npm)
  2. Realize the APIs don't match

The example uses the new-style api, yet the old constructor still requires the old stil API. To avoid mass breakage maybe just add a shim that does if (_modules.peerInfo) {_peerInfo = _modules.peerInfo; _peerBook = _modules.peerBook; _options = _modules.config; _modules = _modules.modules}

@daviddias
Copy link
Member

@mkg20001 you are looking at the README of libp2p 0.22 and using it with libp2p 0.20.4. Simply update to 0.22

@mkg20001
Copy link
Member Author

mkg20001 commented Jul 5, 2018

@diasdavid Ok. Noticed my local-npm server was just outdated again...

@mkg20001 mkg20001 closed this as completed Jul 5, 2018
maschad pushed a commit to maschad/js-libp2p that referenced this issue Jun 21, 2023
Uses new metrics interface from libp2p/js-libp2p-interfaces#310 to report useful connection metrics.

Similar to libp2p#217 but it adds the listening host/port to the metrics name to allow multiple TCP listeners to report metrics separately.

BREAKING CHANGE: requires metrics interface v4
maschad pushed a commit to maschad/js-libp2p that referenced this issue Jun 21, 2023
## [6.0.0](libp2p/js-libp2p-tcp@v5.0.2...v6.0.0) (2022-11-05)

### ⚠ BREAKING CHANGES

* requires metrics interface v4

### Features

* add metrics ([libp2p#223](libp2p/js-libp2p-tcp#223)) ([c004357](libp2p/js-libp2p-tcp@c004357)), closes [libp2p#217](libp2p/js-libp2p-tcp#217)
maschad pushed a commit to maschad/js-libp2p that referenced this issue Jun 21, 2023
Co-authored-by: web3-bot <web3-bot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants