HyperledgerHandsOn / trade-finance-logistics

Trade Finance and Logistics based on Letter of Credit and Proof of Shipment
Apache License 2.0
178 stars 1.5k forks source link

create-channel.js had required a path change #31

Closed sahirvsahirv closed 6 years ago

sahirvsahirv commented 6 years ago

I had to change it to

var

_commonProto = grpc.load(path.join(dirname, '../application/node_modules/fabric-client/lib/protos/common/common.proto')).common; var _configtxProto = grpc.load(path.join(dirname,

'../application/node_modules/fabric-client/lib/protos/common/configtx.proto')).common;

to make it work. Please consider it if it is valid for all. Thanks

VRamakrishna commented 6 years ago

Why did you need this change? What was not working without it?

sahirvsahirv commented 6 years ago

hypledvm@hypledvm-VirtualBox:~/go/src/utilitypoc/application$ node app.js info: [ClientUtils]:



/home/node_modules/grpc/index.js:146 return loadObject(builder.ns, options); ^

TypeError: Cannot read property 'ns' of null at Object.load (/home/node_modules/grpc/index.js:146:29) at Object. (/home/hypledvm/go/src/utilitypoc/middleware/create-channel.js:26:25) at Module._compile (module.js:643:30) at Object.Module._extensions..js (module.js:654:10) at Module.load (module.js:556:32) at tryModuleLoad (module.js:499:12) at Function.Module._load (module.js:491:3) at Module.require (module.js:587:17) at require (internal/module.js:11:18) at Object. (/home/hypledvm/go/src/utilitypoc/application/app.js:32:21)

Changing the directory here works

VRamakrishna commented 6 years ago

Did you follow the instructions in middleware and install the NPM modules before trying to run the application? That's a prerequisite mentioned both in the instructions in this repo and in the chapter (where we walk through middleware before application.) This sequencing has a particular logic.

VRamakrishna commented 6 years ago

FYI, you need to run npm install in middleware/. But do sync the latest code though; I fixed dependency versions a few days ago (because the remote repository for the NPM packages got upgraded.)

sahirvsahirv commented 6 years ago

Probably I did not follow the same steps. But I had to change it to get mine to work.

We can close it if not applicable for all.

On Wed, 8 Aug 2018 at 6:32 PM, VRamakrishna notifications@github.com wrote:

FYI, you need to run npm install in middleware/. But do sync the latest code though; I fixed dependency versions a few days ago (because the remote repository for the NPM packages got upgraded.)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/HyperledgerHandsOn/trade-finance-logistics/issues/31#issuecomment-411397068, or mute the thread https://github.com/notifications/unsubscribe-auth/ATQGk0bSl2A5cgUDG9A0qJGcxlh9MFSBks5uOuFqgaJpZM4VzxTb .

sahirvsahirv commented 6 years ago

Thanks

On Wed, 8 Aug 2018 at 6:32 PM, VRamakrishna notifications@github.com wrote:

FYI, you need to run npm install in middleware/. But do sync the latest code though; I fixed dependency versions a few days ago (because the remote repository for the NPM packages got upgraded.)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/HyperledgerHandsOn/trade-finance-logistics/issues/31#issuecomment-411397068, or mute the thread https://github.com/notifications/unsubscribe-auth/ATQGk0bSl2A5cgUDG9A0qJGcxlh9MFSBks5uOuFqgaJpZM4VzxTb .

VRamakrishna commented 6 years ago
  1. Please confirm that what I suggested worked, and then close the issue.
  2. If you didn't follow the instructions in sequence as specified, clearly you are bound to hit a problem or two somewhere. It's always possible to hack your way out of it, as you did, but that can't be something we can prescribe for others.

In this instance, you were missing dependencies, which you could identify from the exception stack. That ought to have been a clue that you missed (or skipped) a step or two in the instructions.

Let me reiterate that the book (or this code repo) is not meant to be a primer in Go or JavaScript programming (though you get some more lessons in the Composer chapters for the languages used there.) If you are not handy with these languages, you need to be extra careful in following instructions while learning something in the process.

VRamakrishna commented 6 years ago

Lastly, though I'd like to be helpful, especially to our book customers, I'm afraid I can't be addressing issues at this rate. I (like all the authors of this book) have a day job that keeps me busy. Maintaining this code base is strictly a side project for me.

So I'd encourage you to learn from the book and especially understand the rationale behind the steps performed. That'll help you sort out issues.

Of course, if you do find a real problem with the code or the instructions, file a bug report and we'll try to address it ASAP. But make sure you've exhausted your options first.

Thanks, and good luck!

sahirvsahirv commented 6 years ago

Thanks so much. I get that. We need proficiency in node and GO to and docker to start with.

I am new to all the three and it has taught me quite a lot.

I have left office. Will update soon.

Thanks

On Wed, 8 Aug 2018 at 6:51 PM, VRamakrishna notifications@github.com wrote:

  1. Please confirm that what I suggested worked, and then close the issue.
  2. If you didn't follow the instructions in sequence as specified, clearly you are bound to hit a problem or two somewhere. It's always possible to hack your way out of it, as you did, but that can't be something we can prescribe for others.

In this instance, you were missing dependencies, which you could identify from the exception stack. That ought to have been a clue that you missed (or skipped) a step or two in the instructions.

Let me reiterate that the book (or this code repo) is not meant to be a primer in Go or JavaScript programming (though you get some more lessons in the Composer chapters for the languages used there.) If you are not handy with these languages, you need to be extra careful in following instructions while learning something in the process.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/HyperledgerHandsOn/trade-finance-logistics/issues/31#issuecomment-411403012, or mute the thread https://github.com/notifications/unsubscribe-auth/ATQGkznlWlTawFGzckt1RvYJWH0KsdX1ks5uOuXxgaJpZM4VzxTb .

sahirvsahirv commented 6 years ago

The other two that I had posted today, I had already solved by working my way through.

I just posted it thinking that it might help others in the process not because there was a bug in the book or code.

Probably it was the wrong forum. Sorry for that.

Thanks so much. Gowri

On Wed, 8 Aug 2018 at 6:57 PM, VRamakrishna notifications@github.com wrote:

Lastly, though I'd like to be helpful, especially to our book customers, I'm afraid I can't be addressing issues at this rate. I (like all the authors of this book) have a day job that keeps me busy. Maintaining this code base is strictly a side project for me.

So I'd encourage you to learn from the book and especially understand the rationale behind the steps performed. That'll help you sort out issues.

Of course, if you do find a real problem with the code or the instructions, file a bug report and we'll try to address it ASAP. But make sure you've exhausted your options first.

Thanks, and good luck!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/HyperledgerHandsOn/trade-finance-logistics/issues/31#issuecomment-411404685, or mute the thread https://github.com/notifications/unsubscribe-auth/ATQGkz4IxjDHMK0TLNctcg4k_yu1jBINks5uOucvgaJpZM4VzxTb .

VRamakrishna commented 6 years ago

Not a problem. Even if you encounter issues with adaptations to other apps and other network structures because of inadequacies in our instructions, it's useful to bring them to our attention. But do note that we'll get to work on them on a best-effort basis.