Skip to content

Commit

Permalink
RC 1
Browse files Browse the repository at this point in the history
  • Loading branch information
martin-headspace committed Nov 1, 2017
1 parent 1a698cc commit a7c716e
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 8 deletions.
22 changes: 15 additions & 7 deletions blockchainManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -641,32 +641,40 @@ class BlockchainManager {
/** Get the state of the database */
return mongo.getAllAst()
.then((result) => {
let arr = result;
modState = result;
for (let i = 0; i < schedule.length; i++) {
for (let x = 0; x < arr.length; x++) {
if (arr[x].id == schedule[i].from) {
arr[x].balance = arr[x].balance - schedule[i].funds;
for (let x = 0; x < modState.length; x++) {
if (modState[x].id == schedule[i].from) {
modState[x].balance = modState[x].balance - schedule[i].funds;
}
if (arr[x].id == schedule[i].to) {
arr[x].balance = arr[x].balance + schedule[i].funds;
if (modState[x].id == schedule[i].to) {
modState[x].balance = modState[x].balance + schedule[i].funds;
}
}
}
modState = arr;
return bm.init();
})
.then(() => {
return bm.rawAssetsOnLedger();
})
.then((rawLedger) => {
let state = true;
let unsynced = [];
for (let i = 0; i < rawLedger.length; i++) {
for (let x = 0; x < modState.length; x++) {
if (rawLedger[i].id == modState[x].id && rawLedger[i].balance != modState[x].balance) {
unsynced.push(rawLedger[i].id);
state = false;
}
}
}
if(!state){
console.log('=============== UNSYNCED ===============');
for(let i=0;i<unsynced.length;i++){
console.log(unsynced[i]);
}
console.log('=============== UNSYNCED ===============');
}
return state;
})
.catch(function (error) {
Expand Down
4 changes: 4 additions & 0 deletions composer-logs/trace_20171102-124015-064.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
2017-11-01T18:40:17.020Z ERROR HLFConnectionManager :fabric-client() [client-utils.js]: sendPeersProposal - Promise is rejected: Error: chaincode error (status: 500, message: Error: The current identity must be activated (ACTIVATION_REQUIRED))
at /Users/a01334390/Documents/Git Projects/Lyra/node_modules/fabric-client/node_modules/grpc/src/node/src/client.js:434:17 {}$
2017-11-01T18:40:17.021Z ERROR HLFConnection :queryChainCode() {"message":"Error trying to query business network. Error: chaincode error (status: 500, message: Error: The current identity must be activated (ACTIVATION_REQUIRED))","stack":"Error: Error trying to query business network. Error: chaincode error (status: 500, message: Error: The current identity must be activated (ACTIVATION_REQUIRED))\n at channel.queryByChaincode.then.catch (/Users/a01334390/Documents/Git Projects/Lyra/node_modules/composer-connector-hlfv1/lib/hlfconnection.js:749:34)\n at <anonymous>"}$
2017-11-01T18:40:17.021Z ERROR HLFConnection :ping() {"message":"Error trying to ping. Error: Error trying to query business network. Error: chaincode error (status: 500, message: Error: The current identity must be activated (ACTIVATION_REQUIRED))","stack":"Error: Error trying to ping. Error: Error trying to query business network. Error: chaincode error (status: 500, message: Error: The current identity must be activated (ACTIVATION_REQUIRED))\n at _checkRuntimeVersions.then.catch (/Users/a01334390/Documents/Git Projects/Lyra/node_modules/composer-connector-hlfv1/lib/hlfconnection.js:663:34)\n at <anonymous>"}$
Binary file modified dist/lyra-cli.bna
Binary file not shown.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ var figlet = require('figlet');
var inquirer = require('inquirer');

//Hyperledger Fabric Code And Connectors
var hyper = require('./lib/blockchainManager');
var hyper = require('./blockchainManager');
var jsond = require('./package');
var index = require('.');

Expand Down

0 comments on commit a7c716e

Please sign in to comment.