Commit graph

746 commits

Author SHA1 Message Date
Brett Logan
5f80da096c Refactor Asset Query Chaincode Into Idiomatic Go
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>
2020-07-15 10:36:04 -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
NIKHIL E GUPTA
09ebf1c1ce Initialize new private data asset transfer CC
Signed-off-by: NIKHIL E GUPTA <negupta@us.ibm.com>
2020-07-11 08:04:37 -04:00
Brett Logan
a401bc92bc Refactor Asset Secured Chaincode Into Idiomatic Go
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>
2020-07-11 07:53:45 -04:00
Acmefocus
59acacbef1
run fabcar go (#232)
* add go/runfabcar.sh

Signed-off-by: Acmefocus <107723772@qq.com>

* add set hosts and env in go

Signed-off-by: Acmefocus <107723772@qq.com>

* Update fabcar/startFabric.sh

Co-authored-by: Sijo Cherian <sijocherian@users.noreply.github.com>
Signed-off-by: Acmefocus <107723772@qq.com>

* Update startFabric.sh

delete  set  /etc/hosts

Signed-off-by: Acmefocus <107723772@qq.com>

* add environment variable DISCOVERY_AS_LOCALHOST

Signed-off-by: Acmefocus <107723772@qq.com>

Co-authored-by: Sijo Cherian <sijocherian@users.noreply.github.com>
2020-07-10 16:18:05 +01:00
r2roC
1249207afd Update asset_transfer_ledger_chaincode.go
Small off-by-1 bug fix.

Signed-off-by: r2roC <arturo@IBM.com>
2020-07-10 07:39:46 -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
James Taylor
5fe1387a89
Fix java fabcar queryAllCars (#239)
Java chaincode still does not support open ended range queries

Signed-off-by: James Taylor <jamest@uk.ibm.com>
2020-07-09 17:32:08 +01:00
NIKHIL E GUPTA
df727853c8 Update tests for commercial paper
Signed-off-by: NIKHIL E GUPTA <negupta@us.ibm.com>
2020-07-03 13:46:01 -04:00
NIKHIL E GUPTA
a1b7da9b5c remove link to BYFN in README
Signed-off-by: NIKHIL E GUPTA <negupta@us.ibm.com>
2020-07-03 13:44:31 -04:00
denyeart
9291154f78
Remove gossip leader election config from samples (#223)
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>
2020-07-02 15:37:15 -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
Brett Logan
8b54e14ee4 Use Official CouchDB 3.1 Image
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>
2020-07-02 09:56:30 -04:00
James Taylor
7154ed8629
Update fabcar java sample build (#219)
- 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>
2020-07-01 17:12:11 +01:00
James Taylor
c0570df2f8
Fix fabcar Java chaincode test & coverage failures (#218)
Also updates queryAllCars to match other implementations

Signed-off-by: James Taylor <jamest@uk.ibm.com>
2020-07-01 11:25:08 +01: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
nikhil550
adfef198df
FAB-18015 (#214)
Remove first network sample if Fabric 2.2

Signed-off-by: NIKHIL E GUPTA <negupta@us.ibm.com>

Co-authored-by: NIKHIL E GUPTA <negupta@us.ibm.com>
2020-06-26 12:36:29 -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
Tiffany Harris
2bd1599d83 Add asset transfer ledger queries go chaincode sample
- 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>
2020-06-25 09:15:01 -04:00
Tatsuya Sato
fc0c2f81d9 [FAB-18020] Add config.yaml to msp folder for User1 in test-network
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>
2020-06-23 22:45:37 -04:00
zhuzeyu
6c29fa0118 modify query number in fabcar for golang
default query number for fabcar in other programming language is 1000 cars

Signed-off-by: zhuzeyu <zhuzeyu0409@gmail.com>
2020-06-19 13:09:45 -04:00
Tiffany Harris
7b2dcbf2ed Rename GetAsset to ReadAsset
Signed-off-by: Tiffany Harris <tiffany.harris@ibm.com>
2020-06-10 08:43:33 -04:00
Tiffany Harris
f1775d7fdc Rename IssueAsset to CreateAsset
- Move go chaincode to chaincode-go subdirectory
- Add public description argument to CreateAsset()

Signed-off-by: Tiffany Harris <tiffany.harris@ibm.com>
2020-06-10 08:23:06 -04:00
Tiffany Harris
82eaaad954 Rename marbles_transfer to asset-transfer-secured-agreement
- 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>
2020-06-09 23:24:52 -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
NIKHIL E GUPTA
86c194615d Update private data marbes for smart contract api
Signed-off-by: NIKHIL E GUPTA <negupta@us.ibm.com>
2020-06-09 15:52:35 -04:00
robmurgai
045d9b69bc
Update deployCC.sh (#199)
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>
2020-06-05 16:07:14 -04:00
Tatsuya Sato
8c7e8e1b2f
[FAB-17957] Delete --tls extra arguments from fabric-samples (#198)
`--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>
2020-06-04 16:49:29 -04:00
Tiffany Harris
0d247f06b7 Add VerifyAssetProperties to marbles_transfer example
- 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>
2020-06-04 12:34:50 -04:00
Tatsuya Sato
808f035088
[FAB-17952] Fix test-network to use the latest version of fabric-ca (#195)
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>
2020-06-03 13:34:26 -04:00
Andrew Coleman
87a2bc7afd
FABG-935 Update Go fabcar sample use latest beta (#196)
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>
2020-06-03 07:47:43 +01:00
Andrew Coleman
cda88df4f6
FABG-935 GoSDK Fabcar sample (#192)
Fabcar sample demonstrating the use of the new Gateway package in the Go SDK

Signed-off-by: andrew-coleman <andrew_coleman@uk.ibm.com>
2020-05-27 15:19:16 +01:00
Pratik Patil
2759db2847
Disconnected from the gateway in fabcar query.js (#190)
Signed-off-by: pratikpatil024 <pratikspatil024@gmail.com>
2020-05-27 11:22:01 +02:00
Ry Jones
61107dbf84
FAB-17930: Update licenses (#191)
Signed-off-by: Ry Jones <ry@linux.com>
2020-05-26 21:43:33 +02:00
Tiffany Harris
df292e0e8d Implement sale, bid, and history queries
- 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>
2020-05-25 21:22:01 -04:00
NIKHIL E GUPTA
0c61f84af7 Fix last image in transfer sample
Signed-off-by: NIKHIL E GUPTA <negupta@us.ibm.com>
2020-05-21 14:17:41 -04:00
nikhil550
59af212cb3
Add transfer sample to readme (#189)
Signed-off-by: NIKHIL E GUPTA <negupta@us.ibm.com>

Co-authored-by: NIKHIL E GUPTA <negupta@us.ibm.com>
2020-05-21 15:48:31 +02:00
NIKHIL E GUPTA
577bf20fd8 Update marbles transfer images
Signed-off-by: NIKHIL E GUPTA <negupta@us.ibm.com>
2020-05-20 17:04:14 -04:00
NIKHIL E GUPTA
6c876534bc Add function to private data hash to sample private data chaincode
Signed-off-by: NIKHIL E GUPTA <negupta@us.ibm.com>
2020-05-20 17:02:46 -04:00
Arnaud J Le Hors
23df2d620a
FGJ-84 Update Fabcar Java app to 2.1.1 (#167)
This updates the fabcar java application to work with the fabric
gateway java version 2.1.1.
It also changes pom.xml to produce a jar file that is self contained
for ease of use.

Signed-off-by: Arnaud J Le Hors <lehors@us.ibm.com>
2020-05-20 09:03:10 +01:00
Arnaud J Le Hors
a9968ea811
Add CHANGELOG.md with script to update it (#162)
Signed-off-by: Arnaud J Le Hors <lehors@us.ibm.com>
2020-05-19 15:52:13 +01:00
Arnaud J Le Hors
2e3683c419
Add missing Copyright in some files (#163)
Signed-off-by: Arnaud J Le Hors <lehors@us.ibm.com>
2020-05-19 15:50:48 +01:00
Pluto
0396bbd853
fix first network byfn.sh usage (#186)
Signed-off-by: zhuzeyu <zhuzeyu0409@gmail.com>
2020-05-19 11:49:06 +02:00
Arnaud J Le Hors
b2c486a1a4
Nominate Nikhil Cupta as Fabric-samples maintainer (#180)
Nik has been the main source of progress in the fabric-samples
repository for several months, making significant improvements with
the introduction of test-network and updates of all the different
samples around it, among other things.

Signed-off-by: Arnaud J Le Hors <lehors@us.ibm.com>
2020-05-18 18:03:44 +02:00