Commit graph

46 commits

Author SHA1 Message Date
Andrew Coleman
637ef63425
FAB-18367 Update Go client samples to use RC1 of Go SDK (#385)
Signed-off-by: andrew-coleman <andrew_coleman@uk.ibm.com>
2020-12-04 08:31:59 -05:00
Julian Castrence
d6773d502c Remove Short Names and Replace With Full Path in Samples
Signed-off-by: Julian Castrence <juliancastrence@ibm.com>
2020-12-02 23:59:42 -05:00
Rijul Aggarwal
33adb8d164
asset transfer basic - application typescript (#339)
Signed-off-by: Rijul Aggarwal <rijul.aggarwal@ibm.com>

Co-authored-by: Rijul Aggarwal <rijul.aggarwal@ibm.com>
2020-11-04 10:27:09 -05:00
Bret Harrison
524ee2d63f Have the submitTransaction look at the results of submit.
The results of the submit must be returned by the chaincode.

Signed-off-by: Bret Harrison <beharrison@nc.rr.com>
2020-10-22 14:00:28 -04:00
nikhil550
15740deec1
Include link to external chaincode builder doc (#356)
Signed-off-by: Nikhil Gupta <ngupta@symbridge.com>
2020-10-19 20:05:52 +02:00
nikhil550
d82adf3e75
Fix go SDK bug and enable go SDK test (#352)
Signed-off-by: NIKHIL E GUPTA <ngupta@symbridge.com>
2020-10-16 11:28:18 -04:00
GeonWoo Kim
7f6fa7ce0c
Fix Error message application-go (#341)
[FAB-18236]
* fix Error message
* add additional logs to transaction

Signed-off-by: KIM GEONWOO <kgw8919@gmail.com>
2020-09-22 11:57:14 +02:00
Kyohei Shimozato
b1471ef850
Fix duplicate code: asset-transfer-basic/application-go (#313)
Signed-off-by: zatton <ou4ei1@gmail.com>
2020-08-28 09:40:36 -04:00
Paul
94faa34930 Fixed code review items 2020-08-21 16:26:35 -04:00
Paul
69b96f85e0 Added javascript chaincode unit tests for asset-transfer-basic
Signed-off-by: Paul <pksingh8878@gmail.com>
2020-08-21 16:26:35 -04:00
Dereck
8bb870f930
Fix minor issues related to asset-transfer-basic application-go (#291)
* added additional logs to application.
* minor fixes

Signed-off-by: Chongxin Luo <Chongxin.Luo@ibm.com>
2020-08-20 15:40:18 -04:00
Arnaud J Le Hors
5173e73e7b Improve basic asset transfer external chaincode detect script
This change makes the way the type property is extracted from the
metadata.json file much more robust, and therefore sets a better
example.

Signed-off-by: Arnaud J Le Hors <lehors@us.ibm.com>
2020-08-20 12:36:30 -04:00
Brett Logan
11c05fa612 Add missing apps and chaincodes to CI
Adds the apps and chaincodes to linting and testing
CI that weren't added before.

Linting issues were corrected where necessary to make CI pass.

The Basic-Go application and Private-Javascript application
are currently disabled pending fixes currently being worked on.

Signed-off-by: Brett Logan <brett.t.logan@ibm.com>
2020-08-16 23:11:24 -04:00
denyeart
8f180cd5a3
Update asset-transfer-basic external chaincode readme (#300)
Minor clarifications to external chaincode readme.

Signed-off-by: David Enyeart <enyeart@us.ibm.com>
2020-08-15 09:49:06 +02:00
Arnaud J Le Hors
0bfdecd736 Add chaincode-external for asset-transfer-basic sample.
Improve on the initial PR to expand on the README with detailed
information on how to run the external chaincode in a container
on the test network and use the node application against it.

Signed-off-by: Arnaud J Le Hors <lehors@us.ibm.com>
2020-08-14 15:05:00 -04:00
Sijo Cherian
36a2d3a7d0
Switched private data JS app to commons util (#294)
* Switched private data JS app to commons util

Reusing JS app & ca utils
Refactored for Org1 & Org2
assettransfer-basic JS app update for commons util refactor

Signed-off-by: Sijo Cherian <sijo@ibm.com>

* fixed assettransfer-ledgerqueries & private usage of commons util refactor

Signed-off-by: Sijo Cherian <sijo@ibm.com>

Co-authored-by: Sijo Cherian <sijo@ibm.com>
2020-08-13 08:22:05 -04:00
Bret Harrison
f361386231 Add the javascript application for ledger queries
Add the asset-transfer-ledger-queries javascript application.
Update the CI script to run it against go and javascript chaincode.

Signed-off-by: Bret Harrison <beharrison@nc.rr.com>
2020-08-11 22:32:34 -04:00
Dereck
155a3e7e26
Adding golang application for asset-transfer-basic sample. (#211)
Signed-off-by: Chongxin Luo <Chongxin.Luo@ibm.com>
2020-08-10 10:49:04 -04:00
harrisob
c0ffb1cffb
Restructure the basic javascript application to use common code. (#281)
Use common code for reading a connection profile, enrolling the admin,
registering and enrolling a user, building a wallet, and
building a certificate authority client.

Signed-off-by: Bret Harrison <beharrison@nc.rr.com>
2020-08-06 22:07:54 +02:00
Arnaud J Le Hors
42026e2fd4 Improve unmarshalling in asset-transfer-basic Go cc
Although the current code works thanks to Go being quite
forgiving when it comes to pointers, it doesn't exhibit
the best coding style. This patch addresses this.

Signed-off-by: Arnaud J Le Hors <lehors@us.ibm.com>
2020-08-06 11:12:56 -04:00
Dereck
e2817762f1
Add chaincode-external for asset-transfer-basic sample. (#234)
Signed-off-by: Chongxin Luo <Chongxin.Luo@ibm.com>
2020-08-06 02:12:12 +02:00
r2roC
86d5a50a7c
asset-transfer-basic java application. (#276)
Matches format of js app.
Running TestApp: gradle runApp

Signed-off-by: r2roC <arturo@IBM.com>
2020-08-04 17:05:45 -04:00
Chris Gabriel
1270c8418b
Fix typo in code comment (#275)
Signed-off-by: Chris Gabriel <chris_gabriel_98@yahoo.com>
2020-08-03 22:27:16 +02:00
r2roC
e51dfb9bce asset-transfer-basic Java CC. Adapted from fabcar. Unit tests are attached. Integration testing conducted using test network and asset-transfer-basic application-js.
Signed-off-by: r2roC <arturo@IBM.com>
2020-07-31 09:00:12 -04:00
Brett Logan
4c3fe17310 Refactor GetAllAssets
GetAllAssets uses getStateByRange which returns an iterator.
Refactored code to make use of the iterator as this code did
not function in its previous state

Signed-off-by: Brett Logan <brett.t.logan@ibm.com>
2020-07-27 23:51:51 -04:00
Brett Logan
bd38f9220b Capitalize Function Names
Short of creating a second application that calls
the lowerCase version of functions, since Go requires
the functions be exported, capitalizing them in the
Node and Typescript chaincode seems the simplest solution

Signed-off-by: Brett Logan <brett.t.logan@ibm.com>
2020-07-27 23:51:51 -04:00
Brett Logan
06c42bf68b Clean up Node Application and Address Linting Issues
Signed-off-by: Brett Logan <brett.t.logan@ibm.com>
2020-07-27 23:51:51 -04:00
Brett Logan
73a62a6780 Clean up Node Chaincode and Address Linting Issues
Signed-off-by: Brett Logan <brett.t.logan@ibm.com>
2020-07-27 23:51:51 -04:00
Brett Logan
e31ecf3165 Decorate Typescript Chaincode
Add the contract-api specific annotations and
enable the experimental features.

Also properly format code according to the linter

Signed-off-by: Brett Logan <brett.t.logan@ibm.com>
2020-07-27 23:51:51 -04:00
Brett Logan
66b4b2b86a Remove Typescript Application
As the typescript application shows no Fabric
specific features we have elected to remove it

Signed-off-by: Brett Logan <brett.t.logan@ibm.com>
2020-07-27 23:51:51 -04:00
Arnaud J Le Hors
7771b4f216
Revert "Remove Typescript References (#258)" (#261)
This reverts commit 7a23d7872a.
2020-07-23 17:06:57 +02:00
Brett Logan
7a23d7872a
Remove Typescript References (#258)
As the Typescript examples are essentially just reiterations
of the same Javascript code, there is no benefit to having
providing examples in both languages. The functional code
was exactly the same in both languages. On the contrary it
meant we widened the surface of maitainence and thus we are
removing due to the limited benefit provided by the example
chaincode and applications.

Signed-off-by: Brett Logan <brett.t.logan@ibm.com>
2020-07-22 21:57:54 +02:00
Sijo Cherian
b4ed9e5afd
Simplify asset-transfer-basic javascript application (#241)
* Improve asset-transfer-basic javascript app code by combining invoke & query.js

Adding a sample application workflow to demonstrate the chaincodes, similar to the WIP PR for basic go-application (https://github.com/hyperledger/fabric-samples/pull/211).
Simplify and document-in-code the app workflow of this sample, in a single app , instead of invoke & query setting up Gateway

Signed-off-by: Sijo Cherian <sijo@ibm.com>

improve javascript app code by combining invoke & query.js

Signed-off-by: Sijo Cherian <sijo@ibm.com>

reverted chaincode func signature

Signed-off-by: Sijo Cherian <sijo@ibm.com>

* create/updateAsset signature in sync with chaincode func change as in #227

Signed-off-by: Sijo Cherian <sijo@ibm.com>

* Tested with latest chaincode, Improved comments

Signed-off-by: Sijo Cherian <sijo@ibm.com>

Co-authored-by: Sijo Cherian <sijo@ibm.com>
2020-07-15 15:21:38 -04:00
Brett Logan
14e9ccf85b Remove QueryResult Type
There was no need for GetAllAssets to return a custom type,
it can simple return an array of all assets.

Signed-off-by: Brett Logan <brett.t.logan@ibm.com>
2020-07-15 13:22:56 -04:00
Chris Gabriel
621a2c263e Fix param sequence for typescript invoke function.
Signed-off-by: Chris Gabriel <chris_gabriel_98@yahoo.com>
2020-07-12 17:29:06 -04:00
Chris Gabriel
e83aecfe0c Fix param sequence for javascript invoke function.
Signed-off-by: Chris Gabriel <chris_gabriel_98@yahoo.com>
2020-07-12 17:28:43 -04:00
Chris Gabriel
aa3ae32afb Fix param sequence in smartcontract
smartcontract_test.

Signed-off-by: Chris Gabriel <chris_gabriel_98@yahoo.com>
2020-07-12 12:12:32 -04:00
Brett Logan
426cdf1f98 Add Tests and Mocks To Asset Transfer Chaincode
Many users raise questions on how to test chaincode. It used
to be much easier with the old shim, as they could directly
use the old mock stub in the shim. Now that it no longer exists
the fabcar example can provide an example of how to test chaincode.

Also worth noting is our current directory structure of our Go
chaincodes prevents the creation of mocks due to import cycles.
This change also pushes the chaincode logic down into a `chaincode`
package.

Signed-off-by: Brett Logan <brett.t.logan@ibm.com>
2020-07-10 05:59:22 -04:00
Brett Logan
a04db374aa Refactor Chaincode Into Idiomatic Go
Cleans up the code and pushes the smart contract
implementation down into a `chaincode` package.
This is in prep for implementing unit testing in the
chaincode, as you cannot mock code that is part of
the main package.

Signed-off-by: Brett Logan <brett.t.logan@ibm.com>
2020-07-10 05:59:22 -04:00
Dereck
1eafa98a6f
Add application-typescript to asset-transfer-basci (#221)
Signed-off-by: Chongxin Luo <Chongxin.Luo@ibm.com>
2020-07-02 13:43:48 -04:00
Dereck
fd98ec650a
Add filepath check for invoke (#222)
Signed-off-by: Chongxin Luo <Chongxin.Luo@ibm.com>
2020-07-02 13:36:47 -04:00
Dereck
2f58fb29c4
Adding NodeJS app for asset-transfer-basic sample. (#206)
Signed-off-by: Chongxin Luo <Chongxin.Luo@ibm.com>
2020-06-30 15:36:47 -04:00
Chongxin Luo
a42bbba2c5 Adding chaincode-typescript to asset-transfer-basic sample.
Signed-off-by: Chongxin Luo <Chongxin.Luo@ibm.com>
2020-06-25 12:06:13 -04:00
Chongxin Luo
bee5f6e07f Adding chaincode-js to asset-transfer-basic
Signed-off-by: Chongxin Luo <Chongxin.Luo@ibm.com>
2020-06-25 12:02:53 -04:00
Chongxin Luo
22bcf8cfa4 Fix go mod for chaincode-go
Signed-off-by: Chongxin Luo <Chongxin.Luo@ibm.com>
2020-06-25 12:01:45 -04:00
Chongxin Luo
a228b16364 Initialize asset transfer basic sample.
Signed-off-by: Chongxin Luo <Chongxin.Luo@ibm.com>
2020-06-09 19:21:24 -04:00