* 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>
options on the network script to deploy chaincode
-ccn The name to be used as the deployed name and used as
the short name of known chaincodes when the -ccp is not included.
known short names
'basic' - asset-transfer-basic
'secure' - asset-transfer-secured-agreement
'ledger' - asset-transfer-ledger-queries
'private' - asset-transfer-private-data
-ccl the language of the chaincode
-ccv the version
-ccs the sequence
-ccp [optional] the path to the chaincode, when provided
the -ccn will be the deployed name
-cci [optional] the chaincode function to call during deployment
that will perform an initialization of the channel state
required for this chaincode
Signed-off-by: Bret Harrison <beharrison@nc.rr.com>
Rewrites the chaincod in idiomatic Go and cleans up
the general implementation.
A future commit should push the chaincode logic itself
into a separate package as chaincode cannot be tested
when the logic is part of the main package.
Signed-off-by: Brett Logan <brett.t.logan@ibm.com>
Rewrites the chaincode in idiomatic Go and cleans up
the general implementation.
A future commit should push the chaincode logic itself
into a separate package as chaincode cannot be tested
when the logic is part of the main package.
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>
In Fabric v2.2, the gossip defaults are changed to make
peers org leaders instead of using leader election.
This change removes the config from the samples, so that
the samples simply inherit the new peer defaults.
This will simplify the sample configuration.
Signed-off-by: David Enyeart <enyeart@us.ibm.com>
Fabric 2.2 removes official support for CouchDB 2.x.
The migration to 3.1 was to address fsync issues
in the underlying storage implementation in Couch.
This change moves to CouchDB 3.1 which requires the
user to now set an admin identity at startup.
Signed-off-by: Brett Logan <brett.t.logan@ibm.com>
- Update gradle version
- Switch to application plugin
(cc is started as an app not a lib, and java-library-distribution
is still incubating)
- make sure tests and coverage checks are run before installDist
Signed-off-by: James Taylor <jamest@uk.ibm.com>
- Add new generic asset transfer sample based on the existing marbles02 sample
- Add InitLedger() to create base assets
- Add AssetExists() to check for an assets existence in the world state
Signed-off-by: Tiffany Harris <tiffany.harris@ibm.com>
This patch adds missing config.yaml to msp folder for user1 in test-network
to make user1 work properly when using FabricCA.
Signed-off-by: Tatsuya Sato <Tatsuya.Sato@hal.hitachi.com>
- Move go chaincode to chaincode-go subdirectory
- Add public description argument to CreateAsset()
Signed-off-by: Tiffany Harris <tiffany.harris@ibm.com>
- Rename marbles_transfer to a more generic and streamlined asset
- Move sample to new directory
- Remove TODO for marbles by size query
Signed-off-by: Tiffany Harris <tiffany.harris@ibm.com>
In queryInstalled()
Removing line: echo PackageID is ${PACKAGE_ID}
the ```peer lifecycle chaincode queryinstalled``` cmd already prints the Package ID when successfull.
Signed-off-by: Rob Murgai <murgai@us.ibm.com>
`--tls` option of the peer command does not require any argument.
On the other hand, some scripts assign the arguments.
This patch deletes the unnecessary arguments.
Also, this patch fixes a minor problem on private data tutorial instructions
for base64 (Related to FAB-13777).
Signed-off-by: Tatsuya Sato <Tatsuya.Sato@hal.hitachi.com>
- Add query to verifies asset properties
- Delete price records from buyer and seller private data collections
when transfer is complete
- Add 'receipt' for asset transfer
Signed-off-by: Tiffany Harris <tiffany.harris@ibm.com>
To get rid of hard-coded versioning and use the latest version of fabric-ca
in test-network, this patch modifies the existence check logic of
the fabric-ca-client binary in the same way as peer and orderer.
Also, this patch updates addOrg3.sh to use cai <ca_imagetag> option.
Signed-off-by: Tatsuya Sato <Tatsuya.Sato@hal.hitachi.com>
Now that fabric-sdk-go beta2 has been released which contains the new programming model, update the dependency in the fabcar go sample
Signed-off-by: andrew-coleman <andrew_coleman@uk.ibm.com>
- Add marbles proposed sale and bid prices queries
- Add marbles history query
- Add verification of ownership when selling marble
Signed-off-by: Tiffany Harris <tiffany.harris@ibm.com>
Signed-off-by: Dereck Luo <dereckluo@gmail.com>