mirror of
https://github.com/fluencelabs/js-libp2p
synced 2025-07-09 22:01:34 +00:00
Compare commits
5 Commits
Author | SHA1 | Date | |
---|---|---|---|
7b6c921d36 | |||
05c16e4262 | |||
c8a86db310 | |||
ce29902691 | |||
0b729621db |
10
CHANGELOG.md
10
CHANGELOG.md
@ -1,3 +1,13 @@
|
||||
<a name="0.23.1"></a>
|
||||
## [0.23.1](https://github.com/libp2p/js-libp2p/compare/v0.23.0...v0.23.1) (2018-08-13)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* callback with error for invalid or non-peer multiaddr ([#232](https://github.com/libp2p/js-libp2p/issues/232)) ([c8a86db](https://github.com/libp2p/js-libp2p/commit/c8a86db))
|
||||
|
||||
|
||||
|
||||
<a name="0.23.0"></a>
|
||||
# [0.23.0](https://github.com/libp2p/js-libp2p/compare/v0.22.0...v0.23.0) (2018-07-27)
|
||||
|
||||
|
36
MGMT.md
36
MGMT.md
@ -1,36 +0,0 @@
|
||||
# Core Dev Team Work Tracking & Managment
|
||||
|
||||
## How work gets organized (a tl;dr;)
|
||||
|
||||
The js-ipfs core working group follows the OKR structure established for the IPFS project to set the quarterly targets. Within each quarter, work gets tracked using Github and Waffle.
|
||||
|
||||
- Github is used for discussions and track current endeavours.
|
||||
- Waffle gives us a [Kanban](https://en.wikipedia.org/wiki/Kanban) view over the work at hand.
|
||||
|
||||

|
||||
|
||||
In the Waffle board, we have 4 columns:
|
||||
|
||||
- **Inbox** - New issues or PRs that haven't been evaluated yet
|
||||
- **Backlog** - Issues that are blocked or discussion threads that are not currently active
|
||||
- **Ready** - Issues Ready to be worked on
|
||||
- **In Progress** - Issues that someone is already tackling. Contributors should focus on a few things rather than many at once.
|
||||
- **Done** - Issues are automatically moved here when the issue is closed or the PR merged.
|
||||
|
||||
We track work for the JavaScript implementation of the IPFS protocol in 3 separate waffle boards:
|
||||
|
||||
- [js-ipfs](http://waffle.io/ipfs/js-ipfs)
|
||||
- [js-libp2p](http://waffle.io/libp2p/js-libp2p)
|
||||
- [js-ipld](http://waffle.io/ipld/js-ipld)
|
||||
|
||||
## Issue labels and how to use filters
|
||||
|
||||
We use labels to tag urgency and the difficulty of an issue. The current label system has:
|
||||
|
||||
- `difficulty:{easy, moderate, hard}` - This is an instinctive measure give by the project lead or leads. It is a subjective best guess, however the current golden rule is that an issue with difficulty:easy should not require more than a morning (3~4 hours) to do and it should not require having to mess with multiple modules to complete. Issues with difficulty moderate or hard might require some discussion around the problem or even request that another team (i.e go-ipfs) makes some changes. The length of moderate or hard issue might be a day to ad-aeternum.
|
||||
- `priority (P0, P1, P2, P3, P4)` - P0 is the most important while P4 is the least.
|
||||
- `help wanted` - Issues perfect for new contributors. They will have the information necessary or the pointers for a new contributor to figure out what is required. These issues are never blocked on some other issue be done first.
|
||||
|
||||
## Weekly Core Dev Team Calls
|
||||
|
||||
[⚡️ⒿⓈ Core Dev Team Weekly Sync 🙌🏽](https://github.com/ipfs/pm/issues/650)
|
@ -39,7 +39,7 @@ We've come a long way, but this project is still in Alpha, lots of development i
|
||||
|
||||
## Lead Maintainer
|
||||
|
||||
[David Dias](https://github.com/diasdavid/)
|
||||
[Jacob Heun](https://github.com/jacobheun/)
|
||||
|
||||
## Table of Contents
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
{
|
||||
"name": "libp2p",
|
||||
"version": "0.23.0",
|
||||
"version": "0.23.1",
|
||||
"description": "JavaScript base class for libp2p bundles",
|
||||
"leadMaintainer": "David Dias <daviddias@ipfs.io>",
|
||||
"leadMaintainer": "Jacob Heun <jacobheun@gmail.com>",
|
||||
"main": "src/index.js",
|
||||
"scripts": {
|
||||
"lint": "aegir lint",
|
||||
|
@ -3,6 +3,7 @@
|
||||
const PeerId = require('peer-id')
|
||||
const PeerInfo = require('peer-info')
|
||||
const multiaddr = require('multiaddr')
|
||||
const setImmediate = require('async/setImmediate')
|
||||
|
||||
module.exports = (node) => {
|
||||
/*
|
||||
@ -16,12 +17,19 @@ module.exports = (node) => {
|
||||
// Multiaddr instance or Multiaddr String
|
||||
} else if (multiaddr.isMultiaddr(peer) || typeof peer === 'string') {
|
||||
if (typeof peer === 'string') {
|
||||
peer = multiaddr(peer)
|
||||
try {
|
||||
peer = multiaddr(peer)
|
||||
} catch (err) {
|
||||
return setImmediate(() => callback(err))
|
||||
}
|
||||
}
|
||||
|
||||
const peerIdB58Str = peer.getPeerId()
|
||||
|
||||
if (!peerIdB58Str) {
|
||||
throw new Error(`peer multiaddr instance or string must include peerId`)
|
||||
return setImmediate(() => {
|
||||
callback(new Error('peer multiaddr instance or string must include peerId'))
|
||||
})
|
||||
}
|
||||
|
||||
try {
|
||||
|
26
test/get-peer-info.spec.js
Normal file
26
test/get-peer-info.spec.js
Normal file
@ -0,0 +1,26 @@
|
||||
/* eslint-env mocha */
|
||||
'use strict'
|
||||
|
||||
const chai = require('chai')
|
||||
chai.use(require('dirty-chai'))
|
||||
const expect = chai.expect
|
||||
|
||||
const getPeerInfo = require('../src/get-peer-info')
|
||||
|
||||
describe('getPeerInfo', () => {
|
||||
it('should callback with error for invalid string multiaddr', (done) => {
|
||||
getPeerInfo(null)('INVALID MULTIADDR', (err) => {
|
||||
expect(err).to.exist()
|
||||
expect(err.message).to.contain('must start with a "/"')
|
||||
done()
|
||||
})
|
||||
})
|
||||
|
||||
it('should callback with error for invalid non-peer multiaddr', (done) => {
|
||||
getPeerInfo(null)('/ip4/8.8.8.8/tcp/1080', (err) => {
|
||||
expect(err).to.exist()
|
||||
expect(err.message).to.equal('peer multiaddr instance or string must include peerId')
|
||||
done()
|
||||
})
|
||||
})
|
||||
})
|
Reference in New Issue
Block a user