From acb03859ce5dc0b9080d62341163a3cdfd46b35f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernando=20Mart=C3=ADn=20Garc=C3=ADa=20Del=20Angel?= Date: Wed, 22 Nov 2017 11:36:13 -0600 Subject: [PATCH] RCX666 --- Uber-Lyra/app/invoke-transaction.js | 2 +- Uber-Lyra/artifacts/docker-compose.yaml | 7 ++++++- Uber-Lyra/blockchainManager.js | 17 +++++++++-------- basic-network/docker-compose.yml | 1 + 4 files changed, 17 insertions(+), 10 deletions(-) diff --git a/Uber-Lyra/app/invoke-transaction.js b/Uber-Lyra/app/invoke-transaction.js index c800418..3302664 100644 --- a/Uber-Lyra/app/invoke-transaction.js +++ b/Uber-Lyra/app/invoke-transaction.js @@ -88,7 +88,7 @@ var invokeChaincode = function(peerNames, channelName, chaincodeName, fcn, args, let handle = setTimeout(() => { eh.disconnect(); reject(); - }, 120000); + }, 30000); eh.registerTxEvent(transactionID, (tx, code) => { clearTimeout(handle); diff --git a/Uber-Lyra/artifacts/docker-compose.yaml b/Uber-Lyra/artifacts/docker-compose.yaml index 9857a72..5c200a5 100644 --- a/Uber-Lyra/artifacts/docker-compose.yaml +++ b/Uber-Lyra/artifacts/docker-compose.yaml @@ -38,7 +38,6 @@ services: container_name: orderer.example.com image: hyperledger/fabric-orderer environment: - - ORDERER_GENERAL_LEDGERTYPE=ram - ORDERER_GENERAL_LOGLEVEL=debug - ORDERER_GENERAL_LISTENADDRESS=0.0.0.0 - ORDERER_GENERAL_GENESISMETHOD=file @@ -68,6 +67,8 @@ services: - CORE_PEER_ID=peer0.org1.example.com - CORE_PEER_LOCALMSPID=Org1MSP - CORE_PEER_ADDRESS=peer0.org1.example.com:7051 + - CORE_PEER_VALIDATOR_CONSENSUS_PLUGIN=pbft + - CORE_PBFT_GENERAL_MODE=batch ports: - 7051:7051 - 7053:7053 @@ -85,6 +86,8 @@ services: - CORE_PEER_ID=peer1.org1.example.com - CORE_PEER_LOCALMSPID=Org1MSP - CORE_PEER_ADDRESS=peer1.org1.example.com:7051 + - CORE_PEER_VALIDATOR_CONSENSUS_PLUGIN=pbft + - CORE_PBFT_GENERAL_MODE=batch ports: - 7056:7051 - 7058:7053 @@ -119,6 +122,8 @@ services: - CORE_PEER_ID=peer1.org2.example.com - CORE_PEER_LOCALMSPID=Org2MSP - CORE_PEER_ADDRESS=peer1.org2.example.com:7051 + - CORE_PEER_VALIDATOR_CONSENSUS_PLUGIN=pbft + - CORE_PBFT_GENERAL_MODE=batch ports: - 8056:7051 - 8058:7053 diff --git a/Uber-Lyra/blockchainManager.js b/Uber-Lyra/blockchainManager.js index 789282b..2adfb55 100644 --- a/Uber-Lyra/blockchainManager.js +++ b/Uber-Lyra/blockchainManager.js @@ -109,17 +109,18 @@ class BlockchainManager { cannonBalls.push(this.invokeTransactions(peer, chaincodeName, chaincodeName, 'transferFunds', args, username, orgName)); } start = now(); - // Promise.resolve([]) - // .then(all => cannonBalls[0].then(Array.prototype.concat.bind(all))) - return Promise.all(cannonBalls) + + var chain; + return Promise.resolve([]) + .then(all => cannonBalls[0].then(Array.prototype.concat.bind(all))) }) .then(() => { end = now(); this.profilingTime(start, end, amount, 'tx'); - return this.getWalletByRange(peer, chaincodeName, channelName, start, end, username, orgName); + // return this.getWalletByRange(peer, chaincodeName, channelName, start, end, username, orgName); }) .then((ledger) => { - return this.syncChecker(ledger); + //return this.syncChecker(ledger); }) .catch(function (err) { console.log('An error occured: ', chalk.bold.red(err)); @@ -235,9 +236,9 @@ class BlockchainManager { } //Launch the accounts start = now(); - Promise.resolve([]) - // .then(all => all_promise[0].then(Array.prototype.concat.bind(all))) - return Promise.all(all_promise) + + return Promise.resolve([]) + .then(all => all_promise[0].then(Array.prototype.concat.bind(all))) .then(() => { end = now(); this.profilingTime(start, end, amount, 'acc'); diff --git a/basic-network/docker-compose.yml b/basic-network/docker-compose.yml index 0c664f7..1ff6961 100644 --- a/basic-network/docker-compose.yml +++ b/basic-network/docker-compose.yml @@ -29,6 +29,7 @@ services: container_name: orderer.example.com image: hyperledger/fabric-orderer environment: + - ORDERER_GENERAL_LEDGERTYPE=ram - ORDERER_GENERAL_LOGLEVEL=debug - ORDERER_GENERAL_LISTENADDRESS=0.0.0.0 - ORDERER_GENERAL_GENESISMETHOD=file