Commit graph

47 commits

Author SHA1 Message Date
Simon Stone
e2b7cb7464 [FAB-6415] Java 11 support for abstore sample
Signed-off-by: Simon Stone <sstone1@uk.ibm.com>
Change-Id: Ie66fc453cba72dee4ad84b5d1e77feb64a37f678
2019-09-24 09:41:02 +01:00
Matthew White
7010c503ac Merge "[FAB-16607] Update FabCar to reflect CC updates" 2019-09-19 13:01:35 +00:00
Simon Stone
521a7ffc4a [FAB-16607] Update FabCar to reflect CC updates
Node.js CC:
As a result of using the new protobufjs library, certain
external APIs have changed in the Node.js chaincode. The
samples need to be updated to use these new APIs.

Java CC:
As a result of moving to Java 11, we hit this issue:
https://github.com/gradle/gradle/issues/8286
The sample needs to be updated to specify the absolute
path to checkstyle's suppression.xml.

Signed-off-by: Simon Stone <sstone1@uk.ibm.com>
Change-Id: I4db886b3feff46d165e05a7eda624230b65f9cbe
2019-09-19 13:26:51 +01:00
Dongming
c13a5ec8f6 [FAB-16528] marbles private chaincode sync up
This CR is part 2 of porting changes in marbles
private in fabric/integration by FAB-15894 back
to fabric-samples

Signed-off-by: Dongming <dongming@ibm.com>
Change-Id: Ic823bdf4c3c571f43b4700452c50fd4283d35262
2019-09-11 12:35:25 -04:00
Dongming
3fad853c15 [FAB-16528] marbles private chaincode sync up
This CR is to port minor changes made in marbles
private in fabric/integration by FAB-15894 back
to fabric-samples.

Signed-off-by: Dongming <dongming@ibm.com>
Change-Id: I3d729f0d692dbd24e11c1cce45233eda5ddb4831
2019-09-06 12:49:22 -04:00
Simon Stone
86ff0e6581 Merge "[FAB-16362] adding chaincode excution comments" 2019-09-06 12:11:26 +00:00
jaehyun
48082cfa95 [FAB-16362] adding chaincode excution comments
adding chaincode excution comments

Signed-off-by: jaehyun <jaehyun@lgcns.com>
Change-Id: I61ce32561f68fb8db8e0dc3f0d18b0564aaafb70
2019-08-30 10:28:39 +09:00
rthatcher
1d379f341d [FAB-16474] marbles02 chaincode error
Signed-off-by: rthatcher <robert.thatcher@uk.ibm.com>
Change-Id: I72d857b2fe905cbb75e33b76b1ac838e83e6f756
2019-08-29 16:05:50 +01:00
Matthew Sykes
1d3e267bbd Redirect samples to fabric-{chaincode,protos}-go
FAB-16401 #done

Change-Id: I9e6c3857cf1842ccf43d7fa0d25ff64dbeae12d0
Signed-off-by: Matthew Sykes <sykesmat@us.ibm.com>
2019-08-23 17:25:16 +00:00
Simon Stone
3996db59dc [FAB-12219] abstore node -> javascript
Rename the abstore node directory as the sample code
within is JavaScript, and we are planning to add a
TypeScript version as well.

This change also requires updates to BYFN to reflect
the renamed directory.

Signed-off-by: Simon Stone <sstone1@uk.ibm.com>
Change-Id: I1cd554c6598ac7cc71e2b0c65ab541cfaa477354
2019-08-02 11:22:56 +01:00
Simon Stone
14ac271c63 [FAB-12219] marbles02 node -> javascript
Rename the marbles02 node directory as the sample code
within is JavaScript, and we are planning to add a
TypeScript version as well.

Signed-off-by: Simon Stone <sstone1@uk.ibm.com>
Change-Id: I423c8cf78fa16be057f762316e8b3d60b73df7ba
2019-08-02 10:07:31 +01:00
Simon Stone
81be9da421 Merge "[FAB-15625] Add UT for Simple Asset Chaincode" 2019-07-30 14:11:49 +00:00
Tatsuya Sato
868f9d01ca [FAB-15625] Add UT for Simple Asset Chaincode
This patch adds unit test for chaincode/sacc.

The positive test cases are aligned with the manual testing procedures
described in `fabric/docs/source/chaincode4ade.rst`.

FAB-15625 #done

Patch-set #4: adjust to new shim Mockup location

Change-Id: Ic3625e885f6e49507859af7d5f0bfa136eb7a757
Signed-off-by: Tatsuya Sato <Tatsuya.Sato@hal.hitachi.com>
Signed-off-by: Arnaud J Le Hors <lehors@us.ibm.com>
2019-07-30 12:56:06 +00:00
Simon Stone
597d1508e1 [FAB-14532] Remove LL FabCar sample
Remove the Fabric v2.0 version of the low-level FabCar sample. We
should not be advertising how to use the low-level APIs at this
point. The low-level samples are still available for Fabric v1.4
to show the difference between the low-level and high-level APIs.

Signed-off-by: Simon Stone <sstone1@uk.ibm.com>
Change-Id: I87b7edf477064b79f449f618f48902b9495e7d4a
2019-07-30 12:03:18 +01:00
James Taylor
750f937218 [FAB-15213] Add Java FabCar sample contract
Change-Id: I0ae40c2a02aea8293a348038e3e1bd02f7030509
Signed-off-by: James Taylor <jamest@uk.ibm.com>
2019-07-29 11:59:30 +00:00
kukgini
1387aa8319 [FAB-15927] Better expression for golang
Better for loop expression and veriable scope for golang

Signed-off-by: kukgini <kukgini@gmail.com>
Change-Id: I83a4ead246039b5b10334467f17c808465492725
2019-07-17 07:48:48 +00:00
Gari Singh
c57d67ce80 FAB-15782 Sample Go CC should include deps
The ccenv used to build Go chaincode is being
updated to no longer include the shim
dependency.  Go chaincode must now vendor
all of its dependencies prior to being
packaged and installed.

Go chaincodes have been updated to include
go.mod for versioned dependencies.

Change-Id: Ib971cd3f841d5c92a509450bd85f6e424cc60c6e
Signed-off-by: Gari Singh <gari.r.singh@gmail.com>
2019-06-25 09:50:31 -04:00
Arnaud J Le Hors
ae91463639 Merge "[FAB-13769] Add UT code to ABAC sample Chaincode" 2019-06-05 12:07:13 +00:00
David Enyeart
f5278157ac [FAB-15119] Fix BYFN with Java chaincode
The issue is that BYFN passes "Init" function while the
sample Java chaincode checks for "init" function.

Within the init function, there is no need to check the function
argument that is passed in. The sample Go chaincode and Node.js
chaincode do not check the function argument. This change makes
sample Java chaincode behave the same way.

Change-Id: I802978e1276e92a3d420b3f4a391ff66a352d321
Signed-off-by: David Enyeart <enyeart@us.ibm.com>
2019-04-09 05:42:08 -04:00
David Enyeart
137327a009 [FAB-14162] Pin fabric-samples in master to "unstable"
Pin fabric-samples in master to "unstable" so that latest node modules get used by default.

Change-Id: I36df30cb108a350c8e59756ed0d2f03610eb1d73
Signed-off-by: David Enyeart <enyeart@us.ibm.com>
2019-02-12 13:08:22 -05:00
Arnaud J Le Hors
6007c0974c [FAB-13862] Rename example02 ABstore
Updated chaincode, BYFN, and all other references to example02 to use
the new name ABstore.

Change-Id: I04c177f9de68eb913f4384fd643aa69631143d58
Signed-off-by: Arnaud J Le Hors <lehors@us.ibm.com>
2019-01-30 09:02:23 +01:00
Yuki Kondo
b0cda61eaf [FAB-13769] Add UT code to ABAC sample Chaincode
This CR adds unit test code to the ABAC sample Chaincode to show
how to use MockStub for Chaincode that uses the `cid` package.
To test the access control in Chaincode method, Creator field in
MockStub is set by reading mspID and certificate with attributes.

FAB-13769 #done

Change-Id: Iddc5ea105b25afcc18b8ff54cf359d2b9406e829
Signed-off-by: Yuki Kondo <yuki.kondo@hal.hitachi.com>
2019-01-18 21:20:48 +00:00
David Enyeart
8a458b5cdc [FAB-12056] Private marbles cc use transient data
The marbles02_private example needs to be updated to pass all
attributes as transient data instead of arguments.
This will prevent identifiable information being sent to the orderer.

Also removed transferMarblesBasedOnColor since range
queries and update is not supported in a transaction when
using private data, as different peers may have
different data in their local private state
databases.

Change-Id: I7c3cebcb49b6c59e4e8ea35f46a799ffdd1999e9
Signed-off-by: David Enyeart <enyeart@us.ibm.com>
2019-01-06 16:52:37 -05:00
David Enyeart
9567985d29 [FAB-13407] Align fabric-samples with 1.4.0-rc2 release
Change-Id: If784ead9b35c89b874078fe3e87e702fd3be5953
Signed-off-by: David Enyeart <enyeart@us.ibm.com>
2018-12-20 17:11:36 -05:00
David Enyeart
6a7472e72e [FAB-13126] Align fabric-samples with 1.4.0-rc1 release
Change-Id: I2ff248e93cbac8747c322672f7a831ece597e116
Signed-off-by: David Enyeart <enyeart@us.ibm.com>
2018-12-12 07:55:08 -05:00
Simon Stone
445ccbc25a [FAB-12880] Move old prog model samples for FabCar
Move the old programming model samples for FabCar,
including the "node" (JavaScript!) chaincode sample
and the JavaScript application in the top level into
new subdirectories called "javascript-low-level".

We still want to keep these samples around for comparision
purposes, but most new developers should be using the new
samples built using the new programming model.

At the same time, update the startFabric.sh script
to output correct help information on how to run
the applications built using the new programming model
after starting the Fabric network and deploying the chaincode.

Change-Id: I1e3701737f105cba67f661bf893771ac8a3a0373
Signed-off-by: Simon Stone <sstone1@uk.ibm.com>
2018-12-10 21:39:30 +00:00
David Enyeart
33f064f2fb [FAB-13170] Add memberOnlyRead to marbles sample
memberOnlyRead is a new private data collection config
property in v1.4. This CR adds it to the marbles02_private
sample chaincode.

Change-Id: I9aeedd43cf835533c7bb2f0f0b6343f819b53e9c
Signed-off-by: David Enyeart <enyeart@us.ibm.com>
2018-12-04 22:24:50 -05:00
Simon Stone
5c087f1443 [FAB-13046] Update TypeScript contract dependencies
The type definitions for the sinon module have been updated so that
they require TypeScript 3; TypeScript 3 has been out for a while, so
we should pick that up as well as updating all of the other dependencies.

Change-Id: Ia58e36158d83ed3cc5cad6353e164bfc2453a00a
Signed-off-by: Simon Stone <sstone1@uk.ibm.com>
2018-11-29 11:51:28 +00:00
Simon Stone
4fb3b57e6b [FAB-12852] Add fabcar contract w/ new prog model (TS)
Add new FabCar contract sample using the new programming model, written
in TypeScript. Add the new contract sample alongside the existing one
written in the old programming model, which will be removed in a subsequent
change request.

Change-Id: I47e5f16b475c68f9a1c4752af2623f090fbf12c9
Signed-off-by: Simon Stone <sstone1@uk.ibm.com>
2018-11-16 21:12:31 +00:00
Gari Singh
fad8ee1e50 Merge "[FAB-12851] Add fabcar contract w/ new prog model (JS)" 2018-11-16 21:12:14 +00:00
Simon Stone
9facb4256b [FAB-12851] Add fabcar contract w/ new prog model (JS)
Add new FabCar contract sample using the new programming model, written
in JavaScript. Add the new contract sample alongside the existing one
written in the old programming model, which will be removed in a subsequent
change request.

Change-Id: Iea46b0a616dbd072b5bd7227ada827a26560f153
Signed-off-by: Simon Stone <sstone1@uk.ibm.com>
2018-11-15 10:48:28 +00:00
Yuki Kondo
286861e0e3 [FAB-12371]Fix the abac sample to use new cid package
The latest cid package is fabric/core/chaincode/shim/ext/cid.
This CR fixes the abac sample to use the new cid package instead
of the old one at fabric/core/chaincode/lib/cid.
The vendor folder is also updated with the new cid package.

Change-Id: Ifc431ee4504cd009f84f9d5de271721597bba6e7
Signed-off-by: Yuki Kondo <yuki.kondo@hal.hitachi.com>
2018-10-30 20:05:57 +00:00
zhaochy
24c5e47539 [FAB-12026] pagination samples for node marbles02
This change synchronizes the node marbles02 sample chaincode with
fabric/examples/marbles02

Change-Id: I6c11fee15ae39950fca7344fbf230c42f876274a
Signed-off-by: zhaochy <zhaochy_2015@hotmail.com>
2018-10-27 10:43:07 +00:00
David Enyeart
514d4560d9 [FAB-12170] Fix dependency check in java chaincode
Currently sample java chaincode can only work with version
1.3.0-SNAPSHOT of the shim.

Allow sample java chaincode to work with any v1.x java shim.

Change-Id: Iee69289392b4fa5fdb5cb14c41672f96120f711f
Signed-off-by: David Enyeart <enyeart@us.ibm.com>
2018-09-26 00:39:26 -04:00
gennady
9f80e47d2d [FAB-12119] Fix groupId in java chaincodes
According to sonatype.org naming requirements, java shim jars
groupId should be org.hyperledger.fabric-chaincode-java

Change-Id: Ia30cb77b1081b3fb4f7573568f2e2abfe89315d4
Signed-off-by: gennady <gennady@il.ibm.com>
2018-09-24 11:50:58 +03:00
Chris Elder
e7a1b76edb [FAB-9386] Remove Marbles sample reference to Fauxton
Remove marbles sample chaincode references to Fauxton
and outdated "data" wrapper.

This change also synchronizes the marbles sample chaincode with
fabric/examples/marbles02, for example it adds pagination
support that is in fabric/examples/marbles02.

Change-Id: Ie80c66d7b2f97081d21c5ea889b159e398b64777
Signed-off-by: Chris Elder <chris.elder@us.ibm.com>
2018-09-17 12:15:24 +00:00
gennady
4030ebdb3d [FAB-11397] Adding java cc
Added java project sources under chaincode
Added support for "-l java" to byfn.sh

Change-Id: I7038aed9b21ad9bf51bcb58c6b71ceb1f161813f
Signed-off-by: gennady <gennady@il.ibm.com>
2018-09-08 17:35:27 +03:00
David Enyeart
5956178406 [FAB-6600] Sample chaincode for private data
Marbles02 chaincode updated to utilize private
data collections on all ledger APIs.

To run the sample, follow the instructions
in FAB-10231. An official tutorial will follow.

Change-Id: Id9b3dbae8ab62afe81ee8d116b7bd4efc0213933
Signed-off-by: David Enyeart <enyeart@us.ibm.com>
2018-06-02 07:42:09 -04:00
Chris Elder
f3b55c9c0d [FAB-8621] Remove Marbles index json data wrapper
Fabric 1.1 removes the need for a "data" wrapper for CouchDB data.

The marbles02 sample index json files in fabric-samples still contains
the data wrapper.

Change-Id: Ic984b1408da4959000ae99962bf9a48d66334860
Signed-off-by: Chris Elder <chris.elder@us.ibm.com>
2018-03-01 14:02:56 -05:00
Saad Karim
77e74b7cd7 [FAB-8497] Download images required for fabric-ca
Added a script for fabric-ca sample that downloads
all the required docker images.

Vendored dependencies for the fabric-ca sample chaincode.
It can now be run without having a local fabric repository.

Change-Id: I7e0f3d7950201e42fdf82bbef2fc855d33c78676
Signed-off-by: Saad Karim <skarim@us.ibm.com>
2018-02-27 20:35:34 +00:00
David Enyeart
dd12f88dc0 [FAB-7834] Add couchdb index to marbles02 sample
Add sample couchdb index to marbles02 chaincode
to support the chaincode queries.

Also update the go chaincode instructions with
index instructions, and fix the examples to
indicate that chaincodeid should not be included
in queries or indexes as of 1.1.

Change-Id: I4a3b0dbeb83c6a2cf40c73fcee5aed20427acfca
Signed-off-by: David Enyeart <enyeart@us.ibm.com>
2018-01-24 23:02:22 -05:00
nikklein
a0c1687ad8 [FAB-7487] Fix typo in node/fabcar.js
According to this tutorial http://hyperledger-fabric.readthedocs.io/en/latest/write_first_app.html
the function name is spelled changeCarOwner.

Renamed changeCarowner to changeCarOwner.

Change-Id: Ic32c76137e3686cbf951f846da0ef8c4c5d8986d
Signed-off-by: Nikita Klein <objcoding@gmail.com>
2017-12-29 11:57:22 +01:00
ratnakar
1961835674 [FAB-6870] Update node modules versions
fabcar uses 1.0.2 node modules changing it to unstable so that
latest node modules can be used on master branch

Change-Id: Ia9dc866931763760dd3cd7dbc5c7fd9a5de099be
Signed-off-by: ratnakar <asara.ratnakar@gmail.com>
2017-11-02 11:19:57 -04:00
Jim Zhang
cd1b691385 Merge "[FAB-5898] porting samples to node.js chaincode" 2017-10-18 23:13:20 +00:00
Keith Smith
caf5c33db2 [FAB-6050] Adding fabric-ca sample
This sample uses fabric-ca to run an end-to-end test similar
to the BYFN sample. However, instead of using cryptogen, it
uses fabric-ca. All private keys are generated dynamically in
the container in which they are used.

This sample also demonstrates how to use abac
(Attribute-Based Access Control) to make access decisions.
See chaincode/abac/abac.go.

Change-Id: I5eddc9e35908e409ac07266c3183ce89a5a6cd82
Signed-off-by: Keith Smith <bksmith@us.ibm.com>
2017-10-17 16:38:33 -04:00
ratnakar
44c204d8b6 [FAB-5898] porting samples to node.js chaincode
Fabric 1.1 supports javascript chaincode. This changeset
addresses porting of the golang chaincode to node.js
chiancode and the corresponding README files

Change-Id: Iae24e713f16ab3508fe0cc18ee062ffa412b8ba6
Signed-off-by: ratnakar <asara.ratnakar@gmail.com>
2017-10-15 21:12:11 -04:00
Jim Zhang
ca8fad3151 [FAB-5260] Update samples to v1.0.0
basic-network:
 - moved "crypto-config" to top-level and removed
   "network" folder
 - added generate.sh to re-gen crypto materials
 - docker-compose.yaml to ref v1.0.0 images
 - add CLI to docker-compose
 - start.sh to only start CA, orderer, peer and couch
 - startFabric.sh to run start.sh, then launch CLI
   for create channel, install, instantiate, invoke
fabcar:
 - moved chaincode to central chaincode folder
 - moved "creds" to top-level and removed "network"
   folder
 - changed to use the basic-network as the target
   and removed docker-compose.yaml and crypto-config
 - updated package.json to require v1.0.0 modules

- added missing license headers
- restructured to use a central chaincode subdirectory

Change-Id: Ic784d1cf55ea51da5155624f3c38275883de1dca
Signed-off-by: Christopher Ferris <chrisfer@us.ibm.com>
Signed-off-by: Nick Gaski <ngaski@us.ibm.com>
Signed-off-by: Jim Zhang <jzhang@us.ibm.com>
2017-07-12 09:07:39 -04:00