hyperledger-archives / education

Hyperledger training material
https://wiki.hyperledger.org/display/LMDWG
Apache License 2.0
372 stars 360 forks source link

Add a go example to the sawtooth material #15

Open asettouf opened 6 years ago

asettouf commented 6 years ago

Hello,

after following the lesson, I realized I wasn't so confident I could understand the application so I decided to kill 2 birds with one stone. Learn go, and ensure I understood what was happening with the Sawtooth example. And now that I have the example working, I believed it could be nice for people allergic to NodeJS to have a counterpart in a different language.

As of yet the features are working, if you have any recommendations to make the code cleaner, I'll be happy to implement them.

By the way, I had to commit the sawtooth_sdk as right now there is no go get that will easily retrieve the sdk (as opposed to fabric for instance) because some libraries needed by the sdk are not present and must be generated by cloning their repo (cf JIRA-STL-238)

Basically the equivalent of processor/index.js is src/processor/main.go and processor/handler.js is src/handler/handler.go. The rest is the sawtooth_sdk compiled

Signed-off-by: asettouf adonis.settouf@gmail.com

tkuhrt commented 6 years ago

@asettouf : Thank you for the PR. I am wondering if it would make more sense to include this in the SDK examples directory of Hyperledger Sawtooth instead of including it in this material. Since the material in this repository was specifically for the source code covered in the edx.org LFS171x course people may expect the course to also cover the Go code.

asettouf commented 6 years ago

@tkuhrt I believe you're making a good point of integrating the example with sawtooth directly, especially given that the Go SDK is about to get some modifications soon (https://jira.hyperledger.org/browse/STL-974). Is it ok if I use the client you already wrote?

As for this PR I would see 3 possibilities on your side: