From 09c0267fc47465cad88e552266408e6b518db369 Mon Sep 17 00:00:00 2001 From: Attila Klenik Date: Thu, 18 Jul 2019 19:45:30 +0000 Subject: [PATCH] Removed old fabric adapter and related examples Signed-off-by: Attila Klenik --- README.md | 8 +- packages/caliper-cli/package.json | 1 - packages/caliper-core/lib/test/defaultTest.js | 26 - packages/caliper-fabric/.editorconfig | 26 - packages/caliper-fabric/.eslintignore | 17 - packages/caliper-fabric/.eslintrc.yml | 48 - packages/caliper-fabric/index.js | 19 - .../lib/ChannelSignedTransaction.js | 2458 ----------------- packages/caliper-fabric/lib/constant.js | 45 - packages/caliper-fabric/lib/create-channel.js | 270 -- packages/caliper-fabric/lib/e2eUtils.js | 1301 --------- packages/caliper-fabric/lib/fabric.js | 225 -- .../caliper-fabric/lib/fabricClientFactory.js | 54 - .../caliper-fabric/lib/fabricClientWorker.js | 54 - .../caliper-fabric/lib/install-chaincode.js | 60 - .../lib/instantiate-chaincode.js | 50 - packages/caliper-fabric/lib/join-channel.js | 150 - .../lib/signTransactionOffline.js | 99 - packages/caliper-fabric/lib/util.js | 337 --- packages/caliper-fabric/package.json | 59 - .../benchmark/simple/config-file.yaml | 33 - .../fabric-v1.0/2org1peercouchdb/README.md | 4 +- .../2org1peercouchdb/fabric-go-tls.json | 101 - .../2org1peercouchdb/fabric-go.json | 101 - .../fabric-v1.0/2org1peergoleveldb/README.md | 4 +- .../2org1peergoleveldb/fabric-go-tls.json | 101 - .../2org1peergoleveldb/fabric-go.json | 101 - .../fabric-v1.1/2org1peercouchdb/README.md | 6 +- .../2org1peercouchdb/fabric-go-tls.json | 101 - .../2org1peercouchdb/fabric-go.json | 101 - .../2org1peercouchdb/fabric-node-tls.json | 97 - .../2org1peercouchdb/fabric-node.json | 97 - .../fabric-v1.1/2org1peergoleveldb/README.md | 6 +- .../2org1peergoleveldb/fabric-go-tls.json | 101 - .../2org1peergoleveldb/fabric-go.json | 101 - .../2org1peergoleveldb/fabric-node-tls.json | 97 - .../2org1peergoleveldb/fabric-node.json | 97 - .../fabric-v1.2/2org1peercouchdb/README.md | 6 +- .../2org1peercouchdb/fabric-go-tls.json | 101 - .../2org1peercouchdb/fabric-go.json | 101 - .../2org1peercouchdb/fabric-node-tls.json | 97 - .../2org1peercouchdb/fabric-node.json | 97 - .../fabric-v1.2/2org1peergoleveldb/README.md | 6 +- .../2org1peergoleveldb/fabric-go-tls.json | 101 - .../2org1peergoleveldb/fabric-go.json | 101 - .../2org1peergoleveldb/fabric-node-tls.json | 97 - .../2org1peergoleveldb/fabric-node.json | 97 - .../fabric-v1.3/2org1peercouchdb/README.md | 6 +- .../2org1peercouchdb/fabric-go-tls.json | 101 - .../2org1peercouchdb/fabric-go.json | 101 - .../2org1peercouchdb/fabric-node-tls.json | 97 - .../2org1peercouchdb/fabric-node.json | 97 - .../fabric-v1.3/2org1peergoleveldb/README.md | 6 +- .../2org1peergoleveldb/fabric-go-tls.json | 101 - .../2org1peergoleveldb/fabric-go.json | 101 - .../2org1peergoleveldb/fabric-node-tls.json | 97 - .../2org1peergoleveldb/fabric-node.json | 97 - .../fabric-v1.4.1/2org1peercouchdb/README.md | 4 +- .../2org1peergoleveldb/README.md | 4 +- .../fabric-v1.4.1/3org2peercouchdb/README.md | 4 +- .../3org2peergoleveldb/README.md | 4 +- .../fabric-v1.4/2org1peercouchdb/README.md | 6 +- .../2org1peercouchdb/fabric-go-tls.json | 101 - .../2org1peercouchdb/fabric-go.json | 101 - .../2org1peercouchdb/fabric-node-tls.json | 100 - .../2org1peercouchdb/fabric-node.json | 100 - .../fabric-v1.4/2org1peergoleveldb/README.md | 6 +- .../2org1peergoleveldb/fabric-go-tls.json | 101 - .../2org1peergoleveldb/fabric-go.json | 101 - .../2org1peergoleveldb/fabric-node-tls.json | 100 - .../2org1peergoleveldb/fabric-node.json | 100 - .../fabric-v1.4/3org2peercouchdb/README.md | 6 +- .../3org2peercouchdb/fabric-go-tls.json | 140 - .../3org2peercouchdb/fabric-go.json | 140 - .../3org2peercouchdb/fabric-node-tls.json | 141 - .../3org2peercouchdb/fabric-node.json | 141 - .../fabric-v1.4/3org2peergoleveldb/README.md | 6 +- .../3org2peergoleveldb/fabric-go-tls.json | 140 - .../3org2peergoleveldb/fabric-go.json | 140 - .../3org2peergoleveldb/fabric-node-tls.json | 141 - .../3org2peergoleveldb/fabric-node.json | 139 - .../scripts/npm_publish.js | 1 - 82 files changed, 46 insertions(+), 10085 deletions(-) delete mode 100644 packages/caliper-fabric/.editorconfig delete mode 100644 packages/caliper-fabric/.eslintignore delete mode 100644 packages/caliper-fabric/.eslintrc.yml delete mode 100644 packages/caliper-fabric/index.js delete mode 100644 packages/caliper-fabric/lib/ChannelSignedTransaction.js delete mode 100644 packages/caliper-fabric/lib/constant.js delete mode 100644 packages/caliper-fabric/lib/create-channel.js delete mode 100644 packages/caliper-fabric/lib/e2eUtils.js delete mode 100644 packages/caliper-fabric/lib/fabric.js delete mode 100644 packages/caliper-fabric/lib/fabricClientFactory.js delete mode 100644 packages/caliper-fabric/lib/fabricClientWorker.js delete mode 100644 packages/caliper-fabric/lib/install-chaincode.js delete mode 100644 packages/caliper-fabric/lib/instantiate-chaincode.js delete mode 100644 packages/caliper-fabric/lib/join-channel.js delete mode 100644 packages/caliper-fabric/lib/signTransactionOffline.js delete mode 100644 packages/caliper-fabric/lib/util.js delete mode 100644 packages/caliper-fabric/package.json delete mode 100644 packages/caliper-samples/benchmark/simple/config-file.yaml delete mode 100644 packages/caliper-samples/network/fabric-v1.0/2org1peercouchdb/fabric-go-tls.json delete mode 100644 packages/caliper-samples/network/fabric-v1.0/2org1peercouchdb/fabric-go.json delete mode 100644 packages/caliper-samples/network/fabric-v1.0/2org1peergoleveldb/fabric-go-tls.json delete mode 100644 packages/caliper-samples/network/fabric-v1.0/2org1peergoleveldb/fabric-go.json delete mode 100644 packages/caliper-samples/network/fabric-v1.1/2org1peercouchdb/fabric-go-tls.json delete mode 100644 packages/caliper-samples/network/fabric-v1.1/2org1peercouchdb/fabric-go.json delete mode 100644 packages/caliper-samples/network/fabric-v1.1/2org1peercouchdb/fabric-node-tls.json delete mode 100644 packages/caliper-samples/network/fabric-v1.1/2org1peercouchdb/fabric-node.json delete mode 100644 packages/caliper-samples/network/fabric-v1.1/2org1peergoleveldb/fabric-go-tls.json delete mode 100644 packages/caliper-samples/network/fabric-v1.1/2org1peergoleveldb/fabric-go.json delete mode 100644 packages/caliper-samples/network/fabric-v1.1/2org1peergoleveldb/fabric-node-tls.json delete mode 100644 packages/caliper-samples/network/fabric-v1.1/2org1peergoleveldb/fabric-node.json delete mode 100644 packages/caliper-samples/network/fabric-v1.2/2org1peercouchdb/fabric-go-tls.json delete mode 100644 packages/caliper-samples/network/fabric-v1.2/2org1peercouchdb/fabric-go.json delete mode 100644 packages/caliper-samples/network/fabric-v1.2/2org1peercouchdb/fabric-node-tls.json delete mode 100644 packages/caliper-samples/network/fabric-v1.2/2org1peercouchdb/fabric-node.json delete mode 100644 packages/caliper-samples/network/fabric-v1.2/2org1peergoleveldb/fabric-go-tls.json delete mode 100644 packages/caliper-samples/network/fabric-v1.2/2org1peergoleveldb/fabric-go.json delete mode 100644 packages/caliper-samples/network/fabric-v1.2/2org1peergoleveldb/fabric-node-tls.json delete mode 100644 packages/caliper-samples/network/fabric-v1.2/2org1peergoleveldb/fabric-node.json delete mode 100644 packages/caliper-samples/network/fabric-v1.3/2org1peercouchdb/fabric-go-tls.json delete mode 100644 packages/caliper-samples/network/fabric-v1.3/2org1peercouchdb/fabric-go.json delete mode 100644 packages/caliper-samples/network/fabric-v1.3/2org1peercouchdb/fabric-node-tls.json delete mode 100644 packages/caliper-samples/network/fabric-v1.3/2org1peercouchdb/fabric-node.json delete mode 100644 packages/caliper-samples/network/fabric-v1.3/2org1peergoleveldb/fabric-go-tls.json delete mode 100644 packages/caliper-samples/network/fabric-v1.3/2org1peergoleveldb/fabric-go.json delete mode 100644 packages/caliper-samples/network/fabric-v1.3/2org1peergoleveldb/fabric-node-tls.json delete mode 100644 packages/caliper-samples/network/fabric-v1.3/2org1peergoleveldb/fabric-node.json delete mode 100644 packages/caliper-samples/network/fabric-v1.4/2org1peercouchdb/fabric-go-tls.json delete mode 100644 packages/caliper-samples/network/fabric-v1.4/2org1peercouchdb/fabric-go.json delete mode 100644 packages/caliper-samples/network/fabric-v1.4/2org1peercouchdb/fabric-node-tls.json delete mode 100644 packages/caliper-samples/network/fabric-v1.4/2org1peercouchdb/fabric-node.json delete mode 100644 packages/caliper-samples/network/fabric-v1.4/2org1peergoleveldb/fabric-go-tls.json delete mode 100644 packages/caliper-samples/network/fabric-v1.4/2org1peergoleveldb/fabric-go.json delete mode 100644 packages/caliper-samples/network/fabric-v1.4/2org1peergoleveldb/fabric-node-tls.json delete mode 100644 packages/caliper-samples/network/fabric-v1.4/2org1peergoleveldb/fabric-node.json delete mode 100644 packages/caliper-samples/network/fabric-v1.4/3org2peercouchdb/fabric-go-tls.json delete mode 100644 packages/caliper-samples/network/fabric-v1.4/3org2peercouchdb/fabric-go.json delete mode 100644 packages/caliper-samples/network/fabric-v1.4/3org2peercouchdb/fabric-node-tls.json delete mode 100644 packages/caliper-samples/network/fabric-v1.4/3org2peercouchdb/fabric-node.json delete mode 100644 packages/caliper-samples/network/fabric-v1.4/3org2peergoleveldb/fabric-go-tls.json delete mode 100644 packages/caliper-samples/network/fabric-v1.4/3org2peergoleveldb/fabric-go.json delete mode 100644 packages/caliper-samples/network/fabric-v1.4/3org2peergoleveldb/fabric-node-tls.json delete mode 100644 packages/caliper-samples/network/fabric-v1.4/3org2peergoleveldb/fabric-node.json diff --git a/README.md b/README.md index 799b0cf47..ccdf67e5c 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ Welcome to the Hyperledger Caliper project. Caliper is a blockchain performance benchmark framework, which allows users to test different blockchain solutions with predefined use cases, and get a set of performance test results. Currently supported blockchain solutions: -* [fabric v1.0+](https://github.com/hyperledger/fabric), the lastest version that has been verified is v1.1.0 +* [fabric v1.0+](https://github.com/hyperledger/fabric), the latest version that has been verified is v1.4.1 * [sawtooth 1.0+](https://github.com/hyperledger/sawtooth-core) * [Iroha 1.0 beta-3](https://github.com/hyperledger/iroha) * [Burrow 1.0](https://github.com/hyperledger/burrow) @@ -16,7 +16,7 @@ Currently supported performance indicators: * Transaction/Read latency(minimum, maximum, average, percentile) * Resource consumption (CPU, Memory, Network IO,...) -See contact [performance and scale workgroup](https://chat.hyperledger.org/channel/performance-and-scale-wg) to find out the definitions and corresponding measurement methods. +See the [PSWG white paper](https://www.hyperledger.org/resources/publications/blockchain-performance-metrics) to find out the definitions and corresponding measurement methods. For more information on using Caliper please consult the [documentation site](https://hyperledger.github.io/caliper/) @@ -29,7 +29,7 @@ Make sure following tools are installed: * Docker-compose ## Building Caliper -Caliper is split into pacakges that are managed by Lerna, a tool for managing JavaScript projects with multiple packages. To build Caliper, it is necessary to first pull the required base dependancies, and then bootstrap the Caliper project. Note that if you modify base code, it is necessary to rebuild the project +Caliper is split into packages that are managed by Lerna, a tool for managing JavaScript projects with multiple packages. To build Caliper, it is necessary to first pull the required base dependancies, and then bootstrap the Caliper project. Note that if you modify base code, it is necessary to rebuild the project * Run `npm install` in Caliper root folder to install base dependencies locally * Run `npm run repoclean` in Caliper root folder to ensure that all the packages are clean @@ -44,7 +44,7 @@ If you have any issues using Caliper that the documentation does not help you so * [Issues](https://github.com/hyperledger/caliper/issues) Feel free to raise an issue if you are facing a Caliper related problem Caliper interacts with multiple blockchain technologies and consequently it *might* be an issue with the underlying blockchain technology being interacted with. You can seek specific help on these technologies within the following Rocket Chat channels: -* [Hypereledger Burrow](https://chat.hyperledger.org/channel/burrow) +* [Hyperledger Burrow](https://chat.hyperledger.org/channel/burrow) * [Hyperledger Composer](https://chat.hyperledger.org/channel/composer) * [Hyperledger Fabric](https://chat.hyperledger.org/channel/fabric) * [Hyperledger Iroha](https://chat.hyperledger.org/channel/iroha) diff --git a/packages/caliper-cli/package.json b/packages/caliper-cli/package.json index 47446abcf..ab52d70ac 100644 --- a/packages/caliper-cli/package.json +++ b/packages/caliper-cli/package.json @@ -24,7 +24,6 @@ "caliper-core" : "0.1.0", "caliper-burrow" : "0.1.0", "caliper-composer" : "0.1.0", - "caliper-fabric" : "0.1.0", "caliper-fabric-ccp" : "0.1.0", "caliper-iroha" : "0.1.0", "caliper-sawtooth" : "0.1.0", diff --git a/packages/caliper-core/lib/test/defaultTest.js b/packages/caliper-core/lib/test/defaultTest.js index 508bdca35..44aebd9d8 100644 --- a/packages/caliper-core/lib/test/defaultTest.js +++ b/packages/caliper-core/lib/test/defaultTest.js @@ -77,32 +77,6 @@ class DefaultTest { // condition for time based or number based test driving if (args.txNumber) { msg.numb = testRounds[i]; - // File information for reading or writing transaction request - msg.txFile = {roundLength: testRounds.length, roundCurrent: i, txMode: args.txMode}; - if (args.txMode && args.txMode.type === 'file-write') { - logger.info('------ Prepare(file-write) waiting ------'); - msg.txFile.readWrite = 'write'; - msg.rateControl = {type: 'fixed-rate', opts: {tps: 400}}; - try { - await this.clientOrchestrator.startTest(msg, this.clientArgs, function(){}, testLabel, this.clientFactory); - msg.numb = testRounds[i]; - msg.txFile.readWrite = 'read'; - msg.rateControl = args.rateControl[i] ? args.rateControl[i] : {type:'fixed-rate', 'opts' : {'tps': 1}}; - if(i === (testRounds.length - 1)) { - logger.info('Waiting 5 seconds...'); - logger.info('------ Prepare(file-write) success------'); - await CaliperUtils.sleep(5000); - } - } catch (err) { - logger.error('------Prepare(file-write) failed------'); - args.txMode.type = 'file-no'; - } - - } else if(args.txMode && args.txMode.type === 'file-read'){ - msg.txFile.readWrite = 'read'; - } else { - msg.txFile.readWrite = 'no'; - } } else if (args.txDuration) { msg.txDuration = testRounds[i]; } else { diff --git a/packages/caliper-fabric/.editorconfig b/packages/caliper-fabric/.editorconfig deleted file mode 100644 index 1a1ede6c8..000000000 --- a/packages/caliper-fabric/.editorconfig +++ /dev/null @@ -1,26 +0,0 @@ -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -root = true - -[*] -indent_style = space -indent_size = 4 -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true - -[*.md] -trim_trailing_whitespace = false diff --git a/packages/caliper-fabric/.eslintignore b/packages/caliper-fabric/.eslintignore deleted file mode 100644 index e10342716..000000000 --- a/packages/caliper-fabric/.eslintignore +++ /dev/null @@ -1,17 +0,0 @@ -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -coverage -node_modules -/lib/ChannelSignedTransaction.js diff --git a/packages/caliper-fabric/.eslintrc.yml b/packages/caliper-fabric/.eslintrc.yml deleted file mode 100644 index 6616d4923..000000000 --- a/packages/caliper-fabric/.eslintrc.yml +++ /dev/null @@ -1,48 +0,0 @@ -env: - es6: true - node: true - mocha: true -extends: 'eslint:recommended' -parserOptions: - ecmaVersion: 8 - sourceType: - - script -rules: - indent: - - error - - 4 - linebreak-style: - - error - - unix - quotes: - - error - - single - semi: - - error - - always - no-unused-vars: - - error - - args: none - no-console: error - curly: error - eqeqeq: error - no-throw-literal: error - strict: error - no-var: error - dot-notation: error - no-tabs: error - no-trailing-spaces: error - no-use-before-define: error - no-useless-call: error - no-with: error - operator-linebreak: error - require-jsdoc: - - error - - require: - ClassDeclaration: true - MethodDefinition: true - FunctionDeclaration: true - valid-jsdoc: - - error - - requireReturn: false - yoda: error diff --git a/packages/caliper-fabric/index.js b/packages/caliper-fabric/index.js deleted file mode 100644 index 1eb4994c9..000000000 --- a/packages/caliper-fabric/index.js +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -'use strict'; - -module.exports.AdminClient = require('./lib/fabric'); -module.exports.ClientFactory = require('./lib/fabricClientFactory'); - diff --git a/packages/caliper-fabric/lib/ChannelSignedTransaction.js b/packages/caliper-fabric/lib/ChannelSignedTransaction.js deleted file mode 100644 index 7b9d4a4d6..000000000 --- a/packages/caliper-fabric/lib/ChannelSignedTransaction.js +++ /dev/null @@ -1,2458 +0,0 @@ -// /** -// Licensed under the Apache License, Version 2.0 (the 'License'); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 - -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an 'AS IS' BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// */ - -// 'use strict'; - -// var utils = require('./utils.js'); -// var clientUtils = require('./client-utils.js'); -// var util = require('util'); -// var path = require('path'); -// var ChannelEventHub = require('./ChannelEventHub.js'); -// var BlockDecoder = require('./BlockDecoder.js'); -// var TransactionID = require('./TransactionID.js'); -// var grpc = require('grpc'); -// var logger = utils.getLogger('Channel.js'); -// var MSPManager = require('./msp/msp-manager.js'); -// var Policy = require('./Policy.js'); -// var Constants = require('./Constants.js'); - -// var _ccProto = grpc.load(__dirname + '/protos/peer/chaincode.proto').protos; -// var _transProto = grpc.load(__dirname + '/protos/peer/transaction.proto').protos; -// var _proposalProto = grpc.load(__dirname + '/protos/peer/proposal.proto').protos; -// var _responseProto = grpc.load(__dirname + '/protos/peer/proposal_response.proto').protos; -// var _queryProto = grpc.load(__dirname + '/protos/peer/query.proto').protos; -// var _peerConfigurationProto = grpc.load(__dirname + '/protos/peer/configuration.proto').protos; -// var _commonProto = grpc.load(__dirname + '/protos/common/common.proto').common; -// var _configtxProto = grpc.load(__dirname + '/protos/common/configtx.proto').common; -// var _policiesProto = grpc.load(__dirname + '/protos/common/policies.proto').common; -// var _ledgerProto = grpc.load(__dirname + '/protos/common/ledger.proto').common; -// var _commonConfigurationProto = grpc.load(__dirname + '/protos/common/configuration.proto').common; -// var _ordererConfigurationProto = grpc.load(__dirname + '/protos/orderer/configuration.proto').orderer; -// var _abProto = grpc.load(__dirname + '/protos/orderer/ab.proto').orderer; -// var _mspConfigProto = grpc.load(__dirname + '/protos/msp/msp_config.proto').msp; -// var _mspPrincipalProto = grpc.load(__dirname + '/protos/msp/msp_principal.proto').common; -// var _identityProto = grpc.load(path.join(__dirname, '/protos/msp/identities.proto')).msp; - -// const ImplicitMetaPolicy_Rule = { 0: 'ANY', 1: 'ALL', 2: 'MAJORITY' }; - -// /** -// * In fabric v1.0, channels are the recommended way to isolate data and maintain privacy. -// *

-// * A Channel object captures the settings needed to interact with a fabric backend in the -// * context of a channel. These settings including the list of participating organizations, -// * represented by instances of Membership Service Providers (MSP), the list of endorsing peers, -// * and an orderer. -// *

-// * A client application can use the Channel object to create new channels with the orderer, -// * update an existing channel, send various channel-aware requests to the peers such as -// * invoking chaincodes to process transactions or queries. -// *

-// * A Channel object is also responsible for verifying endorsement signatures in transaction -// * proposal responses. A channel object must be initialized after it has been configured with -// * the list of peers and orderers. The initialization sends a get configuration block request -// * to the primary orderer to retrieve the configuration settings for this channel. -// * -// * @class -// */ -// var Channel = class { - -/** -* Returns a new instance of the class. This is a client-side-only call. To create a new channel - * in the fabric, call [createChannel()]{@link Client#createChannel}. - * - * @param {string} name - Name to identify the channel. This value is used as the identifier - * of the channel when making channel-aware requests with the fabric, - * such as invoking chaincodes to endorse transactions. The naming of - * channels is enforced by the ordering service and must be unique within - * the fabric backend - * @param {Client} clientContext - The client instance, which provides operational context - * such as the signing identity - */ -// constructor(name, clientContext) { -// // name is required -// if (typeof name === 'undefined' || !name) { -// logger.error('Failed to create Channel. Missing requirement "name" parameter.'); -// throw new Error('Failed to create Channel. Missing requirement "name" parameter.'); -// } - -// if (typeof clientContext === 'undefined' || !clientContext) { -// logger.error('Failed to create Channel. Missing requirement "clientContext" parameter.'); -// throw new Error('Failed to create Channel. Missing requirement "clientContext" parameter.'); -// } - -// this._name = name; - -// this._peers = []; -// this._anchor_peers = []; -// this._orderers = []; -// this._kafka_brokers = []; - -// this._clientContext = clientContext; - -// this._msp_manager = new MSPManager(); - -// //to do update logger -// logger.debug('Constructed Channel instance: name - %s, ' + -// 'network mode: %s', -// this._name, -// !this._devMode); -// } - -// /** -// * Close the service connection off all assigned peers and orderers -// */ -// close() { -// logger.info('close - closing connections'); -// var closer = function (ep) { -// ep.close(); -// }; -// this._peers.map(closer); -// this._orderers.map(closer); -// } - -// /** -// * Initializes the channel object with the Membership Service Providers (MSPs). The channel's -// * MSPs are critical in providing applications the ability to validate certificates and verify -// * signatures in messages received from the fabric backend. For instance, after calling -// * [sendTransactionProposal()]{@link Channel#sendTransactionProposal}, the application can -// * verify the signatures in the proposal response's endorsements to ensure they have not been -// * tampered with. -// *

-// * This method retrieves the configuration from the orderer if no "config" parameter is passed in. -// * Optionally a configuration may be passed in to initialize this channel without making the call -// * to the orderer. -// * -// * @param {byte[]} config - Optional. An encoded (a.k.a un-decoded) byte array of the protobuf "ConfigUpdate" -// * @return {Promise} A Promise that will resolve when the action is complete -// */ -// initialize(config_update) { -// if (config_update) { -// this.loadConfigUpdate(config_update); -// return Promise.resolve(true); -// } - -// var self = this; -// return this.getChannelConfig() -// .then( -// function (config_envelope) { -// logger.debug('initialize - got config envelope from getChannelConfig :: %j', config_envelope); -// var config_items = self.loadConfigEnvelope(config_envelope); -// return Promise.resolve(config_items); -// } -// ) -// .catch( -// function (error) { -// logger.error('initialize - system error ::' + error.stack ? error.stack : error); -// return Promise.reject(new Error(error)); -// } -// ); -// } - -// /** -// * Get the channel name. -// * @returns {string} The name of the channel. -// */ -// getName() { -// return this._name; -// } - -// /** -// * Get organization identifiers from the MSP's for this channel -// * @returns {string[]} Array of MSP identifiers representing the channel's -// * participating organizations -// */ -// getOrganizations() { -// logger.debug('getOrganizationUnits - start'); -// var msps = this._msp_manager.getMSPs(); -// var orgs = []; -// if (msps) { -// var keys = Object.keys(msps); -// for (var key in keys) { -// var msp = msps[keys[key]]; -// var msp_org = { id: msp.getId() }; -// logger.debug('getOrganizationUnits - found %j', msp_org); -// orgs.push(msp_org); -// } -// } -// logger.debug('getOrganizationUnits - orgs::%j', orgs); -// return orgs; -// } - -// /** -// * Set the MSP Manager for this channel. This utility method will -// * not normally be use as the [initialize()]{@link Channel#initialize} -// * method will read this channel's current configuration and reset -// * MSPManager with the MSP's found in the channel configuration. -// * -// * @param {MSPManager} msp_manager - The msp manager for this channel -// */ -// setMSPManager(msp_manager) { -// this._msp_manager = msp_manager; -// } - -// /** -// * Get the MSP Manager for this channel -// * @returns {MSPManager} -// */ -// getMSPManager() { -// return this._msp_manager; -// } - -// /** -// * Add the peer object to the channel object. A channel object can be optionally -// * configured with a list of peer objects, which will be used when calling certain -// * methods such as [sendInstantiateProposal()]{@link Channel#sendInstantiateProposal}, -// * [sendUpgradeProposal()]{@link Channel#sendUpgradeProposal}, -// * [sendTransactionProposal]{@link Channel#sendTransactionProposal}. -// * -// * @param {Peer} peer - An instance of the Peer class that has been initialized with URL -// * and other gRPC options such as TLS credentials and request timeout. -// */ -// addPeer(peer) { -// var url = peer.getUrl(); -// for (let i = 0; i < this._peers.length; i++) { -// if (this._peers[i].getUrl() === url) { -// var error = new Error(); -// error.name = 'DuplicatePeer'; -// error.message = 'Peer with URL ' + url + ' already exists'; -// logger.error(error.message); -// throw error; -// } -// } -// this._peers.push(peer); -// } - -// /** -// * Remove the first peer object in the channel object's list of peers -// * whose endpoint url property matches the url of the peer that is -// * passed in. -// * -// * @param {Peer} peer - An instance of the Peer class. -// */ -// removePeer(peer) { -// var url = peer.getUrl(); -// for (let i = 0; i < this._peers.length; i++) { -// if (this._peers[i].getUrl() === url) { -// this._peers.splice(i, 1); -// logger.debug('Removed peer with url "%s".', url); -// return; -// } -// } -// } - -// /** -// * Returns the list of peers of this channel object. -// * @returns {Peer[]} The peer list on the channel. -// */ -// getPeers() { -// logger.debug('getPeers - list size: %s.', this._peers.length); -// return this._peers; -// } - -// /** -// * Add the orderer object to the channel object, this is a client-side-only operation. -// * An application may add more than one orderer object to the channel object, however -// * the SDK only uses the first one in the list to send broadcast messages to the -// * orderer backend. -// * -// * @param {Orderer} orderer - An instance of the Orderer class. -// */ -// addOrderer(orderer) { -// var url = orderer.getUrl(); -// for (let i = 0; i < this._orderers.length; i++) { -// if (this._orderers[i].getUrl() === url) { -// var error = new Error(); -// error.name = 'DuplicateOrderer'; -// error.message = 'Orderer with URL ' + url + ' already exists'; -// logger.error(error.message); -// throw error; -// } -// } -// this._orderers.push(orderer); -// } - -// /** -// * Remove the first orderer object in the channel object's list of orderers -// * whose endpoint url property matches the url of the orderer that is -// * passed in. -// * -// * @param {Orderer} orderer - An instance of the Orderer class. -// */ -// removeOrderer(orderer) { -// var url = orderer.getUrl(); -// for (let i = 0; i < this._orderers.length; i++) { -// if (this._orderers[i].getUrl() === url) { -// this._orderers.splice(i, 1); -// logger.debug('Removed orderer with url "%s".', url); -// return; -// } -// } -// } - -// /** -// * Returns the orderers of this channel object. -// * @returns {Orderer[]} The list of orderers in the channel object -// */ -// getOrderers() { -// return this._orderers; -// } - -// /** -// * Returns an {@link ChannelEventHub} object. An event hub object encapsulates the -// * properties of an event stream on a peer node, through which the peer publishes -// * notifications of blocks being committed in the channel's ledger. -// * -// * @returns {ChannelEventHub} The ChannnelEventHub instance -// */ -// newChannelEventHub(peer) { -// peer = this._getPeerForEvents(peer); -// var event_hub = new ChannelEventHub(this, peer); -// return event_hub; -// } - -// /** -// * Returns a list of {@link ChannelEventHub} based on the peers that are -// * defined in this channel that are in the named orgainization of the -// * currently loaded connection profile. If no connetion profile is loaded, -// * an error will be thrown. -// * When called with no organization name, the organization named in the -// * currently active connection profile configuration's client section will -// * be used. A peer with the "eventSource" role setting of true will be added -// * to the list (a role will default to true if not defined). -// * -// * @param {string} org_name - Optional - The name of an organization -// * @returns {ChannelEventHub[]} An array of ChannelEventHub instances -// */ -// getChannelEventHubsForOrg(org_name) { -// let method = 'getChannelEventHubsForOrg'; -// logger.debug('%s - starting', method); -// var channel_event_hubs = []; -// let working_org_name = null; -// let found_peers = {}; -// if (this._clientContext && this._clientContext._network_config) { -// if (!org_name && this._clientContext._network_config.hasClient()) { -// let client = this._clientContext._network_config.getClientConfig(); -// working_org_name = client.organization; -// } else { -// working_org_name = org_name; -// } -// if (working_org_name) { -// let organization = this._clientContext._network_config.getOrganization(working_org_name); -// if (organization) { -// let channel_peers = this.getPeers(); -// let org_peers = organization.getPeers(); -// for (let j in channel_peers) { -// let channel_peer = channel_peers[j]; -// logger.debug('%s - looking at channel peer:%s', method, channel_peer.getName()); -// if (channel_peer.isInRole(Constants.NetworkConfig.EVENT_SOURCE_ROLE)) { -// for (let k in org_peers) { -// let org_peer = org_peers[k]; -// logger.debug('%s - looking at org peer:%s', method, org_peer.getName()); -// if (org_peer.getName() === channel_peer.getName()) { -// found_peers[org_peer.getName()] = org_peer;//to avoid Duplicate Peers -// logger.debug('%s - adding peer to list:%s', method, org_peer.getName()); -// } -// } -// } -// } -// } else { -// throw new Error(util.format('Organization definition not found for %s', working_org_name)); -// } -// } else { -// throw new Error('No organization name provided'); -// } -// } else { -// throw new Error('No connecton profile has been loaded'); -// } - -// for (let name in found_peers) { -// logger.debug('%s - final list has:%s', method, name); -// let peer = found_peers[name]; -// let channel_event_hub = new ChannelEventHub(this, peer); -// channel_event_hubs.push(channel_event_hub); -// } -// return channel_event_hubs; -// } - -// /** -// * @typedef {Object} OrdererRequest -// * @property {TransactionID} txId - Optional. Object with the transaction id and nonce -// * @property {Orderer} orderer - Optional. The orderer instance or string name -// * of the orderer to retrieve genesis block from -// */ - -// /** -// * A channel's first block is called the "genesis block". This block captures the -// * initial channel configuration. For a peer node to join the channel, it must be -// * provided the genesis block. This method must be called before calling -// * [joinChannel()]{@link Channel#joinChannel}. -// * -// * @param {OrdererRequest} request - Optional - A transaction ID object -// * @returns {Promise} A Promise for an encoded protobuf "Block" -// */ -// getGenesisBlock(request) { -// logger.debug('getGenesisBlock - start'); - -// if (!request) { -// request = {}; -// } - -// // verify that we have an orderer configured -// var orderer = this._clientContext.getTargetOrderer(request.orderer, this._orderers, this._name); -// var signer = null; -// var tx_id = request.txId; -// if (!tx_id) { -// signer = this._clientContext._getSigningIdentity(true); -// tx_id = new TransactionID(signer, true); -// } else { -// signer = this._clientContext._getSigningIdentity(tx_id.isAdmin()); -// } - -// // now build the seek info, will be used once the channel is created -// // to get the genesis block back -// // build start -// var seekSpecifiedStart = new _abProto.SeekSpecified(); -// seekSpecifiedStart.setNumber(0); -// var seekStart = new _abProto.SeekPosition(); -// seekStart.setSpecified(seekSpecifiedStart); - -// // build stop -// var seekSpecifiedStop = new _abProto.SeekSpecified(); -// seekSpecifiedStop.setNumber(0); -// var seekStop = new _abProto.SeekPosition(); -// seekStop.setSpecified(seekSpecifiedStop); - -// // seek info with all parts -// var seekInfo = new _abProto.SeekInfo(); -// seekInfo.setStart(seekStart); -// seekInfo.setStop(seekStop); -// seekInfo.setBehavior(_abProto.SeekInfo.SeekBehavior.BLOCK_UNTIL_READY); - -// // build the header for use with the seekInfo payload -// var seekInfoHeader = clientUtils.buildChannelHeader( -// _commonProto.HeaderType.DELIVER_SEEK_INFO, -// this._name, -// tx_id.getTransactionID(), -// this._initial_epoch, -// null, -// clientUtils.buildCurrentTimestamp(), -// orderer.getClientCertHash() -// ); - -// var seekHeader = clientUtils.buildHeader(signer, seekInfoHeader, tx_id.getNonce()); -// var seekPayload = new _commonProto.Payload(); -// seekPayload.setHeader(seekHeader); -// seekPayload.setData(seekInfo.toBuffer()); -// var seekPayloadBytes = seekPayload.toBuffer(); - -// let sig = signer.sign(seekPayloadBytes); -// let signature = Buffer.from(sig); - -// // building manually or will get protobuf errors on send -// var envelope = { -// signature: signature, -// payload: seekPayloadBytes -// }; - -// return orderer.sendDeliver(envelope); -// } - -// /** -// * A protobuf message that gets returned by endorsing peers on proposal requests. -// * The peer node runs the target chaincode, as designated by the proposal, and -// * decides on whether to endorse the proposal or not, and sends back the endorsement -// * result along with the [read and write sets]{@link http://hyperledger-fabric.readthedocs.io/en/latest/arch-deep-dive.html?highlight=readset#the-endorsing-peer-simulates-a-transaction-and-produces-an-endorsement-signature} -// * inside the proposal response message. -// * -// * @typedef {Object} ProposalResponse -// * @property {number} version -// * @property {Timestamp} timestamp - Time the proposal was created by the submitter -// * @property {Response} response -// * @property {byte[]} payload - The payload of the response. It is the encoded bytes of -// * the "ProposalResponsePayload" protobuf message -// * @property {Endorsement} endorsement - The endorsement of the proposal, basically the -// * endorser's signature over the payload -// */ - -// /** -// * A response message indicating whether the endorsement of the proposal was successful -// * -// * @typedef {Object} Response -// * @property {number} status - Status code. Follows [HTTP status code definitions]{@link https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html} -// * @property {string} message - A message associated with the response status code -// * @property {byte[]} payload - A payload that can be used to include metadata with this response -// */ - -// /** -// * @typedef {Object} JoinChannelRequest -// * @property {Peer[]} targets - Optional. An array of Peer objects or Peer names that will -// * be asked to join this channel. When using Peer names or left -// * empty (use default targets) there must be a loaded network -// * configuration. -// * See [loadFromConfig()]{@link Client#loadFromConfig} -// * @property {byte[]} block - The encoded bytes of the channel's genesis block. -// * See [getGenesisBlock()]{@link Channel#getGenesisBlock} method -// * @property {TransactionID} txId - Required. TransactionID object with the transaction id and nonce -// */ - -// /** -// * For a peer node to become part of a channel, it must be sent the genesis -// * block, as explained [here]{@link Channel#getGenesisBlock}. This method -// * sends a join channel proposal to one or more endorsing peers. -// * -// * @param {JoinChannelRequest} request -// * @param {Number} timeout - A number indicating milliseconds to wait on the -// * response before rejecting the promise with a -// * timeout error. This overrides the default timeout -// * of the {@link Peer} instance(s) and the global timeout in the config settings. -// * @returns {Promise} A Promise for an array of {@link ProposalResponse} from the target peers -// */ -// joinChannel(request, timeout) { -// logger.debug('joinChannel - start'); -// var errorMsg = null; - -// // verify that we have targets (Peers) to join this channel -// // defined by the caller -// if (!request) { -// errorMsg = 'Missing all required input request parameters'; -// } -// // verify that we have transaction id -// else if (!request.txId) { -// errorMsg = 'Missing txId input parameter with the required transaction identifier'; -// } -// else if (!request.block) { -// errorMsg = 'Missing block input parameter with the required genesis block'; -// } - -// if (errorMsg) { -// logger.error('joinChannel - error ' + errorMsg); -// throw new Error(errorMsg); -// } - -// var targets = this._getTargets(request.targets); //no role, will get all peers -// var signer = this._clientContext._getSigningIdentity(request.txId.isAdmin()); -// var chaincodeInput = new _ccProto.ChaincodeInput(); -// var args = []; -// args.push(Buffer.from('JoinChain', 'utf8')); -// args.push(request.block.toBuffer()); - -// chaincodeInput.setArgs(args); - -// var chaincodeID = new _ccProto.ChaincodeID(); -// chaincodeID.setName(Constants.CSCC); - -// var chaincodeSpec = new _ccProto.ChaincodeSpec(); -// chaincodeSpec.setType(_ccProto.ChaincodeSpec.Type.GOLANG); -// chaincodeSpec.setChaincodeId(chaincodeID); -// chaincodeSpec.setInput(chaincodeInput); - -// var channelHeader = clientUtils.buildChannelHeader( -// _commonProto.HeaderType.ENDORSER_TRANSACTION, -// '', -// request.txId.getTransactionID(), -// null, //no epoch -// Constants.CSCC, -// clientUtils.buildCurrentTimestamp(), -// targets[0].getClientCertHash() -// ); - -// var header = clientUtils.buildHeader(signer, channelHeader, request.txId.getNonce()); -// var proposal = clientUtils.buildProposal(chaincodeSpec, header); -// var signed_proposal = clientUtils.signProposal(signer, proposal); - -// return clientUtils.sendPeersProposal(targets, signed_proposal, timeout) -// .then( -// function (responses) { -// return Promise.resolve(responses); -// } -// ).catch( -// function (err) { -// logger.error('joinChannel - Failed Proposal. Error: %s', err.stack ? err.stack : err); -// return Promise.reject(err); -// } -// ); -// } -// /** -// * Asks the peer for the current (latest) configuration block for this channel. -// * @param {string | Peer} target - Optional. The peer to be used to make the -// * request. -// * @returns {Promise} A Promise for a {@link ConfigEnvelope} object containing the configuration items. -// */ -// getChannelConfig(target) { -// let method = 'getChannelConfig'; -// logger.debug('%s - start for channel %s', method, this._name); -// var targets = this._getTargetForQuery(target); -// var signer = this._clientContext._getSigningIdentity(true); -// var tx_id = new TransactionID(signer, true); -// var request = { -// targets: targets, -// chaincodeId: Constants.CSCC, -// txId: tx_id, -// signer: signer, -// fcn: 'GetConfigBlock', -// args: [this._name] -// }; -// return this.sendTransactionProposal(request) -// .then( -// function (results) { -// var responses = results[0]; -// // var proposal = results[1]; -// logger.debug('%s - results received', method); -// if (responses && Array.isArray(responses)) { -// let response = responses[0]; -// if (response instanceof Error) { -// return Promise.reject(response); -// } -// else if (response.response && response.response.payload) { -// let block = _commonProto.Block.decode(response.response.payload); -// let envelope = _commonProto.Envelope.decode(block.data.data[0]); -// let payload = _commonProto.Payload.decode(envelope.payload); -// let config_envelope = _configtxProto.ConfigEnvelope.decode(payload.data); -// return Promise.resolve(config_envelope); -// } -// else { -// logger.error('%s - unknown response ::%s', method, response); -// return Promise.reject(new Error(response)); -// } -// } -// return Promise.reject(new Error('Payload results are missing from the get channel config')); -// } -// ).catch( -// function (err) { -// logger.error('%s - Failed getting channel config. Error: %s', method, err.stack ? err.stack : err); -// return Promise.reject(err); -// } -// ); -// } - -// /** -// * Asks the orderer for the current (latest) configuration block for this channel. -// * This is similar to [getGenesisBlock()]{@link Channel#getGenesisBlock}, except -// * that instead of getting block number 0 it gets the latest block that contains -// * the channel configuration, and only returns the decoded {@link ConfigEnvelope}. -// * -// * @returns {Promise} A Promise for a {@link ConfigEnvelope} object containing the configuration items. -// */ -// getChannelConfigFromOrderer() { -// let method = 'getChannelConfigFromOrderer'; -// logger.debug('%s - start for channel %s', method, this._name); - -// var self = this; -// var orderer = this._clientContext.getTargetOrderer(null, this._orderers, this._name); - -// var signer = this._clientContext._getSigningIdentity(); -// var txId = new TransactionID(signer); - -// // seek the latest block -// var seekSpecifiedStart = new _abProto.SeekNewest(); -// var seekStart = new _abProto.SeekPosition(); -// seekStart.setNewest(seekSpecifiedStart); - -// var seekSpecifiedStop = new _abProto.SeekNewest(); -// var seekStop = new _abProto.SeekPosition(); -// seekStop.setNewest(seekSpecifiedStop); - -// // seek info with all parts -// var seekInfo = new _abProto.SeekInfo(); -// seekInfo.setStart(seekStart); -// seekInfo.setStop(seekStop); -// seekInfo.setBehavior(_abProto.SeekInfo.SeekBehavior.BLOCK_UNTIL_READY); - -// // build the header for use with the seekInfo payload -// var seekInfoHeader = clientUtils.buildChannelHeader( -// _commonProto.HeaderType.DELIVER_SEEK_INFO, -// self._name, -// txId.getTransactionID(), -// self._initial_epoch, -// null, -// clientUtils.buildCurrentTimestamp(), -// orderer.getClientCertHash() -// ); - -// var seekHeader = clientUtils.buildHeader(signer, seekInfoHeader, txId.getNonce()); -// var seekPayload = new _commonProto.Payload(); -// seekPayload.setHeader(seekHeader); -// seekPayload.setData(seekInfo.toBuffer()); -// var seekPayloadBytes = seekPayload.toBuffer(); - -// let sig = signer.sign(seekPayloadBytes); -// let signature = Buffer.from(sig); - -// // building manually or will get protobuf errors on send -// var envelope = { -// signature: signature, -// payload: seekPayloadBytes -// }; -// // This will return us a block -// return orderer.sendDeliver(envelope) -// .then( -// function (block) { -// logger.debug('%s - good results from seek block ', method); // :: %j',results); -// // verify that we have the genesis block -// if (block) { -// logger.debug('%s - found latest block', method); -// } -// else { -// logger.error('%s - did not find latest block', method); -// return Promise.reject(new Error('Failed to retrieve latest block', method)); -// } - -// logger.debug('%s - latest block is block number %s', block.header.number); -// // get the last config block number -// var metadata = _commonProto.Metadata.decode(block.metadata.metadata[_commonProto.BlockMetadataIndex.LAST_CONFIG]); -// var last_config = _commonProto.LastConfig.decode(metadata.value); -// logger.debug('%s - latest block has config block of %s', method, last_config.index); - -// var txId = new TransactionID(signer); - -// // now build the seek info to get the block called out -// // as the latest config block -// var seekSpecifiedStart = new _abProto.SeekSpecified(); -// seekSpecifiedStart.setNumber(last_config.index); -// var seekStart = new _abProto.SeekPosition(); -// seekStart.setSpecified(seekSpecifiedStart); - -// // build stop -// var seekSpecifiedStop = new _abProto.SeekSpecified(); -// seekSpecifiedStop.setNumber(last_config.index); -// var seekStop = new _abProto.SeekPosition(); -// seekStop.setSpecified(seekSpecifiedStop); - -// // seek info with all parts -// var seekInfo = new _abProto.SeekInfo(); -// seekInfo.setStart(seekStart); -// seekInfo.setStop(seekStop); -// seekInfo.setBehavior(_abProto.SeekInfo.SeekBehavior.BLOCK_UNTIL_READY); -// //logger.debug('initializeChannel - seekInfo ::' + JSON.stringify(seekInfo)); - -// // build the header for use with the seekInfo payload -// var seekInfoHeader = clientUtils.buildChannelHeader( -// _commonProto.HeaderType.DELIVER_SEEK_INFO, -// self._name, -// txId.getTransactionID(), -// self._initial_epoch, -// null, -// clientUtils.buildCurrentTimestamp(), -// orderer.getClientCertHash() -// ); - -// var seekHeader = clientUtils.buildHeader(signer, seekInfoHeader, txId.getNonce()); -// var seekPayload = new _commonProto.Payload(); -// seekPayload.setHeader(seekHeader); -// seekPayload.setData(seekInfo.toBuffer()); -// var seekPayloadBytes = seekPayload.toBuffer(); - -// let sig = signer.sign(seekPayloadBytes); -// let signature = Buffer.from(sig); - -// // building manually or will get protobuf errors on send -// var envelope = { -// signature: signature, -// payload: seekPayloadBytes -// }; -// // this will return us a block -// return orderer.sendDeliver(envelope); -// } -// ).then( -// function (block) { -// if (!block) { -// return Promise.reject(new Error('Config block was not found')); -// } -// // lets have a look at the block -// logger.debug('%s - config block number ::%s -- numberof tx :: %s', method, block.header.number, block.data.data.length); -// if (block.data.data.length != 1) { -// return Promise.reject(new Error('Config block must only contain one transaction')); -// } -// var envelope = _commonProto.Envelope.decode(block.data.data[0]); -// var payload = _commonProto.Payload.decode(envelope.payload); -// var channel_header = _commonProto.ChannelHeader.decode(payload.header.channel_header); -// if (channel_header.type != _commonProto.HeaderType.CONFIG) { -// return Promise.reject(new Error(util.format('Block must be of type "CONFIG" (%s), but got "%s" instead', _commonProto.HeaderType.CONFIG, channel_header.type))); -// } - -// var config_envelope = _configtxProto.ConfigEnvelope.decode(payload.data); - -// // send back the envelope -// return Promise.resolve(config_envelope); -// } -// ).catch( -// function (err) { -// logger.error('%s - Failed Proposal. Error: %s', method, err.stack ? err.stack : err); -// return Promise.reject(err); -// } -// ); -// } - -// /* -// * Utility method to load this channel with configuration information -// * from an Envelope that contains a Configuration -// * @param {byte[]} the envelope with the configuration update items -// * @see /protos/common/configtx.proto -// */ -// loadConfigUpdateEnvelope(data) { -// logger.debug('loadConfigUpdateEnvelope - start'); -// var envelope = _commonProto.Envelope.decode(data); -// var payload = _commonProto.Payload.decode(envelope.payload); -// var channel_header = _commonProto.ChannelHeader.decode(payload.header.channel_header); -// if (channel_header.type != _commonProto.HeaderType.CONFIG_UPDATE) { -// return new Error('Data must be of type "CONFIG_UPDATE"'); -// } - -// var config_update_envelope = _configtxProto.ConfigUpdateEnvelope.decode(payload.data); -// return this.loadConfigUpdate(config_update_envelope.config_update); -// } - -// loadConfigUpdate(config_update_bytes) { -// var config_update = _configtxProto.ConfigUpdate.decode(config_update_bytes); -// logger.debug('loadConfigData - channel ::' + config_update.channel_id); - -// let read_group = config_update.read_set; -// let write_group = config_update.write_set; - -// var config_items = {}; -// config_items.msps = []; //save all the MSP's found -// config_items['anchor-peers'] = []; //save all the MSP's found -// config_items.orderers = []; -// config_items['kafka-brokers'] = []; -// config_items.settings = {}; -// config_items.versions = {}; -// config_items.versions.read_group = {}; -// config_items.versions.write_group = {}; - -// loadConfigGroup(config_items, config_items.versions.read_group, read_group, 'read_set', null, true, false); -// // do the write_set second so they update anything in the read set -// loadConfigGroup(config_items, config_items.versions.write_group, write_group, 'write_set', null, true, false); -// this._msp_manager.loadMSPs(config_items.msps); -// this._anchor_peers = config_items.anchor_peers; - -// //TODO should we create orderers and endorsing peers -// return config_items; -// } - -// /* -// * Utility method to load this channel with configuration information -// * from a Configuration block -// * @param {ConfigEnvelope} the envelope with the configuration items -// * @see /protos/common/configtx.proto -// */ -// loadConfigEnvelope(config_envelope) { -// logger.debug('loadConfigEnvelope - start'); - -// let group = config_envelope.config.channel_group; - -// var config_items = {}; -// config_items.msps = []; //save all the MSP's found -// config_items['anchor-peers'] = []; //save all the MSP's found -// config_items.orderers = []; -// config_items['kafka-brokers'] = []; -// config_items.versions = {}; -// config_items.versions.channel = {}; - -// loadConfigGroup(config_items, config_items.versions.channel, group, 'base', null, true, true); -// this._msp_manager.loadMSPs(config_items.msps); -// this._anchor_peers = config_items.anchor_peers; - -// //TODO should we create orderers and endorsing peers -// return config_items; -// } - -// /** -// * @typedef {Object} BlockchainInfo -// * @property {number} height - How many blocks exist on the channel's ledger -// * @property {byte[]} currentBlockHash - A block hash is calculated by hashing over the concatenated -// * ASN.1 encoded bytes of: the block number, previous block hash, -// * and current block data hash. It's the chain of the block -// * hashs that guarantees the immutability of the ledger -// * @property {byte[]} previousBlockHash - The block hash of the previous block. -// */ - -// /** -// * Queries for various useful information on the state of the Channel -// * (height, known peers). -// * -// * @param {Peer} target - Optional. The peer that is the target for this query. If no target is passed, -// * the query will use the first peer that was added to the channel object. -// * @param {boolean} useAdmin - Optional. Indicates that the admin credentials should be used in making -// * this call to the peer. -// * @returns {Promise} A Promise for a {@link BlockchainInfo} object with blockchain height, -// * current block hash and previous block hash. -// */ -// queryInfo(target, useAdmin) { -// logger.debug('queryInfo - start'); -// var targets = this._getTargetForQuery(target); -// var signer = this._clientContext._getSigningIdentity(useAdmin); -// var tx_id = new TransactionID(signer, useAdmin); -// var request = { -// targets: targets, -// chaincodeId: Constants.QSCC, -// txId: tx_id, -// signer: signer, -// fcn: 'GetChainInfo', -// args: [this._name] -// }; -// return this.sendTransactionProposal(request) -// .then( -// function (results) { -// var responses = results[0]; -// if (responses && Array.isArray(responses)) { -// logger.debug('queryInfo - got responses=' + responses.length); -// //will only be one response as we are only querying the primary peer -// if (responses.length > 1) { -// return Promise.reject(new Error('Too many results returned')); -// } -// let response = responses[0]; -// if (response instanceof Error) { -// return Promise.reject(response); -// } -// if (response.response) { -// logger.debug('queryInfo - response status %d:', response.response.status); -// var chain_info = _ledgerProto.BlockchainInfo.decode(response.response.payload); -// return Promise.resolve(chain_info); -// } -// // no idea what we have, lets fail it and send it back -// return Promise.reject(response); -// } -// return Promise.reject(new Error('Payload results are missing from the query channel info')); -// } -// ).catch( -// function (err) { -// logger.error('Failed Query channel info. Error: %s', err.stack ? err.stack : err); -// return Promise.reject(err); -// } -// ); -// } - -// /** -// * Queries the ledger on the target peer for a Block TransactionID. -// * -// * @param {string} tx_id - The TransactionID of the Block in question. -// * @param {Peer} target - Optional. The peer to send the query to. If no target is passed, -// * the query is sent to the first peer that was added to the channel object. -// * @param {boolean} useAdmin - Optional. Indicates that the admin credentials should be used in making -// * this call to the peer. -// * @returns {Promise} A Promise for a {@link Block} matching the tx_id, fully decoded into an object. -// */ -// queryBlockByTxID(tx_id, target, useAdmin) { -// logger.debug('queryBlockByTxID - start'); -// if (!tx_id || !(typeof tx_id === 'string')) { -// throw new Error('tx_id as string is required'); -// } - -// const args = [this._name,tx_id]; -// const targets = this._getTargetForQuery(target); -// const signer = this._clientContext._getSigningIdentity(useAdmin); - -// const request = { -// targets, -// chaincodeId: Constants.QSCC, -// txId: new TransactionID(signer,useAdmin), -// fcn: 'GetBlockByTxID', -// args -// }; -// return this.sendTransactionProposal(request) -// .then((results)=> { -// const responses = results[0]; -// if (responses && Array.isArray(responses)) { -// logger.debug('queryBlockByTxID - got response',responses.length); -// //will only be one response as we are only querying the primary peer -// if (responses.length > 1) { -// return Promise.reject(new Error('Too many results returned')); -// } -// const response = responses[0]; -// if (response instanceof Error) { -// return Promise.reject(response); -// } -// if (response.response) { -// logger.debug('queryBlockByTxID - response status %d:', response.response.status); -// const block = BlockDecoder.decode(response.response.payload); -// logger.debug('queryBlockByTxID - looking at block :: %s', block.header.number); -// return Promise.resolve(block); -// } -// // no idea what we have, lets fail it and send it back -// return Promise.reject(response); -// } -// return Promise.reject(new Error('Payload results are missing from the query')); -// }).catch((err)=> { -// logger.error('Failed Query block. Error: %s', err.stack ? err.stack : err); -// return Promise.reject(err); -// }); -// } - -// /** -// * Queries the ledger on the target peer for a Block by block hash. -// * -// * @param {byte[]} block hash of the Block in question. -// * @param {Peer} target - Optional. The peer to send the query to. If no target is passed, -// * the query is sent to the first peer that was added to the channel object. -// * @param {boolean} useAdmin - Optional. Indicates that the admin credentials should be used in making -// * this call to the peer. -// * @returns {Promise} A Promise for a {@link Block} matching the hash, fully decoded into an object. -// */ -// queryBlockByHash(blockHash, target, useAdmin) { -// logger.debug('queryBlockByHash - start'); -// if (!blockHash) { -// throw new Error('Blockhash bytes are required'); -// } -// var targets = this._getTargetForQuery(target); -// var signer = this._clientContext._getSigningIdentity(useAdmin); -// var txId = new TransactionID(signer, useAdmin); -// var request = { -// targets: targets, -// chaincodeId: Constants.QSCC, -// txId: txId, -// signer: signer, -// fcn: 'GetBlockByHash', -// args: [this._name], -// argbytes: blockHash -// }; -// return this.sendTransactionProposal(request) -// .then( -// function (results) { -// var responses = results[0]; -// logger.debug('queryBlockByHash - got response'); -// if (responses && Array.isArray(responses)) { -// //will only be one response as we are only querying the primary peer -// if (responses.length > 1) { -// return Promise.reject(new Error('Too many results returned')); -// } -// let response = responses[0]; -// if (response instanceof Error) { -// return Promise.reject(response); -// } -// if (response.response) { -// logger.debug('queryBlockByHash - response status %d:', response.response.status); -// var block = BlockDecoder.decode(response.response.payload); -// logger.debug('queryBlockByHash - looking at block :: %s', block.header.number); -// return Promise.resolve(block); -// } -// // no idea what we have, lets fail it and send it back -// return Promise.reject(response); -// } -// return Promise.reject(new Error('Payload results are missing from the query')); -// } -// ).catch( -// function (err) { -// logger.error('Failed Query block. Error: %s', err.stack ? err.stack : err); -// return Promise.reject(err); -// } -// ); -// } - -// /** -// * Queries the ledger on the target peer for Block by block number. -// * -// * @param {number} blockNumber - The number of the Block in question. -// * @param {Peer} target - Optional. The peer to send this query to. If no target is passed, -// * the query is sent to the first peer that was added to the channel object. -// * @param {boolean} useAdmin - Optional. Indicates that the admin credentials should be used in making -// * this call to the peer. -// * @returns {Promise} A Promise for a {@link Block} at the blockNumber slot in the ledger, fully decoded into an object. -// */ -// queryBlock(blockNumber, target, useAdmin) { -// logger.debug('queryBlock - start blockNumber %s', blockNumber); -// var block_number = null; -// if (Number.isInteger(blockNumber) && blockNumber >= 0) { -// block_number = blockNumber.toString(); -// } else { -// throw new Error('Block number must be a positive integer'); -// } -// var targets = this._getTargetForQuery(target); -// var signer = this._clientContext._getSigningIdentity(useAdmin); -// var txId = new TransactionID(signer, useAdmin); -// var request = { -// targets: targets, -// chaincodeId: Constants.QSCC, -// txId: txId, -// signer: signer, -// fcn: 'GetBlockByNumber', -// args: [this._name, block_number] -// }; -// return this.sendTransactionProposal(request) -// .then( -// function (results) { -// var responses = results[0]; -// logger.debug('queryBlock - got response'); -// if (responses && Array.isArray(responses)) { -// //will only be one response as we are only querying the primary peer -// if (responses.length > 1) { -// return Promise.reject(new Error('Too many results returned')); -// } -// let response = responses[0]; -// if (response instanceof Error) { -// return Promise.reject(response); -// } -// if (response.response) { -// logger.debug('queryBlock - response status %d:', response.response.status); -// var block = BlockDecoder.decode(response.response.payload); -// logger.debug('queryBlock - looking at block :: %s', block.header.number); -// return Promise.resolve(block); -// } -// // no idea what we have, lets fail it and send it back -// return Promise.reject(response); -// } -// return Promise.reject(new Error('Payload results are missing from the query')); -// } -// ).catch( -// function (err) { -// logger.error('Failed Query block. Error: %s', err.stack ? err.stack : err); -// return Promise.reject(err); -// } -// ); -// } - -// /** -// * Queries the ledger on the target peer for Transaction by id. -// * -// * @param {string} tx_id - The id of the transaction -// * @param {Peer} target - Optional. The peer to send this query to. If no target is passed, -// * the query is sent to the first peer that was added to the channel object. -// * @param {boolean} useAdmin - Optional. Indicates that the admin credentials should be used in making -// * this call to the peer. -// * @returns {Promise} A Promise for a fully decoded {@link ProcessedTransaction} object. -// */ -// queryTransaction(tx_id, target, useAdmin) { -// logger.debug('queryTransaction - start transactionID %s', tx_id); -// if (tx_id) { -// tx_id = tx_id.toString(); -// } else { -// throw new Error('Missing "tx_id" parameter'); -// } -// var targets = this._getTargetForQuery(target); -// var signer = this._clientContext._getSigningIdentity(useAdmin); -// var txId = new TransactionID(signer, useAdmin); -// var request = { -// targets: targets, -// chaincodeId: Constants.QSCC, -// txId: txId, -// signer: signer, -// fcn: 'GetTransactionByID', -// args: [this._name, tx_id] -// }; -// return this.sendTransactionProposal(request) -// .then( -// function (results) { -// var responses = results[0]; -// logger.debug('queryTransaction - got response'); -// if (responses && Array.isArray(responses)) { -// //will only be one response as we are only querying the primary peer -// if (responses.length > 1) { -// return Promise.reject(new Error('Too many results returned')); -// } -// let response = responses[0]; -// if (response instanceof Error) { -// return Promise.reject(response); -// } -// if (response.response) { -// logger.debug('queryTransaction - response status :: %d', response.response.status); -// var processTrans = BlockDecoder.decodeTransaction(response.response.payload); -// return Promise.resolve(processTrans); -// } -// // no idea what we have, lets fail it and send it back -// return Promise.reject(processTrans); -// } -// return Promise.reject(new Error('Payload results are missing from the query')); -// } -// ).catch( -// function (err) { -// logger.error('Failed Transaction Query. Error: %s', err.stack ? err.stack : err); -// return Promise.reject(err); -// } -// ); -// } - -// /** -// * Queries the ledger on the target peer for instantiated chaincodes on this channel. -// * -// * @param {Peer} target - Optional. The peer to send this query to. If no -// * target is passed, the query is sent to the first peer that was -// * added to the channel object. -// * @param {boolean} useAdmin - Optional. Indicates that the admin credentials -// * should be used in making this call to the peer. An administrative -// * identity must have been loaded by network configuration or by -// * using the 'setAdminSigningIdentity' method. -// * @returns {Promise} A Promise for a fully decoded {@link ChaincodeQueryResponse} object. -// */ -// queryInstantiatedChaincodes(target, useAdmin) { -// logger.debug('queryInstantiatedChaincodes - start'); -// const targets = this._getTargetForQuery(target); -// const signer = this._clientContext._getSigningIdentity(useAdmin); -// const txId = new TransactionID(signer, useAdmin); -// const request = { -// targets: targets, -// chaincodeId: Constants.LSCC, -// txId: txId, -// signer: signer, -// fcn: 'getchaincodes', -// args: [] -// }; -// return this.sendTransactionProposal(request) -// .then( -// function (results) { -// const responses = results[0]; -// logger.debug('queryInstantiatedChaincodes - got response'); -// if (responses && Array.isArray(responses)) { -// //will only be one response as we are only querying one peer -// if (responses.length > 1) { -// return Promise.reject(new Error('Too many results returned')); -// } -// const response = responses[0]; -// if (response instanceof Error) { -// return Promise.reject(response); -// } -// if (response.response) { -// logger.debug('queryInstantiatedChaincodes - response status :: %d', response.response.status); -// const queryTrans = _queryProto.ChaincodeQueryResponse.decode(response.response.payload); -// logger.debug('queryInstantiatedChaincodes - ProcessedTransaction.chaincodeInfo.length :: %s', queryTrans.chaincodes.length); -// for (let chaincode of queryTrans.chaincodes) { -// logger.debug('queryInstantiatedChaincodes - name %s, version %s, path %s', chaincode.name, chaincode.version, chaincode.path); -// } -// return Promise.resolve(queryTrans); -// } -// // no idea what we have, lets fail it and send it back -// return Promise.reject(response); -// } -// return Promise.reject(new Error('Payload results are missing from the query')); -// } -// ).catch( -// function (err) { -// logger.error('Failed Instantiated Chaincodes Query. Error: %s', err.stack ? err.stack : err); -// return Promise.reject(err); -// } -// ); -// } - -// /** -// * @typedef {Object} ChaincodeInstantiateUpgradeRequest -// * @property {Peer[]} targets - Optional. An array of endorsing -// * {@link Peer} objects as the targets of the request. When this -// * parameter is omitted the target list will include peers assigned -// * to this channel instance that are in the endorsing role. -// * @property {string} chaincodeType - Optional. Type of chaincode. One of -// * 'golang', 'car', 'java' or 'node'. Default is 'golang'. Note that 'java' -// * is not supported as of v1.0. -// * @property {string} chaincodeId - Required. The name of the chaincode -// * @property {string} chaincodeVersion - Required. Version string of the chaincode, -// * such as 'v1' -// * @property {TransactionID} txId - Required. Object with the transaction id -// * and nonce -// * @property {map} transientMap - Optional. map that can be -// * used by the chaincode during intialization, but not saved in the -// * ledger. Data such as cryptographic information for encryption can -// * be passed to the chaincode using this technique. -// * @property {string} fcn - Optional. The function name to be returned when -// * calling stub.GetFunctionAndParameters() in the target -// * chaincode. Default is 'init'. -// * @property {string[]} args - Optional. Array of string arguments to pass to -// * the function identified by the fcn value. -// * @property {Object} endorsement-policy - Optional. EndorsementPolicy object -// * for this chaincode (see examples below). If not specified, a default -// * policy of "a signature by any member from any of the organizations -// * corresponding to the array of member service providers" is used. -// * WARNING: The default policy is NOT recommended for production, -// * because this allows an application to bypass the proposal endorsement -// * and send a manually constructed transaction, with arbitrary output -// * in the write set, to the orderer directly. An application's own -// * signature would allow the transaction to be successfully validated -// * and committed to the ledger. -// * @example Endorsement policy: "Signed by any member from one of the organizations" -// * { -// * identities: [ -// * { role: { name: "member", mspId: "org1" }}, -// * { role: { name: "member", mspId: "org2" }} -// * ], -// * policy: { -// * "1-of": [{ "signed-by": 0 }, { "signed-by": 1 }] -// * } -// * } -// * @example Endorsement policy: "Signed by admin of the ordererOrg and any member from one of the peer organizations" -// * { -// * identities: [ -// * { role: { name: "member", mspId: "peerOrg1" }}, -// * { role: { name: "member", mspId: "peerOrg2" }}, -// * { role: { name: "admin", mspId: "ordererOrg" }} -// * ], -// * policy: { -// * "2-of": [ -// * { "signed-by": 2}, -// * { "1-of": [{ "signed-by": 0 }, { "signed-by": 1 }]} -// * ] -// * } -// * } -// */ - -// /** -// * Sends a chaincode instantiate proposal to one or more endorsing peers. -// * -// * A chaincode must be instantiated on a channel-by-channel basis before it can -// * be used. The chaincode must first be installed on the endorsing peers where -// * this chaincode is expected to run, by calling [client.installChaincode()]{@link Client#installChaincode}. -// *

-// * Instantiating a chaincode is a full transaction operation, meaning it must be -// * first endorsed as a proposal, then the endorsements are sent to the orderer -// * to be processed for ordering and validation. When the transaction finally gets -// * committed to the channel's ledger on the peers, the chaincode is then considered -// * activated and the peers are ready to take requests to process transactions. -// * -// * @param {ChaincodeInstantiateUpgradeRequest} request -// * @param {Number} timeout - A number indicating milliseconds to wait on the -// * response before rejecting the promise with a -// * timeout error. This overrides the default timeout -// * of the Peer instance and the global timeout in the config settings. -// * @returns {Promise} A Promise for the {@link ProposalResponseObject} -// */ -// sendInstantiateProposal(request, timeout) { -// return this._sendChaincodeProposal(request, 'deploy', timeout); -// } - -// /** -// * Sends a chaincode upgrade proposal to one or more endorsing peers. -// * -// * Upgrading a chaincode involves steps similar to instantiating a chaincode. -// * The new chaincode must first be installed on the endorsing peers where -// * this chaincode is expected to run. -// *

-// * Similar to instantiating a chaincode, upgrading chaincodes is also a full transaction -// * operation. -// * -// * @param {ChaincodeInstantiateUpgradeRequest} request -// * @param {Number} timeout - A number indicating milliseconds to wait on the -// * response before rejecting the promise with a -// * timeout error. This overrides the default timeout -// * of the Peer instance and the global timeout in the config settings. -// * @returns {Promise} A Promise for the {@link ProposalResponseObject} -// */ -// sendUpgradeProposal(request, timeout) { -// return this._sendChaincodeProposal(request, 'upgrade', timeout); -// } - -// /* -// * Internal method to handle both chaincode calls -// */ -// _sendChaincodeProposal(request, command, timeout) { -// let errorMsg = null; - -// //validate the incoming request -// if (!errorMsg) errorMsg = clientUtils.checkProposalRequest(request); -// if (!errorMsg) errorMsg = clientUtils.checkInstallRequest(request); -// if (errorMsg) { -// logger.error('sendChainCodeProposal error ' + errorMsg); -// return Promise.reject(new Error(errorMsg)); -// } -// const peers = this._getTargets(request.targets, Constants.NetworkConfig.ENDORSING_PEER_ROLE); - -// // args is optional because some chaincode may not need any input parameters during initialization -// if (!request.args) { -// request.args = []; -// } - -// // step 1: construct a ChaincodeSpec -// const args = []; -// args.push(Buffer.from(request.fcn ? request.fcn : 'init', 'utf8')); - -// for (let arg of request.args) -// args.push(Buffer.from(arg, 'utf8')); - -// const ccSpec = { -// type: clientUtils.translateCCType(request.chaincodeType), -// chaincode_id: { -// name: request.chaincodeId, -// version: request.chaincodeVersion -// }, -// input: { -// args: args -// } -// }; - -// // step 2: construct the ChaincodeDeploymentSpec -// const chaincodeDeploymentSpec = new _ccProto.ChaincodeDeploymentSpec(); -// chaincodeDeploymentSpec.setChaincodeSpec(ccSpec); - -// const signer = this._clientContext._getSigningIdentity(request.txId.isAdmin()); -// const lcccSpec_args = [ -// Buffer.from(command), -// Buffer.from(this._name), -// chaincodeDeploymentSpec.toBuffer() -// ]; -// if (request['endorsement-policy']) { -// lcccSpec_args[3] = this._buildEndorsementPolicy(request['endorsement-policy']); -// } - -// const lcccSpec = { -// // type: _ccProto.ChaincodeSpec.Type.GOLANG, -// type: clientUtils.translateCCType(request.chaincodeType), -// chaincode_id: { name: Constants.LSCC }, -// input: { args: lcccSpec_args } -// }; - -// const channelHeader = clientUtils.buildChannelHeader( -// _commonProto.HeaderType.ENDORSER_TRANSACTION, -// this._name, -// request.txId.getTransactionID(), -// null, -// Constants.LSCC, -// clientUtils.buildCurrentTimestamp(), -// peers[0].getClientCertHash() -// ); -// const header = clientUtils.buildHeader(signer, channelHeader, request.txId.getNonce()); -// const proposal = clientUtils.buildProposal(lcccSpec, header, request.transientMap); -// const signed_proposal = clientUtils.signProposal(signer, proposal); - -// return clientUtils.sendPeersProposal(peers, signed_proposal, timeout) -// .then( -// function (responses) { -// return [responses, proposal]; -// } -// ); -// } - -// /** -// * @typedef {Object} ChaincodeInvokeRequest -// * @property {Peer[]} targets - Optional. The peers that will receive this request, -// * when not provided the list of peers added to this channel object will be used. -// * @property {string} chaincodeId - Required. The id of the chaincode to process the transaction proposal -// * @property {TransactionID} txId - Required. TransactionID object with the transaction id and nonce -// * @property {map} transientMap - Optional. map that can be used by the chaincode but not -// * saved in the ledger, such as cryptographic information for encryption -// * @property {string} fcn - Optional. The function name to be returned when calling stub.GetFunctionAndParameters() -// * in the target chaincode. Default is 'invoke' -// * @property {string[]} args - An array of string arguments specific to the chaincode's 'Invoke' method -// */ - -// /** -// * Sends a transaction proposal to one or more endorsing peers. -// * -// * After a chaincode gets [installed]{@link Client#installChaincode} and -// * [instantiated]{@link Channel#instantiateChaincode}, it's ready to take endorsement -// * proposals and participating in transaction processing. A chaincode transaction -// * starts with a proposal that gets sent to the endorsing peers, which executes -// * the target chaincode and decides whether the proposal should be endorsed (if it -// * executes successfully) or not (if the chaincode returns an error). -// * -// * @param {ChaincodeInvokeRequest} request -// * @param {Number} timeout - A number indicating milliseconds to wait on the -// * response before rejecting the promise with a -// * timeout error. This overrides the default timeout -// * of the Peer instance and the global timeout in the config settings. -// * @returns {Promise} A Promise for the {@link ProposalResponseObject} -// */ -// sendTransactionProposal(request, timeout) { -// logger.debug('sendTransactionProposal - start'); - -// if (!request) { -// throw new Error('Missing request object for this transaction proposal'); -// } -// request.targets = this._getTargets(request.targets, Constants.NetworkConfig.ENDORSING_PEER_ROLE); - -// return Channel.sendTransactionProposal(request, this._name, this._clientContext, timeout); -// } - -// /* -// * Internal static method to allow transaction proposals to be called without -// * creating a new channel -// */ -// static sendTransactionProposal(request, channelId, clientContext, timeout) { -// // Verify that a Peer has been added -// var errorMsg = clientUtils.checkProposalRequest(request); - -// if (errorMsg) { -// // do nothing so we skip the rest of the checks -// } else if (!request.args) { -// // args is not optional because we need for transaction to execute -// errorMsg = 'Missing "args" in Transaction proposal request'; -// } else if (!request.targets || request.targets.length < 1) { -// errorMsg = 'Missing peer objects in Transaction proposal'; -// } - -// if (errorMsg) { -// logger.error('sendTransactionProposal error ' + errorMsg); -// throw new Error(errorMsg); -// } - -// var args = []; -// args.push(Buffer.from(request.fcn ? request.fcn : 'invoke', 'utf8')); -// logger.debug('sendTransactionProposal - adding function arg:%s', request.fcn ? request.fcn : 'invoke'); - -// for (let i = 0; i < request.args.length; i++) { -// logger.debug('sendTransactionProposal - adding arg:%s', request.args[i]); -// args.push(Buffer.from(request.args[i], 'utf8')); -// } -// //special case to support the bytes argument of the query by hash -// if (request.argbytes) { -// logger.debug('sendTransactionProposal - adding the argument :: argbytes'); -// args.push(request.argbytes); -// } -// else { -// logger.debug('sendTransactionProposal - not adding the argument :: argbytes'); -// } -// let invokeSpec = { -// type: _ccProto.ChaincodeSpec.Type.GOLANG, -// chaincode_id: { -// name: request.chaincodeId -// }, -// input: { -// args: args -// } -// }; - -// var proposal, header; -// var signer = null; -// if (request.signer) { -// signer = request.signer; -// } else { -// signer = clientContext._getSigningIdentity(request.txId.isAdmin()); -// } -// var channelHeader = clientUtils.buildChannelHeader( -// _commonProto.HeaderType.ENDORSER_TRANSACTION, -// channelId, -// request.txId.getTransactionID(), -// null, -// request.chaincodeId, -// clientUtils.buildCurrentTimestamp(), -// request.targets[0].getClientCertHash() -// ); -// header = clientUtils.buildHeader(signer, channelHeader, request.txId.getNonce()); -// proposal = clientUtils.buildProposal(invokeSpec, header, request.transientMap); -// let signed_proposal = clientUtils.signProposal(signer, proposal); - -// return clientUtils.sendPeersProposal(request.targets, signed_proposal, timeout) -// .then( -// function (responses) { -// return Promise.resolve([responses, proposal]); -// } -// ).catch( -// function (err) { -// logger.error('Failed Proposal. Error: %s', err.stack ? err.stack : err); -// return Promise.reject(err); -// } -// ); -// } - -// /** -// * @typedef {Object} TransactionRequest -// * @property {array} proposalResponses - An array of or a single -// * {@link ProposalResponse} object containing the response from the -// * [endorsement]{@link Channel#sendTransactionProposal} call -// * @property {Object} proposal - A Proposal object containing the original -// * request for endorsement(s) -// * @property {Object} txID - Optional. - Must be the transaction ID object -// * used in the proposal endorsement. The transactionID will -// * only be used to determine if the signing of the request -// * should be done by the admin identity or the user assigned -// * to the client instance. -// */ - -// /** -// * Send the proposal responses that contain the endorsements of a transaction proposal -// * to the orderer for further processing. This is the 2nd phase of the transaction -// * lifecycle in the fabric. The orderer will globally order the transactions in the -// * context of this channel and deliver the resulting blocks to the committing peers for -// * validation against the chaincode's endorsement policy. When the committering peers -// * successfully validate the transactions, it will mark the transaction as valid inside -// * the block. After all transactions in a block have been validated, and marked either as -// * valid or invalid (with a [reason code]{@link https://github.com/hyperledger/fabric/blob/v1.0.0/protos/peer/transaction.proto#L125}), -// * the block will be appended (committed) to the channel's ledger on the peer. -// *

-// * The caller of this method must use the proposal responses returned from the endorser along -// * with the original proposal that was sent to the endorser. Both of these objects are contained -// * in the {@link ProposalResponseObject} returned by calls to any of the following methods: -// *
  • [installChaincode()]{@link Client#installChaincode} -// *
  • [sendInstantiateProposal()]{@link Channel#sendInstantiateProposal} -// *
  • [sendUpgradeProposal()]{@link Channel#sendUpgradeProposal} -// *
  • [sendTransactionProposal()]{@link Channel#sendTransactionProposal} -// * -// * @param {TransactionRequest} request -// * @returns {Promise} A Promise for a "BroadcastResponse" message returned by the orderer that contains a -// * single "status" field for a standard [HTTP response code]{@link https://github.com/hyperledger/fabric/blob/v1.0.0/protos/common/common.proto#L27}. -// * This will be an acknowledgement from the orderer of successfully submitted transaction. -// */ -// sendTransaction(request) { -// logger.debug('sendTransaction - start :: channel %s', this); -// var errorMsg = null; - -// if (request) { -// // Verify that data is being passed in -// if (!request.proposalResponses) { -// errorMsg = 'Missing "proposalResponses" parameter in transaction request'; -// } -// if (!request.proposal) { -// errorMsg = 'Missing "proposal" parameter in transaction request'; -// } -// } else { -// errorMsg = 'Missing input request object on the transaction request'; -// } - -// if (errorMsg) { -// logger.error('sendTransaction error ' + errorMsg); -// throw new Error(errorMsg); -// } - -// let proposalResponses = request.proposalResponses; -// let chaincodeProposal = request.proposal; - -// var endorsements = []; -// let proposalResponse = proposalResponses; -// if (Array.isArray(proposalResponses)) { -// for (let i = 0; i < proposalResponses.length; i++) { -// // make sure only take the valid responses to set on the consolidated response object -// // to use in the transaction object -// if (proposalResponses[i].response && proposalResponses[i].response.status === 200) { -// proposalResponse = proposalResponses[i]; -// endorsements.push(proposalResponse.endorsement); -// } -// } -// } else { -// if (proposalResponse && proposalResponse.response && proposalResponse.response.status === 200) { -// endorsements.push(proposalResponse.endorsement); -// } -// } - -// if (endorsements.length < 1) { -// logger.error('sendTransaction - no valid endorsements found'); -// throw new Error('no valid endorsements found'); -// } - -// // verify that we have an orderer configured -// var orderer = this._clientContext.getTargetOrderer(request.orderer, this._orderers, this._name); - -// var use_admin_signer = false; -// if (request.txId) { -// use_admin_signer = request.txId.isAdmin(); -// } - -// let header = _commonProto.Header.decode(chaincodeProposal.getHeader()); - -// var chaincodeEndorsedAction = new _transProto.ChaincodeEndorsedAction(); -// chaincodeEndorsedAction.setProposalResponsePayload(proposalResponse.payload); -// chaincodeEndorsedAction.setEndorsements(endorsements); - -// var chaincodeActionPayload = new _transProto.ChaincodeActionPayload(); -// chaincodeActionPayload.setAction(chaincodeEndorsedAction); - -// // the TransientMap field inside the original proposal payload is only meant for the -// // endorsers to use from inside the chaincode. This must be taken out before sending -// // to the orderer, otherwise the transaction will be rejected by the validators when -// // it compares the proposal hash calculated by the endorsers and returned in the -// // proposal response, which was calculated without the TransientMap -// var originalChaincodeProposalPayload = _proposalProto.ChaincodeProposalPayload.decode(chaincodeProposal.payload); -// var chaincodeProposalPayloadNoTrans = new _proposalProto.ChaincodeProposalPayload(); -// chaincodeProposalPayloadNoTrans.setInput(originalChaincodeProposalPayload.input); // only set the input field, skipping the TransientMap -// chaincodeActionPayload.setChaincodeProposalPayload(chaincodeProposalPayloadNoTrans.toBuffer()); - -// var transactionAction = new _transProto.TransactionAction(); -// transactionAction.setHeader(header.getSignatureHeader()); -// transactionAction.setPayload(chaincodeActionPayload.toBuffer()); - -// var actions = []; -// actions.push(transactionAction); - -// var transaction = new _transProto.Transaction(); -// transaction.setActions(actions); - - -// var payload = new _commonProto.Payload(); -// payload.setHeader(header); -// payload.setData(transaction.toBuffer()); - -// let payload_bytes = payload.toBuffer(); - -// var signer = this._clientContext._getSigningIdentity(use_admin_signer); -// let sig = signer.sign(payload_bytes); -// let signature = Buffer.from(sig); - -// // building manually or will get protobuf errors on send -// var envelope = { -// signature: signature, -// payload: payload_bytes -// }; - -// return orderer.sendBroadcast(envelope); -// } - -// sendSignedTransaction(signedCommitProposal) { -// var orderer = this._clientContext.getTargetOrderer(signedCommitProposal.request.orderer, this._orderers, this._name); -// return orderer.sendBroadcast(signedCommitProposal.signedProposal); -// } - -// generateSignedTransaction(request) { -// logger.debug('sendTransaction - start :: channel %s', this); -// var errorMsg = null; - -// if (request) { -// // Verify that data is being passed in -// if (!request.proposalResponses) { -// errorMsg = 'Missing "proposalResponses" parameter in transaction request'; -// } -// if (!request.proposal) { -// errorMsg = 'Missing "proposal" parameter in transaction request'; -// } -// } else { -// errorMsg = 'Missing input request object on the transaction request'; -// } - -// if (errorMsg) { -// logger.error('sendTransaction error ' + errorMsg); -// throw new Error(errorMsg); -// } - -// let proposalResponses = request.proposalResponses; -// let chaincodeProposal = request.proposal; - -// var endorsements = []; -// let proposalResponse = proposalResponses; -// if (Array.isArray(proposalResponses)) { -// for (let i = 0; i < proposalResponses.length; i++) { -// // make sure only take the valid responses to set on the consolidated response object -// // to use in the transaction object -// if (proposalResponses[i].response && proposalResponses[i].response.status === 200) { -// proposalResponse = proposalResponses[i]; -// endorsements.push(proposalResponse.endorsement); -// } -// } -// } else { -// if (proposalResponse && proposalResponse.response && proposalResponse.response.status === 200) { -// endorsements.push(proposalResponse.endorsement); -// } -// } - -// if (endorsements.length < 1) { -// logger.error('sendTransaction - no valid endorsements found'); -// throw new Error('no valid endorsements found'); -// } - -// // verify that we have an orderer configured -// var orderer = this._clientContext.getTargetOrderer(request.orderer, this._orderers, this._name); - -// var use_admin_signer = false; -// if (request.txId) { -// use_admin_signer = request.txId.isAdmin(); -// } - -// let header = _commonProto.Header.decode(chaincodeProposal.getHeader()); - -// var chaincodeEndorsedAction = new _transProto.ChaincodeEndorsedAction(); -// chaincodeEndorsedAction.setProposalResponsePayload(proposalResponse.payload); -// chaincodeEndorsedAction.setEndorsements(endorsements); - -// var chaincodeActionPayload = new _transProto.ChaincodeActionPayload(); -// chaincodeActionPayload.setAction(chaincodeEndorsedAction); - -// // the TransientMap field inside the original proposal payload is only meant for the -// // endorsers to use from inside the chaincode. This must be taken out before sending -// // to the orderer, otherwise the transaction will be rejected by the validators when -// // it compares the proposal hash calculated by the endorsers and returned in the -// // proposal response, which was calculated without the TransientMap -// var originalChaincodeProposalPayload = _proposalProto.ChaincodeProposalPayload.decode(chaincodeProposal.payload); -// var chaincodeProposalPayloadNoTrans = new _proposalProto.ChaincodeProposalPayload(); -// chaincodeProposalPayloadNoTrans.setInput(originalChaincodeProposalPayload.input); // only set the input field, skipping the TransientMap -// chaincodeActionPayload.setChaincodeProposalPayload(chaincodeProposalPayloadNoTrans.toBuffer()); - -// var transactionAction = new _transProto.TransactionAction(); -// transactionAction.setHeader(header.getSignatureHeader()); -// transactionAction.setPayload(chaincodeActionPayload.toBuffer()); - -// var actions = []; -// actions.push(transactionAction); - -// var transaction = new _transProto.Transaction(); -// transaction.setActions(actions); - - -// var payload = new _commonProto.Payload(); -// payload.setHeader(header); -// payload.setData(transaction.toBuffer()); - -// let payload_bytes = payload.toBuffer(); - -// var signer = this._clientContext._getSigningIdentity(use_admin_signer); -// let sig = signer.sign(payload_bytes); -// let signature = Buffer.from(sig); - -// // building manually or will get protobuf errors on send -// var envelope = { -// signature: signature, -// payload: payload_bytes -// }; - -// //return orderer.sendBroadcast(envelope); -// return envelope; -// } - - -// /** -// * @typedef {Object} ChaincodeQueryRequest -// * @property {Peer[]} targets - Optional. The peers that will receive this request, -// * when not provided the list of peers added to this channel object will be used. -// * @property {string} chaincodeId - Required. The id of the chaincode to process the transaction proposal -// * @property {map} transientMap - Optional. map that can be used by the chaincode but not -// * saved in the ledger, such as cryptographic information for encryption -// * @property {string} fcn - Optional. The function name to be returned when calling stub.GetFunctionAndParameters() -// * in the target chaincode. Default is 'invoke' -// * @property {string[]} args - An array of string arguments specific to the chaincode's 'Invoke' method -// */ - -// /** -// * Sends a proposal to one or more endorsing peers that will be handled by the chaincode. -// * In fabric v1.0, there is no difference in how the endorsing peers process a request -// * to invoke a chaincode for transaction vs. to invoke a chaincode for query. All requests -// * will be presented to the target chaincode's 'Invoke' method which must be implemented to -// * understand from the arguments that this is a query request. The chaincode must also return -// * results in the byte array format and the caller will have to be able to decode -// * these results. -// * -// * @param {ChaincodeQueryRequest} request -// * @returns {Promise} A Promise for an array of byte array results returned from the chaincode -// * on all Endorsing Peers -// * @example -// * Get the list of query results returned by the chaincode -// * channel.queryByChaincode(request) -// * .then((response_payloads) => { -// * for(let i = 0; i < response_payloads.length; i++) { -// * console.log(util.format('Query result from peer [%s]: %s', i, response_payloads[i].toString('utf8'))); -// * } -// * }); -// */ -// queryByChaincode(request, useAdmin) { -// logger.debug('queryByChaincode - start'); -// if (!request) { -// throw new Error('Missing request object for this queryByChaincode call.'); -// } - -// var targets = this._getTargets(request.targets, Constants.NetworkConfig.CHAINCODE_QUERY_ROLE); -// var signer = this._clientContext._getSigningIdentity(useAdmin); -// var txId = new TransactionID(signer, useAdmin); - -// // make a new request object so we can add in the txId and not change the user's -// var trans_request = { -// targets: targets, -// chaincodeId: request.chaincodeId, -// fcn: request.fcn, -// args: request.args, -// transientMap: request.transientMap, -// txId: txId, -// signer: signer -// }; - -// return this.sendTransactionProposal(trans_request) -// .then( -// function (results) { -// var responses = results[0]; -// // var proposal = results[1]; -// logger.debug('queryByChaincode - results received'); -// if (responses && Array.isArray(responses)) { -// let results = []; -// for (let i = 0; i < responses.length; i++) { -// let response = responses[i]; -// if (response instanceof Error) { -// results.push(response); -// } -// else if (response.response && response.response.payload) { -// results.push(response.response.payload); -// } -// else { -// logger.error('queryByChaincode - unknown or missing results in query ::' + results); -// results.push(new Error(response)); -// } -// } -// return Promise.resolve(results); -// } -// return Promise.reject(new Error('Payload results are missing from the chaincode query')); -// } -// ).catch( -// function (err) { -// logger.error('Failed Query by chaincode. Error: %s', err.stack ? err.stack : err); -// return Promise.reject(err); -// } -// ); -// } - -// /** -// * Utility method to verify a single proposal response. It checks the -// * following aspects: -// *
  • The endorser's identity belongs to a legitimate MSP of the channel -// * and can be successfully deserialized -// *
  • The endorsement signature can be successfully verified with the -// * endorser's identity certificate -// *

    -// * This method requires that the initialize method of this channel object -// * has been called to load this channel's MSPs. The MSPs will have the -// * trusted root certificates for this channel. -// * -// * @param {ProposalResponse} proposal_response - The endorsement response from the peer, -// * includes the endorser certificate and signature over the -// * proposal + endorsement result + endorser certificate. -// * @returns {boolean} A boolean value of true when both the identity and -// * the signature are valid, false otherwise. -// */ -// verifyProposalResponse(proposal_response) { -// logger.debug('verifyProposalResponse - start'); -// if (!proposal_response) { -// throw new Error('Missing proposal response'); -// } -// if (!proposal_response.endorsement) { -// throw new Error('Parameter must be a ProposalResponse Object'); -// } - -// let endorsement = proposal_response.endorsement; - -// var sid = _identityProto.SerializedIdentity.decode(endorsement.endorser); -// var mspid = sid.getMspid(); -// logger.debug('getMSPbyIdentity - found mspid %s', mspid); -// var msp = this._msp_manager.getMSP(mspid); - -// if (!msp) { -// throw new Error(util.format('Failed to locate an MSP instance matching the endorser identity\'s orgainization %s', mspid)); -// } -// logger.debug('verifyProposalResponse - found endorser\'s MSP'); - -// try { -// var identity = msp.deserializeIdentity(endorsement.endorser, false); -// if (!identity) { -// throw new Error('Unable to find the endorser identity'); -// } -// } -// catch (error) { -// logger.error('verifyProposalResponse - getting endorser identity failed with: ', error); -// return false; -// } - -// try { -// // see if the identity is trusted -// if (!identity.isValid()) { -// logger.error('Endorser identity is not valid'); -// return false; -// } -// logger.debug('verifyProposalResponse - have a valid identity'); - -// // check the signature against the endorser and payload hash -// var digest = Buffer.concat([proposal_response.payload, endorsement.endorser]); -// if (!identity.verify(digest, endorsement.signature)) { -// logger.error('Proposal signature is not valid'); -// return false; -// } -// } -// catch (error) { -// logger.error('verifyProposalResponse - verify failed with: ', error); -// return false; -// } - -// logger.debug('verifyProposalResponse - This endorsement has both a valid identity and valid signature'); -// return true; -// } - -// /** -// * Utility method to examine a set of proposals to check they contain -// * the same endorsement result write sets. -// * This will validate that the endorsing peers all agree on the result -// * of the chaincode execution. -// * -// * @param {ProposalResponse[]} The proposal responses from all endorsing peers -// * @returns {boolean} True when all proposals compare equally, false otherwise. -// */ -// compareProposalResponseResults(proposal_responses) { -// logger.debug('compareProposalResponseResults - start'); -// if (!proposal_responses) { -// throw new Error('Missing proposal responses'); -// } -// if (!Array.isArray(proposal_responses)) { -// throw new Error('Parameter must be an array of ProposalRespone Objects'); -// } - -// if (proposal_responses.length == 0) { -// throw new Error('Parameter proposal responses does not contain a PorposalResponse'); -// } -// var first_one = _getProposalResponseResults(proposal_responses[0]); -// for (var i = 1; i < proposal_responses.length; i++) { -// var next_one = _getProposalResponseResults(proposal_responses[i]); -// if (next_one.equals(first_one)) { -// logger.debug('compareProposalResponseResults - read/writes result sets match index=%s', i); -// } -// else { -// logger.error('compareProposalResponseResults - read/writes result sets do not match index=%s', i); -// return false; -// } -// } - -// return true; -// } - -// /* -// * utility method to decide on the peer for events -// */ -// _getPeerForEvents(peer) { -// if (!peer) { -// throw new Error('"peer" parameter is missing'); -// } -// var peers = this._getTargets(peer, Constants.NetworkConfig.EVENT_SOURCE_ROLE, true); -// // only want to return one peer -// if (peers && peers.length > 0) { -// return peers[0]; -// } - -// throw new Error('No Peers available to be an event source'); -// } - -// /* -// * utility method to decide on the target for queries that only need ledger access -// */ -// _getTargetForQuery(target) { -// if (Array.isArray(target)) { -// throw new Error('"target" parameter is an array, but should be a singular peer object' + -// ' ' + 'or peer name according to the network configuration loaded by the client instance'); -// } -// let targets = this._getTargets(target, Constants.NetworkConfig.LEDGER_QUERY_ROLE, true); -// // only want to query one peer -// if (targets.length > 1) { -// targets = [targets[0]]; -// } - -// return targets; -// } - -// /* -// * utility method to decide on the targets for requests -// */ -// _getTargets(request_targets, role, isTarget) { -// let targets = null; -// if (request_targets) { -// // first check to see if they have passed a peer or peer name -// targets = this._clientContext.getTargetPeers(request_targets); -// } - -// // nothing yet, maybe there are peers on the channel -// if (!targets || targets.length < 1) { -// const peers = this.getPeers(); -// targets = []; -// for (let peer of peers) { -// if (peer.isInRole(role)) { -// targets.push(peer); -// } -// } -// } - -// // so nothing passed in or set on channel, let's -// // see if we can find in the network configuration -// if (!targets || targets.length < 1) { -// targets = this._getTargetsFromConfig(role); -// } - -// if (!targets || targets.length < 1) { -// let target_msg = 'targets'; -// if (isTarget) target_msg = 'target'; -// if (role === Constants.NetworkConfig.EVENT_SOURCE_ROLE) target_msg = 'peer'; -// throw new Error(util.format('"%s" parameter not specified and no peers' -// + ' ' + 'are set on this Channel instance' -// + ' ' + 'or specfied for this channel in the network ', target_msg)); -// } - -// return targets; -// } - -// /* -// * Utility method to return a list of targets from the network configuration -// * that are in this role of operation -// */ -// _getTargetsFromConfig(role) { -// var method = '_getTargetsFromConfig'; -// logger.debug('%s - start ::role %s', method, role); -// var targets = []; -// if (role) { -// var found = false; -// for (let i in Constants.NetworkConfig.ROLES) { -// if (role === Constants.NetworkConfig.ROLES[i]) { -// found = true; -// break; -// } -// } -// if (!found) { -// throw Error('Target role is unknown'); -// } -// } - -// /* -// * Need to list all the organizations from the network configuration. -// * Check each peer in each organization to see if it is on the channel. -// * If peer is on the channel and in the role, add this peer to a new list -// * of peers for this organization. Keep all these new lists in a list keyed -// * by the organization name. Once we have all the peers on the channel -// * sorted by organization, then we can randomly take one of those peers -// * for each organization and add it to the final target list. -// */ -// if (this._clientContext._network_config) { -// var orgs = this._clientContext._network_config.getOrganizations(); -// if (orgs) { -// //first get all the peers on the channel divided up by orgs -// var peers_by_org = {}; -// for (let i in orgs) { -// let org = orgs[i]; -// var peers_in_org_and_in_channel = []; -// peers_by_org[org.getName()] = peers_in_org_and_in_channel; -// var org_peers = org.getPeers(); -// logger.debug('%s - org:%s has %s peers', method, org.getName(), org_peers.length); -// for (let j in org_peers) { -// let org_peer = org_peers[j]; -// var channel_peers = this.getPeers(); -// for (let k in channel_peers) { -// let channel_peer = channel_peers[k]; -// if (!channel_peer) { -// logger.debug('%s - no peers on this channel', method); -// break; -// } -// if (!org_peer) { -// logger.debug('%s - null peer on this org', method); -// break; -// } -// logger.debug('%s - comparing channel peer:%s to org peer:%s', method, channel_peer.getName(), org_peer.getName()); -// if (channel_peer.getName() === org_peer.getName()) { -// // only peers in the request role get added -// if (channel_peer.isInRole(role)) { -// peers_in_org_and_in_channel.push(channel_peer); -// logger.debug('%s - added peer %s', method, channel_peer.toString()); -// } -// break; -// } -// } -// } -// } -// // now add just one peer from each org to targets if in role -// for (let org_name in peers_by_org) { -// let peers_org = peers_by_org[org_name]; -// if (peers_org && peers_org.length > 0) { -// logger.debug('%s - orgs %s has %s peers', method, org_name, peers_org.length); -// let which_peer = Math.floor(Math.random() * peers_org.length); -// logger.debug('%s - peer index:%s', method, which_peer); -// let peer_org = peers_org[which_peer]; -// targets.push(peer_org); -// logger.debug('%s - added target peer %s', method, peer_org.toString()); -// } else { -// logger.debug('%s - no peers in this org %s', method, org_name); -// } -// } -// } - -// if (targets.length == 0) { -// logger.warn('No peers found in the loaded network configuration that can be used as the target of this operation'); -// } -// return targets; -// } -// } - -// // internal utility method to build chaincode policy -// _buildEndorsementPolicy(policy) { -// return Policy.buildPolicy(this.getMSPManager().getMSPs(), policy); -// } - -// /** -// * return a printable representation of this channel object -// */ -// toString() { -// let orderers = ''; -// for (let i = 0; i < this._orderers.length; i++) { -// orderers = orderers + this._orderers[i].toString() + '|'; -// } -// var state = { -// name: this._name, -// orderers: this._orderers ? orderers : 'N/A' -// }; - -// return JSON.stringify(state); -// } - -// }; - -// //internal utility method to decode and get the write set -// //from a proposal response -// function _getProposalResponseResults(proposal_response) { -// if (!proposal_response.payload) { -// throw new Error('Parameter must be a ProposalResponse Object'); -// } -// var payload = _responseProto.ProposalResponsePayload.decode(proposal_response.payload); -// var extension = _proposalProto.ChaincodeAction.decode(payload.extension); -// // TODO should we check the status of this action -// logger.debug('_getWriteSet - chaincode action status:%s message:%s', extension.response.status, extension.response.message); -// // return a buffer object which has an equals method -// return extension.results.toBuffer(); -// } - -// //internal utility method to combine MSPs -// function _combineMSPs(current, configuration) { -// var results = new Map(); -// _arrayToMap(results, current); -// // do these second to replace any of the same name -// _arrayToMap(results, configuration); - -// return results; -// } - -// //internal utility method to add msps to a map -// function _arrayToMap(map, msps) { -// if (msps) { -// var keys = Object.keys(msps); -// for (let key in keys) { -// let id = keys[key]; -// let msp = msps[id]; -// let mspid = msp.getId(); -// logger.debug('_arrayToMap - add msp ::%s', mspid); -// map.set(mspid, msp); -// } -// } -// } - -// /* -// * utility method to load in a config group -// * @param {Object} - config_items - holder of values found in the configuration -// * @param {Object} - group - used for recursive calls -// * @param {string} - name - used to help with the recursive calls -// * @param {string} - org - Organizational name -// * @param {bool} - top - to handle the differences in the structure of groups -// * @see /protos/common/configtx.proto -// */ -// function loadConfigGroup(config_items, versions, group, name, org, top) { -// logger.debug('loadConfigGroup - %s - > group:%s', name, org); -// if (!group) { -// logger.debug('loadConfigGroup - %s - no group', name); -// logger.debug('loadConfigGroup - %s - < group', name); -// return; -// } - -// var isOrderer = (name.indexOf('base.Orderer') > -1); -// logger.debug('loadConfigGroup - %s - version %s', name, group.version); -// logger.debug('loadConfigGroup - %s - mod policy %s', name, group.mod_policy); - -// var groups = null; -// if (top) { -// groups = group.groups; -// versions.version = group.version; -// } -// else { -// groups = group.value.groups; -// versions.version = group.value.version; -// } -// logger.debug('loadConfigGroup - %s - >> groups', name); - -// if (groups) { -// let keys = Object.keys(groups.map); -// versions.groups = {}; -// if (keys.length == 0) { -// logger.debug('loadConfigGroup - %s - no groups', name); -// } -// for (let i = 0; i < keys.length; i++) { -// let key = keys[i]; -// logger.debug('loadConfigGroup - %s - found config group ==> %s', name, key); -// versions.groups[key] = {}; -// // The Application group is where config settings are that we want to find -// loadConfigGroup(config_items, versions.groups[key], groups.map[key], name + '.' + key, key, false); -// } -// } -// else { -// logger.debug('loadConfigGroup - %s - no groups', name); -// } -// logger.debug('loadConfigGroup - %s - << groups', name); - -// logger.debug('loadConfigGroup - %s - >> values', name); -// var values = null; -// if (top) { -// values = group.values; -// } -// else { -// values = group.value.values; -// } -// if (values) { -// versions.values = {}; -// let keys = Object.keys(values.map); -// for (let i = 0; i < keys.length; i++) { -// let key = keys[i]; -// versions.values[key] = {}; -// var config_value = values.map[key]; -// loadConfigValue(config_items, versions.values[key], config_value, name, org, isOrderer); -// } -// } -// else { -// logger.debug('loadConfigGroup - %s - no values', name); -// } -// logger.debug('loadConfigGroup - %s - << values', name); - -// logger.debug('loadConfigGroup - %s - >> policies', name); -// var policies = null; -// if (top) { -// policies = group.policies; -// } -// else { -// policies = group.value.policies; -// } -// if (policies) { -// versions.policies = {}; -// let keys = Object.keys(policies.map); -// for (let i = 0; i < keys.length; i++) { -// let key = keys[i]; -// versions.policies[key] = {}; -// var config_policy = policies.map[key]; -// loadConfigPolicy(config_items, versions.policies[key], config_policy, name, org); -// } -// } -// else { -// logger.debug('loadConfigGroup - %s - no policies', name); -// } -// logger.debug('loadConfigGroup - %s - << policies', name); - -// logger.debug('loadConfigGroup - %s - < group', name); -// } - -// /* -// * utility method to load in a config value -// * @see /protos/common/configtx.proto -// * @see /protos/msp/mspconfig.proto -// * @see /protos/orderer/configuration.proto -// * @see /protos/peer/configuration.proto -// */ -// function loadConfigValue(config_items, versions, config_value, group_name, org, isOrderer) { -// logger.debug('loadConfigValue - %s - value name: %s', group_name, config_value.key); -// logger.debug('loadConfigValue - %s - version: %s', group_name, config_value.value.version); -// logger.debug('loadConfigValue - %s - mod_policy: %s', group_name, config_value.value.mod_policy); - -// versions.version = config_value.value.version; -// try { -// switch (config_value.key) { -// case 'AnchorPeers': -// var anchor_peers = _peerConfigurationProto.AnchorPeers.decode(config_value.value.value); -// logger.debug('loadConfigValue - %s - AnchorPeers :: %s', group_name, anchor_peers); -// if (anchor_peers && anchor_peers.anchor_peers) for (var i in anchor_peers.anchor_peers) { -// var anchor_peer = { -// host: anchor_peers.anchor_peers[i].host, -// port: anchor_peers.anchor_peers[i].port, -// org: org -// }; -// config_items['anchor-peers'].push(anchor_peer); -// logger.debug('loadConfigValue - %s - AnchorPeer :: %s:%s:%s', group_name, anchor_peer.host, anchor_peer.port, anchor_peer.org); -// } -// break; -// case 'MSP': -// var msp_value = _mspConfigProto.MSPConfig.decode(config_value.value.value); -// logger.debug('loadConfigValue - %s - MSP found', group_name); -// if (!isOrderer) config_items.msps.push(msp_value); -// break; -// case 'ConsensusType': -// var consensus_type = _ordererConfigurationProto.ConsensusType.decode(config_value.value.value); -// config_items.settings['ConsensusType'] = consensus_type; -// logger.debug('loadConfigValue - %s - Consensus type value :: %s', group_name, consensus_type.type); -// break; -// case 'BatchSize': -// var batch_size = _ordererConfigurationProto.BatchSize.decode(config_value.value.value); -// config_items.settings['BatchSize'] = batch_size; -// logger.debug('loadConfigValue - %s - BatchSize max_message_count :: %s', group_name, batch_size.maxMessageCount); -// logger.debug('loadConfigValue - %s - BatchSize absolute_max_bytes :: %s', group_name, batch_size.absoluteMaxBytes); -// logger.debug('loadConfigValue - %s - BatchSize preferred_max_bytes :: %s', group_name, batch_size.preferredMaxBytes); -// break; -// case 'BatchTimeout': -// var batch_timeout = _ordererConfigurationProto.BatchTimeout.decode(config_value.value.value); -// config_items.settings['BatchTimeout'] = batch_timeout; -// logger.debug('loadConfigValue - %s - BatchTimeout timeout value :: %s', group_name, batch_timeout.timeout); -// break; -// case 'ChannelRestrictions': -// var channel_restrictions = _ordererConfigurationProto.ChannelRestrictions.decode(config_value.value.value); -// config_items.settings['ChannelRestrictions'] = channel_restrictions; -// logger.debug('loadConfigValue - %s - ChannelRestrictions max_count value :: %s', group_name, channel_restrictions.max_count); -// break; -// case 'ChannelCreationPolicy': -// var creation_policy = _policiesProto.Policy.decode(config_value.value.value); -// loadPolicy(config_items, versions, config_value.key, creation_policy, group_name, org); -// break; -// case 'HashingAlgorithm': -// var hashing_algorithm_name = _commonConfigurationProto.HashingAlgorithm.decode(config_value.value.value); -// config_items.settings['HashingAlgorithm'] = hashing_algorithm_name; -// logger.debug('loadConfigValue - %s - HashingAlgorithm name value :: %s', group_name, hashing_algorithm_name.name); -// break; -// case 'Consortium': -// var consortium_algorithm_name = _commonConfigurationProto.Consortium.decode(config_value.value.value); -// config_items.settings['Consortium'] = consortium_algorithm_name; -// logger.debug('loadConfigValue - %s - Consortium name value :: %s', group_name, consortium_algorithm_name.name); -// break; -// case 'BlockDataHashingStructure': -// var blockdata_hashing_structure = _commonConfigurationProto.BlockDataHashingStructure.decode(config_value.value.value); -// config_items.settings['BlockDataHashingStructure'] = blockdata_hashing_structure; -// logger.debug('loadConfigValue - %s - BlockDataHashingStructure width value :: %s', group_name, blockdata_hashing_structure.width); -// break; -// case 'OrdererAddresses': -// var orderer_addresses = _commonConfigurationProto.OrdererAddresses.decode(config_value.value.value); -// logger.debug('loadConfigValue - %s - OrdererAddresses addresses value :: %s', group_name, orderer_addresses.addresses); -// if (orderer_addresses && orderer_addresses.addresses) { -// for (let address of orderer_addresses.addresses) { -// config_items.orderers.push(address); -// } -// } -// break; -// case 'KafkaBrokers': -// var kafka_brokers = _ordererConfigurationProto.KafkaBrokers.decode(config_value.value.value); -// logger.debug('loadConfigValue - %s - KafkaBrokers addresses value :: %s', group_name, kafka_brokers.brokers); -// if (kafka_brokers && kafka_brokers.brokers) { -// for (let broker of kafka_brokers.brokers) { -// config_items['kafka-brokers'].push(broker); -// } -// } -// break; -// default: -// logger.debug('loadConfigValue - %s - value: %s', group_name, config_value.value.value); -// } -// } -// catch (err) { -// logger.debug('loadConfigValue - %s - name: %s - *** unable to parse with error :: %s', group_name, config_value.key, err); -// } -// //logger.debug('loadConfigValue - %s - < value name: %s', group_name, config_value.key); -// } - -// /* -// * utility method to load in a config policy -// * @see /protos/common/configtx.proto -// */ -// function loadConfigPolicy(config_items, versions, config_policy, group_name, org) { -// logger.debug('loadConfigPolicy - %s - policy name: %s', group_name, config_policy.key); -// logger.debug('loadConfigPolicy - %s - version: %s', group_name, config_policy.value.version); -// logger.debug('loadConfigPolicy - %s - mod_policy: %s', group_name, config_policy.value.mod_policy); - -// versions.version = config_policy.value.version; -// loadPolicy(config_items, versions, config_policy.key, config_policy.value.policy, group_name, org); -// } - -// function loadPolicy(config_items, versions, key, policy, group_name) { -// try { -// if(policy.type === _policiesProto.Policy.PolicyType.SIGNATURE){ -// let signature_policy = _policiesProto.SignaturePolicyEnvelope.decode(policy.policy); -// logger.debug('loadPolicy - %s - policy SIGNATURE :: %s %s', group_name, signature_policy.encodeJSON(), this.decodeSignaturePolicy(signature_policy.getIdentities())); -// }else if(policy.type === _policiesProto.Policy.PolicyType.IMPLICIT_META){ -// let implicit_policy = _policiesProto.ImplicitMetaPolicy.decode(policy.value); -// let rule = ImplicitMetaPolicy_Rule[implicit_policy.getRule()]; -// logger.debug('loadPolicy - %s - policy IMPLICIT_META :: %s %s', group_name, rule, implicit_policy.getSubPolicy()); -// }else{ -// logger.error('loadPolicy - Unknown policy type :: %s', policy.type); -// throw new Error('Unknown Policy type ::' + policy.type); -// } -// } -// catch (err) { -// logger.debug('loadPolicy - %s - name: %s - unable to parse policy %s', group_name, key, err); -// } -// } - -// function decodeSignaturePolicy(identities) { -// var results = []; -// for (let i in identities) { -// let identity = identities[i]; -// switch (identity.getPrincipalClassification()) { -// case _mspPrincipalProto.MSPPrincipal.Classification.ROLE: -// results.push(_mspPrincipalProto.MSPRole.decode(identity.getPrincipal()).encodeJSON()); -// } -// } -// return results; -// } - -// module.exports = Channel; - diff --git a/packages/caliper-fabric/lib/constant.js b/packages/caliper-fabric/lib/constant.js deleted file mode 100644 index e133371c6..000000000 --- a/packages/caliper-fabric/lib/constant.js +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -'use strict'; - -const os = require('os'); -const path = require('path'); - -const tempdir = path.join(os.homedir(), 'tmp/hfc'); - -const TxErrorEnum = { - NoError: 0, - ProposalResponseError: 1, - BadProposalResponseError: 2, - OrdererResponseError: 4, - BadOrdererResponseError: 8, - EventNotificationError: 16, - BadEventNotificationError: 32 -}; - -const TxErrorIndex = { - ProposalResponseError: 0, - BadProposalResponseError: 1, - OrdererResponseError: 2, - BadOrdererResponseError: 3, - EventNotificationError: 4, - BadEventNotificationError: 5 -}; - -module.exports = { - tempdir: tempdir, - TxErrorIndex: TxErrorIndex, - TxErrorEnum: TxErrorEnum -}; diff --git a/packages/caliper-fabric/lib/create-channel.js b/packages/caliper-fabric/lib/create-channel.js deleted file mode 100644 index 9b57c0c7a..000000000 --- a/packages/caliper-fabric/lib/create-channel.js +++ /dev/null @@ -1,270 +0,0 @@ -/* - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -'use strict'; - -if (global && global.hfc) { - global.hfc.config = undefined; -} - -require('nconf').reset(); -const CaliperUtils = require('caliper-core').CaliperUtils; -const commLogger = CaliperUtils.getLogger('create-channel.js'); -const utils = require('fabric-client/lib/utils.js'); -const Client = require('fabric-client'); - -const fs = require('fs'); -const testUtil = require('./util.js'); -const e2eUtils = require('./e2eUtils.js'); - -const {google, common} = require('fabric-protos'); - -/** - * Populate an empty object with application capabilities - * @param {*} applicationCapabilities the application capability keys - * @returns {*} capabilities in a protobuffer - */ -function populateCapabilities(applicationCapabilities) { - const capabilities = {}; - for (const capability of applicationCapabilities) { - capabilities[capability] = new common.Capability(); - } - return new common.Capabilities({ capabilities: capabilities }); -} - -/** - * @param {*} subPolicyName cn - * @param {*} rule rule - * @returns {*} the policy - */ -function makeImplicitMetaPolicy(subPolicyName, rule){ - const metaPolicy = new common.ImplicitMetaPolicy({ sub_policy: subPolicyName, rule: rule }); - const policy= new common.Policy({ type: common.Policy.PolicyType.IMPLICIT_META, value: metaPolicy.toBuffer() }); - return policy; -} - -/** - * Generate a write policy - * @param {*} version the policy version - * @param {string} modPolicy the modification policy - * @returns {*} an object of Admin/Reader/Writer keys mapping to populated ConfigPolicy protobuffers - */ -function generateWritePolicy(version, modPolicy) { - // Write Policy - const writePolicies = {}; - // admins - const adminsPolicy = makeImplicitMetaPolicy('Admins', common.ImplicitMetaPolicy.Rule.MAJORITY); // majority - writePolicies.Admins = new common.ConfigPolicy({ version: version, policy: adminsPolicy, mod_policy: modPolicy }); - // Readers - const readersPolicy = makeImplicitMetaPolicy('Readers', common.ImplicitMetaPolicy.Rule.ANY); // Any - writePolicies.Readers = new common.ConfigPolicy({ version: version, policy: readersPolicy, mod_policy: modPolicy }); - // Writers - const writersPolicy = makeImplicitMetaPolicy('Writers', common.ImplicitMetaPolicy.Rule.ANY); // Any - writePolicies.Writers = new common.ConfigPolicy({ version: version, policy: writersPolicy, mod_policy: modPolicy }); - return writePolicies; -} -/** - * Create tx for channel create - * @param {string} channelName name of chanel to be created - * @param {number} channelVersion the channel version being configured - * @param {Array} applicationCapabilities application capabilities for the channel - * @param {string} consortiumName the consortium name for the channel. Must match that specified in the original configtx.yaml file - * @param {Array} mspIds array of mspids that are specified in the original configtx.yaml file - * @returns {common.Envelope} a channelTx envelope - */ -function createChannelTxEnvelope(channelName, channelVersion, applicationCapabilities, consortiumName, mspIds) { - - // Versioning - const readVersion = 0; - const writeVersion = 0; - const appVersion = 1; - const policyVersion = 0; - - // Build the readSet - const readValues = {}; - readValues.Consortium = new common.ConfigValue(); - - const readAppGroup = {}; - for (const mspId of mspIds) { - readAppGroup[mspId] = new common.ConfigGroup(); - } - const readGroups = {}; - readGroups.Application = new common.ConfigGroup({ groups: readAppGroup }); - - const readSet = new common.ConfigGroup({ version: readVersion, groups: readGroups, values: readValues }); - - // Build the writeSet (based on consortium name and passed Capabiliites) - const modPolicy = 'Admins'; - const writeValues = {}; - - const consortium = new common.Consortium({ name: consortiumName }); - writeValues.Consortium = new common.ConfigValue({ version: writeVersion, value: consortium.toBuffer() }); - - if (applicationCapabilities) { - const capabilities = populateCapabilities(applicationCapabilities); - writeValues.Capabilities = new common.ConfigValue({ version: writeVersion, value: capabilities.toBuffer(), mod_policy: modPolicy }); - } - - // Write Policy - const writePolicies = generateWritePolicy(policyVersion, modPolicy); - - // Write Application Groups - const writeAppGroup = {}; - for (const mspId of mspIds) { - writeAppGroup[mspId] = new common.ConfigGroup(); - } - - const writeGroups = {}; - writeGroups.Application = new common.ConfigGroup({ version: appVersion, groups: writeAppGroup, policies: writePolicies, mod_policy: modPolicy }); - - const writeSet = new common.ConfigGroup({ version: writeVersion, groups: writeGroups, values: writeValues }); - - // Now create the configUpdate and configUpdateEnv - const configUpdate = new common.ConfigUpdate({ channel_id: channelName, read_set: readSet, write_set: writeSet}); - const configUpdateEnv= new common.ConfigUpdateEnvelope({ config_update: configUpdate.toBuffer(), signatures: [] }); - - // Channel header - const channelTimestamp = new google.protobuf.Timestamp({ seconds: Date.now()/1000, nanos: 0 }); // Date.now() is millis since 1970 epoch, we need seconds - const channelEpoch = 0; - const chHeader = new common.ChannelHeader({ type: common.HeaderType.CONFIG_UPDATE, version: channelVersion, timestamp: channelTimestamp, channel_id: channelName, epoch: channelEpoch }); - - // Common header - const header = new common.Header({ channel_header: chHeader.toBuffer() }); - - // Form the payload header/data - const payload = new common.Payload({ header: header, data: configUpdateEnv.toBuffer() }); - - // Form and return the envelope - const envelope = new common.Envelope({ payload: payload.toBuffer() }); - return envelope; -} - -/** - * Create the channels located in the given configuration file. - * @param {string} config_path The path to the Fabric network configuration file. - * @param {string} root_path The path to the root of the network configuration file. - * @return {Promise} The return promise. - */ -async function run(config_path, root_path) { - const fabric = CaliperUtils.parseYaml(config_path).fabric; - const channels = fabric.channel; - - if(!channels || channels.length === 0) { - return Promise.reject(new Error('No channel information found')); - } - - try { - let ORGS = fabric.network; - let caRootsPath = ORGS.orderer.tls_cacerts; - let data = fs.readFileSync(CaliperUtils.resolvePath(caRootsPath, root_path)); - let caroots = Buffer.from(data).toString(); - utils.setConfigSetting('key-value-store', 'fabric-client/lib/impl/FileKeyValueStore.js'); - - for (const channel of channels) { - if(channel.deployed) { - continue; - } - - commLogger.info(`Creating ${channel.name}...`); - - // Acting as a client in first org when creating the channel - const client = new Client(); - const org = channel.organizations[0]; - - // Conditional action on TLS enablement - if(fabric.network.orderer.url.toString().startsWith('grpcs')){ - const fabricCAEndpoint = fabric.network[org].ca.url; - const caName = fabric.network[org].ca.name; - const tlsInfo = await e2eUtils.tlsEnroll(fabricCAEndpoint, caName); - client.setTlsClientCertAndKey(tlsInfo.certificate, tlsInfo.key); - } - - let orderer = client.newOrderer( - ORGS.orderer.url, - { - 'pem': caroots, - 'ssl-target-name-override': ORGS.orderer['server-hostname'] - } - ); - - let config = null; - let signatures = []; - - const store = await Client.newDefaultKeyValueStore({path: testUtil.storePathForOrg(org)}); - client.setStateStore(store); - let cryptoSuite = Client.newCryptoSuite(); - cryptoSuite.setCryptoKeyStore(Client.newCryptoKeyStore({path: testUtil.storePathForOrg(org)})); - client.setCryptoSuite(cryptoSuite); - await testUtil.getOrderAdminSubmitter(client); - - if (channel.config) { - commLogger.info(`Channel '${channel}' definiton being retrieved from file`); - let envelope_bytes = fs.readFileSync(CaliperUtils.resolvePath(channel.config, root_path)); - config = client.extractChannelConfig(envelope_bytes); - } else { - // Use the protos to create a channelTx envelope and then extract the config buffer required - commLogger.info(`Channel '${channel}' definiton being generated`); - const channelTx = createChannelTxEnvelope(channel.name, channel.version, channel.capabilities, channel.consortium, channel.msps); - const payload = common.Payload.decode(channelTx.getPayload().toBuffer()); - const configtx = common.ConfigUpdateEnvelope.decode(payload.getData().toBuffer()); - config = configtx.getConfigUpdate().toBuffer(); - } - - // sign the config for each org - for (const organization of channel.organizations){ - client._userContext = null; - await testUtil.getSubmitter(client, true, organization); - // sign the config - let signature = client.signChannelConfig(config).toBuffer().toString('hex'); - signatures.push(signature); - } - - client._userContext = null; - await testUtil.getOrderAdminSubmitter(client); - - // sign the config - let signature = client.signChannelConfig(config); - // collect signature from orderer admin - signatures.push(signature); - // build up the create request - let tx_id = client.newTransactionID(); - let request = { - config: config, - signatures : signatures, - name : channel.name, - orderer : orderer, - txId : tx_id - }; - - // send create request to orderer - const result = await client.createChannel(request); - if(result.status && result.status === 'SUCCESS') { - commLogger.info(`Created ${channel.name} successfully`); - } - else { - throw new Error(`Create status for ${channel.name} is ${result.status} with information ${result.info}`); - } - } - - commLogger.info('Sleeping 5s...'); - return await CaliperUtils.sleep(5000); - } catch(err) { - commLogger.error(`Failed to create channels: ${(err.stack ? err.stack : err)}`); - throw err; - } - -} - - -module.exports.run = run; diff --git a/packages/caliper-fabric/lib/e2eUtils.js b/packages/caliper-fabric/lib/e2eUtils.js deleted file mode 100644 index fe9f353a8..000000000 --- a/packages/caliper-fabric/lib/e2eUtils.js +++ /dev/null @@ -1,1301 +0,0 @@ -/* - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -'use strict'; - -const {CaliperUtils, TxStatus} = require('caliper-core'); -const commLogger = CaliperUtils.getLogger('e2eUtils.js'); -const FabricCAServices = require('fabric-ca-client'); -const Client = require('fabric-client'); -const fs = require('fs'); -const util = require('util'); -const testUtil = require('./util.js'); -const signedOffline = require('./signTransactionOffline.js'); - -const TxErrorEnum = require('./constant.js').TxErrorEnum; -const TxErrorIndex = require('./constant.js').TxErrorIndex; - -let Gateway, InMemoryWallet, X509WalletMixin; -let ORGS; -let isLegacy; -let tx_id = null; -let the_user = null; - -let signedTransactionArray = []; -let signedCommitProposal = []; -let txFile; -let invokeCount = 0; -let clientIndex = 0; -let networkRoot; - -/** - * Initialize the Fabric client configuration. - * @param {string} config_path The path of the Fabric network configuration file. - * @param {string} root_path The path of the Fabric network files. - */ -function init(config_path, root_path) { - const config = CaliperUtils.parseYaml(config_path); - networkRoot = root_path; - ORGS = config.fabric.network; - isLegacy = (config.info.Version.startsWith('1.0') || config.info.Version.startsWith('1.1')); - if(!isLegacy){ - Gateway = require('fabric-network').Gateway; - InMemoryWallet = require('fabric-network').InMemoryWallet; - X509WalletMixin = require('fabric-network').X509WalletMixin; - } -} - -/** - * Enrol and get the cert - * @param {*} fabricCAEndpoint url of org endpoint - * @param {*} caName name of caName - * @return {Object} something useful in a promise - */ -async function tlsEnroll(fabricCAEndpoint, caName) { - const tlsOptions = { - trustedRoots: [], - verify: false - }; - const caService = new FabricCAServices(fabricCAEndpoint, tlsOptions, caName); - const req = { - enrollmentID: 'admin', - enrollmentSecret: 'adminpw', - profile: 'tls' - }; - - const enrollment = await caService.enroll(req); - enrollment.key = enrollment.key.toBytes(); - return enrollment; -} - -/** - * Read signed proposal from file. - * @param {string} name The prefix name of the file. - * @async - */ -async function readFromFile(name){ - try { - signedTransactionArray = []; - signedCommitProposal = []; - invokeCount = 0; - let fileName = name + '.signed.metadata.' + clientIndex; - let binFileName = name + '.signed.binary.' + clientIndex; - - let data = fs.readFileSync(fileName); - signedTransactionArray = JSON.parse(data); - commLogger.debug('read buffer file ok'); - let signedBuffer = fs.readFileSync(binFileName); - let start = 0; - for(let i = 0; i < signedTransactionArray.length; i++) { - let length = signedTransactionArray[i].signatureLength; - let signature = signedBuffer.slice(start, start + length); - start += length; - length = signedTransactionArray[i].payloadLength; - let payload = signedBuffer.slice(start, start + length); - signedCommitProposal.push({signature: signature, payload: payload}); - start += length; - } - }catch(err) { - commLogger.error('read err: ' + err); - } -} - -module.exports.readFromFile = readFromFile; - -/** - * Deploy the given chaincode to the given organization's peers. - * @param {string} org The name of the organization. - * @param {object} chaincode The chaincode object from the configuration file. - * @async - */ -async function installChaincode(org, chaincode) { - Client.setConfigSetting('request-timeout', 60000); - const channel_name = chaincode.channel; - - const client = new Client(); - const channel = client.newChannel(channel_name); - - // Conditional action on TLS enablement - if(ORGS.orderer.url.toString().startsWith('grpcs')){ - const fabricCAEndpoint = ORGS[org].ca.url; - const caName = ORGS[org].ca.name; - const tlsInfo = await tlsEnroll(fabricCAEndpoint, caName); - client.setTlsClientCertAndKey(tlsInfo.certificate, tlsInfo.key); - } - - const orgName = ORGS[org].name; - const cryptoSuite = Client.newCryptoSuite(); - cryptoSuite.setCryptoKeyStore(Client.newCryptoKeyStore({path: testUtil.storePathForOrg(orgName)})); - client.setCryptoSuite(cryptoSuite); - - const caRootsPath = ORGS.orderer.tls_cacerts; - let data = fs.readFileSync(CaliperUtils.resolvePath(caRootsPath, networkRoot)); - let caroots = Buffer.from(data).toString(); - - channel.addOrderer( - client.newOrderer( - ORGS.orderer.url, - { - 'pem': caroots, - 'ssl-target-name-override': ORGS.orderer['server-hostname'] - } - ) - ); - - const targets = []; - for (let key in ORGS[org]) { - if (ORGS[org].hasOwnProperty(key)) { - if (key.indexOf('peer') === 0) { - let data = fs.readFileSync(CaliperUtils.resolvePath(ORGS[org][key].tls_cacerts, networkRoot)); - let peer = client.newPeer( - ORGS[org][key].requests, - { - pem: Buffer.from(data).toString(), - 'ssl-target-name-override': ORGS[org][key]['server-hostname'] - } - ); - - targets.push(peer); - channel.addPeer(peer); - } - } - } - - const store = await Client.newDefaultKeyValueStore({path: testUtil.storePathForOrg(orgName)}); - client.setStateStore(store); - - // get the peer org's admin required to send install chaincode requests - the_user = await testUtil.getSubmitter(client, true /* get peer org admin */, org); - - // Don't re-install existing chaincode - let peers = channel.getPeers(); - let res = await client.queryInstalledChaincodes(peers[0].constructor.name.localeCompare('Peer') === 0 ? peers[0] : peers[0]._peer); - let found = false; - for (let i = 0; i < res.chaincodes.length; i++) { - if (res.chaincodes[i].name === chaincode.id && - res.chaincodes[i].version === chaincode.version && - res.chaincodes[i].path === chaincode.path) { - found = true; - commLogger.debug('installedChaincode: ' + JSON.stringify(res.chaincodes[i])); - break; - } - } - if (found) { - return; - } - - let resolvedPath = chaincode.path; - let metadataPath = chaincode.metadataPath ? CaliperUtils.resolvePath(chaincode.metadataPath, networkRoot) : chaincode.metadataPath; - if (chaincode.language === 'node') { - resolvedPath = CaliperUtils.resolvePath(chaincode.path, networkRoot); - } - - // send proposal to endorser - const request = { - targets: targets, - chaincodePath: resolvedPath, - metadataPath: metadataPath, - chaincodeId: chaincode.id, - chaincodeType: chaincode.language, - chaincodeVersion: chaincode.version - }; - - const results = await client.installChaincode(request); - - const proposalResponses = results[0]; - - let all_good = true; - const errors = []; - for(let i in proposalResponses) { - let one_good = false; - if (proposalResponses && proposalResponses[i].response && proposalResponses[i].response.status === 200) { - one_good = true; - } else { - commLogger.error('install proposal was bad'); - errors.push(proposalResponses[i]); - } - all_good = all_good && one_good; - } - if (!all_good) { - throw new Error(util.format('Failed to send install Proposal or receive valid response: %s', errors)); - } -} - -/** - * Assemble a chaincode proposal request. - * @param {Client} client The Fabric client object. - * @param {object} chaincode The chaincode object from the configuration file. - * @param {boolean} upgrade Indicates whether the request is an upgrade or not. - * @param {object} transientMap The transient map the request. - * @param {object} endorsement_policy The endorsement policy object from the configuration file. - * @return {object} The assembled chaincode proposal request. - */ -function buildChaincodeProposal(client, chaincode, upgrade, transientMap, endorsement_policy) { - const tx_id = client.newTransactionID(); - - // send proposal to endorser - const request = { - chaincodePath: chaincode.path, - chaincodeId: chaincode.id, - chaincodeType: chaincode.language, - chaincodeVersion: chaincode.version, - fcn: 'init', - args: chaincode.init || [], - txId: tx_id, - 'endorsement-policy': endorsement_policy - }; - - - if(upgrade) { - // use this call to test the transient map support during chaincode instantiation - request.transientMap = transientMap; - } - - return request; -} - -/** - * Instantiate or upgrade the given chaincode with the given endorsement policy. - * @param {object} chaincode The chaincode object from the configuration file. - * @param {object} endorsement_policy The endorsement policy object from the configuration file. - * @param {boolean} upgrade Indicates whether the call is an upgrade or a new instantiation. - * @async - */ -async function instantiate(chaincode, endorsement_policy, upgrade){ - Client.setConfigSetting('request-timeout', 600000); - - let channel = testUtil.getChannel(chaincode.channel); - if(channel === null) { - throw new Error('Could not find channel in config'); - } - const channel_name = channel.name; - const userOrg = channel.organizations[0]; - - const targets = []; - const eventhubs = []; - let type = 'instantiate'; - if(upgrade) {type = 'upgrade';} - const client = new Client(); - channel = client.newChannel(channel_name); - - const orgName = ORGS[userOrg].name; - const cryptoSuite = Client.newCryptoSuite(); - cryptoSuite.setCryptoKeyStore(Client.newCryptoKeyStore({path: testUtil.storePathForOrg(orgName)})); - client.setCryptoSuite(cryptoSuite); - - const caRootsPath = ORGS.orderer.tls_cacerts; - let data = fs.readFileSync(CaliperUtils.resolvePath(caRootsPath, networkRoot)); - let caroots = Buffer.from(data).toString(); - - // Conditional action on TLS enablement - if(ORGS.orderer.url.toString().startsWith('grpcs')){ - const fabricCAEndpoint = ORGS[userOrg].ca.url; - const caName = ORGS[userOrg].ca.name; - const tlsInfo = await tlsEnroll(fabricCAEndpoint, caName); - client.setTlsClientCertAndKey(tlsInfo.certificate, tlsInfo.key); - } - - channel.addOrderer( - client.newOrderer( - ORGS.orderer.url, - { - 'pem': caroots, - 'ssl-target-name-override': ORGS.orderer['server-hostname'] - } - ) - ); - - const transientMap = {'test': 'transientValue'}; - let request = null; - - const store = await Client.newDefaultKeyValueStore({path: testUtil.storePathForOrg(orgName)}); - client.setStateStore(store); - the_user = await testUtil.getSubmitter(client, true /* use peer org admin*/, userOrg); - - for(let org in ORGS) { - if(ORGS.hasOwnProperty(org) && org.indexOf('org') === 0) { - for (let key in ORGS[org]) { - if(ORGS[org].hasOwnProperty(key) && key.indexOf('peer') === 0) { - let data = fs.readFileSync(CaliperUtils.resolvePath(ORGS[org][key].tls_cacerts, networkRoot)); - let peer = client.newPeer( - ORGS[org][key].requests, - { - pem: Buffer.from(data).toString(), - 'ssl-target-name-override': ORGS[org][key]['server-hostname'] - }); - targets.push(peer); - channel.addPeer(peer); - - const eh = channel.newChannelEventHub(peer); - eventhubs.push(eh); - } - } - } - } - - await channel.initialize(); - - let res = await channel.queryInstantiatedChaincodes(); - let found = false; - for (let i = 0; i < res.chaincodes.length; i++) { - if (res.chaincodes[i].name === chaincode.id && - res.chaincodes[i].version === chaincode.version && - res.chaincodes[i].path === chaincode.path) { - found = true; - commLogger.debug('instantiatedChaincode: ' + JSON.stringify(res.chaincodes[i])); - break; - } - } - if (found) { - return; - } - - let results; - // the v1 chaincode has Init() method that expects a transient map - if (upgrade) { - let request = buildChaincodeProposal(client, chaincode, upgrade, transientMap, endorsement_policy); - tx_id = request.txId; - results = await channel.sendUpgradeProposal(request); - } else { - let request = buildChaincodeProposal(client, chaincode, upgrade, transientMap, endorsement_policy); - tx_id = request.txId; - results = await channel.sendInstantiateProposal(request); - } - - const proposalResponses = results[0]; - - const proposal = results[1]; - let all_good = true; - for(const i in proposalResponses) { - if (proposalResponses && proposalResponses[i].response && proposalResponses[i].response.status === 200) { - commLogger.info(type +' proposal was good'); - } else { - commLogger.warn(type +' proposal was bad: ' + proposalResponses[i]); - all_good = false; - } - } - if (all_good) { - commLogger.info('Successfully sent Proposal and received ProposalResponse'); - request = { - proposalResponses: proposalResponses, - proposal: proposal - }; - } else { - commLogger.warn(JSON.stringify(proposalResponses)); - throw new Error('All proposals were not good'); - } - const deployId = tx_id.getTransactionID(); - - const eventPromises = []; - eventPromises.push(channel.sendTransaction(request)); - eventhubs.forEach((eh) => { - let txPromise = new Promise((resolve, reject) => { - let handle = setTimeout(reject, 300000); - - eh.registerTxEvent(deployId.toString(), (tx, code) => { - commLogger.info('The chaincode ' + type + ' transaction has been committed on peer '+ eh.getPeerAddr()); - clearTimeout(handle); - if (code !== 'VALID') { - commLogger.warn('The chaincode ' + type + ' transaction was invalid, code = ' + code); - reject(); - } else { - commLogger.info('The chaincode ' + type + ' transaction was valid.'); - resolve(); - } - }, (err) => { - commLogger.warn('There was a problem with the instantiate event ' + err); - clearTimeout(handle); - reject(); - }, { - disconnect: true - }); - eh.connect(); - }); - eventPromises.push(txPromise); - }); - - results = await Promise.all(eventPromises); - if (results && !(results[0] instanceof Error) && results[0].status === 'SUCCESS') { - commLogger.info('Successfully sent ' + type + ' transaction to the orderer.'); - } else { - commLogger.warn('Failed to order the ' + type + ' transaction. Error code: ' + results[0].status); - throw new Error('Failed to order the ' + type + ' transaction. Error code: ' + results[0].status); - } -} - -/** - * Instantiate or upgrade the given chaincode with the given endorsement policy. - * @param {object} chaincode The chaincode object from the configuration file. - * @param {object} endorsement_policy The endorsement policy object from the configuration file. - * @param {boolean} upgrade Indicates whether the call is an upgrade or a new instantiation. - * @async - */ -async function instantiateLegacy(chaincode, endorsement_policy, upgrade){ - - Client.setConfigSetting('request-timeout', 600000); - - let channel = testUtil.getChannel(chaincode.channel); - if(channel === null) { - throw new Error('Could not find channel in config'); - } - const channel_name = channel.name; - const userOrg = channel.organizations[0]; - - let targets = [], - eventhubs = []; - let type = 'instantiate'; - if(upgrade) {type = 'upgrade';} - const client = new Client(); - channel = client.newChannel(channel_name); - - const orgName = ORGS[userOrg].name; - const cryptoSuite = Client.newCryptoSuite(); - cryptoSuite.setCryptoKeyStore(Client.newCryptoKeyStore({path: testUtil.storePathForOrg(orgName)})); - client.setCryptoSuite(cryptoSuite); - - const caRootsPath = ORGS.orderer.tls_cacerts; - let data = fs.readFileSync(CaliperUtils.resolvePath(caRootsPath, networkRoot)); - let caroots = Buffer.from(data).toString(); - - channel.addOrderer( - client.newOrderer( - ORGS.orderer.url, - { - 'pem': caroots, - 'ssl-target-name-override': ORGS.orderer['server-hostname'] - } - ) - ); - - targets = []; - const transientMap = {'test': 'transientValue'}; - - let store = await Client.newDefaultKeyValueStore({path: testUtil.storePathForOrg(orgName)}); - client.setStateStore(store); - - the_user = await testUtil.getSubmitter(client, true /* use peer org admin*/, userOrg); - - let eventPeer = null; - for(let org in ORGS) { - if(ORGS.hasOwnProperty(org) && org.indexOf('org') === 0) { - for (let key in ORGS[org]) { - if(ORGS[org].hasOwnProperty(key) && key.indexOf('peer') === 0) { - let data = fs.readFileSync(CaliperUtils.resolvePath(ORGS[org][key].tls_cacerts, networkRoot)); - let peer = client.newPeer( - ORGS[org][key].requests, - { - pem: Buffer.from(data).toString(), - 'ssl-target-name-override': ORGS[org][key]['server-hostname'] - }); - targets.push(peer); - channel.addPeer(peer); - if(org === userOrg && !eventPeer) { - eventPeer = key; - } - } - } - } - } - - data = fs.readFileSync(CaliperUtils.resolvePath(ORGS[userOrg][eventPeer].tls_cacerts, networkRoot)); - let eh = client.newEventHub(); - eh.setPeerAddr( - ORGS[userOrg][eventPeer].events, - { - pem: Buffer.from(data).toString(), - 'ssl-target-name-override': ORGS[userOrg][eventPeer]['server-hostname'] - } - ); - eh.connect(); - eventhubs.push(eh); - - try { - // read the config block from the orderer for the channel - // and initialize the verify MSPs based on the participating - // organizations - await channel.initialize(); - - let res = await channel.queryInstantiatedChaincodes(); - let found = false; - for (let i = 0; i < res.chaincodes.length; i++) { - if (res.chaincodes[i].name === chaincode.id && - res.chaincodes[i].version === chaincode.version && - res.chaincodes[i].path === chaincode.path) { - found = true; - commLogger.debug('instantiatedChaincode: ' + JSON.stringify(res.chaincodes[i])); - break; - } - } - if (found) { - return; - } - let results; - // the v1 chaincode has Init() method that expects a transient map - if (upgrade) { - let request = buildChaincodeProposal(client, chaincode, upgrade, transientMap, endorsement_policy); - tx_id = request.txId; - - results = await channel.sendUpgradeProposal(request); - } else { - let request = buildChaincodeProposal(client, chaincode, upgrade, transientMap, endorsement_policy); - tx_id = request.txId; - results = await channel.sendInstantiateProposal(request); - } - - const proposalResponses = results[0]; - - const proposal = results[1]; - let all_good = true; - let instantiated = false; - for(let i in proposalResponses) { - commLogger.debug('instantiateChaincode responses: i=' + i + ' ' + JSON.stringify(proposalResponses[i])); - let one_good = false; - if (proposalResponses[i].response && proposalResponses[i].response.status === 200) { - one_good = true; - /*} else if (proposalResponses && proposalResponses[i] && proposalResponses[i].code === 2){ - if (proposalResponses[i].details && proposalResponses[i].details.indexOf('exists') !== -1) { - one_good = true; - instantiated = true; - }*/ - - } - all_good = all_good && one_good; - } - - if (!all_good) { - throw new Error('Failed to send ' + type + ' Proposal or receive valid response. Response null or status is not 200.'); - }else if (instantiated) { - return; - } - - const request = { - proposalResponses: proposalResponses, - proposal: proposal, - }; - - // set the transaction listener and set a timeout of 5 mins - // if the transaction did not get committed within the timeout period, - // fail the test - const deployId = tx_id.getTransactionID(); - - const eventPromises = []; - eventhubs.forEach((eh) => { - let txPromise = new Promise((resolve, reject) => { - let handle = setTimeout(reject, 300000); - - eh.registerTxEvent(deployId.toString(), (tx, code) => { - clearTimeout(handle); - eh.unregisterTxEvent(deployId); - - if (code !== 'VALID') { - commLogger.warn('The chaincode ' + type + ' transaction was invalid, code = ' + code); - reject(); - } else { - commLogger.info('The chaincode ' + type + ' transaction was valid.'); - resolve(); - } - }); - }); - eventPromises.push(txPromise); - }); - - let response; - try { - const sendPromise = channel.sendTransaction(request); - results = await Promise.all([sendPromise].concat(eventPromises)); - response = results[0]; // just first results are from orderer, the rest are from the peer events - } catch (err) { - commLogger.error('Failed to send ' + type + ' transaction and get notifications within the timeout period.'); - throw err; - } - - //TODO should look into the event responses - if ((response instanceof Error) || response.status !== 'SUCCESS') { - throw new Error('Failed to order the ' + type + 'transaction. Error code: ' + response.status); - } - } finally { - for(let key in eventhubs) { - const eventhub = eventhubs[key]; - if (eventhub && eventhub.isconnected()) { - eventhub.disconnect(); - } - } - } -} - -/** - * Instantiate or upgrade the given chaincode with the given endorsement policy. - * @param {object} chaincode The chaincode object from the configuration file. - * @param {object} endorsement_policy The endorsement policy object from the configuration file. - * @param {boolean} upgrade Indicates whether the call is an upgrade or a new instantiation. - * @async - */ -async function instantiateChaincode(chaincode, endorsement_policy, upgrade){ - - if (isLegacy) { - await instantiateLegacy(chaincode, endorsement_policy, upgrade); - } else { - await instantiate(chaincode, endorsement_policy, upgrade); - } -} - -/** - * Get the peers of a given organization. - * @param {string} orgName The name of the organization. - * @return {string[]} The collection of peer names. - */ -function getOrgPeers(orgName) { - const peers = []; - const org = ORGS[orgName]; - for (let key in org) { - if ( org.hasOwnProperty(key)) { - if (key.indexOf('peer') === 0) { - peers.push(org[key]); - } - } - } - - return peers; -} - -/** - * Create a Fabric context based on the channel configuration. - * @param {object} channelConfig The channel object from the configuration file. - * @param {Integer} clientIdx the client index - * @param {object} txModeFile The file information for reading or writing. - * @return {Promise} The created Fabric context. - */ -async function getcontext(channelConfig, clientIdx, txModeFile) { - clientIndex = clientIdx; - txFile = txModeFile; - Client.setConfigSetting('request-timeout', 120000); - const channel_name = channelConfig.name; - // var userOrg = channelConfig.organizations[0]; - // choose a random org to use, for load balancing - const idx = Math.floor(Math.random() * channelConfig.organizations.length); - const userOrg = channelConfig.organizations[idx]; - - const client = new Client(); - const channel = client.newChannel(channel_name); - let orgName = ORGS[userOrg].name; - const cryptoSuite = Client.newCryptoSuite(); - const eventhubs = []; - - // Conditional action on TLS enablement - if(ORGS[userOrg].ca.url.toString().startsWith('https')){ - const fabricCAEndpoint = ORGS[userOrg].ca.url; - const caName = ORGS[userOrg].ca.name; - const tlsInfo = await tlsEnroll(fabricCAEndpoint, caName); - client.setTlsClientCertAndKey(tlsInfo.certificate, tlsInfo.key); - } - - cryptoSuite.setCryptoKeyStore(Client.newCryptoKeyStore({path: testUtil.storePathForOrg(orgName)})); - client.setCryptoSuite(cryptoSuite); - - const caRootsPath = ORGS.orderer.tls_cacerts; - let data = fs.readFileSync(CaliperUtils.resolvePath(caRootsPath, networkRoot)); - let caroots = Buffer.from(data).toString(); - - channel.addOrderer( - client.newOrderer( - ORGS.orderer.url, - { - 'pem': caroots, - 'ssl-target-name-override': ORGS.orderer['server-hostname'] - } - ) - ); - - orgName = ORGS[userOrg].name; - - const store = await Client.newDefaultKeyValueStore({path: testUtil.storePathForOrg(orgName)}); - client.setStateStore(store); - the_user = await testUtil.getSubmitter(client, true, userOrg); - - // set up the channel to use each org's random peer for - // both requests and events - for(let i in channelConfig.organizations) { - let org = channelConfig.organizations[i]; - let peers = getOrgPeers(org); - - if(peers.length === 0) { - throw new Error('could not find peer of ' + org); - } - - // Cycle through available peers based on clientIdx - let peerInfo = peers[clientIdx % peers.length]; - let data = fs.readFileSync(CaliperUtils.resolvePath(peerInfo.tls_cacerts, networkRoot)); - let peer = client.newPeer( - peerInfo.requests, - { - pem: Buffer.from(data).toString(), - 'ssl-target-name-override': peerInfo['server-hostname'] - } - ); - channel.addPeer(peer); - - // an event listener can only register with the peer in its own org - if (isLegacy){ - let eh = client.newEventHub(); - eh.setPeerAddr( - peerInfo.events, - { - pem: Buffer.from(data).toString(), - 'ssl-target-name-override': peerInfo['server-hostname'], - //'request-timeout': 120000 - 'grpc.keepalive_timeout_ms' : 3000, // time to respond to the ping, 3 seconds - 'grpc.keepalive_time_ms' : 360000 // time to wait for ping response, 6 minutes - // 'grpc.http2.keepalive_time' : 15 - } - ); - eventhubs.push(eh); - } else { - if(org === userOrg) { - let eh = channel.newChannelEventHub(peer); - eventhubs.push(eh); - } - } - } - - // register event listener - eventhubs.forEach((eh) => { - eh.connect(); - }); - - await channel.initialize(); - return { - org: userOrg, - client: client, - channel: channel, - submitter: the_user, - eventhubs: eventhubs - }; -} - - -/** - * Disconnect the event hubs. - * @param {object} context The Fabric context. - * @async - */ -async function releasecontext(context) { - if(context.hasOwnProperty('eventhubs')){ - for(let key in context.eventhubs) { - const eventhub = context.eventhubs[key]; - if (eventhub && eventhub.isconnected()) { - eventhub.disconnect(); - } - } - context.eventhubs = []; - } -} - -/** - * Write signed proposal to file. - * @param {string} name The prefix name of the file. - * @async - */ -async function writeToFile(name){ - let fileName = name + '.signed.metadata.' + clientIndex; - let binFileName = name + '.signed.binary.' + clientIndex; - - try { - let reArray = []; - let bufferArray = []; - for(let i = 0; i < signedTransactionArray.length; i++) { - let signedTransaction = signedTransactionArray[i]; - let signedProposal = signedTransactionArray[i].signedTransaction; - let signature = signedProposal.signature; - bufferArray.push(signature); - let payload = signedProposal.payload; - bufferArray.push(payload); - reArray.push({txId: signedTransaction.txId, transactionRequest: signedTransaction.transactionRequest, signatureLength: signature.length, payloadLength: payload.length}); - } - let buffer = Buffer.concat(bufferArray); - - fs.writeFileSync(binFileName, buffer); - let signedString = JSON.stringify(reArray); - fs.writeFileSync(fileName, signedString); - signedTransactionArray = []; - signedCommitProposal = []; - commLogger.debug('write file ok'); - - }catch(err) { - commLogger.error('write err: ' + err); - } - -} - -module.exports.writeToFile = writeToFile; - -/** - * Submit a transaction to the orderer. - * @param {object} context The Fabric context. - * @param {object} signedTransaction The transaction information. - * @param {object} invokeStatus The result and stats of the transaction. - * @param {number} startTime The start time. - * @param {number} timeout The timeout for the transaction invocation. - * @return {Promise} The result and stats of the transaction invocation. - */ -async function sendTransaction(context, signedTransaction, invokeStatus, startTime, timeout){ - const channel = context.channel; - const eventHubs = context.eventhubs; - const txId = signedTransaction.txId; - let errFlag = TxErrorEnum.NoError; - try { - let newTimeout = timeout * 1000 - (Date.now() - startTime); - if(newTimeout < 10000) { - commLogger.warn('WARNING: timeout is too small, default value is used instead'); - newTimeout = 10000; - } - - const eventPromises = []; - eventHubs.forEach((eh) => { - eventPromises.push(new Promise((resolve, reject) => { - //let handle = setTimeout(() => reject(new Error('Timeout')), newTimeout); - let handle = setTimeout(() => reject(new Error('Timeout')), 100000); - eh.registerTxEvent(txId, - (tx, code) => { - clearTimeout(handle); - eh.unregisterTxEvent(txId); - - // either explicit invalid event or valid event, verified in both cases by at least one peer - invokeStatus.SetVerification(true); - if (code !== 'VALID') { - let err = new Error('Invalid transaction: ' + code); - errFlag |= TxErrorEnum.BadEventNotificationError; - invokeStatus.SetFlag(errFlag); - invokeStatus.SetErrMsg(TxErrorIndex.BadEventNotificationError, err.toString()); - reject(err); // handle error in final catch - } else { - resolve(); - } - }, - (err) => { - clearTimeout(handle); - // we don't know what happened, but give the other eventhub connections a chance - // to verify the Tx status, so resolve this call - errFlag |= TxErrorEnum.EventNotificationError; - invokeStatus.SetFlag(errFlag); - invokeStatus.SetErrMsg(TxErrorIndex.EventNotificationError, err.toString()); - resolve(); - } - ); - - })); - }); - - let broadcastResponse; - try { - let signedProposal = signedTransaction.signedTransaction; - let broadcastResponsePromise; - let transactionRequest = signedTransaction.transactionRequest; - if (signedProposal === null){ - if(txFile && txFile.readWrite === 'write') { - const beforeInvokeTime = Date.now(); - let signedTransaction = signedOffline.generateSignedTransaction(transactionRequest, channel); - invokeStatus.Set('invokeLatency', (Date.now() - beforeInvokeTime)); - signedTransactionArray.push({ - txId: txId, - signedTransaction: signedTransaction, - transactionRequest: {orderer: transactionRequest.orderer} - }); - return invokeStatus; - } - const beforeTransactionTime = Date.now(); - broadcastResponsePromise = channel.sendTransaction(transactionRequest); - invokeStatus.Set('sT', (Date.now() - beforeTransactionTime)); - } else { - const beforeTransactionTime = Date.now(); - //let signature = Buffer.from(signedProposal.signature.data); - //let payload = Buffer.from(signedProposal.payload.data); - let signature = signedProposal.signature; - let payload = signedProposal.payload; - broadcastResponsePromise = channel.sendSignedTransaction({ - signedProposal: {signature: signature, payload: payload}, - request: signedTransaction.transactionRequest, - }); - invokeStatus.Set('sT', (Date.now() - beforeTransactionTime)); - invokeStatus.Set('invokeLatency', (Date.now() - startTime)); - } - broadcastResponse = await broadcastResponsePromise; - } catch (err) { - commLogger.error('Failed to send transaction error: ' + err); - // missing the ACK does not mean anything, the Tx could be already under ordering - // so let the events decide the final status, but log this error - errFlag |= TxErrorEnum.OrdererResponseError; - invokeStatus.SetFlag(errFlag); - invokeStatus.SetErrMsg(TxErrorIndex.OrdererResponseError,err.toString()); - } - - invokeStatus.Set('time_order', Date.now()); - - if (broadcastResponse && broadcastResponse.status === 'SUCCESS') { - invokeStatus.Set('status', 'submitted'); - } else if (broadcastResponse && broadcastResponse.status !== 'SUCCESS') { - let err = new Error('Received rejection from orderer service: ' + broadcastResponse.status); - errFlag |= TxErrorEnum.BadOrdererResponseError; - invokeStatus.SetFlag(errFlag); - invokeStatus.SetErrMsg(TxErrorIndex.BadOrdererResponseError, err.toString()); - // the submission was explicitly rejected, so the Tx will definitely not be ordered - invokeStatus.SetVerification(true); - throw err; - } - - await Promise.all(eventPromises); - // if the Tx is not verified at this point, then every eventhub connection failed (with resolve) - // so mark it failed but leave it not verified - if (!invokeStatus.IsVerified()) { - invokeStatus.SetStatusFail(); - commLogger.error('Failed to complete transaction [' + txId.substring(0, 5) + '...]: every eventhub connection closed'); - } else { - invokeStatus.SetStatusSuccess(); - } - } catch (err) - { - // at this point the Tx should be verified - invokeStatus.SetStatusFail(); - commLogger.error('Failed to complete transaction [' + txId.substring(0, 5) + '...]:' + (err instanceof Error ? err.stack : err)); - } - return invokeStatus; -} - - -/** - * Submit a transaction to the given chaincode with the specified options. - * @param {object} context The Fabric context. - * @param {string} id The name of the chaincode. - * @param {string} version The version of the chaincode. - * @param {string[]} args The arguments to pass to the chaincode. - * @param {number} timeout The timeout for the transaction invocation. - * @return {Promise} The result and stats of the transaction invocation. - */ -async function invokebycontext(context, id, version, args, timeout){ - - const channel = context.channel; - //const eventHubs = context.eventhubs; - const startTime = Date.now(); - - // timestamps are recorded for every phase regardless of success/failure - let invokeStatus; - - if(context.engine) { - context.engine.submitCallback(1); - } - - commLogger.debug('txFile: ' + JSON.stringify(txFile) + ' clientIndex: ' + clientIndex); - commLogger.debug('signedTransactionArray.length: ' + signedTransactionArray.length + ' : signedCommitProposal.length: ' + signedCommitProposal.length); - - if(txFile && txFile.readWrite === 'read' && signedTransactionArray.length !== 0) { - let count = invokeCount % signedTransactionArray.length; - let signedTransaction = signedTransactionArray[count]; - signedTransaction.signedTransaction = signedCommitProposal[count]; - invokeCount++; - const txId = signedTransaction.txId; - invokeStatus = new TxStatus(txId); - let errFlag = TxErrorEnum.NoError; - invokeStatus.SetFlag(errFlag); - return sendTransaction(context, signedTransaction, invokeStatus, startTime, timeout); - } - - const txIdObject = context.client.newTransactionID(); - const txId = txIdObject.getTransactionID().toString(); - invokeStatus = new TxStatus(txId); - let errFlag = TxErrorEnum.NoError; - invokeStatus.SetFlag(errFlag); - - // TODO: should resolve endorsement policy to decides the target of endorsers - // now random peers ( one peer per organization ) are used as endorsers as default, see the implementation of getContext - // send proposal to endorser - const f = args[0]; - args.shift(); - const proposalRequest = { - chaincodeId: id, - fcn: f, - args: args, - txId: txIdObject, - }; - - let proposalResponseObject = null; - try { - try { - //proposalResponseObject = await channel.sendTransactionProposal(proposalRequest, timeout * 1000); - const beforeProposalTime = Date.now(); - let proposalResponseObjectPromise = channel.sendTransactionProposal(proposalRequest, timeout * 1000); - //commLogger.info('sendTransactionProposal: ' + (Date.now() - beforeProposalTime)); - invokeStatus.Set('sTP', (Date.now() - beforeProposalTime)); - proposalResponseObject = await proposalResponseObjectPromise; - invokeStatus.Set('time_endorse', Date.now()); - } catch (err) { - invokeStatus.Set('time_endorse', Date.now()); - errFlag |= TxErrorEnum.ProposalResponseError; - invokeStatus.SetFlag (errFlag); - invokeStatus.SetErrMsg(TxErrorIndex.ProposalResponseError, err.toString()); - // error occurred, early life-cycle termination, definitely failed - invokeStatus.SetVerification(true); - throw err; // handle logging in one place - } - - const proposalResponses = proposalResponseObject[0]; - const proposal = proposalResponseObject[1]; - - let allGood = true; - for(const i in proposalResponses) { - let one_good = false; - let proposal_response = proposalResponses[i]; - if( proposal_response.response && proposal_response.response.status === 200) { - // TODO: the CPU cost of verifying response is too high. - // Now we ignore this step to improve concurrent capacity for the client - // so a client can initialize multiple concurrent transactions - // Is it a reasonable way? - //let beforeInvokeTime = Date.now(); - //one_good = channel.verifyProposalResponse(proposal_response); - //invokeStatus.Set('invokeLatency', (Date.now() - beforeInvokeTime)); - one_good = true; - } else { - let err = new Error('Endorsement denied: ' + proposal_response.toString()); - errFlag |= TxErrorEnum.BadProposalResponseError; - invokeStatus.SetFlag(errFlag); - invokeStatus.SetErrMsg(TxErrorIndex.BadProposalResponseError, err.toString()); - // explicit rejection, early life-cycle termination, definitely failed - invokeStatus.SetVerification(true); - throw err; - } - allGood = allGood && one_good; - } - - if (allGood) { - // check all the read/write sets to see if the same, verify that each peer - // got the same results on the proposal - //let beforeInvokeTime = Date.now() - allGood = channel.compareProposalResponseResults(proposalResponses); - //invokeStatus.Set('invokeLatency', (Date.now() - beforeInvokeTime)); - if (!allGood) { - let err = new Error('Read/Write set mismatch between endorsements'); - errFlag |= TxErrorEnum.BadProposalResponseError; - invokeStatus.SetFlag(errFlag); - invokeStatus.SetErrMsg(TxErrorIndex.BadProposalResponseError, err.toString()); - // r/w set mismatch, early life-cycle termination, definitely failed - invokeStatus.SetVerification(true); - throw err; - } - } - - invokeStatus.SetResult(proposalResponses[0].response.payload); - - const transactionRequest = { - proposalResponses: proposalResponses, - proposal: proposal, - }; - invokeStatus = sendTransaction(context, {txId: txId, signedTransaction: null, transactionRequest: transactionRequest}, invokeStatus, startTime, timeout); - } catch (err) { - // at this point the Tx should be verified - invokeStatus.SetStatusFail(); - commLogger.error('Failed to complete transaction [' + txId.substring(0, 5) + '...]:' + (err instanceof Error ? err.stack : err)); - } - - return invokeStatus; -} - -/** - * Submit a query to the given chaincode with the specified options. - * @param {object} context The Fabric context. - * @param {string} id The name of the chaincode. - * @param {string} version The version of the chaincode. - * @param {string} name The single argument to pass to the chaincode. - * @param {string} fcn The chaincode query function name. - * @return {Promise} The result and stats of the transaction invocation. - */ -async function querybycontext(context, id, version, name, fcn) { - const client = context.client; - const channel = context.channel; - const tx_id = client.newTransactionID(); - const txStatus = new TxStatus(tx_id.getTransactionID()); - - // send query - const request = { - chaincodeId: id, - chaincodeVersion: version, - txId: tx_id, - fcn: fcn, - args: [name] - }; - - if(context.engine) { - context.engine.submitCallback(1); - } - - const responses = await channel.queryByChaincode(request); - if(responses.length > 0) { - const value = responses[0]; - if(value instanceof Error) { - throw value; - } - - for(let i = 1 ; i < responses.length ; i++) { - if(responses[i].length !== value.length || !responses[i].every(function(v,idx){ - return v === value[idx]; })) { - throw new Error('conflicting query responses'); - } - } - - txStatus.SetStatusSuccess(); - txStatus.SetResult(responses[0]); - return Promise.resolve(txStatus); - } - else { - throw new Error('no query responses'); - } -} - -/** - * Utility method to recursively resolve the tlsCACerts paths listed within the passed json object - * @param {Object} jsonObj a json object defining a common connection profile - */ -function resolveTlsCACerts(jsonObj) { - if( typeof jsonObj === 'object' ) { - Object.entries(jsonObj).forEach(([key, value]) => { - // key is either an array index or object key - if(key.toString() === 'tlsCACerts'){ - value.path = CaliperUtils.resolvePath(value.path, networkRoot); - return; - } else { - resolveTlsCACerts(value); - } - }); - } else { - return; - } -} - -/** - * Create and return an InMemoryWallet for a user in the org - * @param {String} org the org - * @returns {InMemoryWallet} an InMemoryWallet - */ -async function createInMemoryWallet(org) { - const orgConfig = ORGS[org]; - const cert = fs.readFileSync(CaliperUtils.resolvePath(orgConfig.user.cert, networkRoot)).toString(); - const key = fs.readFileSync(CaliperUtils.resolvePath(orgConfig.user.key, networkRoot)).toString(); - const inMemoryWallet = new InMemoryWallet(); - - await inMemoryWallet.import(orgConfig.user.name, X509WalletMixin.createIdentity(orgConfig.mspid, cert, key)); - - if (ORGS.orderer.url.startsWith('grpcs')) { - const fabricCAEndpoint = orgConfig.ca.url; - const caName = orgConfig.ca.name; - const tlsInfo = await tlsEnroll(fabricCAEndpoint, caName); - await inMemoryWallet.import('tlsId', X509WalletMixin.createIdentity(org, tlsInfo.certificate, tlsInfo.key)); - } - - return inMemoryWallet; -} - -/** - * Retrieve the Gateway object for use in subsequent network invocation commands - * @param {String} ccpPath the path to the common connection profile for the network - * @param {String} opts the name of the organisation to use - * @returns {Network} the Fabric Network object - */ -async function retrieveGateway(ccpPath, opts) { - const gateway = new Gateway(); - - ccpPath = CaliperUtils.resolvePath(ccpPath, networkRoot); - let ccp = JSON.parse(fs.readFileSync(ccpPath).toString()); - - // need to resolve tlsCACerts paths for current system - resolveTlsCACerts(ccp); - - await gateway.connect(ccp, opts); - return gateway; -} - -/** - * Submit a transaction to the given chaincode with the specified options. - * @param {object} context The Fabric context. - * @param {string[]} args The arguments to pass to the chaincode. - * @return {Promise} The result and stats of the transaction invocation. - */ -async function submitTransaction(context, args){ - const txIdObject = context.gateway.client.newTransactionID(); - const txId = txIdObject.getTransactionID().toString(); - - // timestamps are recorded for every phase regardless of success/failure - let invokeStatus = new TxStatus(txId); - let errFlag = TxErrorEnum.NoError; - invokeStatus.SetFlag(errFlag); - - if(context.engine) { - context.engine.submitCallback(1); - } - - try { - const result = await context.contract.submitTransaction(...args); - invokeStatus.result = result; - invokeStatus.verified = true; - invokeStatus.SetStatusSuccess(); - return invokeStatus; - } catch (err) { - commLogger.error('failed to submit transaction using args [' + JSON.stringify(args) +'], with error: ' + (err instanceof Error ? err.stack : err)); - invokeStatus.SetStatusFail(); - invokeStatus.result = []; - return Promise.resolve(invokeStatus); - } -} - -/** - * Evaluates the given chaincode function with the specified options; this will not append to the ledger - * @param {object} context The Fabric context. - * @param {string[]} args The arguments to pass to the chaincode. - * @return {Promise} The result and stats of the transaction invocation. - */ -async function evaluateTransaction(context, args){ - const TxErrorEnum = require('./constant.js').TxErrorEnum; - const txIdObject = context.gateway.client.newTransactionID(); - const txId = txIdObject.getTransactionID().toString(); - - // timestamps are recorded for every phase regardless of success/failure - let invokeStatus = new TxStatus(txId); - let errFlag = TxErrorEnum.NoError; - invokeStatus.SetFlag(errFlag); - - if(context.engine) { - context.engine.submitCallback(1); - } - - try { - const result = await context.contract.evaluateTransaction(...args); - invokeStatus.result = result; - invokeStatus.SetStatusSuccess(); - return invokeStatus; - } catch (err) { - commLogger.error('failed to evaluate transaction using args [' + JSON.stringify(args) +'], with error: ' + (err instanceof Error ? err.stack : err)); - invokeStatus.SetStatusFail(); - invokeStatus.result = []; - return Promise.resolve(invokeStatus); - } -} - -module.exports.init = init; -module.exports.installChaincode = installChaincode; -module.exports.instantiateChaincode = instantiateChaincode; -module.exports.getcontext = getcontext; -module.exports.releasecontext = releasecontext; -module.exports.invokebycontext = invokebycontext; -module.exports.querybycontext = querybycontext; -module.exports.tlsEnroll = tlsEnroll; -module.exports.createInMemoryWallet = createInMemoryWallet; -module.exports.retrieveGateway = retrieveGateway; -module.exports.submitTransaction = submitTransaction; -module.exports.evaluateTransaction = evaluateTransaction; diff --git a/packages/caliper-fabric/lib/fabric.js b/packages/caliper-fabric/lib/fabric.js deleted file mode 100644 index 191b4c42a..000000000 --- a/packages/caliper-fabric/lib/fabric.js +++ /dev/null @@ -1,225 +0,0 @@ -/* - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -'use strict'; - -const util = require('./util.js'); -const e2eUtils = require('./e2eUtils.js'); -const impl_create = require('./create-channel.js'); -const impl_join = require('./join-channel.js'); -const impl_install = require('./install-chaincode.js'); -const impl_instantiate = require('./instantiate-chaincode.js'); - -const {BlockchainInterface, CaliperUtils, TxStatus} = require('caliper-core'); -const commLogger = CaliperUtils.getLogger('fabric.js'); - -/** - * Implements {BlockchainInterface} for a Fabric backend. - */ -class Fabric extends BlockchainInterface { - /** - * Create a new instance of the {Fabric} class. - * @param {string} config_path The absolute path of the Fabric network configuration file. - * @param {string} workspace_root The absolute path to the root location for the application configuration files. - */ - constructor(config_path, workspace_root) { - super(config_path); - this.bcType = 'fabric'; - this.workspaceRoot = workspace_root; - } - - /** - * Initialize the {Fabric} object. - * @async - */ - async init() { - util.init(this.configPath, this.workspaceRoot); - e2eUtils.init(this.configPath, this.workspaceRoot); - try { - await impl_create.run(this.configPath, this.workspaceRoot); - await impl_join.run(this.configPath, this.workspaceRoot); - } catch (err) { - commLogger.error(`Fabric initialization failed: ${(err.stack ? err.stack : err)}`); - throw err; - } - } - - /** - * Deploy the chaincode specified in the network configuration file to all peers. - * @async - */ - async installSmartContract() { - try { - await impl_install.run(this.configPath); - await impl_instantiate.run(this.configPath); - } catch (err) { - commLogger.error(`Fabric chaincode install failed: ${(err.stack ? err.stack : err)}`); - throw err; - } - } - - /** - * Return the Fabric context associated with the given callback module name. - * @param {string} name The name of the callback module as defined in the configuration files. - * @param {object} args Unused. - * @param {Integer} clientIdx The client index. - * @param {Object} txFile the file information for reading or writing. - * @return {object} The assembled Fabric context. - * @async - */ - async getContext(name, args, clientIdx, txFile) { - util.init(this.configPath, this.workspaceRoot); - e2eUtils.init(this.configPath, this.workspaceRoot); - this.txFile = txFile; - if(this.txFile){ - this.txFile.name = name; - commLogger.debug('getContext) name: ' + name + ' clientIndex: ' + clientIdx + ' txFile: ' + JSON.stringify(this.txFile)); - if(this.txFile.readWrite === 'read') { - if(this.txFile.roundCurrent === 0){ - await e2eUtils.readFromFile(this.txFile.name); - } - } - } - - let fabricSettings = require(this.configPath); - let context = fabricSettings.fabric.context; - - // Either using network mode or baseAPI mode - if (fabricSettings.info.contractInvoke) { - // Create in memory wallet using org0 - const org = fabricSettings.fabric.channel[0].organizations[0]; - const userId = fabricSettings.fabric.network[org].user.name; - const wallet = await e2eUtils.createInMemoryWallet(org); - - const opts = { - wallet: wallet, - identity: userId, - discovery: {enabled: false} - }; - - // clientTlsIdentity is conditional on config - if (fabricSettings.fabric.network.orderer.url.startsWith('grpcs')) { - opts.clientTlsIdentity = 'tlsId'; - } - - // Retrieve gateway using ccp and options - const gateway = await e2eUtils.retrieveGateway(fabricSettings.fabric.ccp, opts); - - // Retrieve and return the network using the network API commands - commLogger.info(`Retrieving network from channelName ${context[name]}`); - const network = await gateway.getNetwork(context[name]); - return {gateway: gateway, network: network, clientIdx}; - } else { - let channel; - if(typeof context === 'undefined') { - channel = util.getDefaultChannel(); - } - else{ - channel = util.getChannel(context[name]); - } - - if(!channel) { - throw new Error('Could not find context information in the config file'); - } - - return await e2eUtils.getcontext(channel, clientIdx, txFile); - } - } - - /** - * Release the given Fabric context. - * @param {object} context The Fabric context to release. - * @async - */ - async releaseContext(context) { - if(this.txFile && this.txFile.readWrite === 'write') { - if(this.txFile.roundCurrent === (this.txFile.roundLength - 1)){ - await e2eUtils.writeToFile(this.txFile.name); - } - } - if (context.gateway) { - await context.gateway.disconnect(); - } else { - await e2eUtils.releasecontext(context); - } - await CaliperUtils.sleep(1000); - } - - /** - * Invoke the given chaincode according to the specified options. Multiple transactions will be generated according to the length of args. - * @param {object} context The Fabric context returned by {getContext}. - * @param {string} contractID The name of the chaincode. - * @param {string} contractVer The version of the chaincode. - * @param {Array} args Array of JSON formatted arguments for transaction(s). Each element contains arguments (including the function name) passing to the chaincode. JSON attribute named transaction_type is used by default to specify the function name. If the attribute does not exist, the first attribute will be used as the function name. - * @param {number} timeout The timeout to set for the execution in seconds. - * @return {Promise} The promise for the result of the execution. - */ - async invokeSmartContract(context, contractID, contractVer, args, timeout) { - let promises = []; - args.forEach((item, index)=>{ - try { - let simpleArgs = []; - let func; - for(let key in item) { - if(key === 'transaction_type') { - func = item[key].toString(); - } - else { - simpleArgs.push(item[key].toString()); - } - } - if(func) { - simpleArgs.splice(0, 0, func); - } - if(context.gateway) { - promises.push(e2eUtils.submitTransaction(context, simpleArgs)); - } else { - promises.push(e2eUtils.invokebycontext(context, contractID, contractVer, simpleArgs, timeout)); - } - } - catch(err) { - commLogger.error(err); - let badResult = new TxStatus('artifact'); - badResult.SetStatusFail(); - promises.push(Promise.resolve(badResult)); - } - }); - return await Promise.all(promises); - } - - /** - * Query the given chaincode according to the specified options. - * @param {object} context The Fabric context returned by {getContext}. - * @param {string} contractID The name of the chaincode. - * @param {string} contractVer The version of the chaincode. - * @param {string} arg The argument to pass to the chaincode query. - * @param {string} [fcn=query] The chaincode query function name. - * @param {Boolean} consensus boolean flag to indicate if the query is to be recorded ont the ledger or not - * @return {Promise} The promise for the result of the execution. - */ - queryState(context, contractID, contractVer, arg, fcn = 'query', consensus) { - - // Branch on interaction type - if(context.gateway) { - if (consensus) { - return e2eUtils.submitTransaction(context, arg); - } else { - return e2eUtils.executeTransaction(context, arg); - } - } else { - return e2eUtils.querybycontext(context, contractID, contractVer, arg.toString(), fcn); - } - } -} -module.exports = Fabric; diff --git a/packages/caliper-fabric/lib/fabricClientFactory.js b/packages/caliper-fabric/lib/fabricClientFactory.js deleted file mode 100644 index 600d89654..000000000 --- a/packages/caliper-fabric/lib/fabricClientFactory.js +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -'use strict'; - -const childProcess = require('child_process'); -const path = require('path'); - -/** - * Class used to spawn fabric client workers - */ -class FabricClientFactory { - - /** - * Require paths to configuration data used when calling new on fabric.js - * @param {String} absNetworkFile absolute workerPath - * @param {Sting} workspace_root root location - */ - constructor(absNetworkFile, workspace_root){ - this.absNetworkFile = absNetworkFile; - this.workspaceRoot = workspace_root; - } - - - /** - * Spawn the worker and perform required init - * @returns {Object} the child process - */ - spawnWorker() { - const child = childProcess.fork(path.join(__dirname, './fabricClientWorker.js'), process.argv.slice(1), { env: process.env}); - - const msg = { - type: 'init', - absNetworkFile: this.absNetworkFile, - networkRoot: this.workspaceRoot - }; - child.send(msg); - - return child; - } -} - -module.exports = FabricClientFactory; diff --git a/packages/caliper-fabric/lib/fabricClientWorker.js b/packages/caliper-fabric/lib/fabricClientWorker.js deleted file mode 100644 index 0bd74523a..000000000 --- a/packages/caliper-fabric/lib/fabricClientWorker.js +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -'use strict'; - -const {CaliperLocalClient, CaliperUtils} = require('caliper-core'); -const FabricClient = require('./fabric'); - -let caliperClient; -/** - * Message handler - */ -process.on('message', async (message) => { - - if (!message.hasOwnProperty('type')) { - process.send({type: 'error', data: 'unknown message type'}); - return; - } - - try { - switch (message.type) { - case 'init': { - const blockchain = new FabricClient(message.absNetworkFile, message.networkRoot); - caliperClient = new CaliperLocalClient(blockchain); - process.send({type: 'ready', data: {pid: process.pid, complete: true}}); - break; - } - case 'test': { - let result = await caliperClient.doTest(message); - - await CaliperUtils.sleep(200); - process.send({type: 'testResult', data: result}); - break; - } - default: { - process.send({type: 'error', data: 'unknown message type [' + message.type + ']'}); - } - } - } - catch (err) { - process.send({type: 'error', data: err.toString()}); - } -}); diff --git a/packages/caliper-fabric/lib/install-chaincode.js b/packages/caliper-fabric/lib/install-chaincode.js deleted file mode 100644 index 753b6acea..000000000 --- a/packages/caliper-fabric/lib/install-chaincode.js +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -'use strict'; - -const e2eUtils = require('./e2eUtils.js'); -const testUtil = require('./util.js'); -const CaliperUtils = require('caliper-core').CaliperUtils; -const commLogger = CaliperUtils.getLogger('install-chaincode.js'); - -/** - * Install the chaincode listed within config - * @param {*} config_path The path to the Fabric network configuration file. - * @async - */ -async function run(config_path) { - const fabricSettings = CaliperUtils.parseYaml(config_path).fabric; - let chaincodes = fabricSettings.chaincodes; - if(typeof chaincodes === 'undefined' || chaincodes.length === 0) { - return; - } - - testUtil.setupChaincodeDeploy(); - - try { - commLogger.info('installing all chaincodes......'); - - for (const chaincode of chaincodes){ - let channel = testUtil.getChannel(chaincode.channel); - if(channel === null) { - throw new Error('could not find channel in config'); - } - - for(let orgIndex in channel.organizations) { - // NOTE: changed execution to sequential for easier debugging (this is a one-time task, performance doesn't matter) - commLogger.info(`Installing chaincode ${chaincode.id}...`); - await e2eUtils.installChaincode(channel.organizations[orgIndex], chaincode); - } - - commLogger.info(`Installed chaincode ${chaincode.id} successfully in all peers`); - - } - } catch (err) { - commLogger.error(`Failed to install chaincodes: ${(err.stack ? err.stack : err)}`); - throw err; - } -} - -module.exports.run = run; diff --git a/packages/caliper-fabric/lib/instantiate-chaincode.js b/packages/caliper-fabric/lib/instantiate-chaincode.js deleted file mode 100644 index da46185a6..000000000 --- a/packages/caliper-fabric/lib/instantiate-chaincode.js +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -'use strict'; - -const e2eUtils = require('./e2eUtils.js'); -const CaliperUtils = require('caliper-core').CaliperUtils; -const commLogger = CaliperUtils.getLogger('instantiate-chaincode.js'); - -/** - * Install the chaincode listed within config - * @param {*} config_path The path to the Fabric network configuration file. - * @async - */ -async function run(config_path) { - const config = CaliperUtils.parseYaml(config_path); - const fabricSettings = config.fabric; - const policy = fabricSettings['endorsement-policy']; // TODO: support multiple policies - let chaincodes = fabricSettings.chaincodes; - if(typeof chaincodes === 'undefined' || chaincodes.length === 0) { - return; - } - - try { - commLogger.info('Instantiating chaincodes...'); - for (let chaincode of chaincodes) { - await e2eUtils.instantiateChaincode(chaincode, policy, false); - commLogger.info(`Instantiated chaincode ${chaincode.id} successfully`); - } - - commLogger.info('Sleeping 5s...'); - await CaliperUtils.sleep(5000); - } catch (err) { - commLogger.error(`Failed to instantiate chaincodes: ${(err.stack ? err.stack : err)}`); - throw err; - } -} - -module.exports.run = run; diff --git a/packages/caliper-fabric/lib/join-channel.js b/packages/caliper-fabric/lib/join-channel.js deleted file mode 100644 index 3d5f96b67..000000000 --- a/packages/caliper-fabric/lib/join-channel.js +++ /dev/null @@ -1,150 +0,0 @@ -/* - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -'use strict'; - -const fs = require('fs'); -const Client = require('fabric-client'); -const e2eUtils = require('./e2eUtils.js'); -const testUtil = require('./util.js'); -const CaliperUtils = require('caliper-core').CaliperUtils; -const commlogger = CaliperUtils.getLogger('join-channel.js'); - -/** - * Join the peers of the given organization to the given channel. - * @param {string} org The name of the organization. - * @param {string} channelName The name of the channel. - * @param {object} orgs orgs from configuration details. - * @param {string} root_path The path to the root of the network configuration file. - * @async - */ -async function joinChannel(org, channelName, orgs, root_path) { - const client = new Client(); - const channel = client.newChannel(channelName); - const orgName = orgs[org].name; - const targets = []; - - const caRootsPath = orgs.orderer.tls_cacerts; - let data = fs.readFileSync(CaliperUtils.resolvePath(caRootsPath, root_path)); - let caroots = Buffer.from(data).toString(); - - try { - - // Conditional action on TLS enablement - if(orgs.orderer.url.toString().startsWith('grpcs')){ - const fabricCAEndpoint = orgs[org].ca.url; - const caName = orgs[org].ca.name; - const tlsInfo = await e2eUtils.tlsEnroll(fabricCAEndpoint, caName); - client.setTlsClientCertAndKey(tlsInfo.certificate, tlsInfo.key); - } - - const store = await Client.newDefaultKeyValueStore({path: testUtil.storePathForOrg(orgName)}); - client.setStateStore(store); - await testUtil.getOrderAdminSubmitter(client); - - channel.addOrderer( - client.newOrderer( - orgs.orderer.url, - { - 'pem': caroots, - 'ssl-target-name-override': orgs.orderer['server-hostname'] - } - ) - ); - - let tx_id = client.newTransactionID(); - let request = { - txId : tx_id - }; - - const genesis_block = await channel.getGenesisBlock(request); - - // get the peer org's admin required to send join channel requests - client._userContext = null; - - await testUtil.getSubmitter(client, true /* get peer org admin */, org); - - for (let key in orgs[org]) { - if (orgs[org].hasOwnProperty(key)) { - if(key.indexOf('peer') === 0) { - data = fs.readFileSync(CaliperUtils.resolvePath(orgs[org][key].tls_cacerts, root_path)); - targets.push( - client.newPeer( - orgs[org][key].requests, - { - pem: Buffer.from(data).toString(), - 'ssl-target-name-override': orgs[org][key]['server-hostname'] - } - ) - ); - } - } - } - - tx_id = client.newTransactionID(); - request = { - targets : targets, - block : genesis_block, - txId : tx_id - }; - - const results = await channel.joinChannel(request, 130000); - - if(results[0] && results[0].response && results[0].response.status === 200) { - commlogger.info(`Successfully joined ${orgName}'s peers to ${channelName}`); - } else { - throw new Error('Unexpected join channel response: ' + JSON.stringify(results)); - } - } catch (err) { - commlogger.error(`Couldn't join ${orgName}'s peers to ${channelName}: ${err.stack ? err.stack : err}`); - throw err; - } -} - -/** - * Join the channel - * @param {*} config_path The path to the Fabric network configuration file. - * @param {String} root_path the root path to netowrk config - * @async - */ -async function run(config_path, root_path) { - const fabric = CaliperUtils.parseYaml(config_path).fabric; - let channels = fabric.channel; - if(!channels || channels.length === 0) { - return; - } - const orgs = fabric.network; - commlogger.info('Joining channels...'); - - try { - for (let channel of channels) { - if(channel.deployed) { - continue; - } - - for (let org of channel.organizations) { - // NOTE: made the execution sequential for easier debugging - commlogger.info(`Joining organization ${org} to channel ${channel.name}...`); - await joinChannel(org, channel.name, orgs, root_path); - } - - commlogger.info(`Successfully joined ${channel.name}`); - } - } catch (err) { - commlogger.error(`Failed to join peers: ${(err.stack ? err.stack : err)}`); - throw err; - } -} - -module.exports.run = run; diff --git a/packages/caliper-fabric/lib/signTransactionOffline.js b/packages/caliper-fabric/lib/signTransactionOffline.js deleted file mode 100644 index 01d248e8c..000000000 --- a/packages/caliper-fabric/lib/signTransactionOffline.js +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -'use strict'; - -//const fs = require('fs'); -//const path = require('path'); - -//const FabricCAService = require('fabric-ca-client'); -//const Client = require('fabric-client'); -//const hash = require('fabric-client/lib/hash'); - -/*const elliptic = require('elliptic'); -const EC = elliptic.ec; - -const privateKeyPath = path.resolve(__dirname, '../../network/fabric-v1.1/config/crypto-config/peerOrganizations/org1.example.com/users/User1@org1.example.com/msp/keystore/key.pem'); -const privateKeyPem = fs.readFileSync(privateKeyPath, 'utf8'); -const certPath = path.resolve(__dirname, '../../network/fabric-v1.1/config/crypto-config/peerOrganizations/org1.example.com/users/User1@org1.example.com/msp/signcerts/User1@org1.example.com-cert.pem'); -const certPem = fs.readFileSync(certPath, 'utf8'); -const mspId = 'Org1MSP'; - -// this ordersForCurve comes from CryptoSuite_ECDSA_AES.js and will be part of the -// stand alone fabric-sig package in future. -const ordersForCurve = { - 'secp256r1': { - 'halfOrder': elliptic.curves['p256'].n.shrn(1), - 'order': elliptic.curves['p256'].n - }, - 'secp384r1': { - 'halfOrder': elliptic.curves['p384'].n.shrn(1), - 'order': elliptic.curves['p384'].n - } -};*/ - -/** - * this method is used for test at this moment. In future this - * would be a stand alone package that running at the browser/cellphone/PAD - * - * @param {string} privateKey PEM encoded private key - * @param {Buffer} proposalBytes proposal bytes - */ -/*function sign(privateKey, proposalBytes, algorithm, keySize) { - const hashAlgorithm = algorithm.toUpperCase(); - const hashFunction = hash[`${hashAlgorithm}_${keySize}`]; - const ecdsaCurve = elliptic.curves[`p${keySize}`]; - const ecdsa = new EC(ecdsaCurve); - const key = KEYUTIL.getKey(privateKey); - - const signKey = ecdsa.keyFromPrivate(key.prvKeyHex, 'hex'); - const digest = hashFunction(proposalBytes); - - let sig = ecdsa.sign(Buffer.from(digest, 'hex'), signKey); - sig = _preventMalleability(sig, key.ecparams); - - return Buffer.from(sig.toDER()); -} - -function signProposal(proposalBytes) { - const signature = sign(privateKeyPem, proposalBytes, 'sha2', 256); - const signedProposal = { signature, proposal_bytes: proposalBytes }; - return signedProposal; -}*/ - -/** - * Gernerate signed transaction. - * @param {object} transactionRequest The transaction requestion. - * @param {object} channel The Fabric channel. - * @return {object} The object of signed transaction - */ -function generateSignedTransaction(transactionRequest, channel) { - // fabric v1.3 - /*const commitProposal = channel.generateUnsignedTransaction(transactionRequest); - - // sign this commit proposal at local - const signedCommitProposal = signProposal(commitProposal.toBuffer()); - - const response = await channel.sendSignedTransaction({ - signedProposal: signedCommitProposal, - request: commitReq, - }); - return signedCommitProposal;*/ - // fabric v1.2v1.1v1.0 - const signedTransaction = channel.generateSignedTransaction(transactionRequest); - return signedTransaction; -} - -module.exports.generateSignedTransaction = generateSignedTransaction; diff --git a/packages/caliper-fabric/lib/util.js b/packages/caliper-fabric/lib/util.js deleted file mode 100644 index 93a943668..000000000 --- a/packages/caliper-fabric/lib/util.js +++ /dev/null @@ -1,337 +0,0 @@ -/* - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -'use strict'; - -const path = require('path'); -const fs = require('fs-extra'); -const util = require('util'); - -const Client = require('fabric-client'); -const User = require('fabric-client/lib/User.js'); - -const {CaliperUtils} = require('caliper-core'); -const Constants = require('./constant.js'); -const commLogger = CaliperUtils.getLogger('util.js'); - -let copService; -let channels = []; -let cryptodir; -let ORGS; -let networkRoot; - -module.exports.getChannel = function(name) { - for(let i in channels) { - if(channels[i].name === name) { - return channels[i]; - } - } - return null; -}; - -module.exports.getDefaultChannel = function() { - return channels[0]; -}; - -// all temporary files and directories are created under here -const tempdir = Constants.tempdir; - -module.exports.getTempDir = function() { - fs.ensureDirSync(tempdir); - return tempdir; -}; - -// directory for file based KeyValueStore -module.exports.KVS = path.join(tempdir, 'hfc-test-kvs'); -module.exports.storePathForOrg = function(org) { - return module.exports.KVS + '_' + org; -}; - -// temporarily set $GOPATH to the test fixture folder unless specified otherwise -module.exports.setupChaincodeDeploy = function() { - if (typeof process.env.OVERWRITE_GOPATH === 'undefined' || - process.env.OVERWRITE_GOPATH.toString().toUpperCase() === 'TRUE') { - process.env.GOPATH = CaliperUtils.resolvePath('.', networkRoot); - } -}; - -// specifically set the values to defaults because they may have been overridden when -// running in the overall test bucket ('gulp test') -module.exports.resetDefaults = function() { - global.hfc.config = undefined; - require('nconf').reset(); -}; - -module.exports.cleanupDir = function(keyValStorePath) { - const absPath = path.join(process.cwd(), keyValStorePath); - const exists = module.exports.existsSync(absPath); - if (exists) { - fs.removeSync(absPath); - } -}; - -module.exports.getUniqueVersion = function(prefix) { - if (!prefix) {prefix = 'v';} - return prefix + Date.now(); -}; - -// utility function to check if directory or file exists -// uses entire / absolute path from root -module.exports.existsSync = function(absolutePath /*string*/) { - try { - const stat = fs.statSync(absolutePath); - return stat.isDirectory() || stat.isFile(); - } - catch (e) { - return false; - } -}; - -/** - * Read the content of the given file. - * @param {string} path The path of the file. - * @return {Promise} The raw content of the file. - */ -function readFile(path) { - return new Promise((resolve, reject) => { - fs.readFile(path, (err, data) => { - if (err) - {reject(new Error('Failed to read file ' + path + ' due to error: ' + err));} - else - {resolve(data);} - }); - }); -} - -/** - * Read all file contents in the given directory. - * @param {string} dir The path of the directory. - * @return {object[]} The collection of raw file contents. - */ -function readAllFiles(dir) { - const files = fs.readdirSync(dir); - const certs = []; - files.forEach((file_name) => { - let file_path = path.join(dir,file_name); - let data = fs.readFileSync(file_path); - certs.push(data); - }); - return certs; -} - -module.exports.readFile = readFile; - -module.exports.init = function(config_path, root) { - const config = CaliperUtils.parseYaml(config_path); - ORGS = config.fabric.network; - channels = config.fabric.channel; - networkRoot = root; - cryptodir = CaliperUtils.resolvePath(config.fabric.cryptodir, root); - const isLegacyFabricCAClientImpl = (config.info.Version.startsWith('1.0') || config.info.Version.startsWith('1.1') || config.info.Version.startsWith('1.2')); - if(isLegacyFabricCAClientImpl){ - copService = require('fabric-ca-client/lib/FabricCAClientImpl.js'); - } else { - copService = require('fabric-ca-client/lib/FabricCAClient.js'); - } -}; - -const tlsOptions = { - trustedRoots: [], - verify: false -}; - -/** - * Retrieve an enrolled user, or enroll the user if necessary. - * @param {string} username The name of the user. - * @param {string} password The enrollment secret necessary to enroll the user. - * @param {Client} client The Fabric client object. - * @param {string} userOrg The name of the user's organization. - * @return {Promise} The retrieved and enrolled user object. - */ -async function getMember(username, password, client, userOrg) { - const caUrl = ORGS[userOrg].ca.url; - - const user = await client.getUserContext(username, true); - - try { - if (user && user.isEnrolled()) { - return user; - } - - const member = new User(username); - let cryptoSuite = client.getCryptoSuite(); - if (!cryptoSuite) { - cryptoSuite = Client.newCryptoSuite(); - if (userOrg) { - cryptoSuite.setCryptoKeyStore(Client.newCryptoKeyStore({path: module.exports.storePathForOrg(ORGS[userOrg].name)})); - client.setCryptoSuite(cryptoSuite); - } - } - member.setCryptoSuite(cryptoSuite); - - // need to enroll it with CA server - const cop = new copService(caUrl, tlsOptions, ORGS[userOrg].ca.name, cryptoSuite); - - const enrollment = await cop.enroll({enrollmentID: username, enrollmentSecret: password}); - - await member.setEnrollment(enrollment.key, enrollment.certificate, ORGS[userOrg].mspid); - - let skipPersistence = false; - if (!client.getStateStore()) { - skipPersistence = true; - } - await client.setUserContext(member, skipPersistence); - return member; - } catch (err) { - commLogger.error(`Failed to enroll and persist user: ${(err.stack ? err.stack : err)}`); - throw err; - } -} - -/** - * Retrieve the admin identity for the given organization. - * @param {Client} client The Fabric client object. - * @param {string} userOrg The name of the user's organization. - * @return {User} The admin user identity. - */ -async function getAdmin(client, userOrg) { - try { - if(!ORGS.hasOwnProperty(userOrg)) { - throw new Error('Could not found ' + userOrg + ' in configuration'); - } - const org = ORGS[userOrg]; - let keyPEM, certPEM; - if(org.user) { - keyPEM = fs.readFileSync(CaliperUtils.resolvePath(org.user.key)); - certPEM = fs.readFileSync(CaliperUtils.resolvePath(org.user.cert)); - } - else { - let domain = org.domain ? org.domain : (userOrg + '.example.com'); - // crypto-dir is already an absolute path - let basePath = path.join(cryptodir, 'peerOrganizations', domain, 'users', util.format('Admin@%s', domain)); - - let keyPath = path.join(basePath, 'keystore'); - if(!fs.existsSync(keyPath)) { - keyPath = path.join(basePath, 'msp', 'keystore'); - } - keyPEM = readAllFiles(keyPath)[0]; - - let certPath = path.join(basePath, 'signcerts'); - if(!fs.existsSync(certPath)) { - certPath = path.join(basePath, 'msp', 'signcerts'); - } - certPEM = readAllFiles(certPath)[0]; - } - - const cryptoSuite = Client.newCryptoSuite(); - cryptoSuite.setCryptoKeyStore(Client.newCryptoKeyStore({path: module.exports.storePathForOrg(ORGS[userOrg].name)})); - client.setCryptoSuite(cryptoSuite); - - return await client.createUser({ - username: 'peer'+userOrg+'Admin', - mspid: org.mspid, - cryptoContent: { - privateKeyPEM: keyPEM.toString(), - signedCertPEM: certPEM.toString() - } - }); - } - catch(err) { - commLogger.error(`Couldn't retrieve admin of ${userOrg}: ${err.stack ? err.stack : err}`); - throw err; - } -} - -/** - * Retrieve the admin identity of the orderer service organization. - * @param {Client} client The Fabric client object. - * @return {User} The retrieved orderer admin identity. - */ -async function getOrdererAdmin(client) { - try { - if(!ORGS.orderer) { - throw new Error('Could not found orderer in configuration'); - } - - const orderer = ORGS.orderer; - let keyPEM, certPEM; - if(orderer.user) { - keyPEM = fs.readFileSync(CaliperUtils.resolvePath(orderer.user.key)); - certPEM = fs.readFileSync(CaliperUtils.resolvePath(orderer.user.cert)); - } - else { - let domain = orderer.domain ? orderer.domain : 'example.com'; - // crypto-dir is already an absolute path - let basePath = path.join(cryptodir, 'ordererOrganizations', domain, 'users', util.format('Admin@%s', domain)); - - let keyPath = path.join(basePath, 'keystore'); - if(!fs.existsSync(keyPath)) { - keyPath = path.join(basePath, 'msp', 'keystore'); - } - keyPEM = readAllFiles(keyPath)[0]; - let certPath = path.join(basePath, 'signcerts'); - if(!fs.existsSync(certPath)) { - certPath = path.join(basePath, 'msp', 'signcerts'); - } - certPEM = readAllFiles(certPath)[0]; - } - - return await client.createUser({ - username: 'ordererAdmin', - mspid: orderer.mspid, - cryptoContent: { - privateKeyPEM: keyPEM.toString(), - signedCertPEM: certPEM.toString() - } - }); - } - catch(err) { - commLogger.error(`Couldn't retrieve admin of orderer org: ${err.stack ? err.stack : err}`); - throw err; - } -} - - - -module.exports.getOrderAdminSubmitter = function(client) { - return getOrdererAdmin(client); -}; - -module.exports.getSubmitter = async function(client, peerOrgAdmin, org) { - if (arguments.length < 2) {throw new Error('"client" and "test" are both required parameters');} - - let peerAdmin, userOrg; - if (typeof peerOrgAdmin === 'boolean') { - peerAdmin = peerOrgAdmin; - } else { - peerAdmin = false; - } - - // if the 3rd argument was skipped - if (typeof peerOrgAdmin === 'string') { - userOrg = peerOrgAdmin; - } else { - if (typeof org === 'string') { - userOrg = org; - } else { - userOrg = 'org1'; - } - } - - if (peerAdmin) { - return await getAdmin(client, userOrg); - } else { - return await getMember('admin', 'adminpw', client, userOrg); - } -}; diff --git a/packages/caliper-fabric/package.json b/packages/caliper-fabric/package.json deleted file mode 100644 index 38dfbbb64..000000000 --- a/packages/caliper-fabric/package.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "name": "caliper-fabric", - "version": "0.1.0", - "repository": { - "type": "git", - "url": "https://github.com/hyperledger/caliper" - }, - "scripts": { - "test": "npm run lint", - "lint": "npx eslint .", - "nyc": "nyc mocha --recursive -t 10000", - "fabric-v1.0-deps": "npm install --no-save grpc@1.10.1 fabric-ca-client@1.1.0 fabric-client@1.1.0", - "fabric-v1.1-deps": "npm install --no-save grpc@1.10.1 fabric-ca-client@1.1.0 fabric-client@1.1.0", - "fabric-v1.2-deps": "npm install --no-save fabric-ca-client@1.2.0 fabric-client@1.2.0 fabric-network@1.4.0", - "fabric-v1.3-deps": "npm install --no-save fabric-ca-client@1.3.0 fabric-client@1.3.0 fabric-network@1.4.0", - "fabric-v1.4-deps": "npm install --no-save fabric-ca-client@1.4.0 fabric-client@1.4.0 fabric-network@1.4.0" - }, - "engineStrict": true, - "engines": { - "node": ">=8.10.0", - "npm": ">=5.6.0" - }, - "dependencies": { - "caliper-core" : "0.1.0", - "fabric-protos": "2.0.0-snapshot.1", - "fs-extra": "^8.0.1", - "nconf": "^0.10.0" - }, - "devDependencies": { - "chai": "^3.5.0", - "eslint": "^4.19.1", - "mocha": "3.4.2", - "nyc": "11.1.0", - "rewire": "^4.0.0", - "sinon": "2.3.8" - }, - "nyc": { - "exclude": [ - "lib/**" - ], - "reporter": [ - "text-summary", - "html" - ], - "all": true, - "check-coverage": false, - "statements": 5, - "branches": 8, - "functions": 7, - "lines": 5 - }, - "license": "Apache-2.0", - "licenses": [ - { - "type": "Apache-2.0", - "url": "https://github.com/hyperledger/caliper/blob/master/LICENSE" - } - ] -} diff --git a/packages/caliper-samples/benchmark/simple/config-file.yaml b/packages/caliper-samples/benchmark/simple/config-file.yaml deleted file mode 100644 index c1132bd17..000000000 --- a/packages/caliper-samples/benchmark/simple/config-file.yaml +++ /dev/null @@ -1,33 +0,0 @@ ---- -test: - name: simple - description: This is an example benchmark for caliper, to test the backend DLT's - performance with simple account opening & querying transactions - clients: - type: local - number: 4 - rounds: - - label: open - txMode: - type: file-write - txNumber: - - 4000 - rateControl: - - type: fixed-rate - opts: - tps: 4000 - arguments: - money: 10000 - callback: benchmark/simple/open.js -monitor: - type: - - docker - - process - docker: - name: - - all - process: - - command: node - arguments: local-client.js - multiOutput: avg - interval: 1 diff --git a/packages/caliper-samples/network/fabric-v1.0/2org1peercouchdb/README.md b/packages/caliper-samples/network/fabric-v1.0/2org1peercouchdb/README.md index e8c13166e..35afe100f 100755 --- a/packages/caliper-samples/network/fabric-v1.0/2org1peercouchdb/README.md +++ b/packages/caliper-samples/network/fabric-v1.0/2org1peercouchdb/README.md @@ -21,8 +21,8 @@ The configuration files names (with or without the `-tls` part) indicate which n The following network configuration files are available for the different platforms, containing the listed chaincodes that will be deployed (installed and instantiated). ### Fabric -* `fabric(-ccp)-go(-tls)` (__golang__ implementations) +* `fabric-ccp-go(-tls)` (__golang__ implementations) * `marbles` __without__ CouchDB index metadata and rich query support. * `drm` * `simple` - * `smallbank` \ No newline at end of file + * `smallbank` diff --git a/packages/caliper-samples/network/fabric-v1.0/2org1peercouchdb/fabric-go-tls.json b/packages/caliper-samples/network/fabric-v1.0/2org1peercouchdb/fabric-go-tls.json deleted file mode 100644 index 0f2324d19..000000000 --- a/packages/caliper-samples/network/fabric-v1.0/2org1peercouchdb/fabric-go-tls.json +++ /dev/null @@ -1,101 +0,0 @@ -{ - "caliper": { - "blockchain": "fabric", - "command" : { - "start": "docker-compose -f network/fabric-v1.0/2org1peercouchdb/docker-compose-tls.yaml up -d;sleep 3s", - "end" : "docker-compose -f network/fabric-v1.0/2org1peercouchdb/docker-compose-tls.yaml down;(test -z \"$(docker ps -aq)\") || docker rm $(docker ps -aq);(test -z \"$(docker images dev* -q)\") || docker rmi $(docker images dev* -q)" - } - }, - "fabric": { - "cryptodir": "network/fabric-v1.0/config/crypto-config", - "network": { - "orderer": { - "url": "grpcs://localhost:7050", - "mspid": "OrdererMSP", - "msp": "network/fabric-v1.0/config/crypto-config/ordererOrganizations/example.com/msp/", - "server-hostname": "orderer.example.com", - "tls_cacerts": "network/fabric-v1.0/config/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/ca.crt" - }, - "org1": { - "name": "peerOrg1", - "mspid": "Org1MSP", - "msp": "network/fabric-v1.0/config/crypto-config/peerOrganizations/org1.example.com/msp/", - "ca": { - "url": "https://localhost:7054", - "name": "ca.org1.example.com" - }, - "peer1": { - "requests": "grpcs://localhost:7051", - "events": "grpcs://localhost:7053", - "server-hostname": "peer0.org1.example.com", - "tls_cacerts": "network/fabric-v1.0/config/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt" - } - }, - "org2": { - "name": "peerOrg2", - "mspid": "Org2MSP", - "msp": "network/fabric-v1.0/config/crypto-config/peerOrganizations/org2.example.com/msp/", - "ca": { - "url": "https://localhost:8054", - "name": "ca.org2.example.com" - }, - "peer1": { - "requests": "grpcs://localhost:8051", - "events": "grpcs://localhost:8053", - "server-hostname": "peer0.org2.example.com", - "tls_cacerts": "network/fabric-v1.0/config/crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt" - } - } - }, - "channel": [ - { - "name": "mychannel", - "deployed": false, - "config": "network/fabric-v1.0/config/mychannel.tx", - "organizations": ["org1", "org2"] - } - ], - "chaincodes": [ - {"id": "drm", "path": "contract/fabric/drm", "language":"golang", "version": "v0", "channel": "mychannel"}, - {"id": "marbles", "path": "contract/fabric/marbles-norichquery/go", "language":"golang", "version": "v1", "channel": "mychannel"}, - {"id": "simple", "path": "contract/fabric/simple/go", "language":"golang", "version": "v0", "channel": "mychannel"}, - {"id": "smallbank", "path": "contract/fabric/smallbank", "language":"golang", "version": "v0", "channel": "mychannel"} - ], - "endorsement-policy": { - "identities": [ - { - "role": { - "name": "member", - "mspId": "Org1MSP" - } - }, - { - "role": { - "name": "member", - "mspId": "Org2MSP" - } - }, - { - "role": { - "name": "admin", - "mspId": "Org1MSP" - } - } - ], - "policy": { "2-of": [{"signed-by": 0}, {"signed-by": 1}]} - }, - "context": { - "smallOperations": "mychannel", - "init": "mychannel", - "open": "mychannel", - "publish": "mychannel", - "query": "mychannel" - } - }, - "info" : { - "Version": "1.0.0", - "Size": "2 Orgs with 1 Peer", - "Orderer": "Solo", - "Distribution": "Single Host" - } -} \ No newline at end of file diff --git a/packages/caliper-samples/network/fabric-v1.0/2org1peercouchdb/fabric-go.json b/packages/caliper-samples/network/fabric-v1.0/2org1peercouchdb/fabric-go.json deleted file mode 100644 index bd26c6cd5..000000000 --- a/packages/caliper-samples/network/fabric-v1.0/2org1peercouchdb/fabric-go.json +++ /dev/null @@ -1,101 +0,0 @@ -{ - "caliper": { - "blockchain": "fabric", - "command" : { - "start": "docker-compose -f network/fabric-v1.0/2org1peercouchdb/docker-compose.yaml up -d;sleep 3s", - "end" : "docker-compose -f network/fabric-v1.0/2org1peercouchdb/docker-compose.yaml down;(test -z \"$(docker ps -aq)\") || docker rm $(docker ps -aq);(test -z \"$(docker images dev* -q)\") || docker rmi $(docker images dev* -q)" - } - }, - "fabric": { - "cryptodir": "network/fabric-v1.0/config/crypto-config", - "network": { - "orderer": { - "url": "grpc://localhost:7050", - "mspid": "OrdererMSP", - "msp": "network/fabric-v1.0/config/crypto-config/ordererOrganizations/example.com/msp/", - "server-hostname": "orderer.example.com", - "tls_cacerts": "network/fabric-v1.0/config/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/ca.crt" - }, - "org1": { - "name": "peerOrg1", - "mspid": "Org1MSP", - "msp": "network/fabric-v1.0/config/crypto-config/peerOrganizations/org1.example.com/msp/", - "ca": { - "url": "http://localhost:7054", - "name": "ca.org1.example.com" - }, - "peer1": { - "requests": "grpc://localhost:7051", - "events": "grpc://localhost:7053", - "server-hostname": "peer0.org1.example.com", - "tls_cacerts": "network/fabric-v1.0/config/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt" - } - }, - "org2": { - "name": "peerOrg2", - "mspid": "Org2MSP", - "msp": "network/fabric-v1.0/config/crypto-config/peerOrganizations/org2.example.com/msp/", - "ca": { - "url": "http://localhost:8054", - "name": "ca.org2.example.com" - }, - "peer1": { - "requests": "grpc://localhost:8051", - "events": "grpc://localhost:8053", - "server-hostname": "peer0.org2.example.com", - "tls_cacerts": "network/fabric-v1.0/config/crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt" - } - } - }, - "channel": [ - { - "name": "mychannel", - "deployed": false, - "config": "network/fabric-v1.0/config/mychannel.tx", - "organizations": ["org1", "org2"] - } - ], - "chaincodes": [ - {"id": "drm", "path": "contract/fabric/drm", "language":"golang", "version": "v0", "channel": "mychannel"}, - {"id": "marbles", "path": "contract/fabric/marbles-norichquery/go", "language":"golang", "version": "v1", "channel": "mychannel"}, - {"id": "simple", "path": "contract/fabric/simple/go", "language":"golang", "version": "v0", "channel": "mychannel"}, - {"id": "smallbank", "path": "contract/fabric/smallbank", "language":"golang", "version": "v0", "channel": "mychannel"} - ], - "endorsement-policy": { - "identities": [ - { - "role": { - "name": "member", - "mspId": "Org1MSP" - } - }, - { - "role": { - "name": "member", - "mspId": "Org2MSP" - } - }, - { - "role": { - "name": "admin", - "mspId": "Org1MSP" - } - } - ], - "policy": { "2-of": [{"signed-by": 0}, {"signed-by": 1}]} - }, - "context": { - "smallOperations": "mychannel", - "init": "mychannel", - "open": "mychannel", - "publish": "mychannel", - "query": "mychannel" - } - }, - "info" : { - "Version": "1.0.0", - "Size": "2 Orgs with 1 Peer", - "Orderer": "Solo", - "Distribution": "Single Host" - } -} \ No newline at end of file diff --git a/packages/caliper-samples/network/fabric-v1.0/2org1peergoleveldb/README.md b/packages/caliper-samples/network/fabric-v1.0/2org1peergoleveldb/README.md index bc28a5a22..5bbc5bf21 100755 --- a/packages/caliper-samples/network/fabric-v1.0/2org1peergoleveldb/README.md +++ b/packages/caliper-samples/network/fabric-v1.0/2org1peergoleveldb/README.md @@ -21,8 +21,8 @@ The configuration files names (with or without the `(-mutual)-tls` part) indicat The following network configuration files are available for the different platforms, containing the listed chaincodes that will be deployed (installed and instantiated). ### Fabric -* `fabric(-ccp)-go(-tls)` (__golang__ implementations) +* `fabric-ccp-go(-tls)` (__golang__ implementations) * `marbles` __without__ CouchDB index metadata and rich query support. * `drm` * `simple` - * `smallbank` \ No newline at end of file + * `smallbank` diff --git a/packages/caliper-samples/network/fabric-v1.0/2org1peergoleveldb/fabric-go-tls.json b/packages/caliper-samples/network/fabric-v1.0/2org1peergoleveldb/fabric-go-tls.json deleted file mode 100644 index 8db4dce4b..000000000 --- a/packages/caliper-samples/network/fabric-v1.0/2org1peergoleveldb/fabric-go-tls.json +++ /dev/null @@ -1,101 +0,0 @@ -{ - "caliper": { - "blockchain": "fabric", - "command" : { - "start": "docker-compose -f network/fabric-v1.0/2org1peergoleveldb/docker-compose-tls.yaml up -d;sleep 3s", - "end" : "docker-compose -f network/fabric-v1.0/2org1peergoleveldb/docker-compose-tls.yaml down;(test -z \"$(docker ps -aq)\") || docker rm $(docker ps -aq);(test -z \"$(docker images dev* -q)\") || docker rmi $(docker images dev* -q)" - } - }, - "fabric": { - "cryptodir": "network/fabric-v1.0/config/crypto-config", - "network": { - "orderer": { - "url": "grpcs://localhost:7050", - "mspid": "OrdererMSP", - "msp": "network/fabric-v1.0/config/crypto-config/ordererOrganizations/example.com/msp/", - "server-hostname": "orderer.example.com", - "tls_cacerts": "network/fabric-v1.0/config/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/ca.crt" - }, - "org1": { - "name": "peerOrg1", - "mspid": "Org1MSP", - "msp": "network/fabric-v1.0/config/crypto-config/peerOrganizations/org1.example.com/msp/", - "ca": { - "url": "https://localhost:7054", - "name": "ca.org1.example.com" - }, - "peer1": { - "requests": "grpcs://localhost:7051", - "events": "grpcs://localhost:7053", - "server-hostname": "peer0.org1.example.com", - "tls_cacerts": "network/fabric-v1.0/config/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt" - } - }, - "org2": { - "name": "peerOrg2", - "mspid": "Org2MSP", - "msp": "network/fabric-v1.0/config/crypto-config/peerOrganizations/org2.example.com/msp/", - "ca": { - "url": "https://localhost:8054", - "name": "ca.org2.example.com" - }, - "peer1": { - "requests": "grpcs://localhost:8051", - "events": "grpcs://localhost:8053", - "server-hostname": "peer0.org2.example.com", - "tls_cacerts": "network/fabric-v1.0/config/crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt" - } - } - }, - "channel": [ - { - "name": "mychannel", - "deployed": false, - "config": "network/fabric-v1.0/config/mychannel.tx", - "organizations": ["org1", "org2"] - } - ], - "chaincodes": [ - {"id": "drm", "path": "contract/fabric/drm", "language":"golang", "version": "v0", "channel": "mychannel"}, - {"id": "marbles", "path": "contract/fabric/marbles-norichquery/go", "language":"golang", "version": "v1", "channel": "mychannel"}, - {"id": "simple", "path": "contract/fabric/simple/go", "language":"golang", "version": "v0", "channel": "mychannel"}, - {"id": "smallbank", "path": "contract/fabric/smallbank", "language":"golang", "version": "v0", "channel": "mychannel"} - ], - "endorsement-policy": { - "identities": [ - { - "role": { - "name": "member", - "mspId": "Org1MSP" - } - }, - { - "role": { - "name": "member", - "mspId": "Org2MSP" - } - }, - { - "role": { - "name": "admin", - "mspId": "Org1MSP" - } - } - ], - "policy": { "2-of": [{"signed-by": 0}, {"signed-by": 1}]} - }, - "context": { - "smallOperations": "mychannel", - "init": "mychannel", - "open": "mychannel", - "publish": "mychannel", - "query": "mychannel" - } - }, - "info" : { - "Version": "1.0.0", - "Size": "2 Orgs with 1 Peer", - "Orderer": "Solo", - "Distribution": "Single Host" - } -} \ No newline at end of file diff --git a/packages/caliper-samples/network/fabric-v1.0/2org1peergoleveldb/fabric-go.json b/packages/caliper-samples/network/fabric-v1.0/2org1peergoleveldb/fabric-go.json deleted file mode 100644 index 2021962bb..000000000 --- a/packages/caliper-samples/network/fabric-v1.0/2org1peergoleveldb/fabric-go.json +++ /dev/null @@ -1,101 +0,0 @@ -{ - "caliper": { - "blockchain": "fabric", - "command" : { - "start": "docker-compose -f network/fabric-v1.0/2org1peergoleveldb/docker-compose.yaml up -d;sleep 3s", - "end" : "docker-compose -f network/fabric-v1.0/2org1peergoleveldb/docker-compose.yaml down;(test -z \"$(docker ps -aq)\") || docker rm $(docker ps -aq);(test -z \"$(docker images dev* -q)\") || docker rmi $(docker images dev* -q)" - } - }, - "fabric": { - "cryptodir": "network/fabric-v1.0/config/crypto-config", - "network": { - "orderer": { - "url": "grpc://localhost:7050", - "mspid": "OrdererMSP", - "msp": "network/fabric-v1.0/config/crypto-config/ordererOrganizations/example.com/msp/", - "server-hostname": "orderer.example.com", - "tls_cacerts": "network/fabric-v1.0/config/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/ca.crt" - }, - "org1": { - "name": "peerOrg1", - "mspid": "Org1MSP", - "msp": "network/fabric-v1.0/config/crypto-config/peerOrganizations/org1.example.com/msp/", - "ca": { - "url": "http://localhost:7054", - "name": "ca.org1.example.com" - }, - "peer1": { - "requests": "grpc://localhost:7051", - "events": "grpc://localhost:7053", - "server-hostname": "peer0.org1.example.com", - "tls_cacerts": "network/fabric-v1.0/config/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt" - } - }, - "org2": { - "name": "peerOrg2", - "mspid": "Org2MSP", - "msp": "network/fabric-v1.0/config/crypto-config/peerOrganizations/org2.example.com/msp/", - "ca": { - "url": "http://localhost:8054", - "name": "ca.org2.example.com" - }, - "peer1": { - "requests": "grpc://localhost:8051", - "events": "grpc://localhost:8053", - "server-hostname": "peer0.org2.example.com", - "tls_cacerts": "network/fabric-v1.0/config/crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt" - } - } - }, - "channel": [ - { - "name": "mychannel", - "deployed": false, - "config": "network/fabric-v1.0/config/mychannel.tx", - "organizations": ["org1", "org2"] - } - ], - "chaincodes": [ - {"id": "drm", "path": "contract/fabric/drm", "language":"golang", "version": "v0", "channel": "mychannel"}, - {"id": "marbles", "path": "contract/fabric/marbles-norichquery/go", "language":"golang", "version": "v1", "channel": "mychannel"}, - {"id": "simple", "path": "contract/fabric/simple/go", "language":"golang", "version": "v0", "channel": "mychannel"}, - {"id": "smallbank", "path": "contract/fabric/smallbank", "language":"golang", "version": "v0", "channel": "mychannel"} - ], - "endorsement-policy": { - "identities": [ - { - "role": { - "name": "member", - "mspId": "Org1MSP" - } - }, - { - "role": { - "name": "member", - "mspId": "Org2MSP" - } - }, - { - "role": { - "name": "admin", - "mspId": "Org1MSP" - } - } - ], - "policy": { "2-of": [{"signed-by": 0}, {"signed-by": 1}]} - }, - "context": { - "smallOperations": "mychannel", - "init": "mychannel", - "open": "mychannel", - "publish": "mychannel", - "query": "mychannel" - } - }, - "info" : { - "Version": "1.0.0", - "Size": "2 Orgs with 1 Peer", - "Orderer": "Solo", - "Distribution": "Single Host" - } -} \ No newline at end of file diff --git a/packages/caliper-samples/network/fabric-v1.1/2org1peercouchdb/README.md b/packages/caliper-samples/network/fabric-v1.1/2org1peercouchdb/README.md index 9b4ac0ac4..1c11eb4f0 100755 --- a/packages/caliper-samples/network/fabric-v1.1/2org1peercouchdb/README.md +++ b/packages/caliper-samples/network/fabric-v1.1/2org1peercouchdb/README.md @@ -27,11 +27,11 @@ The following network configuration files are available for the different platfo * `vehicle-lifecycle-network` ### Fabric -* `fabric(-ccp)-go((-mutual)-tls)` (__golang__ implementations) +* `fabric-ccp-go((-mutual)-tls)` (__golang__ implementations) * `marbles` __with__ CouchDB index metadata and rich query support. * `drm` * `simple` * `smallbank` -* `fabric(-ccp)-node((-mutual)-tls)` (__Node.JS__ implementations) +* `fabric-ccp-node((-mutual)-tls)` (__Node.JS__ implementations) * `marbles` __with__ CouchDB index metadata and rich query support. - * `simple` \ No newline at end of file + * `simple` diff --git a/packages/caliper-samples/network/fabric-v1.1/2org1peercouchdb/fabric-go-tls.json b/packages/caliper-samples/network/fabric-v1.1/2org1peercouchdb/fabric-go-tls.json deleted file mode 100644 index fe3f9ee50..000000000 --- a/packages/caliper-samples/network/fabric-v1.1/2org1peercouchdb/fabric-go-tls.json +++ /dev/null @@ -1,101 +0,0 @@ -{ - "caliper": { - "blockchain": "fabric", - "command" : { - "start": "docker-compose -f network/fabric-v1.1/2org1peercouchdb/docker-compose-tls.yaml up -d;sleep 3s", - "end" : "docker-compose -f network/fabric-v1.1/2org1peercouchdb/docker-compose-tls.yaml down;(test -z \"$(docker ps -aq)\") || docker rm $(docker ps -aq);(test -z \"$(docker images dev* -q)\") || docker rmi $(docker images dev* -q)" - } - }, - "fabric": { - "cryptodir": "network/fabric-v1.1/config/crypto-config", - "network": { - "orderer": { - "url": "grpcs://localhost:7050", - "mspid": "OrdererMSP", - "msp": "network/fabric-v1.1/config/crypto-config/ordererOrganizations/example.com/msp/", - "server-hostname": "orderer.example.com", - "tls_cacerts": "network/fabric-v1.1/config/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/ca.crt" - }, - "org1": { - "name": "peerOrg1", - "mspid": "Org1MSP", - "msp": "network/fabric-v1.1/config/crypto-config/peerOrganizations/org1.example.com/msp/", - "ca": { - "url": "https://localhost:7054", - "name": "ca.org1.example.com" - }, - "peer1": { - "requests": "grpcs://localhost:7051", - "events": "grpcs://localhost:7053", - "server-hostname": "peer0.org1.example.com", - "tls_cacerts": "network/fabric-v1.1/config/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt" - } - }, - "org2": { - "name": "peerOrg2", - "mspid": "Org2MSP", - "msp": "network/fabric-v1.1/config/crypto-config/peerOrganizations/org2.example.com/msp/", - "ca": { - "url": "https://localhost:8054", - "name": "ca.org2.example.com" - }, - "peer1": { - "requests": "grpcs://localhost:8051", - "events": "grpcs://localhost:8053", - "server-hostname": "peer0.org2.example.com", - "tls_cacerts": "network/fabric-v1.1/config/crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt" - } - } - }, - "channel": [ - { - "name": "mychannel", - "deployed": false, - "config": "network/fabric-v1.1/config/mychannel.tx", - "organizations": ["org1", "org2"] - } - ], - "chaincodes": [ - {"id": "drm", "path": "contract/fabric/drm", "language":"golang", "version": "v0", "channel": "mychannel"}, - {"id": "marbles", "path": "contract/fabric/marbles/go", "language":"golang", "version": "v1", "channel": "mychannel", "metadataPath": "src/contract/fabric/marbles/go/metadata"}, - {"id": "simple", "path": "contract/fabric/simple/go", "language":"golang", "version": "v0", "channel": "mychannel"}, - {"id": "smallbank", "path": "contract/fabric/smallbank", "language":"golang", "version": "v0", "channel": "mychannel"} - ], - "endorsement-policy": { - "identities": [ - { - "role": { - "name": "member", - "mspId": "Org1MSP" - } - }, - { - "role": { - "name": "member", - "mspId": "Org2MSP" - } - }, - { - "role": { - "name": "admin", - "mspId": "Org1MSP" - } - } - ], - "policy": { "2-of": [{"signed-by": 0}, {"signed-by": 1}]} - }, - "context": { - "smallOperations": "mychannel", - "init": "mychannel", - "open": "mychannel", - "publish": "mychannel", - "query": "mychannel" - } - }, - "info" : { - "Version": "1.1.0", - "Size": "2 Orgs with 1 Peer", - "Orderer": "Solo", - "Distribution": "Single Host" - } -} \ No newline at end of file diff --git a/packages/caliper-samples/network/fabric-v1.1/2org1peercouchdb/fabric-go.json b/packages/caliper-samples/network/fabric-v1.1/2org1peercouchdb/fabric-go.json deleted file mode 100644 index 6d73d6816..000000000 --- a/packages/caliper-samples/network/fabric-v1.1/2org1peercouchdb/fabric-go.json +++ /dev/null @@ -1,101 +0,0 @@ -{ - "caliper": { - "blockchain": "fabric", - "command" : { - "start": "docker-compose -f network/fabric-v1.1/2org1peercouchdb/docker-compose.yaml up -d;sleep 3s", - "end" : "docker-compose -f network/fabric-v1.1/2org1peercouchdb/docker-compose.yaml down;(test -z \"$(docker ps -aq)\") || docker rm $(docker ps -aq);(test -z \"$(docker images dev* -q)\") || docker rmi $(docker images dev* -q)" - } - }, - "fabric": { - "cryptodir": "network/fabric-v1.1/config/crypto-config", - "network": { - "orderer": { - "url": "grpc://localhost:7050", - "mspid": "OrdererMSP", - "msp": "network/fabric-v1.1/config/crypto-config/ordererOrganizations/example.com/msp/", - "server-hostname": "orderer.example.com", - "tls_cacerts": "network/fabric-v1.1/config/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/ca.crt" - }, - "org1": { - "name": "peerOrg1", - "mspid": "Org1MSP", - "msp": "network/fabric-v1.1/config/crypto-config/peerOrganizations/org1.example.com/msp/", - "ca": { - "url": "http://localhost:7054", - "name": "ca.org1.example.com" - }, - "peer1": { - "requests": "grpc://localhost:7051", - "events": "grpc://localhost:7053", - "server-hostname": "peer0.org1.example.com", - "tls_cacerts": "network/fabric-v1.1/config/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt" - } - }, - "org2": { - "name": "peerOrg2", - "mspid": "Org2MSP", - "msp": "network/fabric-v1.1/config/crypto-config/peerOrganizations/org2.example.com/msp/", - "ca": { - "url": "http://localhost:8054", - "name": "ca.org2.example.com" - }, - "peer1": { - "requests": "grpc://localhost:8051", - "events": "grpc://localhost:8053", - "server-hostname": "peer0.org2.example.com", - "tls_cacerts": "network/fabric-v1.1/config/crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt" - } - } - }, - "channel": [ - { - "name": "mychannel", - "deployed": false, - "config": "network/fabric-v1.1/config/mychannel.tx", - "organizations": ["org1", "org2"] - } - ], - "chaincodes": [ - {"id": "drm", "path": "contract/fabric/drm", "language":"golang", "version": "v0", "channel": "mychannel"}, - {"id": "marbles", "path": "contract/fabric/marbles/go", "language":"golang", "version": "v1", "channel": "mychannel", "metadataPath": "src/contract/fabric/marbles/go/metadata"}, - {"id": "simple", "path": "contract/fabric/simple/go", "language":"golang", "version": "v0", "channel": "mychannel"}, - {"id": "smallbank", "path": "contract/fabric/smallbank", "language":"golang", "version": "v0", "channel": "mychannel"} - ], - "endorsement-policy": { - "identities": [ - { - "role": { - "name": "member", - "mspId": "Org1MSP" - } - }, - { - "role": { - "name": "member", - "mspId": "Org2MSP" - } - }, - { - "role": { - "name": "admin", - "mspId": "Org1MSP" - } - } - ], - "policy": { "2-of": [{"signed-by": 0}, {"signed-by": 1}]} - }, - "context": { - "smallOperations": "mychannel", - "init": "mychannel", - "open": "mychannel", - "publish": "mychannel", - "query": "mychannel" - } - }, - "info" : { - "Version": "1.1.0", - "Size": "2 Orgs with 1 Peer", - "Orderer": "Solo", - "Distribution": "Single Host" - } -} \ No newline at end of file diff --git a/packages/caliper-samples/network/fabric-v1.1/2org1peercouchdb/fabric-node-tls.json b/packages/caliper-samples/network/fabric-v1.1/2org1peercouchdb/fabric-node-tls.json deleted file mode 100644 index e75f916b5..000000000 --- a/packages/caliper-samples/network/fabric-v1.1/2org1peercouchdb/fabric-node-tls.json +++ /dev/null @@ -1,97 +0,0 @@ -{ - "caliper": { - "blockchain": "fabric", - "command" : { - "start": "docker-compose -f network/fabric-v1.1/2org1peercouchdb/docker-compose-tls.yaml up -d;sleep 3s", - "end" : "docker-compose -f network/fabric-v1.1/2org1peercouchdb/docker-compose-tls.yaml down;(test -z \"$(docker ps -aq)\") || docker rm $(docker ps -aq);(test -z \"$(docker images dev* -q)\") || docker rmi $(docker images dev* -q)" - } - }, - "fabric": { - "cryptodir": "network/fabric-v1.1/config/crypto-config", - "network": { - "orderer": { - "url": "grpcs://localhost:7050", - "mspid": "OrdererMSP", - "msp": "network/fabric-v1.1/config/crypto-config/ordererOrganizations/example.com/msp/", - "server-hostname": "orderer.example.com", - "tls_cacerts": "network/fabric-v1.1/config/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/ca.crt" - }, - "org1": { - "name": "peerOrg1", - "mspid": "Org1MSP", - "msp": "network/fabric-v1.1/config/crypto-config/peerOrganizations/org1.example.com/msp/", - "ca": { - "url": "https://localhost:7054", - "name": "ca.org1.example.com" - }, - "peer1": { - "requests": "grpcs://localhost:7051", - "events": "grpcs://localhost:7053", - "server-hostname": "peer0.org1.example.com", - "tls_cacerts": "network/fabric-v1.1/config/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt" - } - }, - "org2": { - "name": "peerOrg2", - "mspid": "Org2MSP", - "msp": "network/fabric-v1.1/config/crypto-config/peerOrganizations/org2.example.com/msp/", - "ca": { - "url": "https://localhost:8054", - "name": "ca.org2.example.com" - }, - "peer1": { - "requests": "grpcs://localhost:8051", - "events": "grpcs://localhost:8053", - "server-hostname": "peer0.org2.example.com", - "tls_cacerts": "network/fabric-v1.1/config/crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt" - } - } - }, - "channel": [ - { - "name": "mychannel", - "deployed": false, - "config": "network/fabric-v1.1/config/mychannel.tx", - "organizations": ["org1", "org2"] - } - ], - "chaincodes": [ - {"id": "marbles", "path": "src/contract/fabric/marbles/node", "language":"node", "version": "v1", "channel": "mychannel", "metadataPath": "src/contract/fabric/marbles/node/metadata"}, - {"id": "simple", "path": "src/contract/fabric/simple/node", "language":"node", "version": "v0", "channel": "mychannel"} - ], - "endorsement-policy": { - "identities": [ - { - "role": { - "name": "member", - "mspId": "Org1MSP" - } - }, - { - "role": { - "name": "member", - "mspId": "Org2MSP" - } - }, - { - "role": { - "name": "admin", - "mspId": "Org1MSP" - } - } - ], - "policy": { "2-of": [{"signed-by": 0}, {"signed-by": 1}]} - }, - "context": { - "init": "mychannel", - "open": "mychannel", - "query": "mychannel" - } - }, - "info" : { - "Version": "1.1.0", - "Size": "2 Orgs with 1 Peer", - "Orderer": "Solo", - "Distribution": "Single Host" - } -} \ No newline at end of file diff --git a/packages/caliper-samples/network/fabric-v1.1/2org1peercouchdb/fabric-node.json b/packages/caliper-samples/network/fabric-v1.1/2org1peercouchdb/fabric-node.json deleted file mode 100644 index 588b45836..000000000 --- a/packages/caliper-samples/network/fabric-v1.1/2org1peercouchdb/fabric-node.json +++ /dev/null @@ -1,97 +0,0 @@ -{ - "caliper": { - "blockchain": "fabric", - "command" : { - "start": "docker-compose -f network/fabric-v1.1/2org1peercouchdb/docker-compose.yaml up -d;sleep 3s", - "end" : "docker-compose -f network/fabric-v1.1/2org1peercouchdb/docker-compose.yaml down;(test -z \"$(docker ps -aq)\") || docker rm $(docker ps -aq);(test -z \"$(docker images dev* -q)\") || docker rmi $(docker images dev* -q)" - } - }, - "fabric": { - "cryptodir": "network/fabric-v1.1/config/crypto-config", - "network": { - "orderer": { - "url": "grpc://localhost:7050", - "mspid": "OrdererMSP", - "msp": "network/fabric-v1.1/config/crypto-config/ordererOrganizations/example.com/msp/", - "server-hostname": "orderer.example.com", - "tls_cacerts": "network/fabric-v1.1/config/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/ca.crt" - }, - "org1": { - "name": "peerOrg1", - "mspid": "Org1MSP", - "msp": "network/fabric-v1.1/config/crypto-config/peerOrganizations/org1.example.com/msp/", - "ca": { - "url": "http://localhost:7054", - "name": "ca.org1.example.com" - }, - "peer1": { - "requests": "grpc://localhost:7051", - "events": "grpc://localhost:7053", - "server-hostname": "peer0.org1.example.com", - "tls_cacerts": "network/fabric-v1.1/config/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt" - } - }, - "org2": { - "name": "peerOrg2", - "mspid": "Org2MSP", - "msp": "network/fabric-v1.1/config/crypto-config/peerOrganizations/org2.example.com/msp/", - "ca": { - "url": "http://localhost:8054", - "name": "ca.org2.example.com" - }, - "peer1": { - "requests": "grpc://localhost:8051", - "events": "grpc://localhost:8053", - "server-hostname": "peer0.org2.example.com", - "tls_cacerts": "network/fabric-v1.1/config/crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt" - } - } - }, - "channel": [ - { - "name": "mychannel", - "deployed": false, - "config": "network/fabric-v1.1/config/mychannel.tx", - "organizations": ["org1", "org2"] - } - ], - "chaincodes": [ - {"id": "marbles", "path": "src/contract/fabric/marbles/node", "language":"node", "version": "v1", "channel": "mychannel", "metadataPath": "src/contract/fabric/marbles/node/metadata"}, - {"id": "simple", "path": "src/contract/fabric/simple/node", "language":"node", "version": "v0", "channel": "mychannel"} - ], - "endorsement-policy": { - "identities": [ - { - "role": { - "name": "member", - "mspId": "Org1MSP" - } - }, - { - "role": { - "name": "member", - "mspId": "Org2MSP" - } - }, - { - "role": { - "name": "admin", - "mspId": "Org1MSP" - } - } - ], - "policy": { "2-of": [{"signed-by": 0}, {"signed-by": 1}]} - }, - "context": { - "init": "mychannel", - "open": "mychannel", - "query": "mychannel" - } - }, - "info" : { - "Version": "1.1.0", - "Size": "2 Orgs with 1 Peer", - "Orderer": "Solo", - "Distribution": "Single Host" - } -} \ No newline at end of file diff --git a/packages/caliper-samples/network/fabric-v1.1/2org1peergoleveldb/README.md b/packages/caliper-samples/network/fabric-v1.1/2org1peergoleveldb/README.md index 7659e4d85..d7029f335 100755 --- a/packages/caliper-samples/network/fabric-v1.1/2org1peergoleveldb/README.md +++ b/packages/caliper-samples/network/fabric-v1.1/2org1peergoleveldb/README.md @@ -27,11 +27,11 @@ The following network configuration files are available for the different platfo * `vehicle-lifecycle-network` ### Fabric -* `fabric(-ccp)-go((-mutual)-tls)` (__golang__ implementations) +* `fabric-ccp-go((-mutual)-tls)` (__golang__ implementations) * `marbles` __with__ CouchDB index metadata and rich query support. * `drm` * `simple` * `smallbank` -* `fabric(-ccp)-node((-mutual)-tls)` (__Node.JS__ implementations) +* `fabric-ccp-node((-mutual)-tls)` (__Node.JS__ implementations) * `marbles` __with__ CouchDB index metadata and rich query support. - * `simple` \ No newline at end of file + * `simple` diff --git a/packages/caliper-samples/network/fabric-v1.1/2org1peergoleveldb/fabric-go-tls.json b/packages/caliper-samples/network/fabric-v1.1/2org1peergoleveldb/fabric-go-tls.json deleted file mode 100644 index df6668afc..000000000 --- a/packages/caliper-samples/network/fabric-v1.1/2org1peergoleveldb/fabric-go-tls.json +++ /dev/null @@ -1,101 +0,0 @@ -{ - "caliper": { - "blockchain": "fabric", - "command" : { - "start": "docker-compose -f network/fabric-v1.1/2org1peergoleveldb/docker-compose-tls.yaml up -d;sleep 3s", - "end" : "docker-compose -f network/fabric-v1.1/2org1peergoleveldb/docker-compose-tls.yaml down;(test -z \"$(docker ps -aq)\") || docker rm $(docker ps -aq);(test -z \"$(docker images dev* -q)\") || docker rmi $(docker images dev* -q)" - } - }, - "fabric": { - "cryptodir": "network/fabric-v1.1/config/crypto-config", - "network": { - "orderer": { - "url": "grpcs://localhost:7050", - "mspid": "OrdererMSP", - "msp": "network/fabric-v1.1/config/crypto-config/ordererOrganizations/example.com/msp/", - "server-hostname": "orderer.example.com", - "tls_cacerts": "network/fabric-v1.1/config/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/ca.crt" - }, - "org1": { - "name": "peerOrg1", - "mspid": "Org1MSP", - "msp": "network/fabric-v1.1/config/crypto-config/peerOrganizations/org1.example.com/msp/", - "ca": { - "url": "https://localhost:7054", - "name": "ca.org1.example.com" - }, - "peer1": { - "requests": "grpcs://localhost:7051", - "events": "grpcs://localhost:7053", - "server-hostname": "peer0.org1.example.com", - "tls_cacerts": "network/fabric-v1.1/config/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt" - } - }, - "org2": { - "name": "peerOrg2", - "mspid": "Org2MSP", - "msp": "network/fabric-v1.1/config/crypto-config/peerOrganizations/org2.example.com/msp/", - "ca": { - "url": "https://localhost:8054", - "name": "ca.org2.example.com" - }, - "peer1": { - "requests": "grpcs://localhost:8051", - "events": "grpcs://localhost:8053", - "server-hostname": "peer0.org2.example.com", - "tls_cacerts": "network/fabric-v1.1/config/crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt" - } - } - }, - "channel": [ - { - "name": "mychannel", - "deployed": false, - "config": "network/fabric-v1.1/config/mychannel.tx", - "organizations": ["org1", "org2"] - } - ], - "chaincodes": [ - {"id": "drm", "path": "contract/fabric/drm", "language":"golang", "version": "v0", "channel": "mychannel"}, - {"id": "marbles", "path": "contract/fabric/marbles-norichquery/go", "language":"golang", "version": "v1", "channel": "mychannel"}, - {"id": "simple", "path": "contract/fabric/simple/go", "language":"golang", "version": "v0", "channel": "mychannel"}, - {"id": "smallbank", "path": "contract/fabric/smallbank", "language":"golang", "version": "v0", "channel": "mychannel"} - ], - "endorsement-policy": { - "identities": [ - { - "role": { - "name": "member", - "mspId": "Org1MSP" - } - }, - { - "role": { - "name": "member", - "mspId": "Org2MSP" - } - }, - { - "role": { - "name": "admin", - "mspId": "Org1MSP" - } - } - ], - "policy": { "2-of": [{"signed-by": 0}, {"signed-by": 1}]} - }, - "context": { - "smallOperations": "mychannel", - "init": "mychannel", - "open": "mychannel", - "publish": "mychannel", - "query": "mychannel" - } - }, - "info" : { - "Version": "1.1.0", - "Size": "2 Orgs with 1 Peer", - "Orderer": "Solo", - "Distribution": "Single Host" - } -} \ No newline at end of file diff --git a/packages/caliper-samples/network/fabric-v1.1/2org1peergoleveldb/fabric-go.json b/packages/caliper-samples/network/fabric-v1.1/2org1peergoleveldb/fabric-go.json deleted file mode 100644 index 54227b303..000000000 --- a/packages/caliper-samples/network/fabric-v1.1/2org1peergoleveldb/fabric-go.json +++ /dev/null @@ -1,101 +0,0 @@ -{ - "caliper": { - "blockchain": "fabric", - "command" : { - "start": "docker-compose -f network/fabric-v1.1/2org1peergoleveldb/docker-compose.yaml up -d;sleep 3s", - "end" : "docker-compose -f network/fabric-v1.1/2org1peergoleveldb/docker-compose.yaml down;(test -z \"$(docker ps -aq)\") || docker rm $(docker ps -aq);(test -z \"$(docker images dev* -q)\") || docker rmi $(docker images dev* -q)" - } - }, - "fabric": { - "cryptodir": "network/fabric-v1.1/config/crypto-config", - "network": { - "orderer": { - "url": "grpc://localhost:7050", - "mspid": "OrdererMSP", - "msp": "network/fabric-v1.1/config/crypto-config/ordererOrganizations/example.com/msp/", - "server-hostname": "orderer.example.com", - "tls_cacerts": "network/fabric-v1.1/config/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/ca.crt" - }, - "org1": { - "name": "peerOrg1", - "mspid": "Org1MSP", - "msp": "network/fabric-v1.1/config/crypto-config/peerOrganizations/org1.example.com/msp/", - "ca": { - "url": "http://localhost:7054", - "name": "ca.org1.example.com" - }, - "peer1": { - "requests": "grpc://localhost:7051", - "events": "grpc://localhost:7053", - "server-hostname": "peer0.org1.example.com", - "tls_cacerts": "network/fabric-v1.1/config/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt" - } - }, - "org2": { - "name": "peerOrg2", - "mspid": "Org2MSP", - "msp": "network/fabric-v1.1/config/crypto-config/peerOrganizations/org2.example.com/msp/", - "ca": { - "url": "http://localhost:8054", - "name": "ca.org2.example.com" - }, - "peer1": { - "requests": "grpc://localhost:8051", - "events": "grpc://localhost:8053", - "server-hostname": "peer0.org2.example.com", - "tls_cacerts": "network/fabric-v1.1/config/crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt" - } - } - }, - "channel": [ - { - "name": "mychannel", - "deployed": false, - "config": "network/fabric-v1.1/config/mychannel.tx", - "organizations": ["org1", "org2"] - } - ], - "chaincodes": [ - {"id": "drm", "path": "contract/fabric/drm", "language":"golang", "version": "v0", "channel": "mychannel"}, - {"id": "marbles", "path": "contract/fabric/marbles-norichquery/go", "language":"golang", "version": "v1", "channel": "mychannel"}, - {"id": "simple", "path": "contract/fabric/simple/go", "language":"golang", "version": "v0", "channel": "mychannel"}, - {"id": "smallbank", "path": "contract/fabric/smallbank", "language":"golang", "version": "v0", "channel": "mychannel"} - ], - "endorsement-policy": { - "identities": [ - { - "role": { - "name": "member", - "mspId": "Org1MSP" - } - }, - { - "role": { - "name": "member", - "mspId": "Org2MSP" - } - }, - { - "role": { - "name": "admin", - "mspId": "Org1MSP" - } - } - ], - "policy": { "2-of": [{"signed-by": 0}, {"signed-by": 1}]} - }, - "context": { - "smallOperations": "mychannel", - "init": "mychannel", - "open": "mychannel", - "publish": "mychannel", - "query": "mychannel" - } - }, - "info" : { - "Version": "1.1.0", - "Size": "2 Orgs with 1 Peer", - "Orderer": "Solo", - "Distribution": "Single Host" - } -} diff --git a/packages/caliper-samples/network/fabric-v1.1/2org1peergoleveldb/fabric-node-tls.json b/packages/caliper-samples/network/fabric-v1.1/2org1peergoleveldb/fabric-node-tls.json deleted file mode 100644 index f16814e0f..000000000 --- a/packages/caliper-samples/network/fabric-v1.1/2org1peergoleveldb/fabric-node-tls.json +++ /dev/null @@ -1,97 +0,0 @@ -{ - "caliper": { - "blockchain": "fabric", - "command" : { - "start": "docker-compose -f network/fabric-v1.1/2org1peergoleveldb/docker-compose-tls.yaml up -d;sleep 3s", - "end" : "docker-compose -f network/fabric-v1.1/2org1peergoleveldb/docker-compose-tls.yaml down;(test -z \"$(docker ps -aq)\") || docker rm $(docker ps -aq);(test -z \"$(docker images dev* -q)\") || docker rmi $(docker images dev* -q)" - } - }, - "fabric": { - "cryptodir": "network/fabric-v1.1/config/crypto-config", - "network": { - "orderer": { - "url": "grpcs://localhost:7050", - "mspid": "OrdererMSP", - "msp": "network/fabric-v1.1/config/crypto-config/ordererOrganizations/example.com/msp/", - "server-hostname": "orderer.example.com", - "tls_cacerts": "network/fabric-v1.1/config/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/ca.crt" - }, - "org1": { - "name": "peerOrg1", - "mspid": "Org1MSP", - "msp": "network/fabric-v1.1/config/crypto-config/peerOrganizations/org1.example.com/msp/", - "ca": { - "url": "https://localhost:7054", - "name": "ca.org1.example.com" - }, - "peer1": { - "requests": "grpcs://localhost:7051", - "events": "grpcs://localhost:7053", - "server-hostname": "peer0.org1.example.com", - "tls_cacerts": "network/fabric-v1.1/config/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt" - } - }, - "org2": { - "name": "peerOrg2", - "mspid": "Org2MSP", - "msp": "network/fabric-v1.1/config/crypto-config/peerOrganizations/org2.example.com/msp/", - "ca": { - "url": "https://localhost:8054", - "name": "ca.org2.example.com" - }, - "peer1": { - "requests": "grpcs://localhost:8051", - "events": "grpcs://localhost:8053", - "server-hostname": "peer0.org2.example.com", - "tls_cacerts": "network/fabric-v1.1/config/crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt" - } - } - }, - "channel": [ - { - "name": "mychannel", - "deployed": false, - "config": "network/fabric-v1.1/config/mychannel.tx", - "organizations": ["org1", "org2"] - } - ], - "chaincodes": [ - {"id": "marbles", "path": "src/contract/fabric/marbles-norichquery/node", "language":"node", "version": "v1", "channel": "mychannel"}, - {"id": "simple", "path": "src/contract/fabric/simple/node", "language":"node", "version": "v0", "channel": "mychannel"} - ], - "endorsement-policy": { - "identities": [ - { - "role": { - "name": "member", - "mspId": "Org1MSP" - } - }, - { - "role": { - "name": "member", - "mspId": "Org2MSP" - } - }, - { - "role": { - "name": "admin", - "mspId": "Org1MSP" - } - } - ], - "policy": { "2-of": [{"signed-by": 0}, {"signed-by": 1}]} - }, - "context": { - "init": "mychannel", - "open": "mychannel", - "query": "mychannel" - } - }, - "info" : { - "Version": "1.1.0", - "Size": "2 Orgs with 1 Peer", - "Orderer": "Solo", - "Distribution": "Single Host" - } -} \ No newline at end of file diff --git a/packages/caliper-samples/network/fabric-v1.1/2org1peergoleveldb/fabric-node.json b/packages/caliper-samples/network/fabric-v1.1/2org1peergoleveldb/fabric-node.json deleted file mode 100644 index 2ca60eb21..000000000 --- a/packages/caliper-samples/network/fabric-v1.1/2org1peergoleveldb/fabric-node.json +++ /dev/null @@ -1,97 +0,0 @@ -{ - "caliper": { - "blockchain": "fabric", - "command" : { - "start": "docker-compose -f network/fabric-v1.1/2org1peergoleveldb/docker-compose.yaml up -d;sleep 3s", - "end" : "docker-compose -f network/fabric-v1.1/2org1peergoleveldb/docker-compose.yaml down;(test -z \"$(docker ps -aq)\") || docker rm $(docker ps -aq);(test -z \"$(docker images dev* -q)\") || docker rmi $(docker images dev* -q)" - } - }, - "fabric": { - "cryptodir": "network/fabric-v1.1/config/crypto-config", - "network": { - "orderer": { - "url": "grpc://localhost:7050", - "mspid": "OrdererMSP", - "msp": "network/fabric-v1.1/config/crypto-config/ordererOrganizations/example.com/msp/", - "server-hostname": "orderer.example.com", - "tls_cacerts": "network/fabric-v1.1/config/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/ca.crt" - }, - "org1": { - "name": "peerOrg1", - "mspid": "Org1MSP", - "msp": "network/fabric-v1.1/config/crypto-config/peerOrganizations/org1.example.com/msp/", - "ca": { - "url": "http://localhost:7054", - "name": "ca.org1.example.com" - }, - "peer1": { - "requests": "grpc://localhost:7051", - "events": "grpc://localhost:7053", - "server-hostname": "peer0.org1.example.com", - "tls_cacerts": "network/fabric-v1.1/config/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt" - } - }, - "org2": { - "name": "peerOrg2", - "mspid": "Org2MSP", - "msp": "network/fabric-v1.1/config/crypto-config/peerOrganizations/org2.example.com/msp/", - "ca": { - "url": "http://localhost:8054", - "name": "ca.org2.example.com" - }, - "peer1": { - "requests": "grpc://localhost:8051", - "events": "grpc://localhost:8053", - "server-hostname": "peer0.org2.example.com", - "tls_cacerts": "network/fabric-v1.1/config/crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt" - } - } - }, - "channel": [ - { - "name": "mychannel", - "deployed": false, - "config": "network/fabric-v1.1/config/mychannel.tx", - "organizations": ["org1", "org2"] - } - ], - "chaincodes": [ - {"id": "marbles", "path": "src/contract/fabric/marbles-norichquery/node", "language":"node", "version": "v1", "channel": "mychannel"}, - {"id": "simple", "path": "src/contract/fabric/simple/node", "language":"node", "version": "v0", "channel": "mychannel"} - ], - "endorsement-policy": { - "identities": [ - { - "role": { - "name": "member", - "mspId": "Org1MSP" - } - }, - { - "role": { - "name": "member", - "mspId": "Org2MSP" - } - }, - { - "role": { - "name": "admin", - "mspId": "Org1MSP" - } - } - ], - "policy": { "2-of": [{"signed-by": 0}, {"signed-by": 1}]} - }, - "context": { - "init": "mychannel", - "open": "mychannel", - "query": "mychannel" - } - }, - "info" : { - "Version": "1.1.0", - "Size": "2 Orgs with 1 Peer", - "Orderer": "Solo", - "Distribution": "Single Host" - } -} \ No newline at end of file diff --git a/packages/caliper-samples/network/fabric-v1.2/2org1peercouchdb/README.md b/packages/caliper-samples/network/fabric-v1.2/2org1peercouchdb/README.md index ee89523b5..9d429a99e 100755 --- a/packages/caliper-samples/network/fabric-v1.2/2org1peercouchdb/README.md +++ b/packages/caliper-samples/network/fabric-v1.2/2org1peercouchdb/README.md @@ -27,11 +27,11 @@ The following network configuration files are available for the different platfo * `vehicle-lifecycle-network` ### Fabric -* `fabric(-ccp)-go((-mutual)-tls)` (__golang__ implementations) +* `fabric-ccp-go((-mutual)-tls)` (__golang__ implementations) * `marbles` __with__ CouchDB index metadata and rich query support. * `drm` * `simple` * `smallbank` -* `fabric(-ccp)-node((-mutual)-tls)` (__Node.JS__ implementations) +* `fabric-ccp-node((-mutual)-tls)` (__Node.JS__ implementations) * `marbles` __with__ CouchDB index metadata and rich query support. - * `simple` \ No newline at end of file + * `simple` diff --git a/packages/caliper-samples/network/fabric-v1.2/2org1peercouchdb/fabric-go-tls.json b/packages/caliper-samples/network/fabric-v1.2/2org1peercouchdb/fabric-go-tls.json deleted file mode 100644 index 7d9c260e6..000000000 --- a/packages/caliper-samples/network/fabric-v1.2/2org1peercouchdb/fabric-go-tls.json +++ /dev/null @@ -1,101 +0,0 @@ -{ - "caliper": { - "blockchain": "fabric", - "command" : { - "start": "docker-compose -f network/fabric-v1.2/2org1peercouchdb/docker-compose-tls.yaml up -d;sleep 3s", - "end" : "docker-compose -f network/fabric-v1.2/2org1peercouchdb/docker-compose-tls.yaml down;(test -z \"$(docker ps -aq)\") || docker rm $(docker ps -aq);(test -z \"$(docker images dev* -q)\") || docker rmi $(docker images dev* -q)" - } - }, - "fabric": { - "cryptodir": "network/fabric-v1.2/config/crypto-config", - "network": { - "orderer": { - "url": "grpcs://localhost:7050", - "mspid": "OrdererMSP", - "msp": "network/fabric-v1.2/config/crypto-config/ordererOrganizations/example.com/msp/", - "server-hostname": "orderer.example.com", - "tls_cacerts": "network/fabric-v1.2/config/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/ca.crt" - }, - "org1": { - "name": "peerOrg1", - "mspid": "Org1MSP", - "msp": "network/fabric-v1.2/config/crypto-config/peerOrganizations/org1.example.com/msp/", - "ca": { - "url": "https://localhost:7054", - "name": "ca.org1.example.com" - }, - "peer1": { - "requests": "grpcs://localhost:7051", - "events": "grpcs://localhost:7053", - "server-hostname": "peer0.org1.example.com", - "tls_cacerts": "network/fabric-v1.2/config/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt" - } - }, - "org2": { - "name": "peerOrg2", - "mspid": "Org2MSP", - "msp": "network/fabric-v1.2/config/crypto-config/peerOrganizations/org2.example.com/msp/", - "ca": { - "url": "https://localhost:8054", - "name": "ca.org2.example.com" - }, - "peer1": { - "requests": "grpcs://localhost:8051", - "events": "grpcs://localhost:8053", - "server-hostname": "peer0.org2.example.com", - "tls_cacerts": "network/fabric-v1.2/config/crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt" - } - } - }, - "channel": [ - { - "name": "mychannel", - "deployed": false, - "config": "network/fabric-v1.2/config/mychannel.tx", - "organizations": ["org1", "org2"] - } - ], - "chaincodes": [ - {"id": "drm", "path": "contract/fabric/drm", "language":"golang", "version": "v0", "channel": "mychannel"}, - {"id": "marbles", "path": "contract/fabric/marbles/go", "language":"golang", "version": "v1", "channel": "mychannel", "metadataPath": "src/contract/fabric/marbles/go/metadata"}, - {"id": "simple", "path": "contract/fabric/simple/go", "language":"golang", "version": "v0", "channel": "mychannel"}, - {"id": "smallbank", "path": "contract/fabric/smallbank", "language":"golang", "version": "v0", "channel": "mychannel"} - ], - "endorsement-policy": { - "identities": [ - { - "role": { - "name": "member", - "mspId": "Org1MSP" - } - }, - { - "role": { - "name": "member", - "mspId": "Org2MSP" - } - }, - { - "role": { - "name": "admin", - "mspId": "Org1MSP" - } - } - ], - "policy": { "2-of": [{"signed-by": 0}, {"signed-by": 1}]} - }, - "context": { - "smallOperations": "mychannel", - "init": "mychannel", - "open": "mychannel", - "publish": "mychannel", - "query": "mychannel" - } - }, - "info" : { - "Version": "1.2.0", - "Size": "2 Orgs with 1 Peer", - "Orderer": "Solo", - "Distribution": "Single Host" - } -} \ No newline at end of file diff --git a/packages/caliper-samples/network/fabric-v1.2/2org1peercouchdb/fabric-go.json b/packages/caliper-samples/network/fabric-v1.2/2org1peercouchdb/fabric-go.json deleted file mode 100644 index 1ac5dc685..000000000 --- a/packages/caliper-samples/network/fabric-v1.2/2org1peercouchdb/fabric-go.json +++ /dev/null @@ -1,101 +0,0 @@ -{ - "caliper": { - "blockchain": "fabric", - "command" : { - "start": "docker-compose -f network/fabric-v1.2/2org1peercouchdb/docker-compose.yaml up -d;sleep 3s", - "end" : "docker-compose -f network/fabric-v1.2/2org1peercouchdb/docker-compose.yaml down;(test -z \"$(docker ps -aq)\") || docker rm $(docker ps -aq);(test -z \"$(docker images dev* -q)\") || docker rmi $(docker images dev* -q)" - } - }, - "fabric": { - "cryptodir": "network/fabric-v1.2/config/crypto-config", - "network": { - "orderer": { - "url": "grpc://localhost:7050", - "mspid": "OrdererMSP", - "msp": "network/fabric-v1.2/config/crypto-config/ordererOrganizations/example.com/msp/", - "server-hostname": "orderer.example.com", - "tls_cacerts": "network/fabric-v1.2/config/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/ca.crt" - }, - "org1": { - "name": "peerOrg1", - "mspid": "Org1MSP", - "msp": "network/fabric-v1.2/config/crypto-config/peerOrganizations/org1.example.com/msp/", - "ca": { - "url": "http://localhost:7054", - "name": "ca.org1.example.com" - }, - "peer1": { - "requests": "grpc://localhost:7051", - "events": "grpc://localhost:7053", - "server-hostname": "peer0.org1.example.com", - "tls_cacerts": "network/fabric-v1.2/config/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt" - } - }, - "org2": { - "name": "peerOrg2", - "mspid": "Org2MSP", - "msp": "network/fabric-v1.2/config/crypto-config/peerOrganizations/org2.example.com/msp/", - "ca": { - "url": "http://localhost:8054", - "name": "ca.org2.example.com" - }, - "peer1": { - "requests": "grpc://localhost:8051", - "events": "grpc://localhost:8053", - "server-hostname": "peer0.org2.example.com", - "tls_cacerts": "network/fabric-v1.2/config/crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt" - } - } - }, - "channel": [ - { - "name": "mychannel", - "deployed": false, - "config": "network/fabric-v1.2/config/mychannel.tx", - "organizations": ["org1", "org2"] - } - ], - "chaincodes": [ - {"id": "drm", "path": "contract/fabric/drm", "language":"golang", "version": "v0", "channel": "mychannel"}, - {"id": "marbles", "path": "contract/fabric/marbles/go", "language":"golang", "version": "v1", "channel": "mychannel", "metadataPath": "src/contract/fabric/marbles/go/metadata"}, - {"id": "simple", "path": "contract/fabric/simple/go", "language":"golang", "version": "v0", "channel": "mychannel"}, - {"id": "smallbank", "path": "contract/fabric/smallbank", "language":"golang", "version": "v0", "channel": "mychannel"} - ], - "endorsement-policy": { - "identities": [ - { - "role": { - "name": "member", - "mspId": "Org1MSP" - } - }, - { - "role": { - "name": "member", - "mspId": "Org2MSP" - } - }, - { - "role": { - "name": "admin", - "mspId": "Org1MSP" - } - } - ], - "policy": { "2-of": [{"signed-by": 0}, {"signed-by": 1}]} - }, - "context": { - "smallOperations": "mychannel", - "init": "mychannel", - "open": "mychannel", - "publish": "mychannel", - "query": "mychannel" - } - }, - "info" : { - "Version": "1.2.0", - "Size": "2 Orgs with 1 Peer", - "Orderer": "Solo", - "Distribution": "Single Host" - } -} \ No newline at end of file diff --git a/packages/caliper-samples/network/fabric-v1.2/2org1peercouchdb/fabric-node-tls.json b/packages/caliper-samples/network/fabric-v1.2/2org1peercouchdb/fabric-node-tls.json deleted file mode 100644 index cdab58c41..000000000 --- a/packages/caliper-samples/network/fabric-v1.2/2org1peercouchdb/fabric-node-tls.json +++ /dev/null @@ -1,97 +0,0 @@ -{ - "caliper": { - "blockchain": "fabric", - "command" : { - "start": "docker-compose -f network/fabric-v1.2/2org1peercouchdb/docker-compose-tls.yaml up -d;sleep 3s", - "end" : "docker-compose -f network/fabric-v1.2/2org1peercouchdb/docker-compose-tls.yaml down;(test -z \"$(docker ps -aq)\") || docker rm $(docker ps -aq);(test -z \"$(docker images dev* -q)\") || docker rmi $(docker images dev* -q)" - } - }, - "fabric": { - "cryptodir": "network/fabric-v1.2/config/crypto-config", - "network": { - "orderer": { - "url": "grpcs://localhost:7050", - "mspid": "OrdererMSP", - "msp": "network/fabric-v1.2/config/crypto-config/ordererOrganizations/example.com/msp/", - "server-hostname": "orderer.example.com", - "tls_cacerts": "network/fabric-v1.2/config/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/ca.crt" - }, - "org1": { - "name": "peerOrg1", - "mspid": "Org1MSP", - "msp": "network/fabric-v1.2/config/crypto-config/peerOrganizations/org1.example.com/msp/", - "ca": { - "url": "https://localhost:7054", - "name": "ca.org1.example.com" - }, - "peer1": { - "requests": "grpcs://localhost:7051", - "events": "grpcs://localhost:7053", - "server-hostname": "peer0.org1.example.com", - "tls_cacerts": "network/fabric-v1.2/config/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt" - } - }, - "org2": { - "name": "peerOrg2", - "mspid": "Org2MSP", - "msp": "network/fabric-v1.2/config/crypto-config/peerOrganizations/org2.example.com/msp/", - "ca": { - "url": "https://localhost:8054", - "name": "ca.org2.example.com" - }, - "peer1": { - "requests": "grpcs://localhost:8051", - "events": "grpcs://localhost:8053", - "server-hostname": "peer0.org2.example.com", - "tls_cacerts": "network/fabric-v1.2/config/crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt" - } - } - }, - "channel": [ - { - "name": "mychannel", - "deployed": false, - "config": "network/fabric-v1.2/config/mychannel.tx", - "organizations": ["org1", "org2"] - } - ], - "chaincodes": [ - {"id": "marbles", "path": "src/contract/fabric/marbles/node", "language":"node", "version": "v1", "channel": "mychannel", "metadataPath": "src/contract/fabric/marbles/node/metadata"}, - {"id": "simple", "path": "src/contract/fabric/simple/node", "language":"node", "version": "v0", "channel": "mychannel"} - ], - "endorsement-policy": { - "identities": [ - { - "role": { - "name": "member", - "mspId": "Org1MSP" - } - }, - { - "role": { - "name": "member", - "mspId": "Org2MSP" - } - }, - { - "role": { - "name": "admin", - "mspId": "Org1MSP" - } - } - ], - "policy": { "2-of": [{"signed-by": 0}, {"signed-by": 1}]} - }, - "context": { - "init": "mychannel", - "open": "mychannel", - "query": "mychannel" - } - }, - "info" : { - "Version": "1.2.0", - "Size": "2 Orgs with 1 Peer", - "Orderer": "Solo", - "Distribution": "Single Host" - } -} \ No newline at end of file diff --git a/packages/caliper-samples/network/fabric-v1.2/2org1peercouchdb/fabric-node.json b/packages/caliper-samples/network/fabric-v1.2/2org1peercouchdb/fabric-node.json deleted file mode 100644 index 3a311d625..000000000 --- a/packages/caliper-samples/network/fabric-v1.2/2org1peercouchdb/fabric-node.json +++ /dev/null @@ -1,97 +0,0 @@ -{ - "caliper": { - "blockchain": "fabric", - "command" : { - "start": "docker-compose -f network/fabric-v1.2/2org1peercouchdb/docker-compose.yaml up -d;sleep 3s", - "end" : "docker-compose -f network/fabric-v1.2/2org1peercouchdb/docker-compose.yaml down;(test -z \"$(docker ps -aq)\") || docker rm $(docker ps -aq);(test -z \"$(docker images dev* -q)\") || docker rmi $(docker images dev* -q)" - } - }, - "fabric": { - "cryptodir": "network/fabric-v1.2/config/crypto-config", - "network": { - "orderer": { - "url": "grpc://localhost:7050", - "mspid": "OrdererMSP", - "msp": "network/fabric-v1.2/config/crypto-config/ordererOrganizations/example.com/msp/", - "server-hostname": "orderer.example.com", - "tls_cacerts": "network/fabric-v1.2/config/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/ca.crt" - }, - "org1": { - "name": "peerOrg1", - "mspid": "Org1MSP", - "msp": "network/fabric-v1.2/config/crypto-config/peerOrganizations/org1.example.com/msp/", - "ca": { - "url": "http://localhost:7054", - "name": "ca.org1.example.com" - }, - "peer1": { - "requests": "grpc://localhost:7051", - "events": "grpc://localhost:7053", - "server-hostname": "peer0.org1.example.com", - "tls_cacerts": "network/fabric-v1.2/config/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt" - } - }, - "org2": { - "name": "peerOrg2", - "mspid": "Org2MSP", - "msp": "network/fabric-v1.2/config/crypto-config/peerOrganizations/org2.example.com/msp/", - "ca": { - "url": "http://localhost:8054", - "name": "ca.org2.example.com" - }, - "peer1": { - "requests": "grpc://localhost:8051", - "events": "grpc://localhost:8053", - "server-hostname": "peer0.org2.example.com", - "tls_cacerts": "network/fabric-v1.2/config/crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt" - } - } - }, - "channel": [ - { - "name": "mychannel", - "deployed": false, - "config": "network/fabric-v1.2/config/mychannel.tx", - "organizations": ["org1", "org2"] - } - ], - "chaincodes": [ - {"id": "marbles", "path": "src/contract/fabric/marbles/node", "language":"node", "version": "v1", "channel": "mychannel", "metadataPath": "src/contract/fabric/marbles/node/metadata"}, - {"id": "simple", "path": "src/contract/fabric/simple/node", "language":"node", "version": "v0", "channel": "mychannel"} - ], - "endorsement-policy": { - "identities": [ - { - "role": { - "name": "member", - "mspId": "Org1MSP" - } - }, - { - "role": { - "name": "member", - "mspId": "Org2MSP" - } - }, - { - "role": { - "name": "admin", - "mspId": "Org1MSP" - } - } - ], - "policy": { "2-of": [{"signed-by": 0}, {"signed-by": 1}]} - }, - "context": { - "init": "mychannel", - "open": "mychannel", - "query": "mychannel" - } - }, - "info" : { - "Version": "1.2.0", - "Size": "2 Orgs with 1 Peer", - "Orderer": "Solo", - "Distribution": "Single Host" - } -} \ No newline at end of file diff --git a/packages/caliper-samples/network/fabric-v1.2/2org1peergoleveldb/README.md b/packages/caliper-samples/network/fabric-v1.2/2org1peergoleveldb/README.md index b3bcf1122..8bf88ee51 100755 --- a/packages/caliper-samples/network/fabric-v1.2/2org1peergoleveldb/README.md +++ b/packages/caliper-samples/network/fabric-v1.2/2org1peergoleveldb/README.md @@ -27,11 +27,11 @@ The following network configuration files are available for the different platfo * `vehicle-lifecycle-network` ### Fabric -* `fabric(-ccp)-go((-mutual)-tls)` (__golang__ implementations) +* `fabric-ccp-go((-mutual)-tls)` (__golang__ implementations) * `marbles` __with__ CouchDB index metadata and rich query support. * `drm` * `simple` * `smallbank` -* `fabric(-ccp)-node((-mutual)-tls)` (__Node.JS__ implementations) +* `fabric-ccp-node((-mutual)-tls)` (__Node.JS__ implementations) * `marbles` __with__ CouchDB index metadata and rich query support. - * `simple` \ No newline at end of file + * `simple` diff --git a/packages/caliper-samples/network/fabric-v1.2/2org1peergoleveldb/fabric-go-tls.json b/packages/caliper-samples/network/fabric-v1.2/2org1peergoleveldb/fabric-go-tls.json deleted file mode 100644 index a0bbdd3ea..000000000 --- a/packages/caliper-samples/network/fabric-v1.2/2org1peergoleveldb/fabric-go-tls.json +++ /dev/null @@ -1,101 +0,0 @@ -{ - "caliper": { - "blockchain": "fabric", - "command" : { - "start": "docker-compose -f network/fabric-v1.2/2org1peergoleveldb/docker-compose-tls.yaml up -d;sleep 3s", - "end" : "docker-compose -f network/fabric-v1.2/2org1peergoleveldb/docker-compose-tls.yaml down;(test -z \"$(docker ps -aq)\") || docker rm $(docker ps -aq);(test -z \"$(docker images dev* -q)\") || docker rmi $(docker images dev* -q)" - } - }, - "fabric": { - "cryptodir": "network/fabric-v1.2/config/crypto-config", - "network": { - "orderer": { - "url": "grpcs://localhost:7050", - "mspid": "OrdererMSP", - "msp": "network/fabric-v1.2/config/crypto-config/ordererOrganizations/example.com/msp/", - "server-hostname": "orderer.example.com", - "tls_cacerts": "network/fabric-v1.2/config/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/ca.crt" - }, - "org1": { - "name": "peerOrg1", - "mspid": "Org1MSP", - "msp": "network/fabric-v1.2/config/crypto-config/peerOrganizations/org1.example.com/msp/", - "ca": { - "url": "https://localhost:7054", - "name": "ca.org1.example.com" - }, - "peer1": { - "requests": "grpcs://localhost:7051", - "events": "grpcs://localhost:7053", - "server-hostname": "peer0.org1.example.com", - "tls_cacerts": "network/fabric-v1.2/config/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt" - } - }, - "org2": { - "name": "peerOrg2", - "mspid": "Org2MSP", - "msp": "network/fabric-v1.2/config/crypto-config/peerOrganizations/org2.example.com/msp/", - "ca": { - "url": "https://localhost:8054", - "name": "ca.org2.example.com" - }, - "peer1": { - "requests": "grpcs://localhost:8051", - "events": "grpcs://localhost:8053", - "server-hostname": "peer0.org2.example.com", - "tls_cacerts": "network/fabric-v1.2/config/crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt" - } - } - }, - "channel": [ - { - "name": "mychannel", - "deployed": false, - "config": "network/fabric-v1.2/config/mychannel.tx", - "organizations": ["org1", "org2"] - } - ], - "chaincodes": [ - {"id": "drm", "path": "contract/fabric/drm", "language":"golang", "version": "v0", "channel": "mychannel"}, - {"id": "marbles", "path": "contract/fabric/marbles-norichquery/go", "language":"golang", "version": "v1", "channel": "mychannel"}, - {"id": "simple", "path": "contract/fabric/simple/go", "language":"golang", "version": "v0", "channel": "mychannel"}, - {"id": "smallbank", "path": "contract/fabric/smallbank", "language":"golang", "version": "v0", "channel": "mychannel"} - ], - "endorsement-policy": { - "identities": [ - { - "role": { - "name": "member", - "mspId": "Org1MSP" - } - }, - { - "role": { - "name": "member", - "mspId": "Org2MSP" - } - }, - { - "role": { - "name": "admin", - "mspId": "Org1MSP" - } - } - ], - "policy": { "2-of": [{"signed-by": 0}, {"signed-by": 1}]} - }, - "context": { - "smallOperations": "mychannel", - "init": "mychannel", - "open": "mychannel", - "publish": "mychannel", - "query": "mychannel" - } - }, - "info" : { - "Version": "1.2.0", - "Size": "2 Orgs with 1 Peer", - "Orderer": "Solo", - "Distribution": "Single Host" - } -} \ No newline at end of file diff --git a/packages/caliper-samples/network/fabric-v1.2/2org1peergoleveldb/fabric-go.json b/packages/caliper-samples/network/fabric-v1.2/2org1peergoleveldb/fabric-go.json deleted file mode 100644 index 3721acdec..000000000 --- a/packages/caliper-samples/network/fabric-v1.2/2org1peergoleveldb/fabric-go.json +++ /dev/null @@ -1,101 +0,0 @@ -{ - "caliper": { - "blockchain": "fabric", - "command" : { - "start": "docker-compose -f network/fabric-v1.2/2org1peergoleveldb/docker-compose.yaml up -d;sleep 3s", - "end" : "docker-compose -f network/fabric-v1.2/2org1peergoleveldb/docker-compose.yaml down;(test -z \"$(docker ps -aq)\") || docker rm $(docker ps -aq);(test -z \"$(docker images dev* -q)\") || docker rmi $(docker images dev* -q)" - } - }, - "fabric": { - "cryptodir": "network/fabric-v1.2/config/crypto-config", - "network": { - "orderer": { - "url": "grpc://localhost:7050", - "mspid": "OrdererMSP", - "msp": "network/fabric-v1.2/config/crypto-config/ordererOrganizations/example.com/msp/", - "server-hostname": "orderer.example.com", - "tls_cacerts": "network/fabric-v1.2/config/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/ca.crt" - }, - "org1": { - "name": "peerOrg1", - "mspid": "Org1MSP", - "msp": "network/fabric-v1.2/config/crypto-config/peerOrganizations/org1.example.com/msp/", - "ca": { - "url": "http://localhost:7054", - "name": "ca.org1.example.com" - }, - "peer1": { - "requests": "grpc://localhost:7051", - "events": "grpc://localhost:7053", - "server-hostname": "peer0.org1.example.com", - "tls_cacerts": "network/fabric-v1.2/config/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt" - } - }, - "org2": { - "name": "peerOrg2", - "mspid": "Org2MSP", - "msp": "network/fabric-v1.2/config/crypto-config/peerOrganizations/org2.example.com/msp/", - "ca": { - "url": "http://localhost:8054", - "name": "ca.org2.example.com" - }, - "peer1": { - "requests": "grpc://localhost:8051", - "events": "grpc://localhost:8053", - "server-hostname": "peer0.org2.example.com", - "tls_cacerts": "network/fabric-v1.2/config/crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt" - } - } - }, - "channel": [ - { - "name": "mychannel", - "deployed": false, - "config": "network/fabric-v1.2/config/mychannel.tx", - "organizations": ["org1", "org2"] - } - ], - "chaincodes": [ - {"id": "drm", "path": "contract/fabric/drm", "language":"golang", "version": "v0", "channel": "mychannel"}, - {"id": "marbles", "path": "contract/fabric/marbles-norichquery/go", "language":"golang", "version": "v1", "channel": "mychannel"}, - {"id": "simple", "path": "contract/fabric/simple/go", "language":"golang", "version": "v0", "channel": "mychannel"}, - {"id": "smallbank", "path": "contract/fabric/smallbank", "language":"golang", "version": "v0", "channel": "mychannel"} - ], - "endorsement-policy": { - "identities": [ - { - "role": { - "name": "member", - "mspId": "Org1MSP" - } - }, - { - "role": { - "name": "member", - "mspId": "Org2MSP" - } - }, - { - "role": { - "name": "admin", - "mspId": "Org1MSP" - } - } - ], - "policy": { "2-of": [{"signed-by": 0}, {"signed-by": 1}]} - }, - "context": { - "smallOperations": "mychannel", - "init": "mychannel", - "open": "mychannel", - "publish": "mychannel", - "query": "mychannel" - } - }, - "info" : { - "Version": "1.2.0", - "Size": "2 Orgs with 1 Peer", - "Orderer": "Solo", - "Distribution": "Single Host" - } -} \ No newline at end of file diff --git a/packages/caliper-samples/network/fabric-v1.2/2org1peergoleveldb/fabric-node-tls.json b/packages/caliper-samples/network/fabric-v1.2/2org1peergoleveldb/fabric-node-tls.json deleted file mode 100644 index 3859f7899..000000000 --- a/packages/caliper-samples/network/fabric-v1.2/2org1peergoleveldb/fabric-node-tls.json +++ /dev/null @@ -1,97 +0,0 @@ -{ - "caliper": { - "blockchain": "fabric", - "command" : { - "start": "docker-compose -f network/fabric-v1.2/2org1peergoleveldb/docker-compose-tls.yaml up -d;sleep 3s", - "end" : "docker-compose -f network/fabric-v1.2/2org1peergoleveldb/docker-compose-tls.yaml down;(test -z \"$(docker ps -aq)\") || docker rm $(docker ps -aq);(test -z \"$(docker images dev* -q)\") || docker rmi $(docker images dev* -q)" - } - }, - "fabric": { - "cryptodir": "network/fabric-v1.2/config/crypto-config", - "network": { - "orderer": { - "url": "grpcs://localhost:7050", - "mspid": "OrdererMSP", - "msp": "network/fabric-v1.2/config/crypto-config/ordererOrganizations/example.com/msp/", - "server-hostname": "orderer.example.com", - "tls_cacerts": "network/fabric-v1.2/config/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/ca.crt" - }, - "org1": { - "name": "peerOrg1", - "mspid": "Org1MSP", - "msp": "network/fabric-v1.2/config/crypto-config/peerOrganizations/org1.example.com/msp/", - "ca": { - "url": "https://localhost:7054", - "name": "ca.org1.example.com" - }, - "peer1": { - "requests": "grpcs://localhost:7051", - "events": "grpcs://localhost:7053", - "server-hostname": "peer0.org1.example.com", - "tls_cacerts": "network/fabric-v1.2/config/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt" - } - }, - "org2": { - "name": "peerOrg2", - "mspid": "Org2MSP", - "msp": "network/fabric-v1.2/config/crypto-config/peerOrganizations/org2.example.com/msp/", - "ca": { - "url": "https://localhost:8054", - "name": "ca.org2.example.com" - }, - "peer1": { - "requests": "grpcs://localhost:8051", - "events": "grpcs://localhost:8053", - "server-hostname": "peer0.org2.example.com", - "tls_cacerts": "network/fabric-v1.2/config/crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt" - } - } - }, - "channel": [ - { - "name": "mychannel", - "deployed": false, - "config": "network/fabric-v1.2/config/mychannel.tx", - "organizations": ["org1", "org2"] - } - ], - "chaincodes": [ - {"id": "marbles", "path": "src/contract/fabric/marbles-norichquery/node", "language":"node", "version": "v1", "channel": "mychannel"}, - {"id": "simple", "path": "src/contract/fabric/simple/node", "language":"node", "version": "v0", "channel": "mychannel"} - ], - "endorsement-policy": { - "identities": [ - { - "role": { - "name": "member", - "mspId": "Org1MSP" - } - }, - { - "role": { - "name": "member", - "mspId": "Org2MSP" - } - }, - { - "role": { - "name": "admin", - "mspId": "Org1MSP" - } - } - ], - "policy": { "2-of": [{"signed-by": 0}, {"signed-by": 1}]} - }, - "context": { - "init": "mychannel", - "open": "mychannel", - "query": "mychannel" - } - }, - "info" : { - "Version": "1.2.0", - "Size": "2 Orgs with 1 Peer", - "Orderer": "Solo", - "Distribution": "Single Host" - } -} \ No newline at end of file diff --git a/packages/caliper-samples/network/fabric-v1.2/2org1peergoleveldb/fabric-node.json b/packages/caliper-samples/network/fabric-v1.2/2org1peergoleveldb/fabric-node.json deleted file mode 100644 index 0534576c0..000000000 --- a/packages/caliper-samples/network/fabric-v1.2/2org1peergoleveldb/fabric-node.json +++ /dev/null @@ -1,97 +0,0 @@ -{ - "caliper": { - "blockchain": "fabric", - "command" : { - "start": "docker-compose -f network/fabric-v1.2/2org1peergoleveldb/docker-compose.yaml up -d;sleep 3s", - "end" : "docker-compose -f network/fabric-v1.2/2org1peergoleveldb/docker-compose.yaml down;(test -z \"$(docker ps -aq)\") || docker rm $(docker ps -aq);(test -z \"$(docker images dev* -q)\") || docker rmi $(docker images dev* -q)" - } - }, - "fabric": { - "cryptodir": "network/fabric-v1.2/config/crypto-config", - "network": { - "orderer": { - "url": "grpc://localhost:7050", - "mspid": "OrdererMSP", - "msp": "network/fabric-v1.2/config/crypto-config/ordererOrganizations/example.com/msp/", - "server-hostname": "orderer.example.com", - "tls_cacerts": "network/fabric-v1.2/config/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/ca.crt" - }, - "org1": { - "name": "peerOrg1", - "mspid": "Org1MSP", - "msp": "network/fabric-v1.2/config/crypto-config/peerOrganizations/org1.example.com/msp/", - "ca": { - "url": "http://localhost:7054", - "name": "ca.org1.example.com" - }, - "peer1": { - "requests": "grpc://localhost:7051", - "events": "grpc://localhost:7053", - "server-hostname": "peer0.org1.example.com", - "tls_cacerts": "network/fabric-v1.2/config/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt" - } - }, - "org2": { - "name": "peerOrg2", - "mspid": "Org2MSP", - "msp": "network/fabric-v1.2/config/crypto-config/peerOrganizations/org2.example.com/msp/", - "ca": { - "url": "http://localhost:8054", - "name": "ca.org2.example.com" - }, - "peer1": { - "requests": "grpc://localhost:8051", - "events": "grpc://localhost:8053", - "server-hostname": "peer0.org2.example.com", - "tls_cacerts": "network/fabric-v1.2/config/crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt" - } - } - }, - "channel": [ - { - "name": "mychannel", - "deployed": false, - "config": "network/fabric-v1.2/config/mychannel.tx", - "organizations": ["org1", "org2"] - } - ], - "chaincodes": [ - {"id": "marbles", "path": "src/contract/fabric/marbles-norichquery/node", "language":"node", "version": "v1", "channel": "mychannel"}, - {"id": "simple", "path": "src/contract/fabric/simple/node", "language":"node", "version": "v0", "channel": "mychannel"} - ], - "endorsement-policy": { - "identities": [ - { - "role": { - "name": "member", - "mspId": "Org1MSP" - } - }, - { - "role": { - "name": "member", - "mspId": "Org2MSP" - } - }, - { - "role": { - "name": "admin", - "mspId": "Org1MSP" - } - } - ], - "policy": { "2-of": [{"signed-by": 0}, {"signed-by": 1}]} - }, - "context": { - "init": "mychannel", - "open": "mychannel", - "query": "mychannel" - } - }, - "info" : { - "Version": "1.2.0", - "Size": "2 Orgs with 1 Peer", - "Orderer": "Solo", - "Distribution": "Single Host" - } -} \ No newline at end of file diff --git a/packages/caliper-samples/network/fabric-v1.3/2org1peercouchdb/README.md b/packages/caliper-samples/network/fabric-v1.3/2org1peercouchdb/README.md index f5128fa17..c1ce214da 100755 --- a/packages/caliper-samples/network/fabric-v1.3/2org1peercouchdb/README.md +++ b/packages/caliper-samples/network/fabric-v1.3/2org1peercouchdb/README.md @@ -26,11 +26,11 @@ The following network configuration files are available for the different platfo * `vehicle-lifecycle-network` ### Fabric -* `fabric-go(-tls).json` (__golang__ implementations) +* `fabric-ccp-go(-tls).json` (__golang__ implementations) * `marbles` __with__ CouchDB index metadata and rich query support. * `drm` * `simple` * `smallbank` -* `fabric-node(-tls).json` (__Node.JS__ implementations) +* `fabric-ccp-node(-tls).json` (__Node.JS__ implementations) * `marbles` __with__ CouchDB index metadata and rich query support. - * `simple` \ No newline at end of file + * `simple` diff --git a/packages/caliper-samples/network/fabric-v1.3/2org1peercouchdb/fabric-go-tls.json b/packages/caliper-samples/network/fabric-v1.3/2org1peercouchdb/fabric-go-tls.json deleted file mode 100644 index 401a1d6fc..000000000 --- a/packages/caliper-samples/network/fabric-v1.3/2org1peercouchdb/fabric-go-tls.json +++ /dev/null @@ -1,101 +0,0 @@ -{ - "caliper": { - "blockchain": "fabric", - "command" : { - "start": "docker-compose -f network/fabric-v1.3/2org1peercouchdb/docker-compose-tls.yaml up -d;sleep 3s", - "end" : "docker-compose -f network/fabric-v1.3/2org1peercouchdb/docker-compose-tls.yaml down;(test -z \"$(docker ps -aq)\") || docker rm $(docker ps -aq);(test -z \"$(docker images dev* -q)\") || docker rmi $(docker images dev* -q)" - } - }, - "fabric": { - "cryptodir": "network/fabric-v1.3/config/crypto-config", - "network": { - "orderer": { - "url": "grpcs://localhost:7050", - "mspid": "OrdererMSP", - "msp": "network/fabric-v1.3/config/crypto-config/ordererOrganizations/example.com/msp/", - "server-hostname": "orderer.example.com", - "tls_cacerts": "network/fabric-v1.3/config/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/ca.crt" - }, - "org1": { - "name": "peerOrg1", - "mspid": "Org1MSP", - "msp": "network/fabric-v1.3/config/crypto-config/peerOrganizations/org1.example.com/msp/", - "ca": { - "url": "https://localhost:7054", - "name": "ca.org1.example.com" - }, - "peer1": { - "requests": "grpcs://localhost:7051", - "events": "grpcs://localhost:7053", - "server-hostname": "peer0.org1.example.com", - "tls_cacerts": "network/fabric-v1.3/config/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt" - } - }, - "org2": { - "name": "peerOrg2", - "mspid": "Org2MSP", - "msp": "network/fabric-v1.3/config/crypto-config/peerOrganizations/org2.example.com/msp/", - "ca": { - "url": "https://localhost:8054", - "name": "ca.org2.example.com" - }, - "peer1": { - "requests": "grpcs://localhost:8051", - "events": "grpcs://localhost:8053", - "server-hostname": "peer0.org2.example.com", - "tls_cacerts": "network/fabric-v1.3/config/crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt" - } - } - }, - "channel": [ - { - "name": "mychannel", - "deployed": false, - "config": "network/fabric-v1.3/config/mychannel.tx", - "organizations": ["org1", "org2"] - } - ], - "chaincodes": [ - {"id": "drm", "path": "contract/fabric/drm", "language":"golang", "version": "v0", "channel": "mychannel"}, - {"id": "marbles", "path": "contract/fabric/marbles/go", "language":"golang", "version": "v1", "channel": "mychannel", "metadataPath": "src/contract/fabric/marbles/go/metadata"}, - {"id": "simple", "path": "contract/fabric/simple/go", "language":"golang", "version": "v0", "channel": "mychannel"}, - {"id": "smallbank", "path": "contract/fabric/smallbank", "language":"golang", "version": "v0", "channel": "mychannel"} - ], - "endorsement-policy": { - "identities": [ - { - "role": { - "name": "member", - "mspId": "Org1MSP" - } - }, - { - "role": { - "name": "member", - "mspId": "Org2MSP" - } - }, - { - "role": { - "name": "admin", - "mspId": "Org1MSP" - } - } - ], - "policy": { "2-of": [{"signed-by": 0}, {"signed-by": 1}]} - }, - "context": { - "smallOperations": "mychannel", - "init": "mychannel", - "open": "mychannel", - "publish": "mychannel", - "query": "mychannel" - } - }, - "info" : { - "Version": "1.3.0", - "Size": "2 Orgs with 1 Peer", - "Orderer": "Solo", - "Distribution": "Single Host" - } -} \ No newline at end of file diff --git a/packages/caliper-samples/network/fabric-v1.3/2org1peercouchdb/fabric-go.json b/packages/caliper-samples/network/fabric-v1.3/2org1peercouchdb/fabric-go.json deleted file mode 100644 index 26a09aebb..000000000 --- a/packages/caliper-samples/network/fabric-v1.3/2org1peercouchdb/fabric-go.json +++ /dev/null @@ -1,101 +0,0 @@ -{ - "caliper": { - "blockchain": "fabric", - "command" : { - "start": "docker-compose -f network/fabric-v1.3/2org1peercouchdb/docker-compose.yaml up -d;sleep 3s", - "end" : "docker-compose -f network/fabric-v1.3/2org1peercouchdb/docker-compose.yaml down;(test -z \"$(docker ps -aq)\") || docker rm $(docker ps -aq);(test -z \"$(docker images dev* -q)\") || docker rmi $(docker images dev* -q)" - } - }, - "fabric": { - "cryptodir": "network/fabric-v1.3/config/crypto-config", - "network": { - "orderer": { - "url": "grpc://localhost:7050", - "mspid": "OrdererMSP", - "msp": "network/fabric-v1.3/config/crypto-config/ordererOrganizations/example.com/msp/", - "server-hostname": "orderer.example.com", - "tls_cacerts": "network/fabric-v1.3/config/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/ca.crt" - }, - "org1": { - "name": "peerOrg1", - "mspid": "Org1MSP", - "msp": "network/fabric-v1.3/config/crypto-config/peerOrganizations/org1.example.com/msp/", - "ca": { - "url": "http://localhost:7054", - "name": "ca.org1.example.com" - }, - "peer1": { - "requests": "grpc://localhost:7051", - "events": "grpc://localhost:7053", - "server-hostname": "peer0.org1.example.com", - "tls_cacerts": "network/fabric-v1.3/config/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt" - } - }, - "org2": { - "name": "peerOrg2", - "mspid": "Org2MSP", - "msp": "network/fabric-v1.3/config/crypto-config/peerOrganizations/org2.example.com/msp/", - "ca": { - "url": "http://localhost:8054", - "name": "ca.org2.example.com" - }, - "peer1": { - "requests": "grpc://localhost:8051", - "events": "grpc://localhost:8053", - "server-hostname": "peer0.org2.example.com", - "tls_cacerts": "network/fabric-v1.3/config/crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt" - } - } - }, - "channel": [ - { - "name": "mychannel", - "deployed": false, - "config": "network/fabric-v1.3/config/mychannel.tx", - "organizations": ["org1", "org2"] - } - ], - "chaincodes": [ - {"id": "drm", "path": "contract/fabric/drm", "language":"golang", "version": "v0", "channel": "mychannel"}, - {"id": "marbles", "path": "contract/fabric/marbles/go", "language":"golang", "version": "v1", "channel": "mychannel", "metadataPath": "src/contract/fabric/marbles/go/metadata"}, - {"id": "simple", "path": "contract/fabric/simple/go", "language":"golang", "version": "v0", "channel": "mychannel"}, - {"id": "smallbank", "path": "contract/fabric/smallbank", "language":"golang", "version": "v0", "channel": "mychannel"} - ], - "endorsement-policy": { - "identities": [ - { - "role": { - "name": "member", - "mspId": "Org1MSP" - } - }, - { - "role": { - "name": "member", - "mspId": "Org2MSP" - } - }, - { - "role": { - "name": "admin", - "mspId": "Org1MSP" - } - } - ], - "policy": { "2-of": [{"signed-by": 0}, {"signed-by": 1}]} - }, - "context": { - "smallOperations": "mychannel", - "init": "mychannel", - "open": "mychannel", - "publish": "mychannel", - "query": "mychannel" - } - }, - "info" : { - "Version": "1.3.0", - "Size": "2 Orgs with 1 Peer", - "Orderer": "Solo", - "Distribution": "Single Host" - } -} \ No newline at end of file diff --git a/packages/caliper-samples/network/fabric-v1.3/2org1peercouchdb/fabric-node-tls.json b/packages/caliper-samples/network/fabric-v1.3/2org1peercouchdb/fabric-node-tls.json deleted file mode 100644 index 7e7ab83b6..000000000 --- a/packages/caliper-samples/network/fabric-v1.3/2org1peercouchdb/fabric-node-tls.json +++ /dev/null @@ -1,97 +0,0 @@ -{ - "caliper": { - "blockchain": "fabric", - "command" : { - "start": "docker-compose -f network/fabric-v1.3/2org1peercouchdb/docker-compose-tls.yaml up -d;sleep 3s", - "end" : "docker-compose -f network/fabric-v1.3/2org1peercouchdb/docker-compose-tls.yaml down;(test -z \"$(docker ps -aq)\") || docker rm $(docker ps -aq);(test -z \"$(docker images dev* -q)\") || docker rmi $(docker images dev* -q)" - } - }, - "fabric": { - "cryptodir": "network/fabric-v1.3/config/crypto-config", - "network": { - "orderer": { - "url": "grpcs://localhost:7050", - "mspid": "OrdererMSP", - "msp": "network/fabric-v1.3/config/crypto-config/ordererOrganizations/example.com/msp/", - "server-hostname": "orderer.example.com", - "tls_cacerts": "network/fabric-v1.3/config/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/ca.crt" - }, - "org1": { - "name": "peerOrg1", - "mspid": "Org1MSP", - "msp": "network/fabric-v1.3/config/crypto-config/peerOrganizations/org1.example.com/msp/", - "ca": { - "url": "https://localhost:7054", - "name": "ca.org1.example.com" - }, - "peer1": { - "requests": "grpcs://localhost:7051", - "events": "grpcs://localhost:7053", - "server-hostname": "peer0.org1.example.com", - "tls_cacerts": "network/fabric-v1.3/config/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt" - } - }, - "org2": { - "name": "peerOrg2", - "mspid": "Org2MSP", - "msp": "network/fabric-v1.3/config/crypto-config/peerOrganizations/org2.example.com/msp/", - "ca": { - "url": "https://localhost:8054", - "name": "ca.org2.example.com" - }, - "peer1": { - "requests": "grpcs://localhost:8051", - "events": "grpcs://localhost:8053", - "server-hostname": "peer0.org2.example.com", - "tls_cacerts": "network/fabric-v1.3/config/crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt" - } - } - }, - "channel": [ - { - "name": "mychannel", - "deployed": false, - "config": "network/fabric-v1.3/config/mychannel.tx", - "organizations": ["org1", "org2"] - } - ], - "chaincodes": [ - {"id": "marbles", "path": "src/contract/fabric/marbles/node", "language":"node", "version": "v1", "channel": "mychannel", "metadataPath": "src/contract/fabric/marbles/node/metadata"}, - {"id": "simple", "path": "src/contract/fabric/simple/node", "language":"node", "version": "v0", "channel": "mychannel"} - ], - "endorsement-policy": { - "identities": [ - { - "role": { - "name": "member", - "mspId": "Org1MSP" - } - }, - { - "role": { - "name": "member", - "mspId": "Org2MSP" - } - }, - { - "role": { - "name": "admin", - "mspId": "Org1MSP" - } - } - ], - "policy": { "2-of": [{"signed-by": 0}, {"signed-by": 1}]} - }, - "context": { - "init": "mychannel", - "open": "mychannel", - "query": "mychannel" - } - }, - "info" : { - "Version": "1.3.0", - "Size": "2 Orgs with 1 Peer", - "Orderer": "Solo", - "Distribution": "Single Host" - } -} \ No newline at end of file diff --git a/packages/caliper-samples/network/fabric-v1.3/2org1peercouchdb/fabric-node.json b/packages/caliper-samples/network/fabric-v1.3/2org1peercouchdb/fabric-node.json deleted file mode 100644 index 7d09a58ae..000000000 --- a/packages/caliper-samples/network/fabric-v1.3/2org1peercouchdb/fabric-node.json +++ /dev/null @@ -1,97 +0,0 @@ -{ - "caliper": { - "blockchain": "fabric", - "command" : { - "start": "docker-compose -f network/fabric-v1.3/2org1peercouchdb/docker-compose.yaml up -d;sleep 3s", - "end" : "docker-compose -f network/fabric-v1.3/2org1peercouchdb/docker-compose.yaml down;(test -z \"$(docker ps -aq)\") || docker rm $(docker ps -aq);(test -z \"$(docker images dev* -q)\") || docker rmi $(docker images dev* -q)" - } - }, - "fabric": { - "cryptodir": "network/fabric-v1.3/config/crypto-config", - "network": { - "orderer": { - "url": "grpc://localhost:7050", - "mspid": "OrdererMSP", - "msp": "network/fabric-v1.3/config/crypto-config/ordererOrganizations/example.com/msp/", - "server-hostname": "orderer.example.com", - "tls_cacerts": "network/fabric-v1.3/config/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/ca.crt" - }, - "org1": { - "name": "peerOrg1", - "mspid": "Org1MSP", - "msp": "network/fabric-v1.3/config/crypto-config/peerOrganizations/org1.example.com/msp/", - "ca": { - "url": "http://localhost:7054", - "name": "ca.org1.example.com" - }, - "peer1": { - "requests": "grpc://localhost:7051", - "events": "grpc://localhost:7053", - "server-hostname": "peer0.org1.example.com", - "tls_cacerts": "network/fabric-v1.3/config/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt" - } - }, - "org2": { - "name": "peerOrg2", - "mspid": "Org2MSP", - "msp": "network/fabric-v1.3/config/crypto-config/peerOrganizations/org2.example.com/msp/", - "ca": { - "url": "http://localhost:8054", - "name": "ca.org2.example.com" - }, - "peer1": { - "requests": "grpc://localhost:8051", - "events": "grpc://localhost:8053", - "server-hostname": "peer0.org2.example.com", - "tls_cacerts": "network/fabric-v1.3/config/crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt" - } - } - }, - "channel": [ - { - "name": "mychannel", - "deployed": false, - "config": "network/fabric-v1.3/config/mychannel.tx", - "organizations": ["org1", "org2"] - } - ], - "chaincodes": [ - {"id": "marbles", "path": "src/contract/fabric/marbles/node", "language":"node", "version": "v1", "channel": "mychannel", "metadataPath": "src/contract/fabric/marbles/node/metadata"}, - {"id": "simple", "path": "src/contract/fabric/simple/node", "language":"node", "version": "v0", "channel": "mychannel"} - ], - "endorsement-policy": { - "identities": [ - { - "role": { - "name": "member", - "mspId": "Org1MSP" - } - }, - { - "role": { - "name": "member", - "mspId": "Org2MSP" - } - }, - { - "role": { - "name": "admin", - "mspId": "Org1MSP" - } - } - ], - "policy": { "2-of": [{"signed-by": 0}, {"signed-by": 1}]} - }, - "context": { - "init": "mychannel", - "open": "mychannel", - "query": "mychannel" - } - }, - "info" : { - "Version": "1.3.0", - "Size": "2 Orgs with 1 Peer", - "Orderer": "Solo", - "Distribution": "Single Host" - } -} \ No newline at end of file diff --git a/packages/caliper-samples/network/fabric-v1.3/2org1peergoleveldb/README.md b/packages/caliper-samples/network/fabric-v1.3/2org1peergoleveldb/README.md index e181600e1..1c999c62b 100755 --- a/packages/caliper-samples/network/fabric-v1.3/2org1peergoleveldb/README.md +++ b/packages/caliper-samples/network/fabric-v1.3/2org1peergoleveldb/README.md @@ -26,11 +26,11 @@ The following network configuration files are available for the different platfo * `vehicle-lifecycle-network` ### Fabric -* `fabric-go(-tls).json` (__golang__ implementations) +* `fabric-ccp-go(-tls).json` (__golang__ implementations) * `marbles` __without__ CouchDB index metadata and rich query support. * `drm` * `simple` * `smallbank` -* `fabric-node(-tls).json` (__Node.JS__ implementations) +* `fabric-ccp-node(-tls).json` (__Node.JS__ implementations) * `marbles` __without__ CouchDB index metadata and rich query support. - * `simple` \ No newline at end of file + * `simple` diff --git a/packages/caliper-samples/network/fabric-v1.3/2org1peergoleveldb/fabric-go-tls.json b/packages/caliper-samples/network/fabric-v1.3/2org1peergoleveldb/fabric-go-tls.json deleted file mode 100644 index b60778d9b..000000000 --- a/packages/caliper-samples/network/fabric-v1.3/2org1peergoleveldb/fabric-go-tls.json +++ /dev/null @@ -1,101 +0,0 @@ -{ - "caliper": { - "blockchain": "fabric", - "command" : { - "start": "docker-compose -f network/fabric-v1.3/2org1peergoleveldb/docker-compose-tls.yaml up -d;sleep 3s", - "end" : "docker-compose -f network/fabric-v1.3/2org1peergoleveldb/docker-compose-tls.yaml down;(test -z \"$(docker ps -aq)\") || docker rm $(docker ps -aq);(test -z \"$(docker images dev* -q)\") || docker rmi $(docker images dev* -q)" - } - }, - "fabric": { - "cryptodir": "network/fabric-v1.3/config/crypto-config", - "network": { - "orderer": { - "url": "grpcs://localhost:7050", - "mspid": "OrdererMSP", - "msp": "network/fabric-v1.3/config/crypto-config/ordererOrganizations/example.com/msp/", - "server-hostname": "orderer.example.com", - "tls_cacerts": "network/fabric-v1.3/config/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/ca.crt" - }, - "org1": { - "name": "peerOrg1", - "mspid": "Org1MSP", - "msp": "network/fabric-v1.3/config/crypto-config/peerOrganizations/org1.example.com/msp/", - "ca": { - "url": "https://localhost:7054", - "name": "ca.org1.example.com" - }, - "peer1": { - "requests": "grpcs://localhost:7051", - "events": "grpcs://localhost:7053", - "server-hostname": "peer0.org1.example.com", - "tls_cacerts": "network/fabric-v1.3/config/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt" - } - }, - "org2": { - "name": "peerOrg2", - "mspid": "Org2MSP", - "msp": "network/fabric-v1.3/config/crypto-config/peerOrganizations/org2.example.com/msp/", - "ca": { - "url": "https://localhost:8054", - "name": "ca.org2.example.com" - }, - "peer1": { - "requests": "grpcs://localhost:8051", - "events": "grpcs://localhost:8053", - "server-hostname": "peer0.org2.example.com", - "tls_cacerts": "network/fabric-v1.3/config/crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt" - } - } - }, - "channel": [ - { - "name": "mychannel", - "deployed": false, - "config": "network/fabric-v1.3/config/mychannel.tx", - "organizations": ["org1", "org2"] - } - ], - "chaincodes": [ - {"id": "drm", "path": "contract/fabric/drm", "language":"golang", "version": "v0", "channel": "mychannel"}, - {"id": "marbles", "path": "contract/fabric/marbles-norichquery/go", "language":"golang", "version": "v1", "channel": "mychannel"}, - {"id": "simple", "path": "contract/fabric/simple/go", "language":"golang", "version": "v0", "channel": "mychannel"}, - {"id": "smallbank", "path": "contract/fabric/smallbank", "language":"golang", "version": "v0", "channel": "mychannel"} - ], - "endorsement-policy": { - "identities": [ - { - "role": { - "name": "member", - "mspId": "Org1MSP" - } - }, - { - "role": { - "name": "member", - "mspId": "Org2MSP" - } - }, - { - "role": { - "name": "admin", - "mspId": "Org1MSP" - } - } - ], - "policy": { "2-of": [{"signed-by": 0}, {"signed-by": 1}]} - }, - "context": { - "smallOperations": "mychannel", - "init": "mychannel", - "open": "mychannel", - "publish": "mychannel", - "query": "mychannel" - } - }, - "info" : { - "Version": "1.2.0", - "Size": "2 Orgs with 1 Peer", - "Orderer": "Solo", - "Distribution": "Single Host" - } -} diff --git a/packages/caliper-samples/network/fabric-v1.3/2org1peergoleveldb/fabric-go.json b/packages/caliper-samples/network/fabric-v1.3/2org1peergoleveldb/fabric-go.json deleted file mode 100644 index b3d8e7d69..000000000 --- a/packages/caliper-samples/network/fabric-v1.3/2org1peergoleveldb/fabric-go.json +++ /dev/null @@ -1,101 +0,0 @@ -{ - "caliper": { - "blockchain": "fabric", - "command" : { - "start": "docker-compose -f network/fabric-v1.3/2org1peergoleveldb/docker-compose.yaml up -d;sleep 3s", - "end" : "docker-compose -f network/fabric-v1.3/2org1peergoleveldb/docker-compose.yaml down;(test -z \"$(docker ps -aq)\") || docker rm $(docker ps -aq);(test -z \"$(docker images dev* -q)\") || docker rmi $(docker images dev* -q)" - } - }, - "fabric": { - "cryptodir": "network/fabric-v1.3/config/crypto-config", - "network": { - "orderer": { - "url": "grpc://localhost:7050", - "mspid": "OrdererMSP", - "msp": "network/fabric-v1.3/config/crypto-config/ordererOrganizations/example.com/msp/", - "server-hostname": "orderer.example.com", - "tls_cacerts": "network/fabric-v1.3/config/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/ca.crt" - }, - "org1": { - "name": "peerOrg1", - "mspid": "Org1MSP", - "msp": "network/fabric-v1.3/config/crypto-config/peerOrganizations/org1.example.com/msp/", - "ca": { - "url": "http://localhost:7054", - "name": "ca.org1.example.com" - }, - "peer1": { - "requests": "grpc://localhost:7051", - "events": "grpc://localhost:7053", - "server-hostname": "peer0.org1.example.com", - "tls_cacerts": "network/fabric-v1.3/config/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt" - } - }, - "org2": { - "name": "peerOrg2", - "mspid": "Org2MSP", - "msp": "network/fabric-v1.3/config/crypto-config/peerOrganizations/org2.example.com/msp/", - "ca": { - "url": "http://localhost:8054", - "name": "ca.org2.example.com" - }, - "peer1": { - "requests": "grpc://localhost:8051", - "events": "grpc://localhost:8053", - "server-hostname": "peer0.org2.example.com", - "tls_cacerts": "network/fabric-v1.3/config/crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt" - } - } - }, - "channel": [ - { - "name": "mychannel", - "deployed": false, - "config": "network/fabric-v1.3/config/mychannel.tx", - "organizations": ["org1", "org2"] - } - ], - "chaincodes": [ - {"id": "drm", "path": "contract/fabric/drm", "language":"golang", "version": "v0", "channel": "mychannel"}, - {"id": "marbles", "path": "contract/fabric/marbles-norichquery/go", "language":"golang", "version": "v1", "channel": "mychannel"}, - {"id": "simple", "path": "contract/fabric/simple/go", "language":"golang", "version": "v0", "channel": "mychannel"}, - {"id": "smallbank", "path": "contract/fabric/smallbank", "language":"golang", "version": "v0", "channel": "mychannel"} - ], - "endorsement-policy": { - "identities": [ - { - "role": { - "name": "member", - "mspId": "Org1MSP" - } - }, - { - "role": { - "name": "member", - "mspId": "Org2MSP" - } - }, - { - "role": { - "name": "admin", - "mspId": "Org1MSP" - } - } - ], - "policy": { "2-of": [{"signed-by": 0}, {"signed-by": 1}]} - }, - "context": { - "smallOperations": "mychannel", - "init": "mychannel", - "open": "mychannel", - "publish": "mychannel", - "query": "mychannel" - } - }, - "info" : { - "Version": "1.2.0", - "Size": "2 Orgs with 1 Peer", - "Orderer": "Solo", - "Distribution": "Single Host" - } -} diff --git a/packages/caliper-samples/network/fabric-v1.3/2org1peergoleveldb/fabric-node-tls.json b/packages/caliper-samples/network/fabric-v1.3/2org1peergoleveldb/fabric-node-tls.json deleted file mode 100644 index b9f8f7595..000000000 --- a/packages/caliper-samples/network/fabric-v1.3/2org1peergoleveldb/fabric-node-tls.json +++ /dev/null @@ -1,97 +0,0 @@ -{ - "caliper": { - "blockchain": "fabric", - "command" : { - "start": "docker-compose -f network/fabric-v1.3/2org1peergoleveldb/docker-compose-tls.yaml up -d;sleep 3s", - "end" : "docker-compose -f network/fabric-v1.3/2org1peergoleveldb/docker-compose-tls.yaml down;(test -z \"$(docker ps -aq)\") || docker rm $(docker ps -aq);(test -z \"$(docker images dev* -q)\") || docker rmi $(docker images dev* -q)" - } - }, - "fabric": { - "cryptodir": "network/fabric-v1.3/config/crypto-config", - "network": { - "orderer": { - "url": "grpcs://localhost:7050", - "mspid": "OrdererMSP", - "msp": "network/fabric-v1.3/config/crypto-config/ordererOrganizations/example.com/msp/", - "server-hostname": "orderer.example.com", - "tls_cacerts": "network/fabric-v1.3/config/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/ca.crt" - }, - "org1": { - "name": "peerOrg1", - "mspid": "Org1MSP", - "msp": "network/fabric-v1.3/config/crypto-config/peerOrganizations/org1.example.com/msp/", - "ca": { - "url": "https://localhost:7054", - "name": "ca.org1.example.com" - }, - "peer1": { - "requests": "grpcs://localhost:7051", - "events": "grpcs://localhost:7053", - "server-hostname": "peer0.org1.example.com", - "tls_cacerts": "network/fabric-v1.3/config/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt" - } - }, - "org2": { - "name": "peerOrg2", - "mspid": "Org2MSP", - "msp": "network/fabric-v1.3/config/crypto-config/peerOrganizations/org2.example.com/msp/", - "ca": { - "url": "https://localhost:8054", - "name": "ca.org2.example.com" - }, - "peer1": { - "requests": "grpcs://localhost:8051", - "events": "grpcs://localhost:8053", - "server-hostname": "peer0.org2.example.com", - "tls_cacerts": "network/fabric-v1.3/config/crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt" - } - } - }, - "channel": [ - { - "name": "mychannel", - "deployed": false, - "config": "network/fabric-v1.3/config/mychannel.tx", - "organizations": ["org1", "org2"] - } - ], - "chaincodes": [ - {"id": "marbles", "path": "src/contract/fabric/marbles-norichquery/node", "language":"node", "version": "v1", "channel": "mychannel"}, - {"id": "simple", "path": "src/contract/fabric/simple/node", "language":"node", "version": "v0", "channel": "mychannel"} - ], - "endorsement-policy": { - "identities": [ - { - "role": { - "name": "member", - "mspId": "Org1MSP" - } - }, - { - "role": { - "name": "member", - "mspId": "Org2MSP" - } - }, - { - "role": { - "name": "admin", - "mspId": "Org1MSP" - } - } - ], - "policy": { "2-of": [{"signed-by": 0}, {"signed-by": 1}]} - }, - "context": { - "init": "mychannel", - "open": "mychannel", - "query": "mychannel" - } - }, - "info" : { - "Version": "1.2.0", - "Size": "2 Orgs with 1 Peer", - "Orderer": "Solo", - "Distribution": "Single Host" - } -} diff --git a/packages/caliper-samples/network/fabric-v1.3/2org1peergoleveldb/fabric-node.json b/packages/caliper-samples/network/fabric-v1.3/2org1peergoleveldb/fabric-node.json deleted file mode 100644 index 6b0488b6d..000000000 --- a/packages/caliper-samples/network/fabric-v1.3/2org1peergoleveldb/fabric-node.json +++ /dev/null @@ -1,97 +0,0 @@ -{ - "caliper": { - "blockchain": "fabric", - "command" : { - "start": "docker-compose -f network/fabric-v1.3/2org1peergoleveldb/docker-compose.yaml up -d;sleep 3s", - "end" : "docker-compose -f network/fabric-v1.3/2org1peergoleveldb/docker-compose.yaml down;(test -z \"$(docker ps -aq)\") || docker rm $(docker ps -aq);(test -z \"$(docker images dev* -q)\") || docker rmi $(docker images dev* -q)" - } - }, - "fabric": { - "cryptodir": "network/fabric-v1.3/config/crypto-config", - "network": { - "orderer": { - "url": "grpc://localhost:7050", - "mspid": "OrdererMSP", - "msp": "network/fabric-v1.3/config/crypto-config/ordererOrganizations/example.com/msp/", - "server-hostname": "orderer.example.com", - "tls_cacerts": "network/fabric-v1.3/config/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/ca.crt" - }, - "org1": { - "name": "peerOrg1", - "mspid": "Org1MSP", - "msp": "network/fabric-v1.3/config/crypto-config/peerOrganizations/org1.example.com/msp/", - "ca": { - "url": "http://localhost:7054", - "name": "ca.org1.example.com" - }, - "peer1": { - "requests": "grpc://localhost:7051", - "events": "grpc://localhost:7053", - "server-hostname": "peer0.org1.example.com", - "tls_cacerts": "network/fabric-v1.3/config/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt" - } - }, - "org2": { - "name": "peerOrg2", - "mspid": "Org2MSP", - "msp": "network/fabric-v1.3/config/crypto-config/peerOrganizations/org2.example.com/msp/", - "ca": { - "url": "http://localhost:8054", - "name": "ca.org2.example.com" - }, - "peer1": { - "requests": "grpc://localhost:8051", - "events": "grpc://localhost:8053", - "server-hostname": "peer0.org2.example.com", - "tls_cacerts": "network/fabric-v1.3/config/crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt" - } - } - }, - "channel": [ - { - "name": "mychannel", - "deployed": false, - "config": "network/fabric-v1.3/config/mychannel.tx", - "organizations": ["org1", "org2"] - } - ], - "chaincodes": [ - {"id": "marbles", "path": "src/contract/fabric/marbles-norichquery/node", "language":"node", "version": "v1", "channel": "mychannel"}, - {"id": "simple", "path": "src/contract/fabric/simple/node", "language":"node", "version": "v0", "channel": "mychannel"} - ], - "endorsement-policy": { - "identities": [ - { - "role": { - "name": "member", - "mspId": "Org1MSP" - } - }, - { - "role": { - "name": "member", - "mspId": "Org2MSP" - } - }, - { - "role": { - "name": "admin", - "mspId": "Org1MSP" - } - } - ], - "policy": { "2-of": [{"signed-by": 0}, {"signed-by": 1}]} - }, - "context": { - "init": "mychannel", - "open": "mychannel", - "query": "mychannel" - } - }, - "info" : { - "Version": "1.2.0", - "Size": "2 Orgs with 1 Peer", - "Orderer": "Solo", - "Distribution": "Single Host" - } -} diff --git a/packages/caliper-samples/network/fabric-v1.4.1/2org1peercouchdb/README.md b/packages/caliper-samples/network/fabric-v1.4.1/2org1peercouchdb/README.md index 7255dbf2c..247ae660f 100755 --- a/packages/caliper-samples/network/fabric-v1.4.1/2org1peercouchdb/README.md +++ b/packages/caliper-samples/network/fabric-v1.4.1/2org1peercouchdb/README.md @@ -21,11 +21,11 @@ The configuration files names (with or without the `-tls` part) indicate which n The following network configuration files are available for the different platforms, containing the listed chaincodes that will be deployed (installed and instantiated). ### Fabric -* `fabric-go(-tls).json` (__golang__ implementations) +* `fabric-ccp-go(-tls).json` (__golang__ implementations) * `marbles` __with__ CouchDB index metadata and rich query support. * `drm` * `simple` * `smallbank` -* `fabric-node(-tls).json` (__Node.JS__ implementations) +* `fabric-ccp-node(-tls).json` (__Node.JS__ implementations) * `marbles` __with__ CouchDB index metadata and rich query support. * `simple` diff --git a/packages/caliper-samples/network/fabric-v1.4.1/2org1peergoleveldb/README.md b/packages/caliper-samples/network/fabric-v1.4.1/2org1peergoleveldb/README.md index f0e6b76a2..8574321cf 100755 --- a/packages/caliper-samples/network/fabric-v1.4.1/2org1peergoleveldb/README.md +++ b/packages/caliper-samples/network/fabric-v1.4.1/2org1peergoleveldb/README.md @@ -21,11 +21,11 @@ The configuration files names (with or without the `-tls` part) indicate which n The following network configuration files are available for the different platforms, containing the listed chaincodes that will be deployed (installed and instantiated). ### Fabric -* `fabric-go(-tls).json` (__golang__ implementations) +* `fabric-ccp-go(-tls).json` (__golang__ implementations) * `marbles` __without__ CouchDB index metadata and rich query support. * `drm` * `simple` * `smallbank` -* `fabric-node(-tls).json` (__Node.JS__ implementations) +* `fabric-ccp-node(-tls).json` (__Node.JS__ implementations) * `marbles` __without__ CouchDB index metadata and rich query support. * `simple` diff --git a/packages/caliper-samples/network/fabric-v1.4.1/3org2peercouchdb/README.md b/packages/caliper-samples/network/fabric-v1.4.1/3org2peercouchdb/README.md index 884f86115..ee64a011b 100755 --- a/packages/caliper-samples/network/fabric-v1.4.1/3org2peercouchdb/README.md +++ b/packages/caliper-samples/network/fabric-v1.4.1/3org2peercouchdb/README.md @@ -21,11 +21,11 @@ The configuration files names (with or without the `-tls` part) indicate which n The following network configuration files are available for the different platforms, containing the listed chaincodes that will be deployed (installed and instantiated). ### Fabric -* `fabric-go(-tls).json` (__golang__ implementations) +* `fabric-ccp-go(-tls).json` (__golang__ implementations) * `marbles` __with__ CouchDB index metadata and rich query support. * `drm` * `simple` * `smallbank` -* `fabric-node(-tls).json` (__Node.JS__ implementations) +* `fabric-ccp-node(-tls).json` (__Node.JS__ implementations) * `marbles` __with__ CouchDB index metadata and rich query support. * `simple` diff --git a/packages/caliper-samples/network/fabric-v1.4.1/3org2peergoleveldb/README.md b/packages/caliper-samples/network/fabric-v1.4.1/3org2peergoleveldb/README.md index 9ac438ca2..e9d6351a3 100755 --- a/packages/caliper-samples/network/fabric-v1.4.1/3org2peergoleveldb/README.md +++ b/packages/caliper-samples/network/fabric-v1.4.1/3org2peergoleveldb/README.md @@ -21,11 +21,11 @@ The configuration files names (with or without the `-tls` part) indicate which n The following network configuration files are available for the different platforms, containing the listed chaincodes that will be deployed (installed and instantiated). ### Fabric -* `fabric-go(-tls).json` (__golang__ implementations) +* `fabric-ccp-go(-tls).json` (__golang__ implementations) * `marbles` __without__ CouchDB index metadata and rich query support. * `drm` * `simple` * `smallbank` -* `fabric-node(-tls).json` (__Node.JS__ implementations) +* `fabric-ccp-node(-tls).json` (__Node.JS__ implementations) * `marbles` __without__ CouchDB index metadata and rich query support. * `simple` diff --git a/packages/caliper-samples/network/fabric-v1.4/2org1peercouchdb/README.md b/packages/caliper-samples/network/fabric-v1.4/2org1peercouchdb/README.md index 8a9f1e9eb..08ed7d2ae 100755 --- a/packages/caliper-samples/network/fabric-v1.4/2org1peercouchdb/README.md +++ b/packages/caliper-samples/network/fabric-v1.4/2org1peercouchdb/README.md @@ -26,11 +26,11 @@ The following network configuration files are available for the different platfo * `vehicle-lifecycle-network` ### Fabric -* `fabric-go(-tls).json` (__golang__ implementations) +* `fabric-ccp-go(-tls).json` (__golang__ implementations) * `marbles` __with__ CouchDB index metadata and rich query support. * `drm` * `simple` * `smallbank` -* `fabric-node(-tls).json` (__Node.JS__ implementations) +* `fabric-ccp-node(-tls).json` (__Node.JS__ implementations) * `marbles` __with__ CouchDB index metadata and rich query support. - * `simple` \ No newline at end of file + * `simple` diff --git a/packages/caliper-samples/network/fabric-v1.4/2org1peercouchdb/fabric-go-tls.json b/packages/caliper-samples/network/fabric-v1.4/2org1peercouchdb/fabric-go-tls.json deleted file mode 100644 index f09ce7ec1..000000000 --- a/packages/caliper-samples/network/fabric-v1.4/2org1peercouchdb/fabric-go-tls.json +++ /dev/null @@ -1,101 +0,0 @@ -{ - "caliper": { - "blockchain": "fabric", - "command" : { - "start": "docker-compose -f network/fabric-v1.4/2org1peercouchdb/docker-compose-tls.yaml up -d;sleep 3s", - "end" : "docker-compose -f network/fabric-v1.4/2org1peercouchdb/docker-compose-tls.yaml down;(test -z \"$(docker ps -aq)\") || docker rm $(docker ps -aq);(test -z \"$(docker images dev* -q)\") || docker rmi $(docker images dev* -q)" - } - }, - "fabric": { - "cryptodir": "network/fabric-v1.4/config/crypto-config", - "network": { - "orderer": { - "url": "grpcs://localhost:7050", - "mspid": "OrdererMSP", - "msp": "network/fabric-v1.4/config/crypto-config/ordererOrganizations/example.com/msp/", - "server-hostname": "orderer.example.com", - "tls_cacerts": "network/fabric-v1.4/config/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/ca.crt" - }, - "org1": { - "name": "peerOrg1", - "mspid": "Org1MSP", - "msp": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org1.example.com/msp/", - "ca": { - "url": "https://localhost:7054", - "name": "ca.org1.example.com" - }, - "peer1": { - "requests": "grpcs://localhost:7051", - "events": "grpcs://localhost:7053", - "server-hostname": "peer0.org1.example.com", - "tls_cacerts": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt" - } - }, - "org2": { - "name": "peerOrg2", - "mspid": "Org2MSP", - "msp": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org2.example.com/msp/", - "ca": { - "url": "https://localhost:8054", - "name": "ca.org2.example.com" - }, - "peer1": { - "requests": "grpcs://localhost:8051", - "events": "grpcs://localhost:8053", - "server-hostname": "peer0.org2.example.com", - "tls_cacerts": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt" - } - } - }, - "channel": [ - { - "name": "mychannel", - "deployed": false, - "config": "network/fabric-v1.4/config/mychannel.tx", - "organizations": ["org1", "org2"] - } - ], - "chaincodes": [ - {"id": "drm", "path": "contract/fabric/drm", "language":"golang", "version": "v0", "channel": "mychannel"}, - {"id": "marbles", "path": "contract/fabric/marbles/go", "language":"golang", "version": "v1", "channel": "mychannel", "metadataPath": "src/contract/fabric/marbles/go/metadata"}, - {"id": "simple", "path": "contract/fabric/simple/go", "language":"golang", "version": "v0", "channel": "mychannel"}, - {"id": "smallbank", "path": "contract/fabric/smallbank", "language":"golang", "version": "v0", "channel": "mychannel"} - ], - "endorsement-policy": { - "identities": [ - { - "role": { - "name": "member", - "mspId": "Org1MSP" - } - }, - { - "role": { - "name": "member", - "mspId": "Org2MSP" - } - }, - { - "role": { - "name": "admin", - "mspId": "Org1MSP" - } - } - ], - "policy": { "2-of": [{"signed-by": 0}, {"signed-by": 1}]} - }, - "context": { - "smallOperations": "mychannel", - "init": "mychannel", - "open": "mychannel", - "publish": "mychannel", - "query": "mychannel" - } - }, - "info" : { - "Version": "1.4.0", - "Size": "2 Orgs with 1 Peer", - "Orderer": "Solo", - "Distribution": "Single Host" - } -} diff --git a/packages/caliper-samples/network/fabric-v1.4/2org1peercouchdb/fabric-go.json b/packages/caliper-samples/network/fabric-v1.4/2org1peercouchdb/fabric-go.json deleted file mode 100644 index 6dd43ed91..000000000 --- a/packages/caliper-samples/network/fabric-v1.4/2org1peercouchdb/fabric-go.json +++ /dev/null @@ -1,101 +0,0 @@ -{ - "caliper": { - "blockchain": "fabric", - "command" : { - "start": "docker-compose -f network/fabric-v1.4/2org1peercouchdb/docker-compose.yaml up -d;sleep 3s", - "end" : "docker-compose -f network/fabric-v1.4/2org1peercouchdb/docker-compose.yaml down;(test -z \"$(docker ps -aq)\") || docker rm $(docker ps -aq);(test -z \"$(docker images dev* -q)\") || docker rmi $(docker images dev* -q)" - } - }, - "fabric": { - "cryptodir": "network/fabric-v1.4/config/crypto-config", - "network": { - "orderer": { - "url": "grpc://localhost:7050", - "mspid": "OrdererMSP", - "msp": "network/fabric-v1.4/config/crypto-config/ordererOrganizations/example.com/msp/", - "server-hostname": "orderer.example.com", - "tls_cacerts": "network/fabric-v1.4/config/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/ca.crt" - }, - "org1": { - "name": "peerOrg1", - "mspid": "Org1MSP", - "msp": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org1.example.com/msp/", - "ca": { - "url": "http://localhost:7054", - "name": "ca.org1.example.com" - }, - "peer1": { - "requests": "grpc://localhost:7051", - "events": "grpc://localhost:7053", - "server-hostname": "peer0.org1.example.com", - "tls_cacerts": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt" - } - }, - "org2": { - "name": "peerOrg2", - "mspid": "Org2MSP", - "msp": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org2.example.com/msp/", - "ca": { - "url": "http://localhost:8054", - "name": "ca.org2.example.com" - }, - "peer1": { - "requests": "grpc://localhost:8051", - "events": "grpc://localhost:8053", - "server-hostname": "peer0.org2.example.com", - "tls_cacerts": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt" - } - } - }, - "channel": [ - { - "name": "mychannel", - "deployed": false, - "config": "network/fabric-v1.4/config/mychannel.tx", - "organizations": ["org1", "org2"] - } - ], - "chaincodes": [ - {"id": "drm", "path": "contract/fabric/drm", "language":"golang", "version": "v0", "channel": "mychannel"}, - {"id": "marbles", "path": "contract/fabric/marbles/go", "language":"golang", "version": "v1", "channel": "mychannel", "metadataPath": "src/contract/fabric/marbles/go/metadata"}, - {"id": "simple", "path": "contract/fabric/simple/go", "language":"golang", "version": "v0", "channel": "mychannel"}, - {"id": "smallbank", "path": "contract/fabric/smallbank", "language":"golang", "version": "v0", "channel": "mychannel"} - ], - "endorsement-policy": { - "identities": [ - { - "role": { - "name": "member", - "mspId": "Org1MSP" - } - }, - { - "role": { - "name": "member", - "mspId": "Org2MSP" - } - }, - { - "role": { - "name": "admin", - "mspId": "Org1MSP" - } - } - ], - "policy": { "2-of": [{"signed-by": 0}, {"signed-by": 1}]} - }, - "context": { - "smallOperations": "mychannel", - "init": "mychannel", - "open": "mychannel", - "publish": "mychannel", - "query": "mychannel" - } - }, - "info" : { - "Version": "1.4.0", - "Size": "2 Orgs with 1 Peer", - "Orderer": "Solo", - "Distribution": "Single Host" - } -} diff --git a/packages/caliper-samples/network/fabric-v1.4/2org1peercouchdb/fabric-node-tls.json b/packages/caliper-samples/network/fabric-v1.4/2org1peercouchdb/fabric-node-tls.json deleted file mode 100644 index 412720931..000000000 --- a/packages/caliper-samples/network/fabric-v1.4/2org1peercouchdb/fabric-node-tls.json +++ /dev/null @@ -1,100 +0,0 @@ -{ - "caliper": { - "blockchain": "fabric", - "command" : { - "start": "docker-compose -f network/fabric-v1.4/2org1peercouchdb/docker-compose-tls.yaml up -d;sleep 3s", - "end" : "docker-compose -f network/fabric-v1.4/2org1peercouchdb/docker-compose-tls.yaml down;(test -z \"$(docker ps -aq)\") || docker rm $(docker ps -aq);(test -z \"$(docker images dev* -q)\") || docker rmi $(docker images dev* -q)" - } - }, - "fabric": { - "cryptodir": "network/fabric-v1.4/config/crypto-config", - "network": { - "orderer": { - "url": "grpcs://localhost:7050", - "mspid": "OrdererMSP", - "msp": "network/fabric-v1.4/config/crypto-config/ordererOrganizations/example.com/msp/", - "server-hostname": "orderer.example.com", - "tls_cacerts": "network/fabric-v1.4/config/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/ca.crt" - }, - "org1": { - "name": "peerOrg1", - "mspid": "Org1MSP", - "msp": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org1.example.com/msp/", - "ca": { - "url": "https://localhost:7054", - "name": "ca.org1.example.com" - }, - "peer1": { - "requests": "grpcs://localhost:7051", - "events": "grpcs://localhost:7053", - "server-hostname": "peer0.org1.example.com", - "tls_cacerts": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt" - } - }, - "org2": { - "name": "peerOrg2", - "mspid": "Org2MSP", - "msp": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org2.example.com/msp/", - "ca": { - "url": "https://localhost:8054", - "name": "ca.org2.example.com" - }, - "peer1": { - "requests": "grpcs://localhost:8051", - "events": "grpcs://localhost:8053", - "server-hostname": "peer0.org2.example.com", - "tls_cacerts": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt" - } - } - }, - "channel": [ - { - "name": "mychannel", - "deployed": false, - "capabilities": [], - "consortium": "SampleConsortium", - "msps": ["Org1MSP", "Org2MSP", "Org3MSP"], - "organizations": ["org1", "org2"], - "version": 0 - } - ], - "chaincodes": [ - {"id": "marbles", "path": "src/contract/fabric/marbles/node", "language":"node", "version": "v1", "channel": "mychannel", "metadataPath": "src/contract/fabric/marbles/node/metadata"}, - {"id": "simple", "path": "src/contract/fabric/simple/node", "language":"node", "version": "v0", "channel": "mychannel"} - ], - "endorsement-policy": { - "identities": [ - { - "role": { - "name": "member", - "mspId": "Org1MSP" - } - }, - { - "role": { - "name": "member", - "mspId": "Org2MSP" - } - }, - { - "role": { - "name": "admin", - "mspId": "Org1MSP" - } - } - ], - "policy": { "2-of": [{"signed-by": 0}, {"signed-by": 1}]} - }, - "context": { - "init": "mychannel", - "open": "mychannel", - "query": "mychannel" - } - }, - "info" : { - "Version": "1.4.0", - "Size": "2 Orgs with 1 Peer", - "Orderer": "Solo", - "Distribution": "Single Host" - } -} diff --git a/packages/caliper-samples/network/fabric-v1.4/2org1peercouchdb/fabric-node.json b/packages/caliper-samples/network/fabric-v1.4/2org1peercouchdb/fabric-node.json deleted file mode 100644 index 87d58e84f..000000000 --- a/packages/caliper-samples/network/fabric-v1.4/2org1peercouchdb/fabric-node.json +++ /dev/null @@ -1,100 +0,0 @@ -{ - "caliper": { - "blockchain": "fabric", - "command" : { - "start": "docker-compose -f network/fabric-v1.4/2org1peercouchdb/docker-compose.yaml up -d;sleep 3s", - "end" : "docker-compose -f network/fabric-v1.4/2org1peercouchdb/docker-compose.yaml down;(test -z \"$(docker ps -aq)\") || docker rm $(docker ps -aq);" - } - }, - "fabric": { - "cryptodir": "network/fabric-v1.4/config/crypto-config", - "network": { - "orderer": { - "url": "grpc://localhost:7050", - "mspid": "OrdererMSP", - "msp": "network/fabric-v1.4/config/crypto-config/ordererOrganizations/example.com/msp/", - "server-hostname": "orderer.example.com", - "tls_cacerts": "network/fabric-v1.4/config/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/ca.crt" - }, - "org1": { - "name": "peerOrg1", - "mspid": "Org1MSP", - "msp": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org1.example.com/msp/", - "ca": { - "url": "http://localhost:7054", - "name": "ca.org1.example.com" - }, - "peer1": { - "requests": "grpc://localhost:7051", - "events": "grpc://localhost:7053", - "server-hostname": "peer0.org1.example.com", - "tls_cacerts": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt" - } - }, - "org2": { - "name": "peerOrg2", - "mspid": "Org2MSP", - "msp": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org2.example.com/msp/", - "ca": { - "url": "http://localhost:8054", - "name": "ca.org2.example.com" - }, - "peer1": { - "requests": "grpc://localhost:8051", - "events": "grpc://localhost:8053", - "server-hostname": "peer0.org2.example.com", - "tls_cacerts": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt" - } - } - }, - "channel": [ - { - "name": "mychannel", - "deployed": false, - "capabilities": [], - "consortium": "SampleConsortium", - "msps": ["Org1MSP", "Org2MSP", "Org3MSP"], - "organizations": ["org1", "org2"], - "version": 0 - } - ], - "chaincodes": [ - {"id": "marbles", "path": "src/contract/fabric/marbles/node", "language":"node", "version": "v1", "channel": "mychannel", "metadataPath": "src/contract/fabric/marbles/node/metadata"}, - {"id": "simple", "path": "src/contract/fabric/simple/node", "language":"node", "version": "v0", "channel": "mychannel"} - ], - "endorsement-policy": { - "identities": [ - { - "role": { - "name": "member", - "mspId": "Org1MSP" - } - }, - { - "role": { - "name": "member", - "mspId": "Org2MSP" - } - }, - { - "role": { - "name": "admin", - "mspId": "Org1MSP" - } - } - ], - "policy": { "2-of": [{"signed-by": 0}, {"signed-by": 1}]} - }, - "context": { - "init": "mychannel", - "open": "mychannel", - "query": "mychannel" - } - }, - "info" : { - "Version": "1.4.0", - "Size": "2 Orgs with 1 Peer", - "Orderer": "Solo", - "Distribution": "Single Host" - } -} diff --git a/packages/caliper-samples/network/fabric-v1.4/2org1peergoleveldb/README.md b/packages/caliper-samples/network/fabric-v1.4/2org1peergoleveldb/README.md index 2b8c4022c..0efb82f44 100755 --- a/packages/caliper-samples/network/fabric-v1.4/2org1peergoleveldb/README.md +++ b/packages/caliper-samples/network/fabric-v1.4/2org1peergoleveldb/README.md @@ -26,11 +26,11 @@ The following network configuration files are available for the different platfo * `vehicle-lifecycle-network` ### Fabric -* `fabric-go(-tls).json` (__golang__ implementations) +* `fabric-ccp-go(-tls).json` (__golang__ implementations) * `marbles` __without__ CouchDB index metadata and rich query support. * `drm` * `simple` * `smallbank` -* `fabric-node(-tls).json` (__Node.JS__ implementations) +* `fabric-ccp-node(-tls).json` (__Node.JS__ implementations) * `marbles` __without__ CouchDB index metadata and rich query support. - * `simple` \ No newline at end of file + * `simple` diff --git a/packages/caliper-samples/network/fabric-v1.4/2org1peergoleveldb/fabric-go-tls.json b/packages/caliper-samples/network/fabric-v1.4/2org1peergoleveldb/fabric-go-tls.json deleted file mode 100644 index f5cc5c004..000000000 --- a/packages/caliper-samples/network/fabric-v1.4/2org1peergoleveldb/fabric-go-tls.json +++ /dev/null @@ -1,101 +0,0 @@ -{ - "caliper": { - "blockchain": "fabric", - "command" : { - "start": "docker-compose -f network/fabric-v1.4/2org1peergoleveldb/docker-compose-tls.yaml up -d;sleep 3s", - "end" : "docker-compose -f network/fabric-v1.4/2org1peergoleveldb/docker-compose-tls.yaml down;(test -z \"$(docker ps -aq)\") || docker rm $(docker ps -aq);(test -z \"$(docker images dev* -q)\") || docker rmi $(docker images dev* -q)" - } - }, - "fabric": { - "cryptodir": "network/fabric-v1.4/config/crypto-config", - "network": { - "orderer": { - "url": "grpcs://localhost:7050", - "mspid": "OrdererMSP", - "msp": "network/fabric-v1.4/config/crypto-config/ordererOrganizations/example.com/msp/", - "server-hostname": "orderer.example.com", - "tls_cacerts": "network/fabric-v1.4/config/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/ca.crt" - }, - "org1": { - "name": "peerOrg1", - "mspid": "Org1MSP", - "msp": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org1.example.com/msp/", - "ca": { - "url": "https://localhost:7054", - "name": "ca.org1.example.com" - }, - "peer1": { - "requests": "grpcs://localhost:7051", - "events": "grpcs://localhost:7053", - "server-hostname": "peer0.org1.example.com", - "tls_cacerts": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt" - } - }, - "org2": { - "name": "peerOrg2", - "mspid": "Org2MSP", - "msp": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org2.example.com/msp/", - "ca": { - "url": "https://localhost:8054", - "name": "ca.org2.example.com" - }, - "peer1": { - "requests": "grpcs://localhost:8051", - "events": "grpcs://localhost:8053", - "server-hostname": "peer0.org2.example.com", - "tls_cacerts": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt" - } - } - }, - "channel": [ - { - "name": "mychannel", - "deployed": false, - "config": "network/fabric-v1.4/config/mychannel.tx", - "organizations": ["org1", "org2"] - } - ], - "chaincodes": [ - {"id": "drm", "path": "contract/fabric/drm", "language":"golang", "version": "v0", "channel": "mychannel"}, - {"id": "marbles", "path": "contract/fabric/marbles-norichquery/go", "language":"golang", "version": "v1", "channel": "mychannel"}, - {"id": "simple", "path": "contract/fabric/simple/go", "language":"golang", "version": "v0", "channel": "mychannel"}, - {"id": "smallbank", "path": "contract/fabric/smallbank", "language":"golang", "version": "v0", "channel": "mychannel"} - ], - "endorsement-policy": { - "identities": [ - { - "role": { - "name": "member", - "mspId": "Org1MSP" - } - }, - { - "role": { - "name": "member", - "mspId": "Org2MSP" - } - }, - { - "role": { - "name": "admin", - "mspId": "Org1MSP" - } - } - ], - "policy": { "2-of": [{"signed-by": 0}, {"signed-by": 1}]} - }, - "context": { - "smallOperations": "mychannel", - "init": "mychannel", - "open": "mychannel", - "publish": "mychannel", - "query": "mychannel" - } - }, - "info" : { - "Version": "1.4.0", - "Size": "2 Orgs with 1 Peer", - "Orderer": "Solo", - "Distribution": "Single Host" - } -} diff --git a/packages/caliper-samples/network/fabric-v1.4/2org1peergoleveldb/fabric-go.json b/packages/caliper-samples/network/fabric-v1.4/2org1peergoleveldb/fabric-go.json deleted file mode 100644 index 94cac676e..000000000 --- a/packages/caliper-samples/network/fabric-v1.4/2org1peergoleveldb/fabric-go.json +++ /dev/null @@ -1,101 +0,0 @@ -{ - "caliper": { - "blockchain": "fabric", - "command" : { - "start": "docker-compose -f network/fabric-v1.4/2org1peergoleveldb/docker-compose.yaml up -d;sleep 3s", - "end" : "docker-compose -f network/fabric-v1.4/2org1peergoleveldb/docker-compose.yaml down;(test -z \"$(docker ps -aq)\") || docker rm $(docker ps -aq);(test -z \"$(docker images dev* -q)\") || docker rmi $(docker images dev* -q)" - } - }, - "fabric": { - "cryptodir": "network/fabric-v1.4/config/crypto-config", - "network": { - "orderer": { - "url": "grpc://localhost:7050", - "mspid": "OrdererMSP", - "msp": "network/fabric-v1.4/config/crypto-config/ordererOrganizations/example.com/msp/", - "server-hostname": "orderer.example.com", - "tls_cacerts": "network/fabric-v1.4/config/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/ca.crt" - }, - "org1": { - "name": "peerOrg1", - "mspid": "Org1MSP", - "msp": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org1.example.com/msp/", - "ca": { - "url": "http://localhost:7054", - "name": "ca.org1.example.com" - }, - "peer1": { - "requests": "grpc://localhost:7051", - "events": "grpc://localhost:7053", - "server-hostname": "peer0.org1.example.com", - "tls_cacerts": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt" - } - }, - "org2": { - "name": "peerOrg2", - "mspid": "Org2MSP", - "msp": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org2.example.com/msp/", - "ca": { - "url": "http://localhost:8054", - "name": "ca.org2.example.com" - }, - "peer1": { - "requests": "grpc://localhost:8051", - "events": "grpc://localhost:8053", - "server-hostname": "peer0.org2.example.com", - "tls_cacerts": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt" - } - } - }, - "channel": [ - { - "name": "mychannel", - "deployed": false, - "config": "network/fabric-v1.4/config/mychannel.tx", - "organizations": ["org1", "org2"] - } - ], - "chaincodes": [ - {"id": "drm", "path": "contract/fabric/drm", "language":"golang", "version": "v0", "channel": "mychannel"}, - {"id": "marbles", "path": "contract/fabric/marbles-norichquery/go", "language":"golang", "version": "v1", "channel": "mychannel"}, - {"id": "simple", "path": "contract/fabric/simple/go", "language":"golang", "version": "v0", "channel": "mychannel"}, - {"id": "smallbank", "path": "contract/fabric/smallbank", "language":"golang", "version": "v0", "channel": "mychannel"} - ], - "endorsement-policy": { - "identities": [ - { - "role": { - "name": "member", - "mspId": "Org1MSP" - } - }, - { - "role": { - "name": "member", - "mspId": "Org2MSP" - } - }, - { - "role": { - "name": "admin", - "mspId": "Org1MSP" - } - } - ], - "policy": { "2-of": [{"signed-by": 0}, {"signed-by": 1}]} - }, - "context": { - "smallOperations": "mychannel", - "init": "mychannel", - "open": "mychannel", - "publish": "mychannel", - "query": "mychannel" - } - }, - "info" : { - "Version": "1.4.0", - "Size": "2 Orgs with 1 Peer", - "Orderer": "Solo", - "Distribution": "Single Host" - } -} diff --git a/packages/caliper-samples/network/fabric-v1.4/2org1peergoleveldb/fabric-node-tls.json b/packages/caliper-samples/network/fabric-v1.4/2org1peergoleveldb/fabric-node-tls.json deleted file mode 100644 index 6dcca6689..000000000 --- a/packages/caliper-samples/network/fabric-v1.4/2org1peergoleveldb/fabric-node-tls.json +++ /dev/null @@ -1,100 +0,0 @@ -{ - "caliper": { - "blockchain": "fabric", - "command" : { - "start": "docker-compose -f network/fabric-v1.4/2org1peergoleveldb/docker-compose-tls.yaml up -d;sleep 3s", - "end" : "docker-compose -f network/fabric-v1.4/2org1peergoleveldb/docker-compose-tls.yaml down;(test -z \"$(docker ps -aq)\") || docker rm $(docker ps -aq);(test -z \"$(docker images dev* -q)\") || docker rmi $(docker images dev* -q)" - } - }, - "fabric": { - "cryptodir": "network/fabric-v1.4/config/crypto-config", - "network": { - "orderer": { - "url": "grpcs://localhost:7050", - "mspid": "OrdererMSP", - "msp": "network/fabric-v1.4/config/crypto-config/ordererOrganizations/example.com/msp/", - "server-hostname": "orderer.example.com", - "tls_cacerts": "network/fabric-v1.4/config/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/ca.crt" - }, - "org1": { - "name": "peerOrg1", - "mspid": "Org1MSP", - "msp": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org1.example.com/msp/", - "ca": { - "url": "https://localhost:7054", - "name": "ca.org1.example.com" - }, - "peer1": { - "requests": "grpcs://localhost:7051", - "events": "grpcs://localhost:7053", - "server-hostname": "peer0.org1.example.com", - "tls_cacerts": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt" - } - }, - "org2": { - "name": "peerOrg2", - "mspid": "Org2MSP", - "msp": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org2.example.com/msp/", - "ca": { - "url": "https://localhost:8054", - "name": "ca.org2.example.com" - }, - "peer1": { - "requests": "grpcs://localhost:8051", - "events": "grpcs://localhost:8053", - "server-hostname": "peer0.org2.example.com", - "tls_cacerts": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt" - } - } - }, - "channel": [ - { - "name": "mychannel", - "deployed": false, - "capabilities": [], - "consortium": "SampleConsortium", - "msps": ["Org1MSP", "Org2MSP", "Org3MSP"], - "organizations": ["org1", "org2"], - "version": 0 - } - ], - "chaincodes": [ - {"id": "marbles", "path": "src/contract/fabric/marbles-norichquery/node", "language":"node", "version": "v1", "channel": "mychannel"}, - {"id": "simple", "path": "src/contract/fabric/simple/node", "language":"node", "version": "v0", "channel": "mychannel"} - ], - "endorsement-policy": { - "identities": [ - { - "role": { - "name": "member", - "mspId": "Org1MSP" - } - }, - { - "role": { - "name": "member", - "mspId": "Org2MSP" - } - }, - { - "role": { - "name": "admin", - "mspId": "Org1MSP" - } - } - ], - "policy": { "2-of": [{"signed-by": 0}, {"signed-by": 1}]} - }, - "context": { - "init": "mychannel", - "open": "mychannel", - "query": "mychannel" - } - }, - "info" : { - "Version": "1.4.0", - "Size": "2 Orgs with 1 Peer", - "Orderer": "Solo", - "Distribution": "Single Host" - } -} diff --git a/packages/caliper-samples/network/fabric-v1.4/2org1peergoleveldb/fabric-node.json b/packages/caliper-samples/network/fabric-v1.4/2org1peergoleveldb/fabric-node.json deleted file mode 100644 index 61cfc0df0..000000000 --- a/packages/caliper-samples/network/fabric-v1.4/2org1peergoleveldb/fabric-node.json +++ /dev/null @@ -1,100 +0,0 @@ -{ - "caliper": { - "blockchain": "fabric", - "command" : { - "start": "docker-compose -f network/fabric-v1.4/2org1peergoleveldb/docker-compose.yaml up -d;sleep 3s", - "end" : "docker-compose -f network/fabric-v1.4/2org1peergoleveldb/docker-compose.yaml down;(test -z \"$(docker ps -aq)\") || docker rm $(docker ps -aq);(test -z \"$(docker images dev* -q)\") || docker rmi $(docker images dev* -q)" - } - }, - "fabric": { - "cryptodir": "network/fabric-v1.4/config/crypto-config", - "network": { - "orderer": { - "url": "grpc://localhost:7050", - "mspid": "OrdererMSP", - "msp": "network/fabric-v1.4/config/crypto-config/ordererOrganizations/example.com/msp/", - "server-hostname": "orderer.example.com", - "tls_cacerts": "network/fabric-v1.4/config/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/ca.crt" - }, - "org1": { - "name": "peerOrg1", - "mspid": "Org1MSP", - "msp": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org1.example.com/msp/", - "ca": { - "url": "http://localhost:7054", - "name": "ca.org1.example.com" - }, - "peer1": { - "requests": "grpc://localhost:7051", - "events": "grpc://localhost:7053", - "server-hostname": "peer0.org1.example.com", - "tls_cacerts": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt" - } - }, - "org2": { - "name": "peerOrg2", - "mspid": "Org2MSP", - "msp": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org2.example.com/msp/", - "ca": { - "url": "http://localhost:8054", - "name": "ca.org2.example.com" - }, - "peer1": { - "requests": "grpc://localhost:8051", - "events": "grpc://localhost:8053", - "server-hostname": "peer0.org2.example.com", - "tls_cacerts": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt" - } - } - }, - "channel": [ - { - "name": "mychannel", - "deployed": false, - "capabilities": [], - "consortium": "SampleConsortium", - "msps": ["Org1MSP", "Org2MSP", "Org3MSP"], - "organizations": ["org1", "org2"], - "version": 0 - } - ], - "chaincodes": [ - {"id": "marbles", "path": "src/contract/fabric/marbles-norichquery/node", "language":"node", "version": "v1", "channel": "mychannel"}, - {"id": "simple", "path": "src/contract/fabric/simple/node", "language":"node", "version": "v0", "channel": "mychannel"} - ], - "endorsement-policy": { - "identities": [ - { - "role": { - "name": "member", - "mspId": "Org1MSP" - } - }, - { - "role": { - "name": "member", - "mspId": "Org2MSP" - } - }, - { - "role": { - "name": "admin", - "mspId": "Org1MSP" - } - } - ], - "policy": { "2-of": [{"signed-by": 0}, {"signed-by": 1}]} - }, - "context": { - "init": "mychannel", - "open": "mychannel", - "query": "mychannel" - } - }, - "info" : { - "Version": "1.4.0", - "Size": "2 Orgs with 1 Peer", - "Orderer": "Solo", - "Distribution": "Single Host" - } -} diff --git a/packages/caliper-samples/network/fabric-v1.4/3org2peercouchdb/README.md b/packages/caliper-samples/network/fabric-v1.4/3org2peercouchdb/README.md index e99f8b8ad..9a40373f1 100755 --- a/packages/caliper-samples/network/fabric-v1.4/3org2peercouchdb/README.md +++ b/packages/caliper-samples/network/fabric-v1.4/3org2peercouchdb/README.md @@ -26,11 +26,11 @@ The following network configuration files are available for the different platfo * `vehicle-lifecycle-network` ### Fabric -* `fabric-go(-tls).json` (__golang__ implementations) +* `fabric-ccp-go(-tls).json` (__golang__ implementations) * `marbles` __with__ CouchDB index metadata and rich query support. * `drm` * `simple` * `smallbank` -* `fabric-node(-tls).json` (__Node.JS__ implementations) +* `fabric-ccp-node(-tls).json` (__Node.JS__ implementations) * `marbles` __with__ CouchDB index metadata and rich query support. - * `simple` \ No newline at end of file + * `simple` diff --git a/packages/caliper-samples/network/fabric-v1.4/3org2peercouchdb/fabric-go-tls.json b/packages/caliper-samples/network/fabric-v1.4/3org2peercouchdb/fabric-go-tls.json deleted file mode 100644 index 3368248a9..000000000 --- a/packages/caliper-samples/network/fabric-v1.4/3org2peercouchdb/fabric-go-tls.json +++ /dev/null @@ -1,140 +0,0 @@ -{ - "caliper": { - "blockchain": "fabric", - "command" : { - "start": "docker-compose -f network/fabric-v1.4/3org2peercouchdb/docker-compose-tls.yaml up -d;sleep 3s", - "end" : "docker-compose -f network/fabric-v1.4/3org2peercouchdb/docker-compose-tls.yaml down;(test -z \"$(docker ps -aq)\") || docker rm $(docker ps -aq);(test -z \"$(docker images dev* -q)\") || docker rmi $(docker images dev* -q)" - } - }, - "fabric": { - "cryptodir": "network/fabric-v1.4/config/crypto-config", - "network": { - "orderer": { - "url": "grpcs://localhost:7050", - "mspid": "OrdererMSP", - "msp": "network/fabric-v1.4/config/crypto-config/ordererOrganizations/example.com/msp/", - "server-hostname": "orderer.example.com", - "tls_cacerts": "network/fabric-v1.4/config/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/ca.crt" - }, - "org1": { - "name": "peerOrg1", - "mspid": "Org1MSP", - "msp": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org1.example.com/msp/", - "ca": { - "url": "https://localhost:7054", - "name": "ca.org1.example.com" - }, - "peer1": { - "requests": "grpcs://localhost:7051", - "events": "grpcs://localhost:7053", - "server-hostname": "peer0.org1.example.com", - "tls_cacerts": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt" - }, - "peer2": { - "requests": "grpcs://localhost:7057", - "events": "grpcs://localhost:7059", - "server-hostname": "peer1.org1.example.com", - "tls_cacerts": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org1.example.com/peers/peer1.org1.example.com/tls/ca.crt" - } - }, - "org2": { - "name": "peerOrg2", - "mspid": "Org2MSP", - "msp": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org2.example.com/msp/", - "ca": { - "url": "https://localhost:8054", - "name": "ca.org2.example.com" - }, - "peer1": { - "requests": "grpcs://localhost:8051", - "events": "grpcs://localhost:8053", - "server-hostname": "peer0.org2.example.com", - "tls_cacerts": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt" - }, - "peer2": { - "requests": "grpcs://localhost:8057", - "events": "grpcs://localhost:8059", - "server-hostname": "peer1.org2.example.com", - "tls_cacerts": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org2.example.com/peers/peer1.org2.example.com/tls/ca.crt" - } - }, - "org3": { - "name": "peerOrg3", - "mspid": "Org3MSP", - "msp": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org3.example.com/msp/", - "ca": { - "url": "https://localhost:9054", - "name": "ca.org3.example.com" - }, - "peer1": { - "requests": "grpcs://localhost:9051", - "events": "grpcs://localhost:9053", - "server-hostname": "peer0.org3.example.com", - "tls_cacerts": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org3.example.com/peers/peer0.org3.example.com/tls/ca.crt" - }, - "peer2": { - "requests": "grpcs://localhost:9057", - "events": "grpcs://localhost:9059", - "server-hostname": "peer1.org3.example.com", - "tls_cacerts": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org3.example.com/peers/peer1.org3.example.com/tls/ca.crt" - } - } - }, - "channel": [ - { - "name": "mychannel", - "deployed": false, - "config": "network/fabric-v1.4/config/mychannel.tx", - "organizations": ["org1", "org2", "org3"] - } - ], - "chaincodes": [ - {"id": "drm", "path": "contract/fabric/drm", "language":"golang", "version": "v0", "channel": "mychannel"}, - {"id": "marbles", "path": "contract/fabric/marbles/go", "language":"golang", "version": "v1", "channel": "mychannel", "metadataPath": "src/contract/fabric/marbles/go/metadata"}, - {"id": "simple", "path": "contract/fabric/simple/go", "language":"golang", "version": "v0", "channel": "mychannel"}, - {"id": "smallbank", "path": "contract/fabric/smallbank", "language":"golang", "version": "v0", "channel": "mychannel"} - ], - "endorsement-policy": { - "identities": [ - { - "role": { - "name": "member", - "mspId": "Org1MSP" - } - }, - { - "role": { - "name": "member", - "mspId": "Org2MSP" - } - }, - { - "role": { - "name": "member", - "mspId": "Org3MSP" - } - }, - { - "role": { - "name": "admin", - "mspId": "Org1MSP" - } - } - ], - "policy": { "3-of": [{"signed-by": 0}, {"signed-by": 1}, {"signed-by": 2}]} - }, - "context": { - "smallOperations": "mychannel", - "init": "mychannel", - "open": "mychannel", - "publish": "mychannel", - "query": "mychannel" - } - }, - "info" : { - "Version": "1.4.0", - "Size": "3 Orgs with 2 Peers", - "Orderer": "Solo", - "Distribution": "Single Host" - } -} diff --git a/packages/caliper-samples/network/fabric-v1.4/3org2peercouchdb/fabric-go.json b/packages/caliper-samples/network/fabric-v1.4/3org2peercouchdb/fabric-go.json deleted file mode 100644 index d3f78a008..000000000 --- a/packages/caliper-samples/network/fabric-v1.4/3org2peercouchdb/fabric-go.json +++ /dev/null @@ -1,140 +0,0 @@ -{ - "caliper": { - "blockchain": "fabric", - "command" : { - "start": "docker-compose -f network/fabric-v1.4/3org2peercouchdb/docker-compose.yaml up -d;sleep 3s", - "end" : "docker-compose -f network/fabric-v1.4/3org2peercouchdb/docker-compose.yaml down;(test -z \"$(docker ps -aq)\") || docker rm $(docker ps -aq);(test -z \"$(docker images dev* -q)\") || docker rmi $(docker images dev* -q)" - } - }, - "fabric": { - "cryptodir": "network/fabric-v1.4/config/crypto-config", - "network": { - "orderer": { - "url": "grpc://localhost:7050", - "mspid": "OrdererMSP", - "msp": "network/fabric-v1.4/config/crypto-config/ordererOrganizations/example.com/msp/", - "server-hostname": "orderer.example.com", - "tls_cacerts": "network/fabric-v1.4/config/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/ca.crt" - }, - "org1": { - "name": "peerOrg1", - "mspid": "Org1MSP", - "msp": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org1.example.com/msp/", - "ca": { - "url": "http://localhost:7054", - "name": "ca.org1.example.com" - }, - "peer1": { - "requests": "grpc://localhost:7051", - "events": "grpc://localhost:7053", - "server-hostname": "peer0.org1.example.com", - "tls_cacerts": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt" - }, - "peer2": { - "requests": "grpc://localhost:7057", - "events": "grpc://localhost:7059", - "server-hostname": "peer1.org1.example.com", - "tls_cacerts": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org1.example.com/peers/peer1.org1.example.com/tls/ca.crt" - } - }, - "org2": { - "name": "peerOrg2", - "mspid": "Org2MSP", - "msp": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org2.example.com/msp/", - "ca": { - "url": "http://localhost:8054", - "name": "ca.org2.example.com" - }, - "peer1": { - "requests": "grpc://localhost:8051", - "events": "grpc://localhost:8053", - "server-hostname": "peer0.org2.example.com", - "tls_cacerts": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt" - }, - "peer2": { - "requests": "grpc://localhost:8057", - "events": "grpc://localhost:8059", - "server-hostname": "peer1.org2.example.com", - "tls_cacerts": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org2.example.com/peers/peer1.org2.example.com/tls/ca.crt" - } - }, - "org3": { - "name": "peerOrg3", - "mspid": "Org3MSP", - "msp": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org3.example.com/msp/", - "ca": { - "url": "http://localhost:9054", - "name": "ca.org3.example.com" - }, - "peer1": { - "requests": "grpc://localhost:9051", - "events": "grpc://localhost:9053", - "server-hostname": "peer0.org3.example.com", - "tls_cacerts": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org3.example.com/peers/peer0.org3.example.com/tls/ca.crt" - }, - "peer2": { - "requests": "grpc://localhost:9057", - "events": "grpc://localhost:9059", - "server-hostname": "peer1.org3.example.com", - "tls_cacerts": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org3.example.com/peers/peer1.org3.example.com/tls/ca.crt" - } - } - }, - "channel": [ - { - "name": "mychannel", - "deployed": false, - "config": "network/fabric-v1.4/config/mychannel.tx", - "organizations": ["org1", "org2", "org3"] - } - ], - "chaincodes": [ - {"id": "drm", "path": "contract/fabric/drm", "language":"golang", "version": "v0", "channel": "mychannel"}, - {"id": "marbles", "path": "contract/fabric/marbles/go", "language":"golang", "version": "v1", "channel": "mychannel", "metadataPath": "src/contract/fabric/marbles/go/metadata"}, - {"id": "simple", "path": "contract/fabric/simple/go", "language":"golang", "version": "v0", "channel": "mychannel"}, - {"id": "smallbank", "path": "contract/fabric/smallbank", "language":"golang", "version": "v0", "channel": "mychannel"} - ], - "endorsement-policy": { - "identities": [ - { - "role": { - "name": "member", - "mspId": "Org1MSP" - } - }, - { - "role": { - "name": "member", - "mspId": "Org2MSP" - } - }, - { - "role": { - "name": "member", - "mspId": "Org3MSP" - } - }, - { - "role": { - "name": "admin", - "mspId": "Org1MSP" - } - } - ], - "policy": { "3-of": [{"signed-by": 0}, {"signed-by": 1}, {"signed-by": 2}]} - }, - "context": { - "smallOperations": "mychannel", - "init": "mychannel", - "open": "mychannel", - "publish": "mychannel", - "query": "mychannel" - } - }, - "info" : { - "Version": "1.4.0", - "Size": "3 Orgs with 2 Peers", - "Orderer": "Solo", - "Distribution": "Single Host" - } -} diff --git a/packages/caliper-samples/network/fabric-v1.4/3org2peercouchdb/fabric-node-tls.json b/packages/caliper-samples/network/fabric-v1.4/3org2peercouchdb/fabric-node-tls.json deleted file mode 100644 index 474455e6f..000000000 --- a/packages/caliper-samples/network/fabric-v1.4/3org2peercouchdb/fabric-node-tls.json +++ /dev/null @@ -1,141 +0,0 @@ -{ - "caliper": { - "blockchain": "fabric", - "command" : { - "start": "docker-compose -f network/fabric-v1.4/3org2peercouchdb/docker-compose-tls.yaml up -d;sleep 3s", - "end" : "docker-compose -f network/fabric-v1.4/3org2peercouchdb/docker-compose-tls.yaml down;(test -z \"$(docker ps -aq)\") || docker rm $(docker ps -aq);(test -z \"$(docker images dev* -q)\") || docker rmi $(docker images dev* -q)" - } - }, - "fabric": { - "cryptodir": "network/fabric-v1.4/config/crypto-config", - "network": { - "orderer": { - "url": "grpcs://localhost:7050", - "mspid": "OrdererMSP", - "msp": "network/fabric-v1.4/config/crypto-config/ordererOrganizations/example.com/msp/", - "server-hostname": "orderer.example.com", - "tls_cacerts": "network/fabric-v1.4/config/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/ca.crt" - }, - "org1": { - "name": "peerOrg1", - "mspid": "Org1MSP", - "msp": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org1.example.com/msp/", - "ca": { - "url": "https://localhost:7054", - "name": "ca.org1.example.com" - }, - "peer1": { - "requests": "grpcs://localhost:7051", - "events": "grpcs://localhost:7053", - "server-hostname": "peer0.org1.example.com", - "tls_cacerts": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt" - }, - "peer2": { - "requests": "grpcs://localhost:7057", - "events": "grpcs://localhost:7059", - "server-hostname": "peer1.org1.example.com", - "tls_cacerts": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org1.example.com/peers/peer1.org1.example.com/tls/ca.crt" - } - }, - "org2": { - "name": "peerOrg2", - "mspid": "Org2MSP", - "msp": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org2.example.com/msp/", - "ca": { - "url": "https://localhost:8054", - "name": "ca.org2.example.com" - }, - "peer1": { - "requests": "grpcs://localhost:8051", - "events": "grpcs://localhost:8053", - "server-hostname": "peer0.org2.example.com", - "tls_cacerts": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt" - }, - "peer2": { - "requests": "grpcs://localhost:8057", - "events": "grpcs://localhost:8059", - "server-hostname": "peer1.org2.example.com", - "tls_cacerts": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org2.example.com/peers/peer1.org2.example.com/tls/ca.crt" - } - }, - "org3": { - "name": "peerOrg3", - "mspid": "Org3MSP", - "msp": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org3.example.com/msp/", - "ca": { - "url": "https://localhost:9054", - "name": "ca.org3.example.com" - }, - "peer1": { - "requests": "grpcs://localhost:9051", - "events": "grpcs://localhost:9053", - "server-hostname": "peer0.org3.example.com", - "tls_cacerts": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org3.example.com/peers/peer0.org3.example.com/tls/ca.crt" - }, - "peer2": { - "requests": "grpcs://localhost:9057", - "events": "grpcs://localhost:9059", - "server-hostname": "peer1.org3.example.com", - "tls_cacerts": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org3.example.com/peers/peer1.org3.example.com/tls/ca.crt" - } - } - }, - "channel": [ - { - "name": "mychannel", - "deployed": false, - "capabilities": [], - "consortium": "SampleConsortium", - "msps": ["Org1MSP", "Org2MSP", "Org3MSP"], - "organizations": ["org1", "org2", "org3"], - "version": 0 - } - ], - "chaincodes": [ - {"id": "marbles", "path": "src/contract/fabric/marbles/node", "language":"node", "version": "v1", "channel": "mychannel", "metadataPath": "src/contract/fabric/marbles/go/metadata"}, - {"id": "simple", "path": "src/contract/fabric/simple/node", "language":"node", "version": "v0", "channel": "mychannel"} - ], - "endorsement-policy": { - "identities": [ - { - "role": { - "name": "member", - "mspId": "Org1MSP" - } - }, - { - "role": { - "name": "member", - "mspId": "Org2MSP" - } - }, - { - "role": { - "name": "member", - "mspId": "Org3MSP" - } - }, - { - "role": { - "name": "admin", - "mspId": "Org1MSP" - } - } - ], - "policy": { "3-of": [{"signed-by": 0}, {"signed-by": 1}, {"signed-by": 2}]} - }, - "context": { - "smallOperations": "mychannel", - "init": "mychannel", - "open": "mychannel", - "publish": "mychannel", - "query": "mychannel" - } - }, - "info" : { - "Version": "1.4.0", - "Size": "3 Orgs with 2 Peers", - "Orderer": "Solo", - "Distribution": "Single Host" - } -} diff --git a/packages/caliper-samples/network/fabric-v1.4/3org2peercouchdb/fabric-node.json b/packages/caliper-samples/network/fabric-v1.4/3org2peercouchdb/fabric-node.json deleted file mode 100644 index fe864840c..000000000 --- a/packages/caliper-samples/network/fabric-v1.4/3org2peercouchdb/fabric-node.json +++ /dev/null @@ -1,141 +0,0 @@ -{ - "caliper": { - "blockchain": "fabric", - "command" : { - "start": "docker-compose -f network/fabric-v1.4/3org2peercouchdb/docker-compose.yaml up -d;sleep 3s", - "end" : "docker-compose -f network/fabric-v1.4/3org2peercouchdb/docker-compose.yaml down;(test -z \"$(docker ps -aq)\") || docker rm $(docker ps -aq);(test -z \"$(docker images dev* -q)\") || docker rmi $(docker images dev* -q)" - } - }, - "fabric": { - "cryptodir": "network/fabric-v1.4/config/crypto-config", - "network": { - "orderer": { - "url": "grpc://localhost:7050", - "mspid": "OrdererMSP", - "msp": "network/fabric-v1.4/config/crypto-config/ordererOrganizations/example.com/msp/", - "server-hostname": "orderer.example.com", - "tls_cacerts": "network/fabric-v1.4/config/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/ca.crt" - }, - "org1": { - "name": "peerOrg1", - "mspid": "Org1MSP", - "msp": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org1.example.com/msp/", - "ca": { - "url": "http://localhost:7054", - "name": "ca.org1.example.com" - }, - "peer1": { - "requests": "grpc://localhost:7051", - "events": "grpc://localhost:7053", - "server-hostname": "peer0.org1.example.com", - "tls_cacerts": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt" - }, - "peer2": { - "requests": "grpc://localhost:7057", - "events": "grpc://localhost:7059", - "server-hostname": "peer1.org1.example.com", - "tls_cacerts": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org1.example.com/peers/peer1.org1.example.com/tls/ca.crt" - } - }, - "org2": { - "name": "peerOrg2", - "mspid": "Org2MSP", - "msp": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org2.example.com/msp/", - "ca": { - "url": "http://localhost:8054", - "name": "ca.org2.example.com" - }, - "peer1": { - "requests": "grpc://localhost:8051", - "events": "grpc://localhost:8053", - "server-hostname": "peer0.org2.example.com", - "tls_cacerts": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt" - }, - "peer2": { - "requests": "grpc://localhost:8057", - "events": "grpc://localhost:8059", - "server-hostname": "peer1.org2.example.com", - "tls_cacerts": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org2.example.com/peers/peer1.org2.example.com/tls/ca.crt" - } - }, - "org3": { - "name": "peerOrg3", - "mspid": "Org3MSP", - "msp": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org3.example.com/msp/", - "ca": { - "url": "http://localhost:9054", - "name": "ca.org3.example.com" - }, - "peer1": { - "requests": "grpc://localhost:9051", - "events": "grpc://localhost:9053", - "server-hostname": "peer0.org3.example.com", - "tls_cacerts": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org3.example.com/peers/peer0.org3.example.com/tls/ca.crt" - }, - "peer2": { - "requests": "grpc://localhost:9057", - "events": "grpc://localhost:9059", - "server-hostname": "peer1.org3.example.com", - "tls_cacerts": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org3.example.com/peers/peer1.org3.example.com/tls/ca.crt" - } - } - }, - "channel": [ - { - "name": "mychannel", - "deployed": false, - "capabilities": [], - "consortium": "SampleConsortium", - "msps": ["Org1MSP", "Org2MSP", "Org3MSP"], - "organizations": ["org1", "org2", "org3"], - "version": 0 - } - ], - "chaincodes": [ - {"id": "marbles", "path": "src/contract/fabric/marbles/node", "language":"node", "version": "v1", "channel": "mychannel", "metadataPath": "src/contract/fabric/marbles/go/metadata"}, - {"id": "simple", "path": "src/contract/fabric/simple/node", "language":"node", "version": "v0", "channel": "mychannel"} - ], - "endorsement-policy": { - "identities": [ - { - "role": { - "name": "member", - "mspId": "Org1MSP" - } - }, - { - "role": { - "name": "member", - "mspId": "Org2MSP" - } - }, - { - "role": { - "name": "member", - "mspId": "Org3MSP" - } - }, - { - "role": { - "name": "admin", - "mspId": "Org1MSP" - } - } - ], - "policy": { "3-of": [{"signed-by": 0}, {"signed-by": 1}, {"signed-by": 2}]} - }, - "context": { - "smallOperations": "mychannel", - "init": "mychannel", - "open": "mychannel", - "publish": "mychannel", - "query": "mychannel" - } - }, - "info" : { - "Version": "1.4.0", - "Size": "3 Orgs with 2 Peers", - "Orderer": "Solo", - "Distribution": "Single Host" - } -} diff --git a/packages/caliper-samples/network/fabric-v1.4/3org2peergoleveldb/README.md b/packages/caliper-samples/network/fabric-v1.4/3org2peergoleveldb/README.md index 597af08f5..33c79d2a3 100755 --- a/packages/caliper-samples/network/fabric-v1.4/3org2peergoleveldb/README.md +++ b/packages/caliper-samples/network/fabric-v1.4/3org2peergoleveldb/README.md @@ -26,11 +26,11 @@ The following network configuration files are available for the different platfo * `vehicle-lifecycle-network` ### Fabric -* `fabric-go(-tls).json` (__golang__ implementations) +* `fabric-ccp-go(-tls).json` (__golang__ implementations) * `marbles` __without__ CouchDB index metadata and rich query support. * `drm` * `simple` * `smallbank` -* `fabric-node(-tls).json` (__Node.JS__ implementations) +* `fabric-ccp-node(-tls).json` (__Node.JS__ implementations) * `marbles` __without__ CouchDB index metadata and rich query support. - * `simple` \ No newline at end of file + * `simple` diff --git a/packages/caliper-samples/network/fabric-v1.4/3org2peergoleveldb/fabric-go-tls.json b/packages/caliper-samples/network/fabric-v1.4/3org2peergoleveldb/fabric-go-tls.json deleted file mode 100644 index 5b786958b..000000000 --- a/packages/caliper-samples/network/fabric-v1.4/3org2peergoleveldb/fabric-go-tls.json +++ /dev/null @@ -1,140 +0,0 @@ -{ - "caliper": { - "blockchain": "fabric", - "command" : { - "start": "docker-compose -f network/fabric-v1.4/3org2peergoleveldb/docker-compose-tls.yaml up -d;sleep 3s", - "end" : "docker-compose -f network/fabric-v1.4/3org2peergoleveldb/docker-compose-tls.yaml down;(test -z \"$(docker ps -aq)\") || docker rm $(docker ps -aq);(test -z \"$(docker images dev* -q)\") || docker rmi $(docker images dev* -q)" - } - }, - "fabric": { - "cryptodir": "network/fabric-v1.4/config/crypto-config", - "network": { - "orderer": { - "url": "grpcs://localhost:7050", - "mspid": "OrdererMSP", - "msp": "network/fabric-v1.4/config/crypto-config/ordererOrganizations/example.com/msp/", - "server-hostname": "orderer.example.com", - "tls_cacerts": "network/fabric-v1.4/config/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/ca.crt" - }, - "org1": { - "name": "peerOrg1", - "mspid": "Org1MSP", - "msp": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org1.example.com/msp/", - "ca": { - "url": "https://localhost:7054", - "name": "ca.org1.example.com" - }, - "peer1": { - "requests": "grpcs://localhost:7051", - "events": "grpcs://localhost:7053", - "server-hostname": "peer0.org1.example.com", - "tls_cacerts": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt" - }, - "peer2": { - "requests": "grpcs://localhost:7057", - "events": "grpcs://localhost:7059", - "server-hostname": "peer1.org1.example.com", - "tls_cacerts": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org1.example.com/peers/peer1.org1.example.com/tls/ca.crt" - } - }, - "org2": { - "name": "peerOrg2", - "mspid": "Org2MSP", - "msp": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org2.example.com/msp/", - "ca": { - "url": "https://localhost:8054", - "name": "ca.org2.example.com" - }, - "peer1": { - "requests": "grpcs://localhost:8051", - "events": "grpcs://localhost:8053", - "server-hostname": "peer0.org2.example.com", - "tls_cacerts": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt" - }, - "peer2": { - "requests": "grpcs://localhost:8057", - "events": "grpcs://localhost:8059", - "server-hostname": "peer1.org2.example.com", - "tls_cacerts": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org2.example.com/peers/peer1.org2.example.com/tls/ca.crt" - } - }, - "org3": { - "name": "peerOrg3", - "mspid": "Org3MSP", - "msp": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org3.example.com/msp/", - "ca": { - "url": "https://localhost:9054", - "name": "ca.org3.example.com" - }, - "peer1": { - "requests": "grpcs://localhost:9051", - "events": "grpcs://localhost:9053", - "server-hostname": "peer0.org3.example.com", - "tls_cacerts": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org3.example.com/peers/peer0.org3.example.com/tls/ca.crt" - }, - "peer2": { - "requests": "grpcs://localhost:9057", - "events": "grpcs://localhost:9059", - "server-hostname": "peer1.org3.example.com", - "tls_cacerts": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org3.example.com/peers/peer1.org3.example.com/tls/ca.crt" - } - } - }, - "channel": [ - { - "name": "mychannel", - "deployed": false, - "config": "network/fabric-v1.4/config/mychannel.tx", - "organizations": ["org1", "org2", "org3"] - } - ], - "chaincodes": [ - {"id": "drm", "path": "contract/fabric/drm", "language":"golang", "version": "v0", "channel": "mychannel"}, - {"id": "marbles", "path": "contract/fabric/marbles-norichquery/go", "language":"golang", "version": "v1", "channel": "mychannel"}, - {"id": "simple", "path": "contract/fabric/simple/go", "language":"golang", "version": "v0", "channel": "mychannel"}, - {"id": "smallbank", "path": "contract/fabric/smallbank", "language":"golang", "version": "v0", "channel": "mychannel"} - ], - "endorsement-policy": { - "identities": [ - { - "role": { - "name": "member", - "mspId": "Org1MSP" - } - }, - { - "role": { - "name": "member", - "mspId": "Org2MSP" - } - }, - { - "role": { - "name": "member", - "mspId": "Org3MSP" - } - }, - { - "role": { - "name": "admin", - "mspId": "Org1MSP" - } - } - ], - "policy": { "3-of": [{"signed-by": 0}, {"signed-by": 1}, {"signed-by": 2}]} - }, - "context": { - "smallOperations": "mychannel", - "init": "mychannel", - "open": "mychannel", - "publish": "mychannel", - "query": "mychannel" - } - }, - "info" : { - "Version": "1.4.0", - "Size": "3 Orgs with 2 Peers", - "Orderer": "Solo", - "Distribution": "Single Host" - } -} diff --git a/packages/caliper-samples/network/fabric-v1.4/3org2peergoleveldb/fabric-go.json b/packages/caliper-samples/network/fabric-v1.4/3org2peergoleveldb/fabric-go.json deleted file mode 100644 index 489640cae..000000000 --- a/packages/caliper-samples/network/fabric-v1.4/3org2peergoleveldb/fabric-go.json +++ /dev/null @@ -1,140 +0,0 @@ -{ - "caliper": { - "blockchain": "fabric", - "command" : { - "start": "docker-compose -f network/fabric-v1.4/3org2peergoleveldb/docker-compose.yaml up -d;sleep 3s", - "end" : "docker-compose -f network/fabric-v1.4/3org2peergoleveldb/docker-compose.yaml down;(test -z \"$(docker ps -aq)\") || docker rm $(docker ps -aq);(test -z \"$(docker images dev* -q)\") || docker rmi $(docker images dev* -q)" - } - }, - "fabric": { - "cryptodir": "network/fabric-v1.4/config/crypto-config", - "network": { - "orderer": { - "url": "grpc://localhost:7050", - "mspid": "OrdererMSP", - "msp": "network/fabric-v1.4/config/crypto-config/ordererOrganizations/example.com/msp/", - "server-hostname": "orderer.example.com", - "tls_cacerts": "network/fabric-v1.4/config/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/ca.crt" - }, - "org1": { - "name": "peerOrg1", - "mspid": "Org1MSP", - "msp": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org1.example.com/msp/", - "ca": { - "url": "http://localhost:7054", - "name": "ca.org1.example.com" - }, - "peer1": { - "requests": "grpc://localhost:7051", - "events": "grpc://localhost:7053", - "server-hostname": "peer0.org1.example.com", - "tls_cacerts": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt" - }, - "peer2": { - "requests": "grpc://localhost:7057", - "events": "grpc://localhost:7059", - "server-hostname": "peer1.org1.example.com", - "tls_cacerts": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org1.example.com/peers/peer1.org1.example.com/tls/ca.crt" - } - }, - "org2": { - "name": "peerOrg2", - "mspid": "Org2MSP", - "msp": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org2.example.com/msp/", - "ca": { - "url": "http://localhost:8054", - "name": "ca.org2.example.com" - }, - "peer1": { - "requests": "grpc://localhost:8051", - "events": "grpc://localhost:8053", - "server-hostname": "peer0.org2.example.com", - "tls_cacerts": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt" - }, - "peer2": { - "requests": "grpc://localhost:8057", - "events": "grpc://localhost:8059", - "server-hostname": "peer1.org2.example.com", - "tls_cacerts": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org2.example.com/peers/peer1.org2.example.com/tls/ca.crt" - } - }, - "org3": { - "name": "peerOrg3", - "mspid": "Org3MSP", - "msp": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org3.example.com/msp/", - "ca": { - "url": "http://localhost:9054", - "name": "ca.org3.example.com" - }, - "peer1": { - "requests": "grpc://localhost:9051", - "events": "grpc://localhost:9053", - "server-hostname": "peer0.org3.example.com", - "tls_cacerts": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org3.example.com/peers/peer0.org3.example.com/tls/ca.crt" - }, - "peer2": { - "requests": "grpc://localhost:9057", - "events": "grpc://localhost:9059", - "server-hostname": "peer1.org3.example.com", - "tls_cacerts": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org3.example.com/peers/peer1.org3.example.com/tls/ca.crt" - } - } - }, - "channel": [ - { - "name": "mychannel", - "deployed": false, - "config": "network/fabric-v1.4/config/mychannel.tx", - "organizations": ["org1", "org2", "org3"] - } - ], - "chaincodes": [ - {"id": "drm", "path": "contract/fabric/drm", "language":"golang", "version": "v0", "channel": "mychannel"}, - {"id": "marbles", "path": "contract/fabric/marbles-norichquery/go", "language":"golang", "version": "v1", "channel": "mychannel"}, - {"id": "simple", "path": "contract/fabric/simple/go", "language":"golang", "version": "v0", "channel": "mychannel"}, - {"id": "smallbank", "path": "contract/fabric/smallbank", "language":"golang", "version": "v0", "channel": "mychannel"} - ], - "endorsement-policy": { - "identities": [ - { - "role": { - "name": "member", - "mspId": "Org1MSP" - } - }, - { - "role": { - "name": "member", - "mspId": "Org2MSP" - } - }, - { - "role": { - "name": "member", - "mspId": "Org3MSP" - } - }, - { - "role": { - "name": "admin", - "mspId": "Org1MSP" - } - } - ], - "policy": { "3-of": [{"signed-by": 0}, {"signed-by": 1}, {"signed-by": 2}]} - }, - "context": { - "smallOperations": "mychannel", - "init": "mychannel", - "open": "mychannel", - "publish": "mychannel", - "query": "mychannel" - } - }, - "info" : { - "Version": "1.4.0", - "Size": "3 Orgs with 2 Peers", - "Orderer": "Solo", - "Distribution": "Single Host" - } -} diff --git a/packages/caliper-samples/network/fabric-v1.4/3org2peergoleveldb/fabric-node-tls.json b/packages/caliper-samples/network/fabric-v1.4/3org2peergoleveldb/fabric-node-tls.json deleted file mode 100644 index b8a9d1c7f..000000000 --- a/packages/caliper-samples/network/fabric-v1.4/3org2peergoleveldb/fabric-node-tls.json +++ /dev/null @@ -1,141 +0,0 @@ -{ - "caliper": { - "blockchain": "fabric", - "command" : { - "start": "docker-compose -f network/fabric-v1.4/3org2peergoleveldb/docker-compose-tls.yaml up -d;sleep 3s", - "end" : "docker-compose -f network/fabric-v1.4/3org2peergoleveldb/docker-compose-tls.yaml down;(test -z \"$(docker ps -aq)\") || docker rm $(docker ps -aq);(test -z \"$(docker images dev* -q)\") || docker rmi $(docker images dev* -q)" - } - }, - "fabric": { - "cryptodir": "network/fabric-v1.4/config/crypto-config", - "network": { - "orderer": { - "url": "grpcs://localhost:7050", - "mspid": "OrdererMSP", - "msp": "network/fabric-v1.4/config/crypto-config/ordererOrganizations/example.com/msp/", - "server-hostname": "orderer.example.com", - "tls_cacerts": "network/fabric-v1.4/config/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/ca.crt" - }, - "org1": { - "name": "peerOrg1", - "mspid": "Org1MSP", - "msp": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org1.example.com/msp/", - "ca": { - "url": "https://localhost:7054", - "name": "ca.org1.example.com" - }, - "peer1": { - "requests": "grpcs://localhost:7051", - "events": "grpcs://localhost:7053", - "server-hostname": "peer0.org1.example.com", - "tls_cacerts": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt" - }, - "peer2": { - "requests": "grpcs://localhost:7057", - "events": "grpcs://localhost:7059", - "server-hostname": "peer1.org1.example.com", - "tls_cacerts": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org1.example.com/peers/peer1.org1.example.com/tls/ca.crt" - } - }, - "org2": { - "name": "peerOrg2", - "mspid": "Org2MSP", - "msp": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org2.example.com/msp/", - "ca": { - "url": "https://localhost:8054", - "name": "ca.org2.example.com" - }, - "peer1": { - "requests": "grpcs://localhost:8051", - "events": "grpcs://localhost:8053", - "server-hostname": "peer0.org2.example.com", - "tls_cacerts": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt" - }, - "peer2": { - "requests": "grpcs://localhost:8057", - "events": "grpcs://localhost:8059", - "server-hostname": "peer1.org2.example.com", - "tls_cacerts": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org2.example.com/peers/peer1.org2.example.com/tls/ca.crt" - } - }, - "org3": { - "name": "peerOrg3", - "mspid": "Org3MSP", - "msp": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org3.example.com/msp/", - "ca": { - "url": "https://localhost:9054", - "name": "ca.org3.example.com" - }, - "peer1": { - "requests": "grpcs://localhost:9051", - "events": "grpcs://localhost:9053", - "server-hostname": "peer0.org3.example.com", - "tls_cacerts": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org3.example.com/peers/peer0.org3.example.com/tls/ca.crt" - }, - "peer2": { - "requests": "grpcs://localhost:9057", - "events": "grpcs://localhost:9059", - "server-hostname": "peer1.org3.example.com", - "tls_cacerts": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org3.example.com/peers/peer1.org3.example.com/tls/ca.crt" - } - } - }, - "channel": [ - { - "name": "mychannel", - "deployed": false, - "capabilities": [], - "consortium": "SampleConsortium", - "msps": ["Org1MSP", "Org2MSP", "Org3MSP"], - "organizations": ["org1", "org2", "org3"], - "version": 0 - } - ], - "chaincodes": [ - {"id": "marbles", "path": "src/contract/fabric/marbles-norichquery/node", "language":"node", "version": "v1", "channel": "mychannel"}, - {"id": "simple", "path": "src/contract/fabric/simple/node", "language":"node", "version": "v0", "channel": "mychannel"} - ], - "endorsement-policy": { - "identities": [ - { - "role": { - "name": "member", - "mspId": "Org1MSP" - } - }, - { - "role": { - "name": "member", - "mspId": "Org2MSP" - } - }, - { - "role": { - "name": "member", - "mspId": "Org3MSP" - } - }, - { - "role": { - "name": "admin", - "mspId": "Org1MSP" - } - } - ], - "policy": { "3-of": [{"signed-by": 0}, {"signed-by": 1}, {"signed-by": 2}]} - }, - "context": { - "smallOperations": "mychannel", - "init": "mychannel", - "open": "mychannel", - "publish": "mychannel", - "query": "mychannel" - } - }, - "info" : { - "Version": "1.4.0", - "Size": "3 Orgs with 2 Peers", - "Orderer": "Solo", - "Distribution": "Single Host" - } -} diff --git a/packages/caliper-samples/network/fabric-v1.4/3org2peergoleveldb/fabric-node.json b/packages/caliper-samples/network/fabric-v1.4/3org2peergoleveldb/fabric-node.json deleted file mode 100644 index 758caf163..000000000 --- a/packages/caliper-samples/network/fabric-v1.4/3org2peergoleveldb/fabric-node.json +++ /dev/null @@ -1,139 +0,0 @@ -{ - "caliper": { - "blockchain": "fabric", - "command" : { - "start": "docker-compose -f network/fabric-v1.4/3org2peergoleveldb/docker-compose.yaml up -d;sleep 3s", - "end" : "docker-compose -f network/fabric-v1.4/3org2peergoleveldb/docker-compose.yaml down;(test -z \"$(docker ps -aq)\") || docker rm $(docker ps -aq);(test -z \"$(docker images dev* -q)\") || docker rmi $(docker images dev* -q)" - } - }, - "fabric": { - "cryptodir": "network/fabric-v1.4/config/crypto-config", - "network": { - "orderer": { - "url": "grpc://localhost:7050", - "mspid": "OrdererMSP", - "msp": "network/fabric-v1.4/config/crypto-config/ordererOrganizations/example.com/msp/", - "server-hostname": "orderer.example.com", - "tls_cacerts": "network/fabric-v1.4/config/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/ca.crt" - }, - "org1": { - "name": "peerOrg1", - "mspid": "Org1MSP", - "msp": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org1.example.com/msp/", - "ca": { - "url": "http://localhost:7054", - "name": "ca.org1.example.com" - }, - "peer1": { - "requests": "grpc://localhost:7051", - "events": "grpc://localhost:7053", - "server-hostname": "peer0.org1.example.com", - "tls_cacerts": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt" - }, - "peer2": { - "requests": "grpc://localhost:7057", - "events": "grpc://localhost:7059", - "server-hostname": "peer1.org1.example.com", - "tls_cacerts": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org1.example.com/peers/peer1.org1.example.com/tls/ca.crt" - } - }, - "org2": { - "name": "peerOrg2", - "mspid": "Org2MSP", - "msp": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org2.example.com/msp/", - "ca": { - "url": "http://localhost:8054", - "name": "ca.org2.example.com" - }, - "peer1": { - "requests": "grpc://localhost:8051", - "events": "grpc://localhost:8053", - "server-hostname": "peer0.org2.example.com", - "tls_cacerts": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt" - }, - "peer2": { - "requests": "grpc://localhost:8057", - "events": "grpc://localhost:8059", - "server-hostname": "peer1.org2.example.com", - "tls_cacerts": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org2.example.com/peers/peer1.org2.example.com/tls/ca.crt" - } - }, - "org3": { - "name": "peerOrg3", - "mspid": "Org3MSP", - "msp": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org3.example.com/msp/", - "ca": { - "url": "http://localhost:9054", - "name": "ca.org3.example.com" - }, - "peer1": { - "requests": "grpc://localhost:9051", - "events": "grpc://localhost:9053", - "server-hostname": "peer0.org3.example.com", - "tls_cacerts": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org3.example.com/peers/peer0.org3.example.com/tls/ca.crt" - }, - "peer2": { - "requests": "grpc://localhost:9057", - "events": "grpc://localhost:9059", - "server-hostname": "peer1.org3.example.com", - "tls_cacerts": "network/fabric-v1.4/config/crypto-config/peerOrganizations/org3.example.com/peers/peer1.org3.example.com/tls/ca.crt" - } - } - }, - "channel": [ - { - "name": "mychannel", - "deployed": false, - "capabilities": [], - "consortium": "SampleConsortium", - "msps": ["Org1MSP", "Org2MSP", "Org3MSP"], - "organizations": ["org1", "org2", "org3"], - "version": 0 - } - ], - "chaincodes": [ - {"id": "marbles", "path": "src/contract/fabric/marbles-norichquery/node", "language":"node", "version": "v1", "channel": "mychannel"}, - {"id": "simple", "path": "src/contract/fabric/simple/node", "language":"node", "version": "v0", "channel": "mychannel"} - ], - "endorsement-policy": { - "identities": [ - { - "role": { - "name": "member", - "mspId": "Org1MSP" - } - }, - { - "role": { - "name": "member", - "mspId": "Org2MSP" - } - }, - { - "role": { - "name": "member", - "mspId": "Org3MSP" - } - }, - { - "role": { - "name": "admin", - "mspId": "Org1MSP" - } - } - ], - "policy": { "3-of": [{"signed-by": 0}, {"signed-by": 1}, {"signed-by": 2}]} - }, - "context": { - "init": "mychannel", - "open": "mychannel", - "query": "mychannel" - } - }, - "info" : { - "Version": "1.4.0", - "Size": "3 Orgs with 2 Peers", - "Orderer": "Solo", - "Distribution": "Single Host" - } -} diff --git a/packages/caliper-tests-integration/scripts/npm_publish.js b/packages/caliper-tests-integration/scripts/npm_publish.js index e887e9faf..3ff3fb6df 100644 --- a/packages/caliper-tests-integration/scripts/npm_publish.js +++ b/packages/caliper-tests-integration/scripts/npm_publish.js @@ -51,7 +51,6 @@ const packages = [ 'caliper-core', 'caliper-burrow', 'caliper-composer', - 'caliper-fabric', 'caliper-fabric-ccp', 'caliper-iroha', 'caliper-sawtooth',