Compare commits

...

10 Commits

Author SHA1 Message Date
8f6935499e chore: release version v0.10.2 2017-10-12 10:21:43 +02:00
80da1a54b2 chore: update contributors 2017-10-12 10:21:43 +02:00
300266ad51 chore: update deps 2017-10-12 10:20:43 +02:00
3abdcdabbb fix: Always add public key to constructor if possible, Fix for undefined pubKey in remote peers (#68)
* Always add public key to constructor if possible

* extending Non-default # of bits test time, travis took 59521ms

License: MIT
Signed-off-by: Yahya <ya7yaz@gmail.com>
2017-10-12 10:09:18 +02:00
7d3cb8e87c chore: release version v0.10.1 2017-09-07 14:51:57 +01:00
a57c0c6f14 chore: update contributors 2017-09-07 14:51:57 +01:00
d7088d6650 feat(deps): update aegir and libp2p-crypto (#67) 2017-09-07 14:50:44 +01:00
c945d6ad48 chore: release version v0.10.0 2017-09-03 11:51:33 +01:00
0eee1a2a69 chore: update contributors 2017-09-03 11:51:33 +01:00
63428faae9 feat: p2p addrs situation (#66)
* chore: update deps

* chore: update gitignore

* chore: update CI

* chore: update README badge
2017-09-03 11:49:56 +01:00
7 changed files with 252 additions and 36 deletions

19
.gitignore vendored
View File

@ -1,7 +1,14 @@
**/node_modules/
**/*.log
test/repo-tests*
**/bundle.js
# Logs
logs
*.log
coverage
# Runtime data
pids
*.pid
@ -19,11 +26,19 @@ coverage
# node-waf configuration
.lock-wscript
# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release
build
# Dependency directory
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
node_modules
docs
lib
dist
test/test-data/go-ipfs-repo/LOCK
test/test-data/go-ipfs-repo/LOG
test/test-data/go-ipfs-repo/LOG.old
# while testing npm5
package-lock.json
yarn.lock

View File

@ -3,23 +3,17 @@ language: node_js
matrix:
include:
- node_js: 4
env: CXX=g++-4.8
- node_js: 6
env:
- CXX=g++-4.8
- node_js: stable
env: CXX=g++-4.8
# Make sure we have new NPM.
before_install:
- npm install -g npm@4
- node_js: 8
env: CXX=g++-4.8
# - node_js: stable
# env: CXX=g++-4.8
script:
- npm run lint
- npm test
- npm run coverage
- make test
- npm run test
- npm run coverage -- --upload
before_script:
- export DISPLAY=:99.0

206
CHANGELOG.md Normal file
View File

@ -0,0 +1,206 @@
<a name="0.10.2"></a>
## [0.10.2](https://github.com/libp2p/js-peer-id/compare/v0.10.1...v0.10.2) (2017-10-12)
### Bug Fixes
* Always add public key to constructor if possible, Fix for undefined pubKey in remote peers ([#68](https://github.com/libp2p/js-peer-id/issues/68)) ([3abdcda](https://github.com/libp2p/js-peer-id/commit/3abdcda))
<a name="0.10.1"></a>
## [0.10.1](https://github.com/libp2p/js-peer-id/compare/v0.10.0...v0.10.1) (2017-09-07)
### Features
* **deps:** update aegir and libp2p-crypto ([#67](https://github.com/libp2p/js-peer-id/issues/67)) ([d7088d6](https://github.com/libp2p/js-peer-id/commit/d7088d6))
<a name="0.10.0"></a>
# [0.10.0](https://github.com/libp2p/js-peer-id/compare/v0.9.0...v0.10.0) (2017-09-03)
### Features
* p2p addrs situation ([#66](https://github.com/libp2p/js-peer-id/issues/66)) ([63428fa](https://github.com/libp2p/js-peer-id/commit/63428fa))
<a name="0.9.0"></a>
# [0.9.0](https://github.com/libp2p/js-peer-id/compare/v0.8.8...v0.9.0) (2017-07-22)
### Features
* use next libp2p-crypto ([#64](https://github.com/libp2p/js-peer-id/issues/64)) ([442df13](https://github.com/libp2p/js-peer-id/commit/442df13))
<a name="0.8.8"></a>
## [0.8.8](https://github.com/libp2p/js-peer-id/compare/v0.8.7...v0.8.8) (2017-07-21)
<a name="0.8.7"></a>
## [0.8.7](https://github.com/libp2p/js-peer-id/compare/v0.8.6...v0.8.7) (2017-04-03)
### Features
* set privKey pubKey ([ac27907](https://github.com/libp2p/js-peer-id/commit/ac27907))
<a name="0.8.6"></a>
## [0.8.6](https://github.com/libp2p/js-peer-id/compare/v0.8.5...v0.8.6) (2017-03-30)
### Features
* isEqual ([3f4f670](https://github.com/libp2p/js-peer-id/commit/3f4f670))
<a name="0.8.5"></a>
## [0.8.5](https://github.com/libp2p/js-peer-id/compare/v0.8.4...v0.8.5) (2017-03-27)
### Bug Fixes
* avoid using constructor.name ([a3fe1a2](https://github.com/libp2p/js-peer-id/commit/a3fe1a2))
### Features
* isPeerId ([0acc572](https://github.com/libp2p/js-peer-id/commit/0acc572))
<a name="0.8.4"></a>
## [0.8.4](https://github.com/libp2p/js-peer-id/compare/v0.8.2...v0.8.4) (2017-03-16)
<a name="0.8.2"></a>
## [0.8.2](https://github.com/libp2p/js-peer-id/compare/v0.8.1...v0.8.2) (2017-02-09)
<a name="0.8.1"></a>
## [0.8.1](https://github.com/libp2p/js-peer-id/compare/v0.8.0...v0.8.1) (2016-12-18)
### Features
* cache b58 id ([bebb0a7](https://github.com/libp2p/js-peer-id/commit/bebb0a7))
* create b58 string on creation and throw on id mutation ([78d96d0](https://github.com/libp2p/js-peer-id/commit/78d96d0))
<a name="0.8.0"></a>
# [0.8.0](https://github.com/libp2p/js-peer-id/compare/v0.7.0...v0.8.0) (2016-11-03)
* Async Crypto Endeavour (#33) ([31701e2](https://github.com/libp2p/js-peer-id/commit/31701e2))
### BREAKING CHANGES
* This changes the interface of .create, .createFromPrivKey,
.createFromPubKey, .createFromJSON
<a name="0.7.0"></a>
# [0.7.0](https://github.com/libp2p/js-peer-id/compare/v0.6.7...v0.7.0) (2016-05-26)
### Bug Fixes
* code review and docs and go interop ([58f1933](https://github.com/libp2p/js-peer-id/commit/58f1933))
* use new version of libp2p-crypto ([ab55046](https://github.com/libp2p/js-peer-id/commit/ab55046))
<a name="0.6.7"></a>
## [0.6.7](https://github.com/libp2p/js-peer-id/compare/v0.6.6...v0.6.7) (2016-05-23)
<a name="0.6.6"></a>
## [0.6.6](https://github.com/libp2p/js-peer-id/compare/v0.6.5...v0.6.6) (2016-04-12)
<a name="0.6.5"></a>
## [0.6.5](https://github.com/libp2p/js-peer-id/compare/v0.6.1...v0.6.5) (2016-04-12)
<a name="0.6.1"></a>
## [0.6.1](https://github.com/libp2p/js-peer-id/compare/v0.6.0...v0.6.1) (2016-03-15)
<a name="0.6.0"></a>
# [0.6.0](https://github.com/libp2p/js-peer-id/compare/v0.5.3...v0.6.0) (2016-03-10)
<a name="0.5.3"></a>
## [0.5.3](https://github.com/libp2p/js-peer-id/compare/v0.5.1...v0.5.3) (2016-03-05)
<a name="0.5.1"></a>
## [0.5.1](https://github.com/libp2p/js-peer-id/compare/v0.5.0...v0.5.1) (2016-03-03)
<a name="0.5.0"></a>
# [0.5.0](https://github.com/libp2p/js-peer-id/compare/v0.4.0...v0.5.0) (2016-02-14)
<a name="0.4.0"></a>
# [0.4.0](https://github.com/libp2p/js-peer-id/compare/v0.3.4...v0.4.0) (2015-11-05)
<a name="0.3.4"></a>
## [0.3.4](https://github.com/libp2p/js-peer-id/compare/v0.3.3...v0.3.4) (2015-10-28)
<a name="0.3.3"></a>
## [0.3.3](https://github.com/libp2p/js-peer-id/compare/v0.3.2...v0.3.3) (2015-09-15)
<a name="0.3.2"></a>
## [0.3.2](https://github.com/libp2p/js-peer-id/compare/v0.3.1...v0.3.2) (2015-09-14)
<a name="0.3.1"></a>
## [0.3.1](https://github.com/libp2p/js-peer-id/compare/v0.3.0...v0.3.1) (2015-08-25)
<a name="0.3.0"></a>
# [0.3.0](https://github.com/libp2p/js-peer-id/compare/v0.2.0...v0.3.0) (2015-07-19)
<a name="0.2.0"></a>
# [0.2.0](https://github.com/libp2p/js-peer-id/compare/v0.1.0...v0.2.0) (2015-07-17)
<a name="0.1.0"></a>
# 0.1.0 (2015-07-08)

View File

@ -7,7 +7,7 @@
[![Dependency Status](https://david-dm.org/libp2p/js-peer-id.svg?style=flat-square)](https://david-dm.org/libp2p/js-peer-id)
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/feross/standard)
![](https://img.shields.io/badge/npm-%3E%3D3.0.0-orange.svg?style=flat-square)
![](https://img.shields.io/badge/Node.js-%3E%3D4.0.0-orange.svg?style=flat-square)
![](https://img.shields.io/badge/Node.js-%3E%3D6.0.0-orange.svg?style=flat-square)
> [IPFS](https://github.com/ipfs/ipfs) Peer ID implementation in JavaScript.

View File

@ -1,20 +1,19 @@
{
"name": "peer-id",
"version": "0.9.0",
"version": "0.10.2",
"description": "IPFS Peer Id implementation in Node.js",
"main": "src/index.js",
"bin": "src/bin.js",
"scripts": {
"lint": "aegir-lint",
"build": "aegir-build",
"test": "aegir-test",
"test:node": "aegir-test node",
"test:browser": "aegir-test browser",
"release": "aegir-release",
"release-minor": "aegir-release --type minor",
"release-major": "aegir-release --type major",
"coverage": "aegir-coverage",
"coverage-publish": "aegir-coverage publish"
"lint": "aegir lint",
"build": "aegir build",
"test": "aegir test",
"test:node": "aegir test -t node",
"test:browser": "aegir test -t browser -t webworker",
"release": "aegir release",
"release-minor": "aegir release --type minor",
"release-major": "aegir release --type major",
"coverage": "aegir coverage"
},
"keywords": [
"IPFS"
@ -26,7 +25,7 @@
"test"
],
"engines": {
"node": ">=4.0.0",
"node": ">=6.0.0",
"npm": ">=3.0.0"
},
"bugs": {
@ -34,16 +33,16 @@
},
"homepage": "https://github.com/libp2p/js-peer-id",
"devDependencies": {
"aegir": "^11.0.2",
"chai": "^4.1.0",
"aegir": "^12.0.8",
"chai": "^4.1.2",
"dirty-chai": "^2.0.1",
"pre-commit": "^1.2.2"
},
"dependencies": {
"async": "^2.5.0",
"libp2p-crypto": "~0.9.4",
"libp2p-crypto": "~0.10.3",
"lodash": "^4.17.4",
"multihashes": "~0.4.5"
"multihashes": "~0.4.9"
},
"repository": {
"type": "git",
@ -56,8 +55,9 @@
"Prashanth Chandra <coolshanth94@gmail.com>",
"Richard Littauer <richard.littauer@gmail.com>",
"Stephen Whitmore <stephen.whitmore@gmail.com>",
"Yahya <ya7yaz@gmail.com>",
"greenkeeperio-bot <support@greenkeeper.io>",
"nginnever <ginneversource@gmail.com>",
"npmcdn-to-unpkg-bot <npmcdn-to-unpkg-bot@users.noreply.github.com>"
]
}
}

View File

@ -8,7 +8,6 @@ const mh = require('multihashes')
const crypto = require('libp2p-crypto')
const assert = require('assert')
const waterfall = require('async/waterfall')
const Buffer = require('safe-buffer').Buffer
class PeerId {
constructor (id, privKey, pubKey) {
@ -203,7 +202,7 @@ exports.createFromPrivKey = function (key, callback) {
return callback(err)
}
callback(null, new PeerId(digest, privKey))
callback(null, new PeerId(digest, privKey, privKey.public))
})
}

View File

@ -9,7 +9,6 @@ const expect = chai.expect
const crypto = require('libp2p-crypto')
const mh = require('multihashes')
const parallel = require('async/parallel')
const Buffer = require('safe-buffer').Buffer
const PeerId = require('../src')
@ -86,6 +85,7 @@ describe('PeerId', () => {
PeerId.createFromPrivKey(encoded, (err, id2) => {
expect(err).to.not.exist()
expect(testIdB58String).to.equal(id2.toB58String())
expect(id.marshalPubKey()).to.deep.equal(id2.marshalPubKey())
done()
})
})
@ -103,7 +103,9 @@ describe('PeerId', () => {
})
})
it('Non-default # of bits', (done) => {
it('Non-default # of bits', function (done) {
// rsa is slow atm
this.timeout(100000)
PeerId.create({ bits: 1024 }, (err, shortId) => {
expect(err).to.not.exist()
PeerId.create({ bits: 4096 }, (err, longId) => {