Commit graph

733 commits

Author SHA1 Message Date
nikhil550
1cd71fd26a
Add dutch auction sample with auditor (#426)
Signed-off-by: NIKHIL E GUPTA <ngupta@symbridge.com>
2021-05-24 22:01:54 +02:00
Dave Kelsey
9f07960dae
Correct Javascript Chaincode (#445)
- In CreateAsset, await was never called on putState causing issues
especially with tools such as caliper and is not correct practice.
Unfortunately all the other examples use `return` which works but is
actually not the idiomatic way of handling promises, so here await is
chosen rather than return

Signed-off-by: D <d_kelsey@uk.ibm.com>

Co-authored-by: D <d_kelsey@uk.ibm.com>
2021-05-11 10:22:25 +01:00
denyeart
6ebf692ab8
Disable Go pprof profiling in test network (#444)
Peers and Orderers by default disable Go pprof profiling, however test
network was enabling pprof in peers by default. As a good practice,
pprof should be disabled by default and only enabled when needed
for debug profiling.

Signed-off-by: David Enyeart <enyeart@us.ibm.com>
2021-04-30 11:57:30 +00:00
Matthew B White
ce5186008b
Correct index location (#443)
Signed-off-by: Matthew B White <whitemat@uk.ibm.com>
2021-04-29 11:21:41 +02:00
cena
9db8164f04
Fix typo in code comment (#442)
Signed-off-by: sukill <ckdrms622@gmail.com>
2021-04-28 08:02:30 +02:00
Arnaud J Le Hors
6d043af487 Add repolinter support
Fix link in SECURITY file, and add missing copyright and license
notices.

To check, run: repolinter --rulesetUrl https://github.com/hyperledger-labs/hyperledger-community-management-tools/raw/main/repo_structure/repolint.json

Signed-off-by: Arnaud J Le Hors <lehors@us.ibm.com>
2021-04-23 15:35:20 -04:00
Simon Stone
e9122f86e7
Resign as maintainer (#441)
Signed-off-by: Simon Stone <sstone1@uk.ibm.com>
2021-04-22 21:44:57 +01:00
Arun S M
7ee1bf793d
TLS enabled external chaincode example (#438)
* Enable TLS on asset-transfer-basic external chaincode

1. Introduce environment variables to enable or disable TLS
at runtime. Also, introduce environment variables which carries
the server key, cert and the client machine's root CA cert
information.
2. Read the environment variables to decide with appropriate
assumptions on default values to work as is today.

Signed-off-by: S m, Aruna <arun.s.m.cse@gmail.com>

* Update the chaincode.env with new options

1. Introduce four new environment variables to the default
chaincode environment file.
2. Add two new environment files for easy/automation running
of the external chaincodes for different organizations.

Note that when TLS enabled, the package contents will change.
So each organization will have their own package ID
generated unlike earlier. Also, there will be two chaincode
containers running instead of one for the given example.

Signed-off-by: S m, Aruna <arun.s.m.cse@gmail.com>

* Add docker compose file for running chaincodes

The file will build and run the chaincode on the fly.
Also, it will make use of the available files which is
configured by the user as part of execution. This will
help in bringup/bringdown of the chaincode containers.

In addition, it will help in updating the environment
variables on the go.

Signed-off-by: S m, Aruna <arun.s.m.cse@gmail.com>

* Introduce crypto directory and ignore the pem contents

The directory is used by the docker-compose file for
automation. Instructions in the README.md file will
suffice the filling up of required files in this directory.

Signed-off-by: S m, Aruna <arun.s.m.cse@gmail.com>

* Instructions on TLS enabled external chaincode server

1. Add instructions to generate a chaincode server TLS
parameters.
2. Add instructions on different parameters that peer node
expects and the chaincode expects.
3. Add instructions on steps to be followed in asset-transfer
-basic to work with iTLS enabled exteral chaincode.

Signed-off-by: S m, Aruna <arun.s.m.cse@gmail.com>

* Enable chaincode to work without TLS as well

1. Root certificate is an optional parameter supplied for
chaincode to verify the peer's connection in response.
2. If TLS is enabled, then specify the key and cert
parameters. Do not expect it otherwise.

Signed-off-by: S m, Aruna <arun.s.m.cse@gmail.com>
2021-04-20 11:06:46 +02:00
Kurt Seifried
9f7a5e8d99 Fixed information leak
Signed-off-by: Kurt Seifried <kurt@seifried.org>
Signed-off-by: Ry Jones <ry@linux.com>
2021-04-19 11:50:02 -07:00
Michał Mirończuk
c5e190680f
abstore smart contract - Fixed Aval and Bval validation (#436)
Signed-off-by: Michał Mirończuk <michalmironczuk1@gmail.com>
2021-03-31 12:50:59 -04:00
Kestutis Gudynas
3acff50554
Java chaincode samples fixed (#432)
Signed-off-by: Kestutis Gudynas <44440041+kemi04@users.noreply.github.com>
2021-03-24 12:43:54 +00:00
dvrajitha
2b662e08b4
Update RegisterUser.java (#428)
Use correct identity for the appUser (Not the same admin user certificates)

Signed-off-by: dvrajitha <dvrajitha@gmail.com>
2021-03-21 07:29:30 +01:00
David Enyeart
cbf263dc3b Update "master" branch references to "main"
Update "master" branch references to "main".

Signed-off-by: David Enyeart <enyeart@us.ibm.com>
2021-03-19 19:23:09 -04:00
Simon Stone
365172ddb3
Stop ERC-20 transfer bug when to/from accounts are the same (#425)
Using the ERC-20 sample, you can submit a transfer to and from
the same account. Because the code doesn't handle this, it ends
up minting new tokens into that account.

The correct behaviour is not specified by the ERC-20 specification,
although the OpenZeppelin implementation seems to permit it.

IMO we should just block it with an error because I can't see a use
case for allowing it and it is most likely a user error.

Signed-off-by: Simon Stone <sstone1@uk.ibm.com>
2021-02-24 15:07:06 -05:00
Baran Kılıç
651f2235aa
Fix empty event in token-erc-20 example (#424)
Signed-off-by: Baran Kılıç <baran.kilic@boun.edu.tr>
2021-02-24 08:58:13 -05:00
Yuki Kondo
b88ec9f4b4
Add ERC721 non-fungible token sample for javascript Chaincode (#406)
This PR adds a new non-fungible token sample using ERC721
functionalities. It includes javascript Chaincode and the README
explaining how to mint and transfer a non-fungible token in the
Fabric's test-network.

Signed-off-by: Yuki Kondo <yuki.kondo.ob@hitachi.com>
2021-02-24 13:51:24 +00:00
nikhil550
b4db1f53a0
Updates to external chaincode readme (#422)
Signed-off-by: Nikhil Gupta <ngupta@symbridge.com>
2021-02-22 02:47:56 +01:00
nikhil550
3714bd5ad5
Update test network docker compose network name (#423)
Signed-off-by: Nikhil Gupta <ngupta@symbridge.com>
2021-02-20 10:26:04 +01:00
bblwbtd
15275a0d4d
Change docker compose file version (#421)
Signed-off-by: bblwbtd <gmyxgmyx@outlook.com>
2021-02-14 18:48:35 -05:00
Brett Logan
8eb97d92a1 Remove Stray IMAGE_TAG
Signed-off-by: Brett Logan <lindluni@github.com>
2021-02-11 18:39:26 -05:00
Brett Logan
c30ceaa675 Remove Image Tag Override
The `-i` flag was originally added to support an
upgrade sample. Since that sample is no longer available
remove the `-i` flag to clean up the network.sh options
and avoid confusion as it's possible now to specify
an image version that is no longer backwards compatible
with the new test-network with osnadmin.

Signed-off-by: Brett Logan <lindluni@github.com>
2021-02-11 18:20:43 -05:00
Brett Logan
c81ba4c411 Use Dynamic Linter
The new lint.sh script no longer requires the use
of a matrix and instead dynamically finds and lints
directories.

Signed-off-by: Brett Logan <lindluni@github.com>
2021-02-11 18:11:17 -05:00
Brett Logan
855c8e4db3 Update Go Modules
Signed-off-by: Brett Logan <lindluni@github.com>
2021-02-11 18:11:17 -05:00
Brett Logan
221203fbb4 Lock Chaincode Java Dep Version
There is a dependency conflict when using newer versions of fabric-chaincode-java

Signed-off-by: Brett Logan <lindluni@github.com>
2021-02-11 18:11:17 -05:00
Brett Logan
41bb1d0b5c Fix Linting Issues
Signed-off-by: Brett Logan <lindluni@github.com>
2021-02-11 18:11:17 -05:00
Brett Logan
2907329c20 Fix Linting and Enable ES6 Syntax
Fix a small linting issue and add the es6 tag to handle
the return of a Promise as it is not defined in the ECMA
spec.

Signed-off-by: Brett Logan <lindluni@github.com>
2021-02-11 18:11:17 -05:00
Brett Logan
65b3741a93 Additional Auction Cleanup
Remove unused orgMSP vars and replace `==`
with `===`.

Signed-off-by: Brett Logan <lindluni@github.com>
2021-02-11 18:11:17 -05:00
Brett Logan
9b071d0463 Add ESLinte to Auction Example
The auction example had no ESLint configuration.
This change adds a .eslintrc.js file that matches
the rest of the projects.

This change also fixes all the linting issue in
the auction example.

Signed-off-by: Brett Logan <lindluni@github.com>
2021-02-11 18:11:17 -05:00
Brett Logan
37513c3c2b Add Service Labels and Cleanup Using Standard Tools
Add a service label to all containers launch by compose.
This allows us to filter on the label for removing running
containers.

Use filtering for querying running containers and
images to make sure we only target the containers
and images we want to remove.

Signed-off-by: Brett Logan <lindluni@github.com>
2021-02-11 17:34:49 -05:00
Brett Logan
ae81e8b296 Remove Unused Variable
Signed-off-by: Brett Logan <lindluni@github.com>
2021-02-11 17:34:49 -05:00
Brett Logan
49bf79909d
Remove .env Files and Explicitly Name Network (#417)
There have been lots of changes and quirks with the
docker-compose .env file, this change removes the file
and explicitly creates and assigns the networks in the
compose yaml files.

Signed-off-by: Brett Logan <lindluni@github.com>
2021-02-10 21:38:35 -05:00
SamYuan1990
f67079584e try to fix CI error
Signed-off-by: SamYuan1990 <yy19902439@126.com>
2021-02-08 10:52:35 -05:00
Julian Castrence
51f76977b0 Rename --channel-id to --channelID in osadmin
Signed-off-by: Julian Castrence <juliancastrence@ibm.com>
2021-02-03 13:33:19 -05:00
nikhil550
6875049c8d
Auction sample clean up (#408)
Signed-off-by: Nikhil Gupta <ngupta@symbridge.com>

Co-authored-by: Nikhil Gupta <nikhilgupta@macbook-air.lan>
2021-02-01 10:19:45 +01:00
Andrei Lebedev
822c4c4c25
Fix crypto materials copy in commercial-paper network-starter (#410)
Signed-off-by: Andrei Lebedev <lebdron@gmail.com>
2021-01-29 10:12:59 +01:00
Waleed Mortaja
14dc7e1316
Fix creating channel when ${PWD} contains space. (#402)
* Fix creating channel when ${PWD} contains space.

If the path of the project contains spaces, the "test-network/scripts/envVar.sh" script sets the value of "$ORDERER_CA" to a value containg "${PWD}" which, in turn, contains space(s).

When the variable used in "test-network/scripts/createChannel.sh", The first part of the value (before the first space) is handled as the whole value for "--cafile". Other parts are considered to be part of the command!

I tried putting (escaped) quotes in the "test-network/scripts/envVar.sh" definition for the variable "$ORDERER_CA" to make the fix more general, but the quotation marks were sometime interpreted to be part of the path that consisted of concatenated parts somewhere and it did not work.

While this edit will fix this issue, I belive this is just a work around. I expect that there is a better way to solve the root cause of the problem instead of just fixing it in one place. Moreover, All variables/paths that may include spaces should be properly handled as well.

Thanks

Signed-off-by: Waleed Mortaja <waleedmortaja@protonmail.com>

* Double quote variables evaluations that depends on $PWD

I tried to handle most (if not all) of the variables evaluations in the project that depends on $PWD by wrapping them in double-quotations to avoid values that contains white spaces.

Some lines I was not sure if they are Okay or not but I left them as they are. Samples (not all lines) as follows:
- commercial-paper/network-clean.sh:15:DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
- commercial-paper/network-starter.sh:15:DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
- asset-transfer-basic/chaincode-javascript/node_modules/fabric-shim/coverage/fabric-shim/lib/chaincode.js.html:997: optsCpy.pem = fs.readFileSync(process.env.CORE_PEER_TLS_ROOTCERT_FILE).toString();
- commercial-paper/organization/digibank/digibank.sh:29:export PEER_PARMS="${PEER_CONN_PARMS##*( )}"

The next sample I was not really sure, but still edited it:
- test-network/addOrg3/fabric-ca/registerEnroll.sh:68:  cp ${PWD}/../organizations/peerOrganizations/org3.example.com/peers/peer0.org3.example.com/tls/tlscacerts/* ${PWD}/../organizations/peerOrganizations/org3.example.com/peers/peer0.org3.example.com/tls/ca.crt

I deliberately ignored some lines because I think they are not problem. These lines include:
- `export` sentences
- assignment sentences like: test-network/scripts/createChannel.sh:48:  FABRIC_CFG_PATH=$PWD/../config/
- gradlew files: the line SAVED="`pwd`"
- gradlew files: the line APP_HOME="`pwd -P`"
- gradlew files: the line CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar

Signed-off-by: Waleed Mortaja <waleedmortaja@protonmail.com>

* remove unnecessary leading space trimming

Signed-off-by: Waleed Mortaja <waleedmortaja@protonmail.com>

* resolved conflict with master

Co-authored-by: Arnaud J Le Hors <lehors@us.ibm.com>
2021-01-20 16:32:38 +01:00
Julian Castrence
aa7287e1e3 Update Test Network to Use osadmin
FAB-18369

Signed-off-by: Julian Castrence <juliancastrence@ibm.com>
2021-01-19 20:55:19 -05:00
Brett Logan
622cf52814 Update Fabric Dependency Version
Signed-off-by: Brett Logan <brett.t.logan@ibm.com>
2021-01-19 13:02:01 -05:00
Nikhil Gupta
5b8c4390db Cleanup of register/enroll script
Signed-off-by: Nikhil Gupta <ngupta@symbridge.com>
2021-01-18 14:22:20 -05:00
nikhil550
6fd327a347
Fix error that occurs with go CC and javascript app (#399)
Signed-off-by: Nikhil Gupta <ngupta@symbridge.com>
2021-01-13 15:37:34 -05:00
Brett Logan
08aaaf0313
Update Javascript and Typescript Deps (#403)
Update all of the Node deps to 2.2.<latest>
and regenerate existing package-lock.json files

Signed-off-by: Brett Logan <brett.t.logan@ibm.com>

Co-authored-by: Brett Logan <brett.t.logan@ibm.com>
2021-01-13 12:19:31 -05:00
Nikhil Gupta
80a698b100 Add Attribute based access control asset transfer sample
Signed-off-by: Nikhil Gupta <ngupta@symbridge.com>
2021-01-13 01:43:15 -05:00
5pecia1
ca5c16dbae add test code about SetOption in toeknERC20.test
Signed-off-by: 5pecia1 <pdpxpd@gmail.com>
2021-01-13 00:53:46 -05:00
Will Lahti
9b8f50e2d0
Remove Org3cli and configtx.yaml anchor peers from test-network (#401)
* Remove Org3cli from test-network

FAB-18381

Signed-off-by: Will Lahti <wtlahti@us.ibm.com>

* Remove configtx.yaml anchor peers from test-network

These values were only used by configtxgen's --outputAnchorPeerUpdate
function and should not be set in a channel genesis block This is because
a peer cannot be an anchor peer for a channel until it has joined that
channel and it can't join a channel until the genesis block has been
created.

FAB-18381

Signed-off-by: Will Lahti <wtlahti@us.ibm.com>
2021-01-11 11:27:58 -05:00
Will Lahti
b690d8f30f
Stop using deprecated outputAnchorPeersUpdate in test-network (#394)
* Stop using deprecated outputAnchorPeersUpdate in test-network

FAB-18381

Signed-off-by: Will Lahti <wtlahti@us.ibm.com>

* Improve consistency of test-network output

Signed-off-by: Will Lahti <wtlahti@us.ibm.com>
2021-01-07 13:22:03 -05:00
Brett Logan
df752bfc7b
Explicitly Mount the Docker Unix Socket (#397)
Instead of mounted the entire /var/run directory
explicitly mount the unix socket. Mounting the entire
directory causes issues with future versions of Docker
on some platforms.

Signed-off-by: Brett Logan <brett.t.logan@ibm.com>
2021-01-04 13:47:57 -05:00
Julian Castrence
27ac653c74
Completely Remove Short Name Support (#390)
Signed-off-by: Julian Castrence <juliancastrence@ibm.com>

Co-authored-by: Julian Castrence <juliancastrence@ibm.com>
2020-12-22 18:10:58 -05:00
nikhil550
377ccb0b59
Add go smart contract language to deploy commands (#393)
Signed-off-by: Nikhil Gupta <nikhilgupta@macbook-air.lan>

Co-authored-by: Nikhil Gupta <nikhilgupta@macbook-air.lan>
2020-12-18 14:57:26 +01:00
Nikhil Gupta
2e4a3275ce add full path to off chain data sample
Signed-off-by: Nikhil Gupta <ngupta@symbridge.com>
2020-12-14 10:33:11 -05:00
The Coder X Tea
541cebe154
correct typing (#391)
Signed-off-by: tuyendev <tuyendev@gmail.com>
2020-12-11 08:44:57 -05:00