mirror of
https://github.com/fluencelabs/js-libp2p-noise
synced 2025-08-01 01:22:15 +00:00
Merge pull request #71 from NodeFactoryIo/release-1.2.0
Release 1.2.0-rc.1
This commit is contained in:
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [1.2.0-rc.1]
|
||||
|
||||
#### Features
|
||||
- switched to aegir for building and linting
|
||||
- replaced some Buffer usage with Uint8Arrays
|
||||
|
||||
## [1.1.2]
|
||||
|
||||
#### Bugfixes
|
||||
|
40
benchmarks/benchmark.js
Normal file
40
benchmarks/benchmark.js
Normal file
@@ -0,0 +1,40 @@
|
||||
/* eslint-disable */
|
||||
|
||||
const { Noise } = require('../dist/src/index')
|
||||
const benchmark = require('benchmark')
|
||||
const DuplexPair = require('it-pair/duplex')
|
||||
const PeerId = require('peer-id')
|
||||
|
||||
const bench = async function () {
|
||||
console.log('Initializing handshake benchmark')
|
||||
const initiator = new Noise()
|
||||
const initiatorPeer = await PeerId.createFromJSON({
|
||||
id: '12D3KooWH45PiqBjfnEfDfCD6TqJrpqTBJvQDwGHvjGpaWwms46D',
|
||||
privKey: 'CAESYBtKXrMwawAARmLScynQUuSwi/gGSkwqDPxi15N3dqDHa4T4iWupkMe5oYGwGH3Hyfvd/QcgSTqg71oYZJadJ6prhPiJa6mQx7mhgbAYfcfJ+939ByBJOqDvWhhklp0nqg==',
|
||||
pubKey: 'CAESIGuE+IlrqZDHuaGBsBh9x8n73f0HIEk6oO9aGGSWnSeq'
|
||||
})
|
||||
const responder = new Noise()
|
||||
const responderPeer = await PeerId.createFromJSON({
|
||||
id: '12D3KooWP63uzL78BRMpkQ7augMdNi1h3VBrVWZucKjyhzGVaSi1',
|
||||
privKey: 'CAESYPxO3SHyfc2578hDmfkGGBY255JjiLuVavJWy+9ivlpsxSyVKf36ipyRGL6szGzHuFs5ceEuuGVrPMg/rW2Ch1bFLJUp/fqKnJEYvqzMbMe4Wzlx4S64ZWs8yD+tbYKHVg==',
|
||||
pubKey: 'CAESIMUslSn9+oqckRi+rMxsx7hbOXHhLrhlazzIP61tgodW'
|
||||
})
|
||||
console.log('Init complete, running benchmark')
|
||||
const bench = new benchmark('handshake', {
|
||||
defer: true,
|
||||
fn: async function (deffered) {
|
||||
const [inboundConnection, outboundConnection] = DuplexPair()
|
||||
await Promise.all([
|
||||
initiator.secureOutbound(initiatorPeer, outboundConnection, responderPeer),
|
||||
responder.secureInbound(responderPeer, inboundConnection, initiatorPeer)
|
||||
])
|
||||
deffered.resolve()
|
||||
}
|
||||
})
|
||||
.on('complete', function (stats) {
|
||||
console.log(String(stats.currentTarget))
|
||||
})
|
||||
bench.run({ async: true })
|
||||
}
|
||||
|
||||
bench()
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "libp2p-noise",
|
||||
"version": "1.1.2",
|
||||
"version": "1.2.0-rc.1",
|
||||
"main": "dist/src/index.js",
|
||||
"types": "dist/src/index.d.ts",
|
||||
"files": [
|
||||
@@ -19,6 +19,7 @@
|
||||
"crypto"
|
||||
],
|
||||
"scripts": {
|
||||
"bench": "node benchmarks/benchmark.js",
|
||||
"build": "aegir build --ts",
|
||||
"lint": "aegir lint --ts",
|
||||
"lint:fix": "aegir lint --ts --fix",
|
||||
@@ -32,8 +33,10 @@
|
||||
"@types/chai": "^4.2.4",
|
||||
"@types/mocha": "^5.2.7",
|
||||
"aegir": "25.0.0",
|
||||
"benchmark": "^2.1.4",
|
||||
"chai": "^4.2.0",
|
||||
"karma-mocha-webworker": "^1.3.0",
|
||||
"microtime": "^3.0.0",
|
||||
"mocha": "^6.2.2",
|
||||
"sinon": "^8.1.0"
|
||||
},
|
||||
|
36
yarn.lock
36
yarn.lock
@@ -2386,6 +2386,14 @@ bcrypto@^5.2.0:
|
||||
bufio "~1.0.7"
|
||||
loady "~0.0.1"
|
||||
|
||||
benchmark@^2.1.4:
|
||||
version "2.1.4"
|
||||
resolved "https://registry.yarnpkg.com/benchmark/-/benchmark-2.1.4.tgz#09f3de31c916425d498cc2ee565a0ebf3c2a5629"
|
||||
integrity sha1-CfPeMckWQl1JjMLuVloOvzwqVik=
|
||||
dependencies:
|
||||
lodash "^4.17.4"
|
||||
platform "^1.3.3"
|
||||
|
||||
better-assert@~1.0.0:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/better-assert/-/better-assert-1.0.2.tgz#40866b9e1b9e0b55b481894311e68faffaebc522"
|
||||
@@ -7296,6 +7304,11 @@ lodash@^4.17.10, lodash@^4.17.11, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17
|
||||
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.19.tgz#e48ddedbe30b3321783c5b4301fbd353bc1e4a4b"
|
||||
integrity sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==
|
||||
|
||||
lodash@^4.17.4:
|
||||
version "4.17.20"
|
||||
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52"
|
||||
integrity sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==
|
||||
|
||||
log-symbols@2.2.0, log-symbols@^2.1.0:
|
||||
version "2.2.0"
|
||||
resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-2.2.0.tgz#5740e1c5d6f0dfda4ad9323b5332107ef6b4c40a"
|
||||
@@ -7693,6 +7706,14 @@ micromatch@^4.0.2:
|
||||
braces "^3.0.1"
|
||||
picomatch "^2.0.5"
|
||||
|
||||
microtime@^3.0.0:
|
||||
version "3.0.0"
|
||||
resolved "https://registry.yarnpkg.com/microtime/-/microtime-3.0.0.tgz#d140914bde88aa89b4f9fd2a18620b435af0f39b"
|
||||
integrity sha512-SirJr7ZL4ow2iWcb54bekS4aWyBQNVcEDBiwAz9D/sTgY59A+uE8UJU15cp5wyZmPBwg/3zf8lyCJ5NUe1nVlQ==
|
||||
dependencies:
|
||||
node-addon-api "^1.2.0"
|
||||
node-gyp-build "^3.8.0"
|
||||
|
||||
miller-rabin@^4.0.0:
|
||||
version "4.0.1"
|
||||
resolved "https://registry.yarnpkg.com/miller-rabin/-/miller-rabin-4.0.1.tgz#f080351c865b0dc562a8462966daa53543c78a4d"
|
||||
@@ -8131,6 +8152,11 @@ nise@^3.0.1:
|
||||
lolex "^5.0.1"
|
||||
path-to-regexp "^1.7.0"
|
||||
|
||||
node-addon-api@^1.2.0:
|
||||
version "1.7.2"
|
||||
resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-1.7.2.tgz#3df30b95720b53c24e59948b49532b662444f54d"
|
||||
integrity sha512-ibPK3iA+vaY1eEjESkQkM0BbCqFOaZMiXRTtdB0u7b4djtY6JnsjvPdUHVMg6xQt3B8fpTTWHI9A+ADjM9frzg==
|
||||
|
||||
node-addon-api@^2.0.0:
|
||||
version "2.0.2"
|
||||
resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-2.0.2.tgz#432cfa82962ce494b132e9d72a15b29f71ff5d32"
|
||||
@@ -8162,6 +8188,11 @@ node-forge@^0.9.1:
|
||||
resolved "https://registry.yarnpkg.com/node-forge/-/node-forge-0.9.1.tgz#775368e6846558ab6676858a4d8c6e8d16c677b5"
|
||||
integrity sha512-G6RlQt5Sb4GMBzXvhfkeFmbqR6MzhtnT7VTHuLadjkii3rdYHNdw0m8zA4BTxVIh68FicCQ2NSUANpsqkr9jvQ==
|
||||
|
||||
node-gyp-build@^3.8.0:
|
||||
version "3.9.0"
|
||||
resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-3.9.0.tgz#53a350187dd4d5276750da21605d1cb681d09e25"
|
||||
integrity sha512-zLcTg6P4AbcHPq465ZMFNXx7XpKKJh+7kkN699NiQWisR2uWYOWNWqRHAmbnmKiL4e9aLSlmy5U7rEMUXV59+A==
|
||||
|
||||
node-gyp-build@^4.2.0:
|
||||
version "4.2.3"
|
||||
resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.2.3.tgz#ce6277f853835f718829efb47db20f3e4d9c4739"
|
||||
@@ -8983,6 +9014,11 @@ pkg-up@^3.1.0:
|
||||
dependencies:
|
||||
find-up "^3.0.0"
|
||||
|
||||
platform@^1.3.3:
|
||||
version "1.3.6"
|
||||
resolved "https://registry.yarnpkg.com/platform/-/platform-1.3.6.tgz#48b4ce983164b209c2d45a107adb31f473a6e7a7"
|
||||
integrity sha512-fnWVljUchTro6RiCFvCXBbNhJc2NijN7oIQxbwsyL0buWJPG85v81ehlHI9fXrJsMNgTofEoWIQeClKpgxFLrg==
|
||||
|
||||
plur@^4.0.0:
|
||||
version "4.0.0"
|
||||
resolved "https://registry.yarnpkg.com/plur/-/plur-4.0.0.tgz#729aedb08f452645fe8c58ef115bf16b0a73ef84"
|
||||
|
Reference in New Issue
Block a user