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>
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>
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>
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>
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>
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>
* 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>
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>
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>
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>