Skip to content

Commit

Permalink
Fix fabric v2 validation and etherium web3 level
Browse files Browse the repository at this point in the history
  • Loading branch information
nklincoln committed Jun 10, 2020
1 parent e10dc05 commit 7e3b1a4
Show file tree
Hide file tree
Showing 37 changed files with 404 additions and 129 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: node_js
node_js:
- "8"
- "10"

services:
- docker
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
"packages/caliper-gui-server",
"packages/generator-caliper"
],
"version": "0.3.2-unstable",
"version": "0.3.2",
"hoist": true
}
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "caliper",
"description": "Performance benchmarking for Hyperledger blockchain technologies. You must install [Lerna](https://lernajs.io) to build this multi-package repository.",
"version": "0.3.2-unstable",
"version": "0.3.2",
"repository": {
"type": "git",
"url": "https://github.com/hyperledger/caliper"
Expand All @@ -11,7 +11,8 @@
"bootstrap": "lerna bootstrap",
"pretest": "npm run licchk",
"licchk": "license-check-and-add",
"test": "lerna run test"
"test": "lerna run test",
"version-fix": "node ./packages/caliper-publish/publish.js version fix"
},
"engines": {
"node": ">=8.10.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/caliper-burrow/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@hyperledger/caliper-burrow",
"description": "Hyperledger Burrow adaptor for Caliper, enabling the running of performance benchmarks that interact with Burrow",
"version": "0.3.2-unstable",
"version": "0.3.2",
"repository": {
"type": "git",
"url": "https://github.com/hyperledger/caliper",
Expand All @@ -22,7 +22,7 @@
"npm": ">=5.6.0"
},
"dependencies": {
"@hyperledger/caliper-core": "0.3.2-unstable",
"@hyperledger/caliper-core": "0.3.2",
"google-protobuf": "^3.11.4"
},
"devDependencies": {
Expand Down
16 changes: 8 additions & 8 deletions packages/caliper-cli/lib/lib/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,20 @@ sut:
# The name/key of the SDK binding
1.0.0:
# Specifies the packages and their versions to install
packages: ['[email protected]', '[email protected]', '[email protected]', '[email protected]', '[email protected]']
packages: ['[email protected]', '[email protected]', '[email protected]', '[email protected]']
# The settings to apply during binding. The first setting whose versionRegexp matches the node version will be used
settings:
- *new-node-old-grpc
1.1.0:
packages: ['[email protected]', '[email protected]', '[email protected]', '[email protected]', '[email protected]']
packages: ['[email protected]', '[email protected]', '[email protected]', '[email protected]']
settings:
- *new-node-old-grpc
1.2.0:
packages: ['[email protected]', '[email protected]', '[email protected]', '[email protected]', '[email protected]']
packages: ['[email protected]', '[email protected]', '[email protected]', '[email protected]']
settings:
- *new-node-old-grpc
1.3.0:
packages: ['[email protected]', '[email protected]', '[email protected]', '[email protected]', '[email protected]']
packages: ['[email protected]', '[email protected]', '[email protected]', '[email protected]']
1.4.0:
packages: ['[email protected]', '[email protected]', '[email protected]', '[email protected]', '[email protected]']
1.4.1:
Expand Down Expand Up @@ -99,14 +99,14 @@ sut:

ethereum:
1.2.1: &ethereum-latest
packages: ['[email protected].0']
packages: ['[email protected].2']
latest: *ethereum-latest

besu:
1.3.2:
packages: ['[email protected].0']
packages: ['[email protected].2']
1.3:
packages: ['[email protected].0']
packages: ['[email protected].2']
1.4: &besu-latest
packages: ['[email protected].0']
packages: ['[email protected].2']
latest: *besu-latest
16 changes: 8 additions & 8 deletions packages/caliper-cli/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@hyperledger/caliper-cli",
"description": "Hyperledger Caliper CLI, for convenience running of a performance benchmark to test blockchain technologies",
"version": "0.3.2-unstable",
"version": "0.3.2",
"repository": {
"type": "git",
"url": "https://github.com/hyperledger/caliper",
Expand All @@ -26,13 +26,13 @@
"npm": ">=5.6.0"
},
"dependencies": {
"@hyperledger/caliper-core": "0.3.2-unstable",
"@hyperledger/caliper-burrow": "0.3.2-unstable",
"@hyperledger/caliper-fabric": "0.3.2-unstable",
"@hyperledger/caliper-iroha": "0.3.2-unstable",
"@hyperledger/caliper-sawtooth": "0.3.2-unstable",
"@hyperledger/caliper-ethereum": "0.3.2-unstable",
"@hyperledger/caliper-fisco-bcos": "0.3.2-unstable",
"@hyperledger/caliper-core": "0.3.2",
"@hyperledger/caliper-burrow": "0.3.2",
"@hyperledger/caliper-fabric": "0.3.2",
"@hyperledger/caliper-iroha": "0.3.2",
"@hyperledger/caliper-sawtooth": "0.3.2",
"@hyperledger/caliper-ethereum": "0.3.2",
"@hyperledger/caliper-fisco-bcos": "0.3.2",
"yargs": "15.3.1"
},
"devDependencies": {
Expand Down
4 changes: 3 additions & 1 deletion packages/caliper-core/lib/common/messaging/mqtt-master.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,16 @@ class MqttMasterMessenger extends MessengerInterface {
* Clean up any resources associated with the messenger.
*/
async dispose() {
Logger.info('Disconnecting from MQTT service');
const messengerDisconnectedPromise = new Promise((resolve, reject) => {
this.messengerDisconnectedPromise = {
resolve: resolve,
reject: reject
};
});

this.mqttClient.end(false, undefined, () => {
this.mqttClient.end(false, {}, () => {
Logger.info('MQTT connection closed');
this.messengerDisconnectedPromise.resolve();
});

Expand Down
4 changes: 3 additions & 1 deletion packages/caliper-core/lib/common/messaging/mqtt-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,14 +124,16 @@ class MqttWorkerMessenger extends MessengerInterface {
* Clean up any resources associated with the messenger.
*/
async dispose() {
Logger.info('Disconnecting from MQTT service');
const messengerDisconnectedPromise = new Promise((resolve, reject) => {
this.messengerDisconnectedPromise = {
resolve: resolve,
reject: reject
};
});

this.mqttClient.end(true, undefined, () => {
this.mqttClient.end(false, {}, () => {
Logger.info('MQTT connection closed');
this.messengerDisconnectedPromise.resolve();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class PrometheusPushClient {
useGateway(method, body) {
Logger.debug(`Prometheus client sending body ${body} to target ${this.requestParams.href}`);
// Convert body to binary, the newline is important
body = new Buffer(body + '\n', 'binary');
body = Buffer.from(body + '\n', 'binary');

// Assign request options
const options = Object.assign(this.requestParams, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ class MonitorOrchestrator {
* @async
*/
async stopAllMonitors() {
logger.info('Stopping all monitors');
if(this.started === true) {

for (let key of this.monitors.keys()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class WorkerOrchestrator {
this.workerArguments = workerArguments;

this.workers = {};
this.workerObjects = [];
this.workerObjects = []; // used in the process communications
this.updates = {id:0, data:[]}; // contains txUpdated messages
this.results = []; // cumulative results

Expand Down Expand Up @@ -486,16 +486,17 @@ class WorkerOrchestrator {
}

/**
* Stop all test workers (child processes)
* Stop all test workers and disconnect from messenger
*/
async stop() {
logger.info('Sending exit message to connected workers');
this.messenger.send(['all'], TYPES.EXIT, {});
await this.messenger.dispose();

for (let workerObject of this.workerObjects) {
workerObject.kill();
}
// Internally spawned workers are killed within the messenger handling of 'exit', but clean the array of processes here
this.workerObjects = [];

// dispose of master messenger
await this.messenger.dispose();
}

/**
Expand Down Expand Up @@ -538,13 +539,13 @@ class WorkerOrchestrator {
logger.info(`Launching worker ${index} of ${this.number}`);

// Spawn the worker. The index is assigned upon connection
let cliPath = process.argv[1];
let workerCommands = ['launch', 'worker'];
let remainingArgs = process.argv.slice(4);
const cliPath = process.argv[1];
const workerCommands = ['launch', 'worker'];
const remainingArgs = process.argv.slice(4);

let nodeArgs = workerCommands.concat(remainingArgs);
const nodeArgs = workerCommands.concat(remainingArgs);

let worker = childProcess.fork(cliPath, nodeArgs, {
const worker = childProcess.fork(cliPath, nodeArgs, {
env: process.env,
cwd: process.cwd()
});
Expand Down
2 changes: 1 addition & 1 deletion packages/caliper-core/lib/master/report/report-builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

const Config = require('../../common/config/config-util');
const Utils = require('../../common/utils/caliper-utils');
const Logger = Utils.getLogger('caliper-flow');
const Logger = Utils.getLogger('report-builder');
const fs = require('fs');
const Mustache = require('mustache');
const path = require('path');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ const bc = require('../../common/core/blockchain.js');
const RateControl = require('../rate-control/rateControl.js');
const PrometheusClient = require('../../common/prometheus/prometheus-push-client');

const Logger = CaliperUtils.getLogger('caliper-local-client.js');
const Logger = CaliperUtils.getLogger('caliper-local-client');

/**
* Class for Client Interaction
*/
Expand Down
3 changes: 2 additions & 1 deletion packages/caliper-core/lib/worker/client/message-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class MessageHandler {
* @param {Messenger} messenger the Messenger to use for communication with the orchestrator
*/
constructor(handlers, messenger) {

if (!handlers.init) {
let msg = 'Handler for "init" is not specified';
logger.error(msg);
Expand Down Expand Up @@ -236,7 +237,7 @@ class MessageHandler {
case 'exit': {
logger.info('Handling "exit" message');
await context.messenger.dispose();
logger.info(`Handled "exit" message for worker ${context.workerId}`);
logger.info(`Handled "exit" message for worker ${context.workerId}, exiting process`);
process.exit(0);
break;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/caliper-core/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@hyperledger/caliper-core",
"description": "Core Hyperledger Caliper module, used for running performance benchmarks that interact with blockchain technologies",
"version": "0.3.2-unstable",
"version": "0.3.2",
"repository": {
"type": "git",
"url": "https://github.com/hyperledger/caliper",
Expand Down
4 changes: 2 additions & 2 deletions packages/caliper-ethereum/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@hyperledger/caliper-ethereum",
"description": "Ethereum adaptor for Caliper, enabling the running of performance benchmarks that interact with Ethereum",
"version": "0.3.2-unstable",
"version": "0.3.2",
"repository": {
"type": "git",
"url": "https://github.com/hyperledger/caliper",
Expand All @@ -22,7 +22,7 @@
"npm": ">=5.6.0"
},
"dependencies": {
"@hyperledger/caliper-core": "0.3.2-unstable",
"@hyperledger/caliper-core": "0.3.2",
"ethereumjs-wallet": "^0.6.3"
},
"devDependencies": {
Expand Down
Loading

0 comments on commit 7e3b1a4

Please sign in to comment.