- Updates `bn.js` from 4.12.0 to 4.12.3
- Updates `minimatch` from 3.1.2 to 3.1.5
- Updates `@angular/core` from 14.3.0 to 21.2.0
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
- Updates `js-yaml` from 3.14.1 to 3.14.2
- Updates `axios` from 1.11.0 to 1.13.5
- Updates `body-parser` from 2.2.0 to 2.2.2
- Updates `lodash` from 4.17.21 to 4.17.23
- Updates `qs` from 6.14.0 to 6.15.0
- Updates `tmp` from 0.0.33 to 0.2.5
- Updates `validator` from 13.11.0 to 13.15.26
- Updates `@angular/common` from 14.3.0 to 21.1.5
- Updates `@angular/compiler` from 14.3.0 to 21.1.5
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
- Updates to ESLint v10 and fixes lint failures.
- Aligns tsconfig on Node 20, which is the current minimum required Node
version.
- Adds package-lock.json files to source control to avoid future random
failures when dependencies update.
Signed-off-by: Mark S. Lewis <Mark.S.Lewis@outlook.com>
Updates `github.com/sirupsen/logrus` from 1.9.0 to 1.9.1
Updates `golang.org/x/crypto` from 0.40.0 to 0.45.0
Updates `github.com/sirupsen/logrus` from 1.8.1 to 1.8.3
Updates `github.com/consensys/gnark-crypto` from 0.12.1 to 0.18.1
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This PR replaces deprecated containerd registry.mirrors configuration with
config_path mode and hosts.toml, required for containerd 2.x
(KIND v0.27.0+). The old configuration prevents the CRI plugin
from loading, causing kubelet to fail on startup.
Also, this fixes CA enrollment in create_node_local_MSP() to specify
port 443 explicitly, and other minor issues, including removing
redundant throws from Java close() methods.
Signed-off-by: Tatsuya Sato <tatsuya.sato.so@hitachi.com>
Co-authored-by: Mark S. Lewis <Mark.S.Lewis@outlook.com>
Empty Docker Conpose YAML files can cause errors with old Docker Compose
versions due to bugs in their YAML handling. Since these files are empty
and have no functional purpose, this change removes the files and
references to them in scripts.
Signed-off-by: Mark S. Lewis <Mark.S.Lewis@outlook.com>
The Fabric Gateway client API v1.10.0 provides simplified access to Go
error details. This change updates sample client application to use this
latest version of the client API, and updates Go client applications to
reflect the error handling changes.
Signed-off-by: Mark S. Lewis <Mark.S.Lewis@outlook.com>
The build is only testing the Go chaincode for the
asset-transfer-private-data sample. The behavior of the TypeScript
chaincode implementation is not consistent with the Go and Java
versions, which prevents it from working correctly.
This change fixes the TypeScript chaincode implementation for the
asset-transfer-private-data sample so that it works correctly.
Additionally, some JSON property names are explicitly set in the Go
client application sample, which prevented it from working with the Java
and TypeScript chaincode implementations.
Signed-off-by: Mark S. Lewis <Mark.S.Lewis@outlook.com>
The version element is obsolete and unused since Compose v1 was
deprecated in favour of Compose v2 in 2022, and reached end-of-life in
2023. The version element generates warning messages running Docker
Compose commands when bringing up and down the test-network, which
adds unnecessary noise and can be confusing for users.
Signed-off-by: Mark S. Lewis <Mark.S.Lewis@outlook.com>
- Node latest LTS
- Go latest stable
- Fabric 2.5.14, 3.1.3
- Just 1.43.0
- k9s 0.50.15
- Kind 0.30.0
- yq 4.48.1
- nvm 0.40.3
This addresses build breakages due to back-level versions.
Signed-off-by: Mark S. Lewis <Mark.S.Lewis@outlook.com>
- Update Gradle to 9.1.0.
- Update shadow plugin to 9.2.2.
- Requires a minimum of Java 17 to run Gradle.
- Chaincode and applications still target Java 11.
- Use release option instead of Gradle toolchain since the toolchain
download can cause issues when building Docker images.
Signed-off-by: Mark S. Lewis <Mark.S.Lewis@outlook.com>
Build failures because the startFabric.sh script specified that the
chaincode required initialization, which is both legacy behavior and is
unnecessary.
The chaincode is updated to use the Contract API instead of the legacy /
low-level chaincode API. The client application is also simplified.
Signed-off-by: Mark S. Lewis <Mark.S.Lewis@outlook.com>
The CI script invoked Gradle directly, which could picker newer Gradle
versions not compatible with the build definition. This change uses the
Gradle wrapper included in the client application sample.
Signed-off-by: Mark S. Lewis <Mark.S.Lewis@outlook.com>
- Updates `golang.org/x/net` from 0.34.0 to 0.38.0
- Updates `github.com/getkin/kin-openapi` from 0.120.0 to 0.131.0
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
- Updates `golang.org/x/net` from 0.38.0 to 0.42.0
- Updates `google.golang.org/protobuf` from 1.33.0 to 1.36.6
- Updates `github.com/golang/glog` from 1.2.4 to 1.2.5
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
The high-throughput sample used the deprecated Go SDK. This change
updates the sample to use the currently supported Fabric Gateway client
API and adds some automated testing to ensure the sample works
correctly.
Signed-off-by: Mark S. Lewis <Mark.S.Lewis@outlook.com>
Node 20+ is now required. This is the oldest currently support LTS
version of Node.js.
Docker images are moved to Node 22, which is the current LTS release.
Signed-off-by: Mark S. Lewis <Mark.S.Lewis@outlook.com>
Add some methods to the parsing API within the Go off_chain_data sample
for consistency with the Node and Java implementations:
- ToProto() on Block, Transaction and NamespaceReadWriteSet.
- ValidationCode() on Transaction.
- Creator() on Transaction
Signed-off-by: Mark S. Lewis <Mark.S.Lewis@outlook.com>
Make the CA script logging more readable for users
trying to understand the fabric-ca-client commands.
Print the actual command to the log and remove the
debug logging which adds noise.
Signed-off-by: David Enyeart <enyeart@us.ibm.com>
Use the operations service health check to detect when nodes are started
in test-network-nano-bash instead of using arbitrary sleeps. Depending
on the host machine and whether CAs are used, this can reduce network
start time by up to 15 seconds.
Also ensure the Docker socket location is set correctly for Docker
contexts that use a non-default location. This is required to prevent
the health service from returning Docker connection errors.
Signed-off-by: Mark S. Lewis <Mark.S.Lewis@outlook.com>
This commit implements the TypeScript version of the asset-transfer-ledger-queries Chaincode.
Resolves#1232
Signed-off-by: Satoshi Ito <satoshi.ito.tf@hitachi.com>
This patch bumps fabric to v2.5.12.
It also updates some parts of fabric-ca that were missed in the previous update.
Signed-off-by: Tatsuya Sato <tatsuya.sato.so@hitachi.com>
By default, Docker images are referenced from Docker Hub. This has now
applied rate limiting that is causing builds to fail. Current Fabric
v2.5 and chaincode container Docker images are also published to GitHub
Container Registry, which does not impose rate limits and will be
located closer to the GitHub Actions runners.
This change:
- Updates to latest Fabric component versions, which are available in
GHCR. The Fabric install script defaults to GHCR as the Docker
registry for versions that are available here.
- Pulls and re-tags chaincode container images from GHCR in advance of
running tests in the build. This avoids them being pulled from Docker
Hub during test execution.
Signed-off-by: Mark S. Lewis <Mark.S.Lewis@outlook.com>
If CA server hasn't finished initialization then the initial register and enroll requests will fail.
Instead of waiting 3 seconds, actually check if CA service is ready.
Signed-off-by: David Enyeart <enyeart@us.ibm.com>
If CA server hasn't finished initialization then the initial
register and enroll requests will fail.
Waiting 3 seconds resolves the issue.
Signed-off-by: David Enyeart <enyeart@us.ibm.com>
Fix test-network-nano-bash orderer4 enrollment.
Also improve error handling and messages in CA interaction.
Signed-off-by: David Enyeart <enyeart@us.ibm.com>
test-network-nano-bash is often used with locally built
fabric and fabric-ca binaries.
As such the intent is to first look for locally
built binaries and then fall back to binaries downloaded
with the samples.
This was correct for fabric binaries but not the fabric-ca binaries.
Signed-off-by: David Enyeart <enyeart@us.ibm.com>
This patch adds BFT Orderer testing to the CI workflows.
The following test environments are updated:
- test-network
- test-network-k8s
Signed-off-by: Tatsuya Sato <tatsuya.sato.so@hitachi.com>
This patch adds initial support for BFT orderers in the test-network-k8s.
When `TEST_NETWORK_ORDERER_TYPE` is set to `bft`, the network launches
four orderers configured with SmartBFT.
Signed-off-by: Tatsuya Sato <tatsuya.sato.so@hitachi.com>
The existing orderer configuration file is incompatible with v3.0,
and the v3.0 configuration does not work with v2.5.
To support both versions, configuration settings have been updated to
use environment variables instead of referencing static configuration
files.
Signed-off-by: Tatsuya Sato <tatsuya.sato.so@hitachi.com>
The shadow plugin is now maintained by the GradleUp organization. Change
to use the current plugin ID and latest version.
Signed-off-by: Mark S. Lewis <Mark.S.Lewis@outlook.com>
A behaviour change in microfab means that the orderer endpoint needs to
be explicitly specified when using the peer CLI to submit transactions.
Ideally the microfab environment would not require this but the
documented commands do not currently work without this.
This change updates the full-stack-asset-transfer-guide documentation so
that CLI commands include the orderer endpoint explicitly.
Signed-off-by: Mark S. Lewis <Mark.S.Lewis@outlook.com>
The new microfab release seems to start slower than the previous
release. This might be due to a change from solo to raft consensus. This
causes failures in the full-stack-asset-transfer appdev tests. Chaincode
deployment fails since the channel is not yet available.
Instead of increasing the sleep time after launching microfab, this
change attempts to wait however long is required by looking for the
"Microfab started" message in the container log before proceeding.
The test script is also updated to correctly stop the external chaincode
process when the script exits. Previously the process ID of the npm
command used to lauch the chaincode was captured rather than the actual
chaincode process.
Signed-off-by: Mark S. Lewis <Mark.S.Lewis@outlook.com>
Update maintainers to reflect activty from the past year.
- Retire Josh Kneubuhl, Matthew White, Arnaud Le Hors, Nikhil Gupta.
- Add Mark Lewis
Signed-off-by: David Enyeart <enyeart@us.ibm.com>
This patch updates chaincode container versions to 2.5 in the following
samples:
- test-network-k8s
- full-stack-asset-transfer-guide
Signed-off-by: Tatsuya Sato <tatsuya.sato.so@hitachi.com>
The test-network peer configuration specifies $(TWO_DIGIT_VERSION) as
the tag for the Node and Java chaincode containers. For Fabric v3.0,
this requests fabric-nodeenv:3.0 and fabric-javaenv:3.0 Docker images to
host Node and Java chaincode respectively. These images do not exist,
which causes deployment of Node and Java chaincode to fail when using
Fabric v3.0. Fabric v3.0 continues to use fabric-nodeenv:2.5 and
fabric-javaenv:2.5.
This change updates the test-network peer configuration to explicitly
specify `2.5` as the Node and Java chaincode Docker image tags. This is
(currently) the correct version for both Fabric v2.5 and Fabric v3.0.
Signed-off-by: Mark S. Lewis <Mark.S.Lewis@outlook.com>
Created project directory, app.go and connect.go files. Reused the logic for
connect.go from the events application and added second organization setup.
Implemented private data transaction example in go as described in the main
documentation in "Tutorials/Using Private Data in Fabric".
Updated README.md with the command to run the go application and the script
which runs the application in the Github Actions workflow.
Fixed typos and punctuation in the private data typescript application.
Signed-off-by: Stanislav Jakuschevskij <stas@two-giants.com>
The latest fabric-gateway client API release (v1.7.0) includes the gRPC error
details in the GatewayExcetion stack trace so it is not necessary to
programmatically access them to demonstrate that they are present.
This change updates the asset-transfer-basic/application-gateway-java
sample to simplify the updateNonExistentAsset example method. It also:
- Updates all samples to use the latest fabric-gateway release.
- Adds equivalent Maven POM files for fabric-gateway application samples.
Signed-off-by: Mark S. Lewis <Mark.S.Lewis@outlook.com>
The repository currently uses Go 1.22 to test samples in the automated
build. This change sets the Go version in all go.mod (and go.work) files
to Go 1.22.0, and removes any Go toolchain entries.
Signed-off-by: Mark S. Lewis <Mark.S.Lewis@outlook.com>
For some signing implementations, such as ed25519, a non-default hash
implementation must be specified when creating the Gateway connection in
client applications. Rather than relying on the default hash algorithm,
it is probably good practice in general to specify an algorithm that is
compatible with your signing implementation.
This change explicitly specifies the hash algorithm to raise visibility
of the option to select the hash algorithm.
Signed-off-by: Mark S. Lewis <Mark.S.Lewis@outlook.com>
Since Fabric v3.0 builds on ubuntu 22.04,
it is necessary for samples CI to run on ubuntu 22.04.
Both Fabric v2.5 components (ubuntu 20.04) and
Fabric v3.0 components (ubuntu 22.04) work on
ubuntu 22.04 runtime.
The update also requires shell script updates to pass linting.
Signed-off-by: David Enyeart <enyeart@us.ibm.com>
This patch improves prereqs logic in test-network-k8s.
- Use the newer install script instead of bootstrap.sh
- Download binaries matching the Docker image versions, instead of the latest version
- Add checks for Fabric versions to ensure consistency between images and binaries
Signed-off-by: Tatsuya Sato <tatsuya.sato.so@hitachi.com>
Add document about how to benchmark the performance using Hyperledger Caliper
Signed-off-by: takayuki-nagai <takayuki.nagai.nu@hitachi.com>
Co-authored-by: Tatsuya Sato <tatsuya.sato.so@hitachi.com>
While the TypeScript application sample is essentially identical (with
the addition of some type declarations), there seems to be sufficient
uncertainty amongst JavaScript developers not familiar with TypeScript
on how best to implement a JavaScript application that it is worthwhile
having one plain JavaScript sample using the current client API.
Signed-off-by: Mark S. Lewis <Mark.S.Lewis@outlook.com>
The removed samples make use of deprecated legacy client SDKs. They all
have equivalent samples implemented using the currently supported Fabric
Gateway client API, and are therefore redundant.
Signed-off-by: Mark S. Lewis <Mark.S.Lewis@outlook.com>
- Dependency updates
- ESLint flat configuration format, replacing deprecated configuration
- Minor fixes to compile and lint issues
- Consistent TypeScript formatting with .editorconfig
Signed-off-by: Mark S. Lewis <Mark.S.Lewis@outlook.com>
- Correct sh compability in ca_utils.sh
- Correct linux compatibility in external builder
Signed-off-by: Chris Elder <celder628@gmail.com>
Signed-off-by: Chris Elder <celder@Chriss-MacBook-Pro.local>
This demonstrates good practice in restricting the chaincode package
versions to those applicable for the specific Fabric (major/minor)
version targeted for deployment.
Also some corrections to the repository README. Particularly referring
to other branches for samples targeted at earlier Fabric versions, since
samples in the main branch may exploit features not available in older
Fabric releases, which can cause confusion for end users.
Signed-off-by: Mark S. Lewis <Mark.S.Lewis@outlook.com>
This change adds:
- shell scripts to start CAs for each org
- optional flag (-c) to network.sh to start CAs
- generate crypto material in the same format as cryptogen using the CAs
- describe how to start the CAs using terminals
Signed-off-by: Chris Elder <celder@chriss-mbp.raleigh.ibm.com>
Add required permissions for upcoming k8s builder release
Also adds ttl to install jobs and configures the k8s builder prefix
Signed-off-by: James Taylor <jamest@uk.ibm.com>
This resolves mocking errors using the latest Java chaincode shim and
very old versions of Mockito.
Signed-off-by: Mark S. Lewis <Mark.S.Lewis@outlook.com>
full-stack-asset-transfer points to an old image
that no longer exists.
Point to the hyperledger-labs microfab image instead.
Signed-off-by: David Enyeart <enyeart@us.ibm.com>
With removal of fabric-tools image, test-network
now depends on jq being installed locally.
This commit logs an error message if jq commands
fail due to jq not being installed locally.
Signed-off-by: David Enyeart <enyeart@us.ibm.com>
Fix regression in network.sh and update peer scripts to allow
chaincodeListenAddress and chaincodeAddress to be overridden if
required
Also updates the nano test network readme to describe the new
environment variables for the k8s builder
Fixes#1198
Signed-off-by: James Taylor <jamest@uk.ibm.com>
This patch aims to refactor the test-network in several aspects,
following the decoupling of the fabric-tools image from fabric-samples.
- Rename 'test_network_home' env var to 'TEST_NETWORK_HOME'
- Dedicate the intermediate artifacts related to configtx to
channel-artifacts
- Refer to core.yaml in fabric-samples/config, similar to org1 and 2,
instead of adding a new core file
- Remove unnecessary functions and comments for CLI container
- Other minor modifications
Signed-off-by: Tatsuya Sato <tatsuya.sato.so@hitachi.com>
Change shell script to use single equals.
In my shell environment single bracket with double equals did not work.
It caused failure when running the chaincode-external tutorial README.
It looks like for maximum portability, it is best to use single bracket with single equals.
Signed-off-by: David Enyeart <enyeart@us.ibm.com>
Allow client applications to work regardless of whether network was creating using a CA or cryptogen since they create different client certificate file names.
Signed-off-by: Mark S. Lewis <Mark.S.Lewis@outlook.com>
* add support for docker compose v2 (fix#730)
Signed-off-by: uniform64 <jiny2048@gmail.com>
* add support for docker compose v2 (fix#730)
some missing places in the previous commit
Signed-off-by: uniform64 <jiny2048@gmail.com>
---------
Signed-off-by: uniform64 <jiny2048@gmail.com>
The default ForkJoinPool.commonPool may have limited capacity in some environments, risking deadlock. This implementation also better demonstrates handling of connection errors.
Signed-off-by: Mark S. Lewis <Mark.S.Lewis@outlook.com>
Resolves a regression introduced in e73bb717db.
Previous change defaulted to "auto" as the sequence number but omitted the call to generate the correct sequence number for the "auto" value. This resulted in "auto" being used as the sequence number, which is an error since an integer is required.
Signed-off-by: Mark S. Lewis <Mark.S.Lewis@outlook.com>
This change is meant to help cover end user functionality
that was previously covered by the blockchain VSCode Plugin.
Functions added:
- cc mode with package, list chaincode, invoke and query functions
- auto sequencing for chaincode deployment
- move variables into config file
Signed-off-by: Chris Elder <celder@Chriss-MacBook-Air.local>
The originally used image of Hyperledger Fabric Ansible Collection was
not compatible with K8s v1.25.x. This patch replaces the image with
the latest hyperledger-labs/fabric-ansible-collection.
Additionally, deprecated notations in the latest Kustomize,
patchesJson and patchesStrategicMerge, have been replaced with the
recommended syntax to prevent ansible task execution failures.
Signed-off-by: Tatsuya Sato <tatsuya.sato.so@hitachi.com>
This patch updates fabric-operator to utilize PodSecurity Admission
controller for Kubernetes v1.25.x.
This change is based on the following PR:
https://github.com/hyperledger-labs/fabric-operator/pull/82
Signed-off-by: Tatsuya Sato <tatsuya.sato.so@hitachi.com>
This patch updates the versions of software used in CI tests to the latest:
- Fabric
- GO
- KIND, kubectl
Signed-off-by: Tatsuya Sato <tatsuya.sato.so@hitachi.com>
This patch moves publishing of REST sample image from AZP to GHA.
This was the last job running on AZP.
Also, this patch fixes an error encounterd during the image build.
Publishing of REST sample image is now only executed when pushing to main.
Signed-off-by: Tatsuya Sato <tatsuya.sato.so@hitachi.com>
- Update to Node 16.
- Simplify SKI code using Node standard packages and avoiding use of jsrsasign.
Signed-off-by: Mark S. Lewis <Mark.S.Lewis@outlook.com>
This patch fixes the description of orderer2-4 in OrdererEndpoints
in test-network's bft-config/configtx.yaml.
Signed-off-by: Tatsuya Sato <tatsuya.sato.so@hitachi.com>
This patch includes:
- Fixed a minor bug in the parsing of the BFT flag
- Added check for when a user attempts to use BFT orderer in
Fabric network with CA
- Update of printHelp for use of the BFT flag
- Fixed explanations
Signed-off-by: Tatsuya Sato <tatsuya.sato.so@hitachi.com>
Added a new option for creating channel:
Running ./network.sh createChannel -bft will initiate a channel running BFT orderers.
Using ./network.sh up -bft will initiate dockers for bft environment.
Added option for 4 orderers.
Add add_new_orderer_to_config.py which is referenced in the fabric official docs.
Signed-off-by: Arkadi Piven <arkadi.piven@ibm.com>
Signed-off-by: arkadipiven <arkadi7770@gmail.com>
The general overflow judgment condition for function sub is not in every case.
The judgment result is wrong in the condition of b < 0 && q >=0
for example, b = -3, q = 2, diff = -5, it's not overflow,
but if (diff > b) == (b >= 0 && q >= 0) wil be true.
for another example, b = -3, q = maxint, b-q is overflow,
but if (diff > b) == (b >= 0 && q >= 0) wil be false.
Signed-off-by: yjwxfq <112159687+yjwxfq@users.noreply.github.com>
This patch extends the sleep time to wait for starting
nginx by following the description on
full-stack-asset-transfer-guide/justfile
to stabilize the intergration test
Signed-off-by: Tatsuya Sato <tatsuya.sato.so@hitachi.com>
- Use calculatepackageid to set CHAINCODE_ID
- Use waitForEvent to wait for commit event intead of 2s sleep
Signed-off-by: David Enyeart <enyeart@us.ibm.com>
Tatsuya has been helping to groom fabric-samples for multiple years.
More recently, Tatsuya has helped to keep test-network-k8s
and full-stack-asset-transfer samples working well.
Tatsuya has expressed interest in becoming a maintainer and
I would welcome the addition!
Signed-off-by: David Enyeart <enyeart@us.ibm.com>
Signed-off-by: YunusEmreKarakose <yemre05@hotmail.com.tr>
Signed-off-by: Ry Jones <ry@linux.com>
Signed-off-by: yunusemrekarakose <yemre05@hotmail.com.tr>
This patch updates full-stack-asset-transfer to Fabric 2.5 by default.
In particular, since k8s-builder-peer is set as the default value for
peer image, it needs to be updated to use 0.11.0, which is derived
from Fabric v2.5 image, as the version default value.
Signed-off-by: Tatsuya Sato <tatsuya.sato.so@hitachi.com>
This patch updates k8s CC builder to 0.11.0 to resolve the
distribution mismatch between k8s-builder base image and fabric-peer
base image.
Signed-off-by: Tatsuya Sato <tatsuya.sato.so@hitachi.com>
Include specific gRPC TLS implementation in dependencies instead of relying on an appropriate one to be present as a transitive dependency.
Signed-off-by: Mark S. Lewis <Mark.S.Lewis@outlook.com>
- Set correct CERTIFICATE file name in application ChaincodeEvents exercise.
- Add required environment variables to application AssetTransfer exercise, rather than rely on the RunApplication exercise being run in the same terminal first.
Signed-off-by: Mark S. Lewis <Mark.S.Lewis@outlook.com>
A typo in the 10-appdev-e2e.sh script caused the shell to exit with an error status, and the killall command appears to match some key processes in the runner so removing.
Also:
- Update sample application and smart contract to Node 18, using the latest fabric-contact-api release.
- Use release versions of Fabric v2.5 and update tool versions in workflow set up.
- Use GitHub Action to install just instead of curl of install script.
Signed-off-by: Mark S. Lewis <mark_lewis@uk.ibm.com>
* Fix npm problems on asset-transfer-basic/chaincode-typescript
This patch fixes npm problems on
asset-transfer-basic/chaincode-typescript.
- Sync npm-shrinkwrap.json with package.json to fix the npm ci error
- Update the version of TypeScript to avoid the type error on logform
Signed-off-by: Tatsuya Sato <tatsuya.sato.so@hitachi.com>
* Update npm-shrinkwrap.json
Fix dependencies
Signed-off-by: Arnaud J Le Hors <lehors@us.ibm.com>
---------
Signed-off-by: Tatsuya Sato <tatsuya.sato.so@hitachi.com>
Signed-off-by: Arnaud J Le Hors <lehors@us.ibm.com>
Co-authored-by: Arnaud J Le Hors <lehors@us.ibm.com>
For the asset transfer example (https://hyperledger-fabric.readthedocs.io/en/release-2.5/private_data_tutorial.html#pd-use-case)
the are three private data collections, one per org and one shared between the orgs.
The shared collection didn't have an endorsement policy so inheritted the chaincodes; this was specifically set away from the default
to be OR(Org1MSP,Org2MSP). The documentation says this is to ensure that either organization can create and asset.
However this isn't really necassary, the endorsement policy should be lowest level; so this PR moves the endorsement policy to
the collection. The documentation does I believe lead to a false understanding
Signed-off-by: Matthew B White <whitemat@uk.ibm.com>
Ensure that all sample applications return exit code 1 upon failure
so that github actions can report the failure.
Signed-off-by: David Enyeart <enyeart@us.ibm.com>
Flag --csr.hosts is only relevant for tls enrollments, it adds the SAN to the TLS cert.
For msp enrollments, the cert is only used for identity, therefore there is no need for SAN and no need to pass --csr.hosts.
Having --csr.hosts for msp enrollments is misleading, this commit removes it.
Signed-off-by: David Enyeart <enyeart@us.ibm.com>
Also:
- Tidy up README documentation.
- Add MacOS/Homebrew (Apple silicon) default SoftHSM library location to HSM scripts and sample applications to avoid the need to explicitly override the library location when running the sample.
Signed-off-by: Mark S. Lewis <mark_lewis@uk.ibm.com>
* Update go dependencies
Update go dependencies in sample chaincodes and applications
Signed-off-by: David Enyeart <enyeart@us.ibm.com>
* Update to Go 1.19.6
Update to Go 1.19.6
Signed-off-by: David Enyeart <enyeart@us.ibm.com>
---------
Signed-off-by: David Enyeart <enyeart@us.ibm.com>
* Return exit(1) if application-java fails
If application-java fails, return an exit(1) code,
so that callers such as Github Actions CI can detect the failure.
Signed-off-by: David Enyeart <enyeart@us.ibm.com>
* asset-transfer-basic CI improvements
- Application failure should result in CI failure
- Automatically remove wallet from prior runs
- Fix chaincode name issues, allow chaincode name to be passed from CI
- Fix appUser collisions (duplicate registration failures)
- Fix key create collisions across apps (in cases where same chaincode is used for multiple apps)
Signed-off-by: David Enyeart <enyeart@us.ibm.com>
---------
Signed-off-by: David Enyeart <enyeart@us.ibm.com>
This patch fixes the gradle version used in asset-transfer-basic/
chaincode-java build to 7.
The reason is because the gradle version in the gradle:jdk11-alpine
image is updated from 7 to 8, which seems to cause the build to fail.
Signed-off-by: Tatsuya Sato <tatsuya.sato.so@hitachi.com>
The samples repository has been refactored to focus on an asset transfer series of samples.
The goal of the samples repository is to align with the fabric documentation tutorials
with minimal other distractions.
The heritage samples were left in place for a period of time until the asset transfer series stabilized.
It is now time to purge the heritage samples.
Signed-off-by: David Enyeart <enyeart@us.ibm.com>
Rely on the dependencies of @hyperledger/fabric-gateway making these packages transitively available. Having explicit dependency versions in the application can cause type conflicts due to private member changes in the gRPC Client class across versions.
Also fix some missing or incorrect Node types and engines version contraints.
Signed-off-by: Mark S. Lewis <mark_lewis@uk.ibm.com>
The Commercial Paper example code hasn't kept pace with the state-of-the-art of writing applications and chaincode
Whilst the scenario is still a valid usecase, the example itself is not helping - in fact causing confusion.
Signed-off-by: Matthew B White <whitemat@uk.ibm.com>
* Add in examples and notes on using PurgePrivateData
- Update the configtx.yaml to enable the 2.5 capabillity
- Added purge into the chancode
- Added pruge into the application client code.
Signed-off-by: Matthew B White <whitemat@uk.ibm.com>
* Temporarily remove java cc test
Signed-off-by: Matthew B White <whitemat@uk.ibm.com>
* run test suites with 2.5 binaries and images
Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
* Swap to use the Helper Function to create policies (#907)
The old way used the direct protobuf functions, there is a helper function
in the chaincode does exactly that.
Signed-off-by: Matthew B White <whitemat@uk.ibm.com>
Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
Signed-off-by: Matthew B White <whitemat@uk.ibm.com>
Co-authored-by: Matthew B White <whitemat@uk.ibm.com>
The old way used the direct protobuf functions, there is a helper function
in the chaincode does exactly that.
Signed-off-by: Matthew B White <whitemat@uk.ibm.com>
Late 2022 it was discovered that when used via the CA, the certificate had a fixed named covention. cert.pem
Signed-off-by: Matthew B White <whitemat@uk.ibm.com>
Signed-off-by: Matthew B White <whitemat@uk.ibm.com>
Fixing TLS issues while using org1-peer-gateway-svc.${DOMAIN}.
This would be needed so there are no TLS issues when sending requests.
Signed-off-by: Deepak Singh <91736795+blockguardian@users.noreply.github.com>
Signed-off-by: Deepak Singh <91736795+blockguardian@users.noreply.github.com>
* fixed comment consistency problem with erc20 chaincode
Signed-off-by: Ali Shahverdi <ali@Alis-MacBook-Pro.local>
* added more comment consistancy fix
Signed-off-by: Ali Shahverdi <ali@Alis-MacBook-Pro.local>
* added more comment consistancy fix
Signed-off-by: Ali Shahverdi <ali@Alis-MacBook-Pro.local>
* added more comment consistancy fix
Signed-off-by: Ali Shahverdi <ali@Alis-MacBook-Pro.local>
* added more comment consistancy fix
Signed-off-by: Ali Shahverdi <ali@Alis-MacBook-Pro.local>
Signed-off-by: Ali Shahverdi <ali@Alis-MacBook-Pro.local>
Co-authored-by: Ali Shahverdi <ali@Alis-MacBook-Pro.local>
* REST api added for asset transfer in Golang
Signed-off-by: Basil K Y <techiebasil@gmail.com>
* add go.sum to git
Signed-off-by: Basil K Y <techiebasil@gmail.com>
* fix golint error
Signed-off-by: Basil K Y <techiebasil@gmail.com>
Signed-off-by: Basil K Y <techiebasil@gmail.com>
Error handling example used a transaction invocation with the wrong number of arguments and so did not demonstrate the same error condition as other language samples. The error handling code was also not as comprehensive as it should be.
Also changed the console output throughout to match the content and format of the Node and Java samples.
Signed-off-by: Mark S. Lewis <mark_lewis@uk.ibm.com>
Signed-off-by: Mark S. Lewis <mark_lewis@uk.ibm.com>
* Import Full Stack Asset Transfer Guide at commit fb554befdbbeff9e69159b54fce0b811603f29c7
Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
* Update the workshop with a new WORKSHOP_PATH under fabric-samples
Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
* Update the workshop with a new WORKSHOP_PATH under fabric-samples
Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
* missed a .git ignored directory on add
Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
* Updates to run the workshop on the Apple M1
Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
* Workaround for https://github.com/eslint/eslint/issues/15299 in the contract tslinter
Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
* Build an arch-specific CC images on M1
Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
* empty commit - force a build
Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
* revert an accidental commit that was building the top-level asset-transfer as arm64
Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
* Refactor Go files
1. replace deprecated ioutil functions (ioutil is deprecated since Go 1.16)
2. fix variable names that collide with imported package name
3. fix typos
Also update Go version specified by Go modules to ensure a Go version is used in which ioutil is deprecated and replacement functions are available in os and io packages.
Signed-off-by: Tommy TIAN <xtianae@connect.ust.hk>
Co-authored-by: Mark S. Lewis <mark_lewis@uk.ibm.com>
* Specify go 1.18 instead of go 1.19 in go.mod files
Signed-off-by: Mark S. Lewis <mark_lewis@uk.ibm.com>
Signed-off-by: Tommy TIAN <xtianae@connect.ust.hk>
Signed-off-by: Mark S. Lewis <mark_lewis@uk.ibm.com>
Co-authored-by: Tommy TIAN <xtianae@connect.ust.hk>
Correctly check for installed chaincode and enable the same chaincode to be deployed on different channels
Signed-off-by: James Taylor <jamest@uk.ibm.com>
Signed-off-by: James Taylor <jamest@uk.ibm.com>
Fix minor bugs, and add network.sh script to simplify standing up the network
Note: the updated peerNadmin.sh scripts no longer create or join a channel and now only configure the environment for the relevant peer
Signed-off-by: James Taylor <jamest@uk.ibm.com>
* seperate namespace for each organization
Signed-off-by: Basil K Y <techiebasil@gmail.com>
* rest server working
Signed-off-by: Basil K Y <techiebasil@gmail.com>
* use single namespace by default, fix k8s buider
Signed-off-by: Basil K Y <techiebasil@gmail.com>
* added ci test for testing k8s n/w on multiple namespaces
Signed-off-by: Basil K Y <techiebasil@gmail.com>
* fix: access rest server via gateway
Signed-off-by: Basil K Y <techiebasil@gmail.com>
Signed-off-by: Basil K Y <techiebasil@gmail.com>
This change fixes a few minor errors and adds a note to help the user.
Signed-off-by: Arnaud J Le Hors <lehors@us.ibm.com>
Signed-off-by: Arnaud J Le Hors <lehors@us.ibm.com>
* Run RCAADMIN registration on the host OS, not in k8s
Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
* Fix a typo that caused the log trailer to not exit cleanly on error
Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
* allow a node registration to have been previously created. This allows for multiple 'network up' targets to be run.
Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
This changes the base image used to build the chaincode-as-a-service
java container to the alpine version which is sufficient and less
taxing than using the full gradle:jdk11 one.
Signed-off-by: Arnaud J Le Hors <lehors@us.ibm.com>
This change updates the test-network README with up-to-date information
about using podman on Mac and improves support for podman in deployCCAAS.sh
Signed-off-by: Arnaud J Le Hors <lehors@us.ibm.com>
npm audit reveals several high and one critical vulnerabilities in the dependencies:
ansi-regex 4.0.0 - 4.1.0
Severity: high
Inefficient Regular Expression Complexity in chalk/ansi-regex - https://github.com/advisories/GHSA-93q8-gq69-wqmw
fix available via `npm audit fix`
node_modules/nyc/node_modules/ansi-regex
minimist <=1.2.5
Severity: critical
Prototype Pollution in minimist - https://github.com/advisories/GHSA-xvch-5gv4-984h
Prototype Pollution in minimist - https://github.com/advisories/GHSA-vh95-rmgr-6w4m
fix available via `npm audit fix --force`
Will install mocha@10.0.0, which is a breaking change
node_modules/minimist
node_modules/ts-node/node_modules/minimist
mkdirp 0.4.1 - 0.5.1
Depends on vulnerable versions of minimist
node_modules/mkdirp
mocha 1.21.5 - 6.2.2 || 7.0.0-esm1 - 7.1.0
Depends on vulnerable versions of mkdirp
node_modules/mocha
protobufjs 6.11.0 - 6.11.2
Severity: high
Prototype Pollution in protobufjs - https://github.com/advisories/GHSA-g954-5hwp-pp24
fix available via `npm audit fix`
node_modules/protobufjs
5 vulnerabilities (2 moderate, 2 high, 1 critical)
This change (from running npm audit fix --force) removes all of them:
npm audit
found 0 vulnerabilities
Signed-off-by: Arnaud J Le Hors <lehors@us.ibm.com>
* bump CA to v1.5.5; Fabric to v2.4.4
Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
* Reorganizes the kube test network environment default parameters to align on column boundaries.
Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
* Run k8s sample network tests against latest MAJOR.MINOR release of fabric, CA docker hub images.
Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
A recent commit added the potential buyer to an asset's state based endorsement policy.
That change was problematic because if the transfer fell through, the buyer lost control of the asset,
in that they could no longer update the asset or change the sell price or sell to somebody else.
The asset state based endorsement policy is now based on the seller only, and we document
that additional parties could be added such as a trusted third party (although no
such party exists in test network at this time).
This commit also re-adds some necessary verifications, and make other minor edits and
comments to help users understand the sample.
Signed-off-by: David Enyeart <enyeart@us.ibm.com>
Issues:
1. When the name of NETWORK_NAME or NS in file "network" (i.e., the namespace in k8s) is changed from "test-network", the resources in the k8s cluster cannot be created successfully when the command "./network up" is executed.
Error message: error: the namespace from the provided object "test-network" does not match the namespace "xxxxxx". You must pass '--namespace=test-network' to perform this operation.
2. org2-cc.yaml is not completed.
Fix:
1. Replace "test-network" in yaml files in folder "kube" with "${NS}".
2. Complete "org2-cc-template.yaml" by referring to "org1-cc-template.yaml".
Signed-off-by: destinysky <kangrui10@126.com>
- chaincode-java Gradle project name did not match the instructions or the chaincode name used by the sample application code.
- Added test of Java chaincode to CI pipeline.
Signed-off-by: Mark S. Lewis <mark_lewis@uk.ibm.com>
- Updated build to use Go 1.18 since Go 1.16 is no longer supported.
- Use Java 11 in updated samples, and take advantage of new language features.
Signed-off-by: Mark S. Lewis <mark_lewis@uk.ibm.com>
This patch fixes errors in the document.
Fix errors as follows:
- Change shell script arguments
- Correct display results
Signed-off-by: Satoshi Ito <satoshi.ito.tf@hitachi.com>
* Support the fabric-builder-k8s for the chaincode "easy button."
Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
* Run the CI/CD test suite using the correct matrix env for k8s builder
Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
* Incorporate review feedback : remove zz_unused and pkgk8scc routines
Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
Also minor implementation changes to TypeScript sample for better consistency between implementations.
Signed-off-by: Mark S. Lewis <mark_lewis@uk.ibm.com>
In chaincode debugging guidance, using the Docker host alias
`host.docker.internal` is assumed.
But, the alias is not yet supported for Linux.
So, this patch adds its alternate procedure for Linux.
Signed-off-by: Tatsuya Sato <tatsuya.sato.so@hitachi.com>
Use an .npmrc to enable engine-strict checks so that `npm install` will fail for projects when an incompatible Node version is used, rather than confusing errors about unsupported language features occuring at runtime.
Signed-off-by: Mark S. Lewis <mark_lewis@uk.ibm.com>
* Addresses Issue #548 by providing a simple guide for running Java chaincode as a service with a local debugger.
Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
* missed a couple of bash syntax errors
Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
* Add metadata and activate examples to the CC README
Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
* move ccpackage/ contents into network script
Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
* Fix CI test - Azure mounts git checkout at a different folder root path
Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
* Update test-network-k8s README with updated cc deploy commands
Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
* Run basic-asset transfer CI tests with Java + golang CC in Azure
Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
* remove (obsolete) test-net chaincode/ folder
Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
* Address some PR review feedback points - README reorg
Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
* Use the SDKs contract router Main, not a local entrypoint
Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
* bump the build - remove trailing newlines from a README
Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
The Hyperledger provided Fabric peer images are only a sample so it would be good to make the k8s test network peer image configurable, for example to include a custom builder
Signed-off-by: James Taylor <jamest@uk.ibm.com>
This patch includes some minor improvements, such as:
- Fix typos and broken links
- Correct chaincode type of asset-transfer-basic-debug
(seems it should be ccaas)
Signed-off-by: Tatsuya Sato <tatsuya.sato.so@hitachi.com>
This patch supports for pulling all images to the local docker cache
and loading to KIND.
Also, this adds the missing docker image pulling (couchdb) for Fabric.
Signed-off-by: Tatsuya Sato <tatsuya.sato.so@hitachi.com>
After feedback from the community, this PR adds CORS support in, but as an option
to enable.
Along with warnings that the default wildcard origin might not be applicable
in a production use case
Signed-off-by: Matthew B White <whitemat@uk.ibm.com>
* Access the test network services via a local Nginx ingress controller.
Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
* Run E2E / CI test suite against the Ingress based k8s test network
Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
* Improved wait for Nginx Ingress - this was causing some test flakes
Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
1. The default chaincode use Capitalized JSON Names, whereas for new asset the REST validation didn't.. Adjusted
so it matches the chaincode
Signed-off-by: Matthew B White <whitemat@uk.ibm.com>
This PR fixes the followings to run the tutorial.
- Add an instruction to set PATH to call the `peer` command.
- Correct an option for `deployCCAAS` to debug Chaincode.
Signed-off-by: Yuki Kondo <yuki.kondo.ob@hitachi.com>
-Go chaincode - Paginated range query should return the bookmark so that next page can be requested
-Javascript chaincode - Make query return JSON consistent with Go chaincode
-Javascript app was broken at bookmark query due to invalid JSON parsing from inconsistent chaincode responses
-Javascript and Java app had incorrect comments
Signed-off-by: David Enyeart <enyeart@us.ibm.com>
Podman isn't as lenient as docker when it comes to the syntax of the
Dockerfile and insists on getting the ARG command properly scoped.
This fixes this error:
...
[2/2] STEP 12/15: EXPOSE $CC_SERVER_PORT
Error: error building at STEP "EXPOSE $CC_SERVER_PORT": EXPOSE requires at least one argument
Signed-off-by: Arnaud J Le Hors <lehors@us.ibm.com>
This addresses Issue #504. This extends the test-network-nano-bash
sample to offer an option to run a fabric network without using any
containers at all. The chaincode is running as an external service
directly on the host machine.
Signed-off-by: Arnaud J Le Hors <lehors@us.ibm.com>
Instead of using the Fabric and Fabric CA three digit version (2.4.3),
utilize the two digit version (2.4).
Each time a Fabric/FabricCA release is pushed to dockerhub the two digit version tag is updated.
This approach simplifies maintenance so that scripts don't have to be updated for every
third digit release.
Signed-off-by: David Enyeart <enyeart@us.ibm.com>
erc-721 Go chaincode was delivered to both /go and /chaincode-go directories.
This commit removes the /go implementation.
Signed-off-by: David Enyeart <enyeart@us.ibm.com>
* impl for couchdb supports in test0network8s as hardcode
Signed-off-by: Sam Yuan <yy19902439@126.com>
* fix up according to pr review comments
Signed-off-by: Sam Yuan <yy19902439@126.com>
* check if running
Signed-off-by: Kieran O Mahony <Kieran.O.Mahony1@ibm.com>
* fix indent
Signed-off-by: Kieran O Mahony <Kieran.O.Mahony1@ibm.com>
better detection in create channel
Signed-off-by: Kieran O Mahony <Kieran.O.Mahony1@ibm.com>
bring network down first case
Signed-off-by: Kieran O Mahony <Kieran.O.Mahony1@ibm.com>
bring network down first case
changed count of containers to 4
Signed-off-by: Kieran O Mahony <Kieran.O.Mahony1@ibm.com>
add echo
Signed-off-by: Kieran O Mahony <Kieran.O.Mahony1@ibm.com>
typo
Signed-off-by: Kieran O Mahony <Kieran.O.Mahony1@ibm.com>
Co-authored-by: Kieran O Mahony <Kieran.O.Mahony1@ibm.com>
Also:
- Refactor application-gateway-java slightly to reflect more idiomatic Java class structure, in line with asset-transfer-events sample.
- Correctly handle unexpected error case where key file is missing.
- Update Gradle wrapper for application-gateway-java.
Signed-off-by: Mark S. Lewis <mark_lewis@uk.ibm.com>
Co-authored-by: deeptiraom <41100100+deeptiraom@users.noreply.github.com>
Signed-off-by: Mark S. Lewis <mark_lewis@uk.ibm.com>
Co-authored-by: deeptiraom <41100100+deeptiraom@users.noreply.github.com>
* Experimental Support for using podman with the test-network
Signed-off-by: Matthew B White <whitemat@uk.ibm.com>
* supplement podman with nerdctl
Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
* adds experimental support for nerdctl compose
Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
* install fabric images to containerd with 'nerdctl' pull
Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
* Podman Support
Use a core set of compose files, with overlays for specific details.
In the case of podman, the overlays refer to a specific core.yaml for the peer that distables the use of teh
docker daemon
In the case of docker, the overlays add enable the docker daemon accesss for the peer to create chaincode
containers
Signed-off-by: Matthew B White <whitemat@uk.ibm.com>
Co-authored-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
The network.sh is dependent onbeing executed from the test-network directory
This PR makes it a little more tolerant, and will add a bin directgory based on the location
of the script - not just the PWD
Signed-off-by: Matthew B White <whitemat@uk.ibm.com>
Changed:
- Console output formatting
- Transaction arguments
- Readability and comments of code
- Linting rules
- Missing semicolons
- Package name and descrption
Signed-off-by: Mark S. Lewis <mark_lewis@uk.ibm.com>
* Gateway Migration for events application
Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>
* Documentation Error Fix
Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>
* Updated ci pipelines to include the app
Readme update
Wait for events to complete
Refactor code for events replay
Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>
* updating readme with all samples
Signed-off-by: Kieran O Mahony <Kieran.O.Mahony1@ibm.com>
* add eol
Signed-off-by: Kieran O Mahony <Kieran.O.Mahony1@ibm.com>
Co-authored-by: Kieran O Mahony <Kieran.O.Mahony1@ibm.com>
- removed unused overrides
- addressed issue using $__interval which doesn't work as well as
$interval
- addressed issue where multiple channels may not give correct output
Signed-off-by: D <d_kelsey@uk.ibm.com>
Co-authored-by: D <d_kelsey@uk.ibm.com>
Although test network scripts functionally worked, they demonstrated
some strange patterns around use of the ca cert.
This change makes it clear that the ca cert is configured and used
at the org level, and not related to any individual peer or orderer node.
Also that when connecting to individual servers, clients can pass the
org level CA cert as the root of trust when establishing TLS connections.
Signed-off-by: David Enyeart <enyeart@us.ibm.com>
Also fix the version of prometheus and grafana being used
to ensure the queries remain compatible as well as avoid
issues whether they may not work if latest images already
exist on machine but are not at a level that will work
Signed-off-by: D <d_kelsey@uk.ibm.com>
Co-authored-by: D <d_kelsey@uk.ibm.com>
This fixes several typos and more importantly add an instruction to
set FABRIC_CFG_PATH without which the peer command fails.
Signed-off-by: Arnaud J Le Hors <lehors@us.ibm.com>
Fenced code blocks within a list were at the wrong level if indentation and so logically terminated the list.
Signed-off-by: Mark S. Lewis <mark_lewis@uk.ibm.com>
Split boiler-plate connection code into a separate file since the basic sample already covers this aspect. The `app.go` file now only presents the main application code, making it much easier for readers to view.
Also changed the event replay code to use a different style of reading from the real-time eventing example, demonstrating the use of timeouts while reading events we expect to arrive quickly, and avoiding any possibility of the main application execution hanging indefinitely.
Signed-off-by: Mark S. Lewis <mark_lewis@uk.ibm.com>
* Added for client java application using gateway api in java sdk
Signed-off-by: deeptiraom <41100100+deeptiraom@users.noreply.github.com>
* removed eclipse plugin for gradle
Signed-off-by: deeptiraom <41100100+deeptiraom@users.noreply.github.com>
JCenter is deprecated, can no longer be published to, and is scheduled for removal. It is now causing build failures. Replace with Maven Central.
Also remove mavenLocal() as this is not recommended practice:
- https://docs.gradle.org/current/userguide/declaring_repositories.html#sec:case-for-maven-local
Note that Jitpack still needs to be included as a package repository for Java chaincode since it has dependencies on an old version of com.github.everit-org.json-schema:org.everit.json.schema that is only published there.
Signed-off-by: Mark S. Lewis <mark_lewis@uk.ibm.com>
Signed-off-by: fraVlaca <ocsenarf@outlook.com>
added promethesus-grafana server to test-network
Signed-off-by: fraVlaca <ocsenarf@outlook.com>
changed image for cadvisor to version that works on Linux
Signed-off-by: fraVlaca <ocsenarf@outlook.com>
improved documentation on README and tweaked docker-compose file
Signed-off-by: fraVlaca <ocsenarf@outlook.com>
updated and fixed documentation for the prometheus/grafana sample for the test-network
Signed-off-by: fraVlaca <ocsenarf@outlook.com>
final modification to grafana dashboard and prom/graf docs
Signed-off-by: fraVlaca <ocsenarf@outlook.com>
Move signposts to sample source files from index.ts to the readme and reinforce the key aspects of the sample
Signed-off-by: James Taylor <jamest@uk.ibm.com>
* Changes to the test-network k8s deployment to use the
built-in as-a-service chaincode builder from the Peer Container
Signed-off-by: Matthew B White <whitemat@uk.ibm.com>
* Remove the ccaas init container from org2 peer; tweak docs on ccaas config
Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
Co-authored-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
- Updated the test-network with examples of runnig CCAAS
- Updating the asset transfer basic with how to run chaincode as a service.
Signed-off-by: Matthew B White <whitemat@uk.ibm.com>
Match the versions required in asset-transfer-basic/application-typescript
Also update to latest version of fabric-network
Signed-off-by: James Taylor <jamest@uk.ibm.com>
“The app.locals object has properties that are local variables within the application.”
…which looks like a better option than app.get and app.set for app settings.
Also passes app to the initJobQueueWorker function for consistency.
Signed-off-by: James Taylor <jamest@uk.ibm.com>
Previously transactions were only retried after being successfully endorsed, and always with the same transaction ID
Transactions will now be added to a queue for processing and will also be retried if endorsement fails (with a different transaction id for invalid transactions)
Signed-off-by: James Taylor <jamest@uk.ibm.com>
- default command should be start, rather than start:dev in the docker image
- added a multistage build
- fixed node-gyp error
- removed dev dependencies
- added a start:dotenv script to support a .env file in production (may be useful for
k8s later)
- updated Readme and generateEnv script to simplify the setup
- updated external network in docker-compose.yaml to match the test network
Signed-off-by: James Taylor <jamest@uk.ibm.com>
Use more common X-Api-Key header with no prefix
Also updates Unauthorized response to include a json error body
and simplifies working with new API key via curl and the vscode
rest client
Signed-off-by: James Taylor <jamest@uk.ibm.com>
Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>
removed auth check from live,ready apis..
code format
http file changes for apikey
comments for getting api key
readme update for apikey usage
replaced -H with --header
apikey config made mandatory
fix linting
Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>
used fabric protos insted of blockdecoder
changed import statement
Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>
revert back eslintrc
Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>
function name change
Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>
format changes
Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>
Also install goimports globally to run the linting check rather than installing to each gomodule, which was causing dependency conflicts.
Signed-off-by: Mark S. Lewis <mark_lewis@uk.ibm.com>
Fix CORE_PEER_ID for peer4.
This fix ensures that peer3 and peer4 don't share the
same chaincode container.
Signed-off-by: David Enyeart <enyeart@us.ibm.com>
* Address Issue #511 with docs and better error handling
Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
* Set the TEST_NETWORK_FABRIC_VERSION in documentation for local development.
Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
- Add a new label to each peer to mark which org it is in
- Create new service per org, that matches this label - so the service can pick from one of multiple pods
- Update the kubeproxy to give more choice of ha stratergies
- Update the application configmaps and samples to refer to this new service rather than specific peers
Signed-off-by: Matthew B White <whitemat@uk.ibm.com>
Josh has been helping to update samples for the Kubernetes age.
He has contributed the test-network-k8s sample and has been active in
managing fabric-samples issues. Let's welcome Josh
as a fabric-samples maintainer!
Signed-off-by: David Enyeart <enyeart@us.ibm.com>
The latest version (2.1.2) of sort-keys-recursive adds TypeScript
typing, which includes export default function.
This change has caused the TS2349 type error.
This patch modifies the import form in assetTransfer.ts to fix the error.
Signed-off-by: Tatsuya Sato <tatsuya.sato.so@hitachi.com>
- updated the logging for the application command; wasn't very good
- added some information to the help option. the current settings
useful if you're not sure what you've set
Signed-off-by: Matthew B White <whitemat@uk.ibm.com>
"Farewell! thou art too dear for my possessing,
And like enough thou knowst thy estimate.
The Charter of thy worth gives thee releasing;
My bonds in thee are all determinate.
For how do I hold thee but by thy granting,
And for that riches where is my deserving?
The cause of this fair gift in me is wanting,
And so my patent back again is swerving.
Thy self thou gav'st, thy own worth then not knowing,
Or me, to whom thou gav'st it, else mistaking,
So thy great gift, upon misprision growing,
Comes home again, on better judgement making.
Thus have I had thee as a dream doth flatter:
In sleep a king, but waking no such matter."
- bill
Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
* Run the fabric test network on Kubernetes
Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
* Re-LINT
Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
CHAINCODEADDRESS is set to host.docker.internal which is
only available in MAC and Windows environments.
For that reason, it cannot launch chaincode on Linux.
This PR sets CHAINCODEADDRESS to 127.0.0.1 instead of
host.docker.internal.
Signed-off-by: Nao Nishijima <nao.nishijima.xt@hitachi.com>
The functions BatchTransferFrom and BatchTransferFromMultiRecipient in ERC1155 sometimes give the error `ProposalResponsePayloads do not match`. This happens because iterating maps in Go is not deterministic. As a solution, I copied the keys of the map and sorted them and iterated over the sorted keys.
Signed-off-by: Baran Kılıç <baran.kilic@boun.edu.tr>
* This is the initial add of a test-network-kind
Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
* Update the test-network-kind README; removes the local docker registry; updated 'clean' instructions
Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
Co-authored-by: Matthew B White <mbwhite@users.noreply.github.com>
Helper script to set environment variables, so make it eaiser to use the peer command
from the shell command line
Signed-off-by: Matthew B White <whitemat@uk.ibm.com>
* updated chaincodes for asset-trnsfer-basic in order to show good example on how achieving determinism in json
Signed-off-by: fraVlaca <ocsenarf@outlook.com>
* final fixes for chaincode-java of asset-tranfer-basic
Signed-off-by: fraVlaca <ocsenarf@outlook.com>
* removed extra unused excheptions
Signed-off-by: fraVlaca <ocsenarf@outlook.com>
* corrected indentation of contract in the chancode-javasript of asset-trnsfer-basic
Signed-off-by: fraVlaca <ocsenarf@outlook.com>
* last fixes for chaincode-javascript of asset-transfer-basic
Signed-off-by: fraVlaca <ocsenarf@outlook.com>
* last last fixes for chaincode-javascript of asset-transfer-basic
Signed-off-by: fraVlaca <ocsenarf@outlook.com>
If ORDERER_KAFKA_VERBOSE is true, the output of /logspec will contain
the following kafka information even if it is raft orderer.
{"spec":"orderer.consensus.kafka.sarama=debug:info"}
This PR deletes environment valiable for kafka in docker-compose.
Signed-off-by: Nao Nishijima <nao.nishijima.xt@hitachi.com>
* fixed json dependencies for java
Signed-off-by: fraVlaca <ocsenarf@outlook.com>
* updated dependency for asset-tranfer-sbe: now declaing also org.hyperledger.fabric.protos.common
Signed-off-by: fraVlaca <ocsenarf@outlook.com>
* "corrected typo of last commit and added testImplementation 'org.hyperledger.fabric.protos.common'"
Signed-off-by: fraVlaca <ocsenarf@outlook.com>
* included correct dependecy for fabric-protos and added com.google.protobuf as well
Signed-off-by: fraVlaca <ocsenarf@outlook.com>
It's been some time since I've had the cycles available to review
anything here, so removing myself.
Signed-off-by: Jason Yellick <jason-github@unaddressable.org>
Test network Nano bash provides a set of minimal bash scripts
to run a Fabric network on your local machine.
The network is functionally equivalent to the docker-based Test Network,
you can therefore run all the tutorials and samples that target the Test Network.
The Fabric release binaries are utilized rather than using docker containers
to avoid all unnecessary layers. Only the chaincode and chaincode builder
runs in a docker container behind the scenes.
Using the Fabric binaries also makes it simple for Fabric developers
to iteratively and quickly modify Fabric code and test a Fabric network as a user.
Signed-off-by: David Enyeart <enyeart@us.ibm.com>
* change docker-compose version from 2 to 2.4 on folder addOrg3/docker
Signed-off-by: Saliou <boomse@hotmail.fr>
* changing all docker-compose version from 2 to 2.4 under addOrg3/docker
Signed-off-by: Saliou <boomse@hotmail.fr>
Co-authored-by: Saliou <admin@example.com>
Docker version 20.10 support rootless mode. That features
changes a mount path of docker.sock.
This PR loads a mount path from DOCKER_HOST environment,
and if not set, a mount path will be /var/run/docker.sock
FAB-18481
Signed-off-by: Nao Nishijima <nao.nishijima.xt@hitachi.com>
The Golang and Java sample chaincode returned an error when trying to create an asset which already exists
JavaScript and TypeScript samples should now do the same
Signed-off-by: James Taylor <jamest@uk.ibm.com>
The off_chain_data sample fails to put data to the off-chain
database. The application does not read fetched blocks because
it uses the old interface of `addBlockListener()` to handle
block events.
This PR fixes the application to use the latest block listener
and build the off-chain database.
Signed-off-by: Yuki Kondo <yuki.kondo.ob@hitachi.com>
- 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>
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>
* 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>
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>
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>
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>
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>
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>
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>
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>
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>
* 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>
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>
* 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>
* 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>
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>
The chaincode packaging function wrongly implies that the packaging
operation is performed on a peer when it is in fact done locally.
This change fixes that.
Signed-off-by: Arnaud J Le Hors <lehors@us.ibm.com>
go chaincode now sets the Asset owner as client identity certificate string (instead of base64 str)
Reason for the update: "GetClientIdentity().GetID()" api in go chaincode returns base64 string, while same api in java chaincode returns the same data as string
go & java chaincode sets same owner string
updated js app verify method
Signed-off-by: Sijo Cherian <sijo@ibm.com>
Java chaincode that can be deployed via test-network, with shortname 'private'
Unit test for core transactions
Bugfix for QueryAsset txn function signature
Incorporated PR feedback
Signed-off-by: Sijo Cherian <sijo@ibm.com>
* commercial paper enhancements
Signed-off-by: Paul O'M <mahoney@uk.ibm.com>
* commercial paper enhancements
Signed-off-by: Paul O'M <mahoney@uk.ibm.com>
* commercial paper enhancements
Signed-off-by: Paul O'M <mahoney@uk.ibm.com>
* Add further README changes from #335
Signed-off-by: Paul O'M <mahoney@uk.ibm.com>
* Add further README changes from #335
Signed-off-by: Paul O'M <mahoney@uk.ibm.com>
* Add further README changes from #335
Signed-off-by: Paul O'M <mahoney@uk.ibm.com>
Update ERC-20 readme to indicate the new contract name
and add TransferFrom tutorial for Go chaincode.
Signed-off-by: David Enyeart <enyeart@us.ibm.com>
This PR changes the auction sample to a simple blind auction with just a
single item to be sold to the highest bidder.
Signed-off-by: Arnaud J Le Hors <lehors@us.ibm.com>
Added check to avoid double spent in token-utxo chaincode
In the transfer function it was possible to pass the same utxo more than once in the array of input utxos without any error. Making it possible to spend the same utxo more than once in the same transaction and like this create more tokens than minted. To fix this I changed the array that was used to store the input utxo states to a map and so utxos were stored in the map by there key, which made it possible to know if a key and so a utxo had already been used.
I tested this by setting up the test-network, deploying the token-utxo chaincode with my fix, minting a utxo and trying to spent this utxo more than once in the same transaction, which was not possible anymore. It can only be spent one time anymore with this fix.
Add new chaincode and javascript application to demostrate
the use of chaincode events and block events with private data.
Signed-off-by: Bret Harrison <beharrison@nc.rr.com>
This PR adds ERC20 capabilities to the token-account-based sample.
It includes javascript Chaincode and the updated README to explain
how to use tokens in the Fabric test-network.
Signed-off-by: Yuki Kondo <yuki.kondo.ob@hitachi.com>
The current scripts given to setup the user environment do not work
on Mac:
$ . ./magnetocorp.sh
-bash: cd: /Users/lehors/Projects/Go/src/github.com/hyperledger/fabric-samples/commercial-paper/organization/magnetocorp
Saving session...
...copying shared history...
...saving history...truncating history files...
...completed./../../../test-network: No such file or directory
-bash: ./scripts/envVar.sh: No such file or directory
[...truncated...]
export FABRIC_CFG_PATH="/Users/lehors/Projects/Go/src/github.com/hyperledger/fabric-samples/commercial-paper/organization/magnetocorp"
export PATH="/Users/lehors/Projects/Go/src/github.com/hyperledger/fabric-samples/commercial-paper/organization/magnetocorp"
export PEER_PARMS=""
Saving session...
Saving session...
The session history related output is actually captured when setting the environment variables:
$ echo $FABRIC_CFG_PATH
/Users/lehors/Projects/Go/src/github.com/hyperledger/fabric-samples/commercial-paper/organization/magnetocorp
Saving session...
...copying shared history...
...saving history...truncating history files...
...completed./../../../config
With this simple change the scripts work:
$ echo $FABRIC_CFG_PATH
/Users/lehors/Projects/Go/src/github.com/hyperledger/fabric-samples/commercial-paper/organization/magnetocorp/../../../config
Signed-off-by: Arnaud J Le Hors <lehors@us.ibm.com>
The user's PATH must be set on the first use of Terminal 2 for the
call to the fabric-ca-client command to succeed. The current README
only sets it later. This fix changes that.
Signed-off-by: Arnaud J Le Hors <lehors@us.ibm.com>
The user's PATH must be set on the first use of Terminal 2 for the
call to the fabric-ca-client command to succeed. The current README
only sets it later. This fix changes that.
Signed-off-by: Arnaud J Le Hors <lehors@us.ibm.com>
Signed-off-by: Chris Gabriel <chris_gabriel_98@yahoo.com>
udpate artifact removal to include all .tar.gz
Signed-off-by: Chris Gabriel <chris_gabriel_98@yahoo.com>
Re-enable CI tests for asset-transfer-private-data JavaScript application.
Also re-add the error when private asset details are not found in the collection,
so that the CLI instructions work as desired, and to demonstrate error
handing in the client application.
Signed-off-by: David Enyeart <enyeart@us.ibm.com>
This change makes the way the type property is extracted from the
metadata.json file much more robust, and therefore sets a better
example.
Signed-off-by: Arnaud J Le Hors <lehors@us.ibm.com>
Adds the apps and chaincodes to linting and testing
CI that weren't added before.
Linting issues were corrected where necessary to make CI pass.
The Basic-Go application and Private-Javascript application
are currently disabled pending fixes currently being worked on.
Signed-off-by: Brett Logan <brett.t.logan@ibm.com>
Improve on the initial PR to expand on the README with detailed
information on how to run the external chaincode in a container
on the test network and use the node application against it.
Signed-off-by: Arnaud J Le Hors <lehors@us.ibm.com>
Add the asset-transfer-ledger-queries javascript application.
Update the CI script to run it against go and javascript chaincode.
Signed-off-by: Bret Harrison <beharrison@nc.rr.com>
The InitLedger was not writing the composite key for the color index.
Therefore TransferAssetByColor was not working.
Now InitLedger will call CreateAsset which creates both the asset
and the color index entry.
Signed-off-by: David Enyeart <enyeart@us.ibm.com>
This script fails if chaincode version is higher than 9 as 'grep' does not match ex. version equal to '10'
Signed-off-by: Titas <titas.petravicius@gmail.com>
Signed-off-by: lehors <lehors@us.ibm.com>
Co-authored-by: Arnaud J Le Hors <lehors@us.ibm.com>
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>
We delete folders and files locally on the host system
today. If the user is not a super user the files can't
be deleted as they are created by a root user in the
containers. This change uses busybox to perform the
deletions instead so a root user can remove them.
Signed-off-by: Brett Logan <brett.t.logan@ibm.com>
Pushes the scripting logic into a standalone script
and adds tests for the applications which by side-effect
also test the invoke and query functions on the chaincode.
Signed-off-by: Brett Logan <brett.t.logan@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>
Signed-off-by: Chris Gabriel <chris_gabriel_98@yahoo.com>
Remove images from fabric-samples and move to docs.
Signed-off-by: Chris Gabriel <chris_gabriel_98@yahoo.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>
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>
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>
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>
Update application and chaincode dependendencies to use v2.0 or
later versions in package.json, build.gradle, pom.xml files.
Signed-off-by: David Enyeart <enyeart@us.ibm.com>
* Use numbers without leading zeroes for key
Signed-off-by: Stefan Obermeier <scray@stefan-obermeier.de>
* Update chaincode to be compatible with doc.
E.g. Return key of the queried record
Signed-off-by: Stefan Obermeier <scray@stefan-obermeier.de>
* Clean up
Use always whitespaces to indent the start of the line
Remove unnecessary whitespaces
Signed-off-by: Stefan Obermeier <scray@stefan-obermeier.de>
This change organizes the `ci` directory into common-sense
subfolders and standardizes pipelines naming schemes.
Also removes the dead Jenkins code in the `./scripts` directory
Signed-off-by: Brett Logan <brett.t.logan@ibm.com>
The current scripts download the fabric binaries and place them
in `/usr/local`. Modifying the host system in CI is generally
bad practice. The `bootstrap.sh` script also downloads the
binaries into the root of the `fabric-samples` repo. It is
good practice for us to do the same in CI. We also have
several samples that make an assumption about the location
of these scripts. In the future we should re-evaluate these
examples.
Signed-off-by: Brett Logan <brett.t.logan@ibm.com>
initLedger must be called instead of init, that does not exist.
That also keeps consistency between the "with TLS" and "withtout" TLS cases.
Signed-off-by: Jonathan Gross <woodyjon@gmail.com>
echo Generating channel configuration transaction 'channel.tx'
it will be output to the console "configtxgen -profile TwoOrgsChannel -outputCreateChannelTx ./channel-artifacts/channel.tx -channelID mychannel"
Signed-off-by: KIM GEONWOO <kgw8919@gmail.com>
Add sample which can be used with the builder scripts described in
the "Chaincode as an external service" documentation
Signed-off-by: James Taylor <jamest@uk.ibm.com>
Description
The use of Orderer.Addresses in configtx.yaml is deprecated, and Organizations.<Org>.OrdererEndpoints should be used instead. Therefore, update all the fabric-samples configtx.yaml files.
Related issues
https://jira.hyperledger.org/browse/FAB-17504
Signed-off-by: xu wu <wuxu1103@163.com>
The CA's are not part of the `test` docker network. So
applications written and hosted on the `test` network
cannot interact with the CA
Signed-off-by: Brett Logan <brett.t.logan@ibm.com>
This reverts commit 9ef61e2d72.
Introduced regressions when running without explicitly specifying
a chaincode label
Signed-off-by: Brett Logan <brett.t.logan@ibm.com>
Have the application read the common connection profile to
build a JSON object used for the gateway connect and for
a fabric-ca client instance.
Signed-off-by: Bret Harrison <beharrison@nc.rr.com>
Change 2.0.0-beta to 2.0.0 when CommercialPaper uses the test network
Add test network to the azure pipelines
Correct test network envvar script
Signed-off-by: Matthew B White <whitemat@uk.ibm.com>
* WIP Commercial Paper -> Test network
Signed-off-by: Matthew B White <whitemat@uk.ibm.com>
* Update Commercial Paper to v2.0 lifecycle
- move to using the test-network
- updating README.md to include commands to use v2.0 lifecylce
- update Contracts and Applications to use 2.0 libraries
Signed-off-by: Matthew B White <whitemat@uk.ibm.com>
This patch fixes some wrong artifact names for fabric-ca in
`fabric-samples/test-network/network.sh`.
Artifacts names which include `issuerPublicKey` and `issuerRevocationPublicKey`
should start with capital letters.
Due to the wrong names, some files remain even after running the command to
bring down networks using fabric-ca.
Signed-off-by: Tatsuya Sato <Tatsuya.Sato@hal.hitachi.com>
Update the applications and scripts to use the new v2
SDKs and the new lifecycle
Add in a basic script based on the readme.md that does
a basic run of the scenario
Signed-off-by: Matthew B White <whitemat@uk.ibm.com>
It includes two config changes in fabric recently:
* GenesisMethod --> BootstrapMethod
* GenesisFile --> BootstrapFile
Signed-off-by: Baohua Yang <yangbaohua@gmail.com>
Signed-off-by: Baohua Yang <baohua.yang@oracle.com>
Remove leftover call to removed ReplacePrivateKey function which
makes calling ./byfn.sh up fail if cryptogen hasn't been run first.
Signed-off-by: Arnaud J Le Hors <lehors@us.ibm.com>
- Update .gitignore
- Use builds on Sonatype, not Nexus
- Enable new discovery as localhost flag
Signed-off-by: Simon Stone <sstone1@uk.ibm.com>
Change-Id: Ia0904cedf953b5ecbf6aaf859245a9bb431d3f76
Also add .gitignore files for abstore/marbles02, as these are
currently missing.
Signed-off-by: Simon Stone <sstone1@uk.ibm.com>
Change-Id: I9f9da3e5289a275dd26c1021ea8de80def605e36
Using V2_0_0 capabilities will turn on identification of admins
via node OU, and will fix the failing sample since cryptogen
is now setup to generate admins via node OU.
Change-Id: I30ff651a112bd88c93f6563f5e4414f8d2c6693e
Signed-off-by: David Enyeart <enyeart@us.ibm.com>
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
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
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
A Solo ordering node offers no benefits over
a single node Raft ordering node. Raft is the
best practice for Fabric v2.0, and should be
the only option in the BYFN sample going
forwards.
This CR removes Solo and the consensus related
options from BYFN, and always uses Raft.
Signed-off-by: Simon Stone <sstone1@uk.ibm.com>
Change-Id: I686cb68d8bc8fc9a231a0fa680263175451f2820
All samples that deploy Go chaincode must now vendor
their dependencies before deployment, due to changes
in FAB-5177 which stop the shim being available at
deployment time. This CR adds the command:
"GO111MODULE=on go mod vendor"
... to all scripts/readmes as appropriate.
Signed-off-by: Simon Stone <sstone1@uk.ibm.com>
Change-Id: If0a2cc3a20dc943917d8325a8905427a79eb2400
Update the blacklisted versions in BYFN so that
BYFN from Fabric v2.0 samples refuses to work
with binaries and Docker images from Fabric v1.x.
Signed-off-by: Simon Stone <sstone1@uk.ibm.com>
Change-Id: I7fceb7f2b7635830ada35e2e47988d84b9ee14c3
The docker-compose-e2e-template.yaml file and generated
docker-compose-e2e.yaml file should not be used any more,
and should be removed. The associated Docker Compose
file argument (-f docker-compose-e2e.yaml) should also
be removed.
Users wishing to deploy BYFN with a CA should use the new
-a option, and we should probably just make that the default
anyway.
There are associated documentation changes required for
this which I will do in another CR.
Signed-off-by: Simon Stone <sstone1@uk.ibm.com>
Change-Id: Ie7fc0b809b44cbb2a7d55865ce8f3e887e0e7c58
Update the Raft ordering nodes to use the same ports
inside the Docker network as they are mapped to outside
of the Docker network (7050, 8050, 9050, 10050, 11050).
This enables applications to work using service
discovery, whether those applications are running inside
or outside the Docker network.
Signed-off-by: Simon Stone <sstone1@uk.ibm.com>
Change-Id: I40b24653d76b6e60c73b754cd7e1544c333e0021
Add a channel event handler sample to master and
update for lifecyce.
Change-Id: I5420ddc7070dbee785218ce5960f7604ac799f90
Signed-off-by: Chris Elder <chris.elder@us.ibm.com>
(cherry picked from commit 1efd213110)
Remove Kafka as a consensus mechanism option
in BYFN, including all related configuration.
Users wishing to configure Kafka (not best
practice) in Fabric v2.0 can consult the
Fabric v1.4 and earlier samples.
Signed-off-by: Simon Stone <sstone1@uk.ibm.com>
Change-Id: I3bbffc876a6b64831cb6b2bdfac28a88cc013bdf
Update with Java Contract
Change-Id: Iced5568a248c1474ae4b6fb0352d23e49ebfc252
Signed-off-by: Matthew B. White <whitemat@uk.ibm.com>
Signed-off-by: James Taylor <jamest@uk.ibm.com>
The FabToken sample needs to be removed, as the FabToken code
itself is being removed/disabled by Angelo De Caro due to it
not being included in Fabric v2.0. Additionally, the FabToken
sample is subject to sporadic CI failures, which we are trying
to clean up.
Signed-off-by: Simon Stone <sstone1@uk.ibm.com>
Change-Id: Id434d384493f030d2407ca2f9d8687b0681a3723
FAB-15782 added go.mod files for versioned dependencies,
but "go mod vendor" is never run before deploying the
FabCar Go contract either by the user or in CI.
Signed-off-by: Simon Stone <sstone1@uk.ibm.com>
Change-Id: I958d426ca72938a2051bf95d6ecc4c6e3cd1d7b2
Connection profiles are now generated during BYFN
execution, and should not be tracked via Git. Also,
the remaining connection profiles for Org3 need to
be removed as they are no longer used/valid.
Signed-off-by: Simon Stone <sstone1@uk.ibm.com>
Change-Id: Ifb76e2a183643a26e95781b455f8c42fc2935928
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
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
Implementation of Fabcar client for Java Gateway SDK
Changes to first-network to generate the CCP files with
embedded PEM certificates rather than paths to files on disk
Change-Id: Iff15425e96ce28c6f96079cee474c35868fab554
Signed-off-by: andrew-coleman <andrew_coleman@uk.ibm.com>
FGJ-4 split java fabcar into separate classes
Incorporate review comments from previous CR
Split enroll/register/transactions into separate classes
Change-Id: I384cec59c7f53a37864bfc28be11e785a61421f3
Signed-off-by: andrew-coleman <andrew_coleman@uk.ibm.com>
FGJ-4 add license header to fabcar java sample
Change-Id: Ic658fe3bdece9875ca3ceaf28d94c5fb48879083
Signed-off-by: andrew-coleman <andrew_coleman@uk.ibm.com>
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>
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
Collect logs from all existing Docker containers instead
of just limiting it to a predefined (and incorrect) set.
Also clean up the directory structure for the logs, and
remove any networks/volumes after each test run.
Signed-off-by: Simon Stone <sstone1@uk.ibm.com>
Change-Id: Ifcf88baeb9ba4d42f757f7cd23ab2a178ab39b41
Remove versions from fabric-samples readme so that
it doesn't need to be maintained for each release.
Also clarify the bootstrap.sh download instructions.
Change-Id: I4ef80e048b0d8f27429059635e57e08a8c70c0fa
Signed-off-by: David Enyeart <enyeart@us.ibm.com>
Better for loop expression and veriable scope for golang
Signed-off-by: kukgini <kukgini@gmail.com>
Change-Id: I83a4ead246039b5b10334467f17c808465492725
This patch fixes the instructions for dev-mode.
For the commands to start the chaincode to work properly,
this patch modifies the commands.
- Use peer.address flag (instead of the unused env var after FAB-14770)
- Add CORE_PEER_TLS_ENABLED=false (dev-mode is for non-TLS mode only)
FAB-15716 #done
Signed-off-by: Tatsuya Sato <Tatsuya.Sato@hal.hitachi.com>
Change-Id: I160d22389bb611c5b96ee880497266f06d25abd7
Update samples now that QueryApprovalStatus has been renamed
to SimulateCommitChaincodeDefinition.
FAB-15831 #done
Change-Id: I4e12ca2c8424bf8d6537e77e1a9de7fd3723636d
Signed-off-by: Will Lahti <wtlahti@us.ibm.com>
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>
This patch fixes the script and instruction with the ccenv container.
Running chaincode dev-mode fails because bash was removed from the
ccenv by FAB-15670.
This patch changes the command from /bin/bash to /bin/sh.
FAB-15723 #done
Change-Id: Ibf31ce9170e606988302bf46d8dac98b62e2043e
Signed-off-by: Tatsuya Sato <Tatsuya.Sato@hal.hitachi.com>
Removed scripts/bootstrap.sh file and updated the README.md
with steps to download bootstrap.sh from Fabric repository.
Signed-off-by: Yukihiko <hirayanagi@jp.fujitsu.com>
Change-Id: I50357c702c8b357fedaf8ccd1ec97ef6c4429371
CI Fabcar javascript test fails because a query proposal is
sent to a peer which does not have Chaincode. The query handler
in fabric-network does not consider if Chaincode is installed on
target peers.
As a workaround, this CR adds steps installing Chaincode
on all peers during the setup.
Change-Id: Iaff0c5bde8c54cef12a176b55e13d70173ee8108
Signed-off-by: Yuki Kondo <yuki.kondo@hal.hitachi.com>
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: I0faef40d4cfddc689e6d7184491fd3759a3558a1
This patch fixes typo in docs/fabric-samples-ci.md
Change-Id: I814efb14d47e3509e3f785504b8d6d2ef26399a0
Signed-off-by: Tatsuya Sato <Tatsuya.Sato@hal.hitachi.com>
CR31665 increased MAX_RETRY to 15 which allowed the fabcar go test
to succeed but the fabcar javascript test still fails. This sets
it to 20 in hope this will be enough.
Change-Id: I51a0e24893634d773b12341f5b87d49d2bbf7cb6
Signed-off-by: Arnaud J Le Hors <lehors@us.ibm.com>
This CR removes the unused variable 'OS_ARCH' from byfn.sh,
eyfn.sh and interest swap in fabric-samples.
FAB-9329 #done
Change-Id: I0d1b87679d66bec1d9e4aaee9e770305f9c8f4b9
Signed-off-by: Yuki Kondo <yuki.kondo@hal.hitachi.com>
BYFN and Fabcar with couchdb are failing intermittently
because CLI sends a request for joining a Channel before
a Peer connects to the couchdb.
This CR changes the value of MAX_RETRY from 10 to 15
as a workaround.
FAB-15601 #done
Change-Id: I8d91fa224c585cc52c9dfabebb808b8909253900
Signed-off-by: Yuki Kondo <yuki.kondo@hal.hitachi.com>
Update high throughput sample scripts for
chaincode lifecycle
Change-Id: I8e7f9d98bb62d75a779e2767b0e165a36a700d43
Signed-off-by: NIKHIL E GUPTA <negupta@us.ibm.com>
Update FabCar to use BYFN. As a result, the sample
client applications need to change so that they use
the correct connection profile paths, and so that
they use service discovery.
Change-Id: If02b7fb4ad308c6a7d1e1aa9f953e1bc4e942719
Signed-off-by: Simon Stone <sstone1@uk.ibm.com>
Add a new "-n" option to byfn.sh that optionally skips
the deployment of the abstore chaincode. When BYFN is
used as a network for other samples, we don't really
want the default chaincode deployed.
Change-Id: I6b4043a5c0bcedbeec431cc4a860a3b12da8d8f6
Signed-off-by: Simon Stone <sstone1@uk.ibm.com>
Add a new "-a" option to byfn.sh that optionally deploys
certificate authorities (in Docker containers) for
organisation 1 and 2.
Change-Id: Ib58c46941aa6e8e58bac01aa3349e97d1f93b930
Signed-off-by: Simon Stone <sstone1@uk.ibm.com>
Add connection profiles as part of the BYFN and EYFN
samples. The connection profiles can be used by client
applications using the Fabric SDKs to connect to those
networks.
Each organisation needs its own connection profile
that contains the set of peers that organisation
should use to connect to the network. Orderers and
channels are not needed, as they can be determined
by using service discovery.
Connection profiles can be specified in either JSON
or YAML, so provide both.
Change-Id: Ie8e3d2aef6475b324e5be8ebdada4c594c2235ae
Signed-off-by: Simon Stone <sstone1@uk.ibm.com>
Previously fabric-samples utilized the fabric list of maintainers. Over time
other contributors have become active. The fabric maintainers will use this
CR to vote for a new set of fabric-samples mainatiners, with the initial list
based on developers with the most contributions and reviews for fabric-samples
over the last 12 months.
Additionally, change fabric-samples from a two +2 policy to a
non-author code review policy.
Change-Id: I9c479f2e8a3dd7389e6e317aa4430cba1df9f3b3
Signed-off-by: David Enyeart <enyeart@us.ibm.com>
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>
- implement sample app to issue, transfer, redeem and list tokens
- change basic-network/crypto-config.yaml user count to 2
- regenerate crypto and channel config via generate.sh
- add fabtoken/README.md
Change-Id: I8d270c95b29e4af9c432fb05e7e8dc6be7bbc069
Signed-off-by: Wenjian Qiao <wenjianq@gmail.com>
This patch updates CI pipeline scripts which utilizes global shared
library reusable functions. It also creates ci.properties file with
all the parameters required to test the fabric-samples patch.
Change-Id: I9ed97c8dd0c07a3677042dbda034043e8a19a0f1
Signed-off-by: rameshthoomu <rameshbabu.thoomu@gmail.com>
This change set upgrades config files, scripts and fixtures for the
basic-network sample.
Changes are as follows:
- configtx.yaml was amended adding capabilities and policies required
to bootstrap a 2.0 channel
- crypto-config.yaml was amended adding support for node OUs (so that
policies involving peers, admins and clients can be evaluated)
- generate.sh was amended adding the name of the orderer system channel
- generate.sh is executed, producing fixtures in the crypto-config and
config directories
- docker-compose.yml is changed specifying the correct SKI after
crypto material has been regenerated
- finally, startFabric.sh has been upgraded to use the new lifecycle
Change-Id: I201a98e3bf4d9717741539f572719aa687f4bb63
Signed-off-by: Alessandro Sorniotti <ale.linux@sopit.net>
This change is to add a delStandard() function to the
high-throughput fabric sample, as well as fix a typo
in putStandard(). In addition to modifying the
chaincode, an additional bash script,
'del-traditional.sh', was created to remotely delete
a created asset from within the docker CLI in
accordance with the sample walkthrough.
This change is necessary to demonstrate the full
capability of the fabric Shim library, such that no
assets remain on the ledger that the user doesn't want
This change was tested on a local deployment of
Fabric 1.4, using the 'Basic Network' asset that
was created by Ethan Fox for internal use by the
IBM Blockchain Innovation Unit within GBS Global.
Change-Id: I34488dc3131f817563568a43f923856fecb07a5a
Signed-off-by: Ethan Fox <Ethan.Fox@ibm.com>
This sample does not demonstrate best
practices.
Change-Id: I80fb5a7748ac6d067e52e8e0601a46cfb15cb0ac
Signed-off-by: Gari Singh <gari.r.singh@gmail.com>
Between the approve and commit steps we add a QueryApprovalStatus to verify
whether peers are ready to commit the chaincode definition.
Change-Id: I18805a4180fa61da07d2bca321c6355660f772fc
Signed-off-by: Alessandro Sorniotti <ale.linux@sopit.net>
A sample application in Write Your First Application has an
unnecessary parameter “chainId” in a transaction proposal request.
Since a channel name is included in a channel object, it is not
required in a request.
This CR removes the parameter ”chainId” from the sample code.
FAB-12215 #done
Change-Id: I1e9b24c791a2129534766805855d05e78b050149
Signed-off-by: Yuki Kondo <yuki.kondo@hal.hitachi.com>
The tools and fabric images are all alpine based now and do not have
apt-get. Instead, they are prepopulated with jq. This CR simply
removes the attempt to install jq (which always fails) and acts as a
red-herring when trying to debug.
Change-Id: I8fe83dc4a9ba6995ebfb2786cee45fe0e591b85a
Signed-off-by: Jason Yellick <jyellick@us.ibm.com>
Extend the 3-node etcd/raft cluster in BYFN to 5 nodes, in
order to better support the documentation effort. This will
allow users to experiment creating channels with less then
5 nodes, but avoid the pitfalls of a 2-node cluster.
Change-Id: I5ba1d6039b4bb4864b2b97271de81fbfe91b4fb5
Signed-off-by: Yoav Tock <tock@il.ibm.com>
Building Chaincode fails with the ccenv container created from
Alpine because go build process can't import the shim package.
GOPATH in ccenv changed from "/opt/gopath" to "/go" due to the
move to Alpine. However, docker-compose-simple.yaml still has
`GOPATH=/opt/gopath`.
This CR removes the environment variable.
FAB-14369 #done
Change-Id: I18d9861d9b6f45c1548169fbb143e7883f8ba207
Signed-off-by: Yuki Kondo <yuki.kondo@hal.hitachi.com>
Augment the fabric-samples first-network sample to include an option
to choose etcd/raft as consensus-type.
Extend the -o flag so that it allows users to choose between the
solo, kafka, or etcdraft consensus-type for the ordering service.
Use three orderer nodes.
Change-Id: Ibc4c3564220466aef0a87baee4a2d594e5554a62
Signed-off-by: Yoav Tock <tock@il.ibm.com>
Configtxgen was failing to print the org definition for org3 because it
was missing the required policies for the org definition. This caused a
failure in the CI test for adding an org.
Because it will be needed in the future, this CR also adds the new
lifecycle endorsement and general endorsement policies to the
configtx.yamls as well.
Change-Id: Ie53165231cf8afe6377b51a28625797b15ca78ec
Signed-off-by: Jason Yellick <jyellick@us.ibm.com>
Update both BYFN and EYFN so that the peer request and
chaincode ports match the externally mapped ports. This
enables applications both inside and outside the Docker
network to use service discovery to interact with these
networks (see the JIRA for more details).
Change-Id: I73c36dfdb269ec4225376fb04b1e7a087363e4cc
Signed-off-by: Simon Stone <sstone1@uk.ibm.com>
Previously, configtxgen would auto-populate policies if they were
omitted. This presented some problems for specifying partial policy
schemes, like only overriding one policy. Support for omitting policies
was deprecated in v1.3 and has been removed for v2.0.0.
Change-Id: Ie01bf8f05911358a0af144f2fe2df2667c2bf12e
Signed-off-by: Jason Yellick <jyellick@us.ibm.com>
fabric-samples/high-throughput is a sample Chaincode for
delta-based transaction model. When executing `update`, a new delta
for a particular variable is updated to the ledger. The sum of a
variable is updated to ledger by deleting all of its delta rows
while computing the sum. The current Chaincode has two types of
pruning functions. However, there is no difference in terms of
Fabric's transaction model.
This CR adds the following changes.
- Remove unnecessary `pruneSafe` function.
- Change the name of function from `pruneFast` to `prune`.
- Update or delete related scripts.
- Improve a related documentation.
FAB-11796 #done
Change-Id: I5daa21554e53d77b7b5081f02a2846a85ec06f9a
Signed-off-by: Yuki Kondo <yuki.kondo@hal.hitachi.com>
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>
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>
Fix misspellings of "Prerequesites" to "Prerequisites",
and "prinicpal" to "principal"
Change-Id: I1024cc0f720bedddee3286b2520ab3824d7a1d5b
Signed-off-by: Daisuke IIZUKA <daisuke.iizuka.ag@hitachi.com>
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>
Updated compose files and scripts to use the correct mapping.
Change-Id: Iccbe384393c2736c5ba197d70ef6a124588ad588
Signed-off-by: Arnaud J Le Hors <lehors@us.ibm.com>
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>
This sample uses images which are no
longer published and are not supported
by the community.
FABC-781 #done
Change-Id: I01865b433a1ef4345aaf47255b92c1f83275aa4f
Signed-off-by: Gari Singh <gari.r.singh@gmail.com>
Update the Balance Transfer to return the fabric error.
The sample application was updated to both return the error
in the REST response and to post the error to the log.
The sample was updated with the 'channel.close()' so
that users will note how to shutdown a channel and not
hold connections open.
Change-Id: I49f20a50340adff52cf57db00a121ffd75eb1827
Signed-off-by: Bret Harrison <beharrison@nc.rr.com>
This change is to update Jenkinsfile to fetch
the patchset for verify jobs and clone the latest
commit for merge jobs.
Change-Id: I20f9a322eb9f60b648b4b630df2d4565223be916
Signed-off-by: Sambhav Nidamarty <sambhavdutt@gmail.com>
Use GitHub's process to automatically comment
and close PRs, with a pointer to the contributing
guide.
Change-Id: Iea3d1391a4175c98f2d5eeb9a8047d09286d46b7
Signed-off-by: Ry Jones <ry@linux.com>
This is an example on how to represent and implement basic interest
rate swap handling using fabric. It demonstrates the
usage of state-based endorsement.
Change-Id: I04e631299d95262e54e1532489766aa20477064c
Signed-off-by: Matthias Neugschwandtner <eug@zurich.ibm.com>
Signed-off-by: Alessandro Sorniotti <ale.linux@sopit.net>
Signed-off-by: David Enyeart <enyeart@us.ibm.com>
Update byfn/eyfn Jenkins script to get the latest
version binaries for fabric and fabric-ca
Change-Id: I0a310385285b1c086a6cfef0f7cb1c1906ed8351
Signed-off-by: Sambhav Nidamarty <sambhavdutt@gmail.com>
- Update CORE_LOGGING_LEVEL to FABRIC_LOGGING_SPEC
- Add port as an argument in case default port is used
Change-Id: I29725a100a095b2b6f2ec6262e7b70730445385e
Signed-off-by: Wenjian Qiao <wenjianq@gmail.com>
The -o flag was a legacy option on `peer node start` and has been
removed.
Change-Id: Idf3cf57d39461b57c6f61b32e971e14031278e3f
Signed-off-by: Matthew Sykes <sykesmat@us.ibm.com>
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>
The TypeScript version of the FabCar app uses a dodgy
"as any" cast to get around a bug that has been fixed;
turns out the wrong name was being used (should have
been asLocalhost, not useLocalhost).
Note, because basic-network does not use TLS, we cannot
use service discovery. We can enable service discovery
when we migrate FabCar to BYFN instead.
Change-Id: I36dad1c8cc7380ca1123805ae3e74fe1e7665b40
Signed-off-by: Simon Stone <sstone1@uk.ibm.com>
The new FabCar apps currently have a dependency on
the fabric-client (old programming model) module,
but now the dependencies of the fabric-network module
have been corrected, this dependency can be removed.
The fabric-ca-client dependency is staying because the
FabCar apps explicitly require this module to perform
CA interactions.
Change-Id: Iee40f7a560d5ac0a0f8202fc6d751aa45467829e
Signed-off-by: Simon Stone <sstone1@uk.ibm.com>
Add a new version of the FabCar applications using the new
programming model (fabric-network), written in JavaScript.
Change-Id: I0fcc2e8a10291805d5389c7fc8d1e529debd600a
Signed-off-by: Simon Stone <sstone1@uk.ibm.com>
Add a new version of the FabCar applications using the new
programming model (fabric-network), written in TypeScript.
The new programming model requires a connection profile, so
I have added connection profiles (JSON and YAML) versions to
the basic-network sample. When we switch FabCar to use first-network,
we will have to add connection profiles into that as well.
Change-Id: I81bae907fc64a1cde0234325f37b53e5cd7964e5
Signed-off-by: Simon Stone <sstone1@uk.ibm.com>
Adding support to upgrade from 1.3.x to 1.4.0 using upgrade_to_v14.sh
and changes to byfn.sh
For this, no v1_4 capabilities need to be enabled other than v1_3
capabilities on channel and application group level
Only upgrading the images from v1.3.x to v.1.4.0 for peer, orderer,
cli, ccenv
Change-Id: I991f96c2deb3c91870ec4654aa8b561f49594248
Signed-off-by: Surya Lanka <suryalnvs@gmail.com>
Augment the fabric-samples first-network sample to include a flag that allows a choice of consensus-type:
solo (default) or kafka.
- Add note on production deployment of kafka
- Remove port mapping for kafka and zookeeper containars
Change-Id: I3204ba44e5974961eb69649b6f5744f52097ce80
Signed-off-by: Yoav Tock <tock@il.ibm.com>
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>
Introduce automated tests for the fabcar sample, that deploy
the new sample contracts and submit the initLedger transaction
using the "peer" CLI.
Additional changes will follow to drive the new sample apps
to ensure that they work as well (but the apps aren't there
yet!).
Change-Id: Ie42d139eb1dc1cf0f7c16f41f54bb5f40309921c
Signed-off-by: Simon Stone <sstone1@uk.ibm.com>
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>
This CR updates the startFabric.sh script in the fabcar
sample to deploy the new fabcar contracts written with
the new programming model, in either JavaScript or
TypeScript.
Because both JavaScript and TypeScript use the chaincode
language of "node", we need to separate "source" language
from "runtime" language. Also taking the chance to rename
the option "golang" to "go" to match the directory.
Change-Id: Ib42661223925b1d8df8fd73cf8c1aac9d8a29e59
Signed-off-by: Simon Stone <sstone1@uk.ibm.com>
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>
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>
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>
This change synchronizes the node marbles02 sample chaincode with
fabric/examples/marbles02
Change-Id: I6c11fee15ae39950fca7344fbf230c42f876274a
Signed-off-by: zhaochy <zhaochy_2015@hotmail.com>
Block Query by hash Fixed in balance transfer app.
Change-Id: Iad5c0af657e7359ee787e1f939a6695d470da1cd
Signed-off-by: sebastianpaulp <spaul@jeadigital.com>
Currently, balance-transfer does not have anchor peer
configuration. As a result, users are unable to use private data
and can't take advantage of service discovery.
This CR adds a function and modifies a test script to update
anchor peers at the setup.
Change-Id: Icbd7e4eb2e3bbcb187a083e94c616ef4825c5fb4
Signed-off-by: Yuki Kondo <yuki.kondo@hal.hitachi.com>
fabric-samples already completed in release-1.3 branch.
This CR fixes up version references in master to match.
Change-Id: I95f9d2db5e5fed749560768ca0ba753bb7cae700
Signed-off-by: David Enyeart <enyeart@us.ibm.com>
Balance-Transfer docker-compose file does not have the parameters
-CORE_PEER_GOSSIP_BOOTSTRAP and -CORE_PEER_GOSSIP_EXTERNALENDPOINT
assigned to its peers. This impacts the usage of Fabric v1.2 discovery
feature by apps like Blockchain Explorer
Change-Id: I2ca8adc57af34a0442e91a956b97e754088bba74
Signed-off-by: Cláudio Ramos <claudiovtramos@gmail.com>
This change is to fix the couchdb timeout errors in byfn
test. This could be an CI environment issue but to fix CI
failures, increasing the MAX_RETRY count to 10
Change-Id: Id16b1846374eb2cb91b4d67fedb38562df90c7d3
Signed-off-by: rameshthoomu <rameshbabu.thoomu@gmail.com>
Update stable version to 1.4.0-stable in CI scripts
Change-Id: I558442ccce8975533f9123193d7aa343ae883ba5
Signed-off-by: rameshthoomu <rameshbabu.thoomu@gmail.com>
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>
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>
Update fabric-ca build scripts to download s390x binary
to run the fabric-ca test scripts
Change-Id: Ieaeac4a7e43435dbf49e6b9dc2649705e9348892
Signed-off-by: rameshthoomu <rameshbabu.thoomu@gmail.com>
Since fabric-ca-orderer/peer/tools images are no longer being
published, this updates the fabric-ca sample to not use them.
Instead, it either uses locally built images or it builds them
by using curl to download the published fabric-ca-client binary
from nexus.
Change-Id: I29776c72445660ab02a5e82a4e6b0ade0d0167e7
Signed-off-by: Keith Smith <bksmith@us.ibm.com>
Signed-off-by: Saad Karim <skarim@us.ibm.com>
Changes include upgrade from v1.2.x to v1.3.x.
First, upgrades the network from v1.2.x to v1.3.x and
upgrade_to_v13.sh will run config updates on /Channel level and
/Channel/Application level for v1_3 capabilities.
Add 15 sec's delay to couchdb tests
Change-Id: Ic2a1633842b7dd8a39ee674c5159d67b46122ff4
Signed-off-by: Surya <suryalnvs@gmail.com>
Signed-off-by: RameshBabu <rameshbabu.thoomu@gmail.com>
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>
Increase retry timeout from 3s to 15s so that initial CLI
commands after peers and couchdb come up are successful.
Change-Id: Ib5f879bde52395d9f600683da17bf03aff6e05b2
Signed-off-by: David Enyeart <enyeart@us.ibm.com>
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>
Balance transfer fails to install Chaincode since there is a
undeclared variable "tx_id". However, "tx_id" is not required
in ChaincodeInstallRequest.
This CR removes the line getting transactionId to execute
installChaincode correctly.
Change-Id: Ia62844172ceecd84fa9a9f2e40e804d1f7a7499b
Signed-off-by: Yuki Kondo <yuki.kondo@hal.hitachi.com>
Fixed typo in instatiate-chaincode.js and removed unused imports from other JavaScript files in balance-transfer/app
Change-Id: If9695c4f51e9c0835230b2c7f969cbf4aa132675
Signed-off-by: Clyde DCruz <clydecroix@gmail.com>
Update byfn_eyfn.sh script to fetch the binaries from the
correct nexus url.
Change-Id: I0ea675235cc0dce691b8a1bbf30951504f0a8112
Signed-off-by: rameshthoomu <rameshbabu.thoomu@gmail.com>
Update fabric image version to 1.3.0-stable to pull the
latest fabric and fabric-ca docker images
Change-Id: I598b98afa205ca68b37598d159bf0fb9f36fd370
Signed-off-by: rameshthoomu <rameshbabu.thoomu@gmail.com>
Removed the use of the old EventHub from both
FabCar and BalanceTransfer.
Change-Id: Ia4a0bb443f95c462efde9b054058986ae8bd80fd
Signed-off-by: Bret Harrison <beharrison@nc.rr.com>
for balance transfer app in node-sdk samples.
Added Endorsement policy in instantiate-chaincode.
Change-Id: Ie7344353a8febf0f1e76f6a4edcb3035ab2d00e2
Signed-off-by: susmita <susmita.somanchi@gmail.com>
The Profile section of configtx.yaml must now be at the end of the file,
so the building of this file dynamically must be updated.
I also updated the version of the fabric CA in bootstrap.sh to 1.2.0.
Change-Id: Ifabccebc901f74569cfa1fe1d824fbcd26c4ffd1
Signed-off-by: Keith Smith <bksmith@us.ibm.com>
Signed-off-by: Christopher Ferris <chrisfer@us.ibm.com>
This patch set includes changes for demonstrating
byfn network sample upgrade from v1.1 to v1.2
Change-Id: Ib0e5243e7ec280861c13feab0a23dc3566674f4c
Signed-off-by: Naga Pemmara <naga.pemmaraju@ibm.com>
This patch supports Jenkins CI pipeline project type for master branch.
Script will pull docker images (1.2.0-stable) and binaries from Nexus
and run byfn and eyfn tests. The pipeline script supports only master
branch and release branches supports regular freestyle flow.
Change-Id: I85938f66b588b2e37a2a12d4941672632d52c8dd
Signed-off-by: rameshthoomu <rameshbabu.thoomu@gmail.com>
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>
This change set adds querying to peers in all orgs at the end of eyfn
to ensure peers of all orgs are in sync.
Which proves they all validated the transaction and there is no state fork
among peers of different orgs.
Change-Id: I33ed632798a6e01d182e879c66c282fc4af6dbce
Signed-off-by: yacovm <yacovm@il.ibm.com>
This CR fixes broken links to the install manual
in fabric-samples/chaincode-docker-devmode/README.rst.
The style is also updated to follow the style of rst.
Change-Id: I9bbb6e0b88b8aabf8e020bb81756f4619115989c
Signed-off-by: Yuki Kondo <yuki.kondo@hal.hitachi.com>
This patchset removes wrong max message size configuration from
network-config.yaml in the balance-transfer sample.
After [FAB-9337] was merged, this configuration was activated and caused
an error in running the sample.
Change-Id: I209448bd7701d5843b7ac06501be6a9d16d378e1
Signed-off-by: Taku Shimosawa <taku.shimosawa@hal.hitachi.com>
There are currently multiple docker-compose downs going on in the
first-network samples. These are in an attempt to catch different
configurations of the same compose network. The flag --remove-orphans
was created to allow tearing down components in a composition even when
there is a mismatch in the compose definition, so this cleans the down
scripts up a bit.
Change-Id: Ied6a06e2ebc21053993e2a6b39b6fbd7fffdfe02
Signed-off-by: Jason Yellick <jyellick@us.ibm.com>
Update BYFN to use V1_2 application capability.
Required for private data collections.
Change-Id: I56c74b9fb6cd77864b5c8d13abb066a3d729500b
Signed-off-by: David Enyeart <enyeart@us.ibm.com>
This CR fixes the broken link to the document of ABAC
in fabric-samples/fabric-ca/README.md.
Change-Id: I2aff8a2c6b1f3e208f211f20f9237d8c3efd14d8
Signed-off-by: Yuki Kondo <yuki.kondo@hal.hitachi.com>
This CR updates the first-network (BYFN and EYFN) to use an
'AND (...)' endorsement policy. It also cleans up some of the
output and fixes the line length of some comments.
Change-Id: I741f41226955ccfcd3eb5369d8ba6eb77e49e89e
Signed-off-by: Will Lahti <wtlahti@us.ibm.com>
Changed README.md to instruct user to edit byfn.sh instead
of docker-compose-cli file since this is where the standard
BFYN script is now run.
Also added missing Copyright notices.
Change-Id: Ib18afe8a23cc3874729031a82480aac5b0a2b555
Signed-off-by: Arnaud J Le Hors <lehors@us.ibm.com>
Some general cleanup of byfn.sh script:
- Given that "-m" is deprecated, remove its normal processing,
but retain (for now) its early recognition so that CI passes.
- Drop reference to "--help", only "-h" is supported.
- Add reference to "upgrade" mode to usage message and comment.
Change-Id: If1d6624c8788ec660abca5d13e7c87aafb13ce59
Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
fixed [FAB-8245], and fabric samples have to be changed accordingly.
currently, added support for both output formats.
Change-Id: I0cac063af44556d6a37f17b25abf20134032540f
Signed-off-by: nirro <nirro@il.ibm.com>
There is no "samples.html" in latest documents.
This patch changes the dead link to "install.html"
Change-Id: I431d197c5f4124a979d706f668da28ad1d14b235
Signed-off-by: Nao Nishijima <nao.nishijima@hal.hitachi.com>
eliminate the noise of echoing the environment
variables for each command and add -v option to
enable the noise for debug purposes for byfn.sh
and eyfn.sh in first-network sample
also eliminate noise in fabcar
Change-Id: I46c377360efbab598fd37c0a31b29a119b99173e
Signed-off-by: Christopher Ferris <chrisfer@us.ibm.com>
I found "depete" in first-network/byfn.sh.
Maybe it should be "delete".
Change-Id: Iecdb6f8822b8b99765bc9d93e9b5ab623cb63607
Signed-off-by: foolcage <5533061@qq.com>
Rather than cram most .gitignore content into the top-level .gitignore
file, partition it into lower-level .gitignore files, as is already done
with a couple subdirectories, just to be consistent.
I'm sure these files could be even tidier but this seems sufficient for
a first pass.
Change-Id: I0cc8cb2a9d7fa82c4f6de1aef9f82107c8cc7a6a
Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
When running the sample "Adding an Org to a Channel", then upon clean up,
./eyfn.sh -m down script must be run before ./byfn.sh -m down; otherwise,
org3 containers and volumes and containers do not get cleaned properly.
This patch adds the org3 container and volume cleanup to ./byfn.sh so
that a user does not have to worry about the correct execution ordering
of ./eyfn.sh and ./byfn.sh scripts.
Change-Id: Ieac1adc4081d59943286cfe9139a74395986460b
Signed-off-by: Salman Baset <sabaset@us.ibm.com>
Remove the package lock file and allow current
versions to be installed.
Change-Id: I74a4710173e4f2307e87b73c6021ecf20237a974
Signed-off-by: Bret Harrison <beharrison@nc.rr.com>
I have fixed a spelling error in registerUser.js, changing
"intreact" to "interact".
Change-Id: Ib07af36923a5fe652be01e1c83e316d4495d4a46
Signed-off-by: David Seybold <daseybold@gmail.com>
The jq script which performs the config update in
scripts/run-fabric.sh fails if the orderer name contains
a hyphen. It requires modifying the way in which jq
interpolates shell variables.
Change-Id: Ie4de9459cb17693465613d6efd78b3d98575bbb2
Signed-off-by: rennman <eabailey@us.ibm.com>
byfn test failing intermittently in CI due to peer not
being available when the join channel command is
executed. Need to wait for peer to finsih establishing
connection with couchdb before joining channel.
The exit code was not being correctly captured from the
peer join command and thus the retry logic was not being
executed.
Change-Id: I2c27d17cd769c6b8de1bdcfed263d9b0f758b432
Signed-off-by: Saad Karim <skarim@us.ibm.com>
Fix USE_INTERMEDIATE_CA variable to allow
exclusive use of RootCA for sample tests.
Change-Id: If10f9a768ba17943f03b416f5a68edb9eb65a27a
Signed-off-by: rennman <eabailey@us.ibm.com>
The returned error message was changed to "access denied" when
a certificate has been revoked. This simply changes the sample
to look for the correct error message.
Change-Id: Id107d4e1813099e2f21ba9eaffa0bd0b9912a97b
Signed-off-by: Keith Smith <bksmith@us.ibm.com>
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>
The first-network CLI yaml was recently enhanced to use volume mounts
for the ledger directories. There is the additional e2e yaml which
depends on the container definitions and is now failing. This CR simply
edits its template to include these new volume definitions.
Change-Id: Ia5b7b93b2be4f9de1f0ebfaa804f8ef713fb935d
Signed-off-by: Jason Yellick <jyellick@us.ibm.com>
Docker compose makes volume management easy and transparent to the user.
By defaulting the ledgers to be docker compose volumes, we transparently
get ledger persistence for the ugprade case, and may trivially tear the
volumes down in the docker-compose down command with the addition of the
--volumes flag. This would allow the upgrade scenario to work without
the use of the '-p' flag, and is likely to be generally much cleaner.
Change-Id: I80b36a63370065a7aad0f9c284ec578533123d2b
Signed-off-by: Jason Yellick <jyellick@us.ibm.com>
replace DEBUG level logging w/INFO, but add in
shell debug statements for all fabric commands
for improved UX
Change-Id: I97a19db0373ecaf7a504cb95d4815a11cd64dfed
Signed-off-by: Christopher Ferris <chrisfer@us.ibm.com>
As of 1.1 alpha timeframe, 3rd party images do not follow the
same docker IMAGE_TAG versioning as the other Fabric docker images.
Need to remove IMAGE_TAG from couchdb images, and default to
latest couchdb image, which is how it worked prior to
the -i introduction.
This change needs to be made in master branch but not release branch,
since the IMAGE_TAGs are aligned in 1.0.x release.
Change-Id: Iaca24ea7ed1fc6319738dcf59f665da9259d2b9a
Signed-off-by: David Enyeart <enyeart@us.ibm.com>
Update sample code to use the channel-based events.
The sample will also use the new connection profile
API to get a list of channel-based NodeSDK event hubs
using filtered blocks, automatic unregistration, and
automatic disconnect, all new features of channel-based
events. This will demostrate the most common use case
for events. The sample code will require the NodeSDK
to be at 1.1 alpha.
Change-Id: Id9f2b37f02d7d662b7ca1016586560ee4c595992
Signed-off-by: Bret Harrison <beharrison@nc.rr.com>
Adding upgrade functionality to byfn.sh to upgrade the fabric network
from v1.0.x to v1.1 and scripts for cli to enable
/Channel, /Channel/Orderer, /Channel/Application capabilities
Usage:
git fetch origin
git checkout origin/release
./byfn.sh -m up -i 1.0.6
git checkout origin/master
./byfn.sh upgrade
Change-Id: I6f53a6db39501e2653dc4c325d3d42d78f463e87
Signed-off-by: Surya <suryalnvs@gmail.com>
Signed-off-by: Jason Yellick <jyellick@us.ibm.com>
This CR adds a new docker-compose-persist.yaml file which creates a
volume mount in the current directory at ./ledgers/<container> and binds
it to the ledger directory for the container.
It also adds a '-p' flag to the byfn.sh script to allow users to include
this new compose file when bringing up the network.
Change-Id: I1ee5faa33c7f0ce18fe7711f5f752d7bf18f117c
Signed-off-by: Jason Yellick <jyellick@us.ibm.com>
Signed-off-by: Surya <suryalnvs@gmail.com>
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>
The first-network tutorial turns on the v1.1 fabric capabilities, and
depends on very recent versions of cryptogen and configtxlator. Users
appear to be running the latest version of first-network with older
binaries, and are experiencing cryptic failures.
This CR adds basic version checking, both for the local binary versions
as well as the binary versions contained within the docker images. If
these versions are mismatched, it prints a warning. If either of the
versions is in a black-list, the byfn.sh will error out.
Change-Id: I1a43ec396c8d1f5a438472cb422d5a7e52e2ef63
Signed-off-by: Jason Yellick <jyellick@us.ibm.com>
As pointed out in [FAB-8496], updating the orgs for the fabric-ca
sample does not have an effect currently.
This RC added the affiliation settings in env.sh script into the
default config file.
Change-Id: I3eaa601fc572f6880b15dec48a4be8a69d01eb4e
Signed-off-by: Min Luo <luomin_tokyotech@hotmail.com>
The pattern of the byfn scripts and of our tutorial is to start the CLI
container, then docker exec commands against it. For some reason, we
only start the CLI container with a command of 'sleep 1000' which causes
it exit after this time.
This causes headaches of having to restart the CLI container and is only
saving the overhead of one idle bash process. From a usability
it seems far better to leave an idle bash process so that we can be
assured the container is still running.
Change-Id: I8d5c860b89226a28f15d42f5a19e42b923bfa8c1
Signed-off-by: Jason Yellick <jyellick@us.ibm.com>
A number of the image lines in the compose files were skipped when the
IMAGE_TAG option was added. This CR fixes them.
Change-Id: I60ca932de47315f2c99368ac41ed6710aca96614
Signed-off-by: Jason Yellick <jyellick@us.ibm.com>
Adding IMAGE_TAG option to byfn script to launch specific
version of fabric network
Usage: ./byfn.sh up -i 1.1.0-alpha
Change-Id: I67a1d01257abd7021ea344c354c6e1c97eebf4f7
Signed-off-by: Surya <suryalnvs@gmail.com>
Signed-off-by: Jason Yellick <jyellick@us.ibm.com>
Add --gencrl flag to revoke command to illustrate
the ability to generate a CRL while performing
a revocation.
Change-Id: I7521cfee54f8704675236d7afb2876b87eb339bf
Signed-off-by: Saad Karim <skarim@us.ibm.com>
Fabric CA sample fails with TLS error when
running against latest 1.1 code because orderer
was expecting client certificate but was not receiving
on during TLS handshake. This change set fixes the
problem by specifying --clientauth, --keyfile and
--certfile command line arguments to the peer commands
that need to communicate with orderer, like 'peer channel
create'.
Change-Id: I34ad39c919c0121916116c3711c7429009db7fc8
Signed-off-by: Anil Ambati <aambati@us.ibm.com>
This change set makes bootstrap peers aligned to recommended
settings.
Change-Id: Ibd29577000d1a91d091c595ac3f32c00cead1d13
Signed-off-by: yacovm <yacovm@il.ibm.com>
org3 peer role is not enabled in org3-artifacts/org3-crypto.yaml
which causes failure in executing the transaction on org3.
adding the following configuration fixes the issue
"EnableNodeOUs: true"
Change-Id: Id345583a7f5a1f8fb970c8e6113a094de82b6358
Signed-off-by: ratnakar <asara.ratnakar@gmail.com>
V1.1 introduces a new CLI for configtxlator which eliminates the need to
run it as a REST service. Since this makes the example simpler, this CR
changes those REST calls to be direct CLI invocations.
Change-Id: I005068d1ca27946b9b6d4d1a2a1056268e366d61
Signed-off-by: Jason Yellick <jyellick@us.ibm.com>
This change-set does the following:
- it modifies the first-network example to show how to use FAB-5664.
Namely, the identity classification is enabled by
setting EnableNodeOUs to true in crypto-config.yaml.
Then, the endorsement policy is changed to requires
peers and not members. Finally, cryptotx.yaml is modified
to enable v1.1 capabilities.
Change-Id: If8e943b5833b4402d612895449ac110ab2fee4b5
Signed-off-by: Angelo De Caro <adc@zurich.ibm.com>
The fabric-samples/fabric-ca/scripts/setup-fabric.sh script needs
two small changes so that orderers and peers are registered with
the correct type. They are currently defaulting to type 'client'.
Change-Id: Ibd813cd68ae1669bc39423826ca1d39ac57d16c1
Signed-off-by: luomin <luomin_tokyotech@hotmail.com>
This change brings a new set of scripts and configuration files to the
first-network sample to make it easier for people to follow the new
tutorial on how to add a third org to the network setup in BYFN.
To function properly the new Extend You First Network script (eyfn.sh)
must be run after byfn.sh is run and with the same parameters. So,
valid uses include:
./byfn.sh up
./eyfn.sh up
or
./byfn.sh up -c testchannel -s couchdb -l node
./eyfn.sh up -c testchannel -s couchdb -l node
A single './eyfn.sh down' command is however necessary to take the
whole network down.
Patch-set #2: fixes ./eyfn.sh down
Patch-set #3: removed unused option from Usage and spurious whitespaces
Patch-set #4: added missing test file
Change-Id: I9c926b52f2243dda1c5f9368112c314a6c5c6929
Signed-off-by: Arnaud J Le Hors <lehors@us.ibm.com>
FIX [FAB-8122] Added steps to clear containers and
artifacts before starting the network manually.
Change-Id: I83abd30e0080ff2395d91c76029a3527e4e69de4
Signed-off-by: susmita <susmita.somanchi@gmail.com>
Currently client authentication is not enabled on
any peers and orderer in the fabric-ca sample. This
change set will enable client authentication on all
the peers and orderer.
Change-Id: If3c6a5dc6d1dc3a38096608617971945bde359c0
Signed-off-by: Anil Ambati <aambati@us.ibm.com>
Fix the instructions in chain-docker-devmode for v1.1-perview.
Resubmit this FAB-6934 due to the merge conflict.
https://gerrit.hyperledger.org/r/#/c/15405/
Change-Id: I6d2dece3f48ca8b8c904c0745adb2253a7c6581a
Signed-off-by: luomin <luomin_tokyotech@hotmail.com>
The stop.sh script cleans up the network and service
containers from the composition file, but does not
clean up the resulting chaincode containers. This
CR removes the chaincode containers and their images
as well.
Change-Id: I06ba13486efc59b4761728891aab27535ae0366d
Signed-off-by: Latitia M Haskins <latitia.haskins@gmail.com>
The basic-network sample consists of a initialization script which
removes any content inside the hfc-key-store and later copies the
content from creds to the keystore. However this creds directory
doesnot exist or is ever created in the sample execution.
Change-Id: Ia3d07ad78875328f6798290d3f0ab3098b9e85fc
Signed-off-by: Sudheesh Singanamalla <sudheesh95@gmail.com>
This change fixes a set of related issues.
It fixes the use of the cli timeout setting. It is now merely about
the maximum time spent waiting for a response.
The e2e script is no longer run from docker-compose but by calling
docker exec from byfn.sh and docker-compose now merely has the cli
waiting/sleeping for 1000 seconds.
This not only allows starting the network without automatically
running the e2e script, it also allows byfn.sh to properly end when
the e2e script ends rather than hang. It also makes the tutorial
simpler.
The time the cli container waits/sleeps cannot be changed other than
by editing the config file but this shouldn't be a problem.
This change also fixes the log output of the e2e script so that peers
are consistantly being referenced as in peerX.orgY.
In addition, this changes the usage of byfn.sh so that the -m
parameter is no longer needed. One merely needs to type "./byfn.sh up"
rather than "./byfn.sh -m up". The old way is still supported though,
for human backward compatibility. ;-) And by default the answer to the
prompt for continuation is "y" so the user can simply continue with a
hit of the return key.
Change-Id: I3e2409d81018f97ec9306ce6e1ae916d8fe18fec
Signed-off-by: Arnaud J Le Hors <lehors@us.ibm.com>
"queryChaincode" doesn’t output responses from all
peers in log message. It exits the loop processing after
outputting the first response.
We should print all responses from all peers. Also, we should
return a response (e.g. the response_payloads[0]) after the loop.
This patch fixes the problems above.
Change-Id: I92a0c5a663d6da0854d89bf76c5ba36da86754ef
Signed-off-by: Yuki Kondo <yuki.kondo@hal.hitachi.com>
2017-11-10 22:51:20 +00:00
1398 changed files with 171234 additions and 17571 deletions
before participating. It is important that we keep things civil.
```bash
./fabric-preload.sh [version]
```
<arel="license"href="http://creativecommons.org/licenses/by/4.0/"><imgalt="Creative Commons License"style="border-width:0"src="https://i.creativecommons.org/l/by/4.0/88x31.png"/></a><br/>This work is licensed under a <arel="license"href="http://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution 4.0 International License</a>
<arel="license"href="http://creativecommons.org/licenses/by/4.0/"><imgalt="Creative Commons License"style="border-width:0"src="https://i.creativecommons.org/l/by/4.0/88x31.png"/></a><br/>This work is licensed under a <arel="license"href="http://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution 4.0 International License</a>.
We welcome contributions to the Hyperledger Fabric Project in many forms, and
there's always plenty to do!
Please visit the
[contributors guide](http://hyperledger-fabric.readthedocs.io/en/latest/CONTRIBUTING.html) in the
docs to learn how to make contributions to this exciting project.
## Code of Conduct Guidelines <aname="conduct"></a>
See our [Code of Conduct Guidelines](./CODE_OF_CONDUCT.md).
## Maintainers <aname="maintainers"></a>
Should you have any questions or concerns, please reach out to one of the project's [Maintainers](./MAINTAINERS.md).
<arel="license"href="http://creativecommons.org/licenses/by/4.0/"><imgalt="Creative Commons License"style="border-width:0"src="https://i.creativecommons.org/l/by/4.0/88x31.png"/></a><br/>This work is licensed under a <arel="license"href="http://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution 4.0 International License</a>.
fabric-samples uses a non-author code review policy, requiring a single approval from a non-author maintainer.
<arel="license"href="http://creativecommons.org/licenses/by/4.0/"><imgalt="Creative Commons License"style="border-width:0"src="https://i.creativecommons.org/l/by/4.0/88x31.png"/></a><br/>This work is licensed under a <arel="license"href="http://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution 4.0 International License</a>
| Dave Enyeart | denyeart | Dave Enyeart | enyeart@us.ibm.com |
| Mark Lewis | bestbeforetoday | bestbeforetoday | Mark.S.Lewis@outlook.com |
| Tatsuya Sato | satota2 | satota2 | tatsuya.sato.so@hitachi.com |
Also: Please see the [Release Manager section](https://github.com/hyperledger/fabric/blob/main/MAINTAINERS.md)
<arel="license"href="http://creativecommons.org/licenses/by/4.0/"><imgalt="Creative Commons License"style="border-width:0"src="https://i.creativecommons.org/l/by/4.0/88x31.png"/></a><br/>This work is licensed under a <arel="license"href="http://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution 4.0 International License</a>.
You can use Fabric samples to get started working with Hyperledger Fabric, explore important Fabric features, and learn how to build applications that can interact with blockchain networks using the Fabric SDKs. To learn more about Hyperledger Fabric, visit the [Fabric documentation](https://hyperledger-fabric.readthedocs.io/en/latest).
Note that this branch contains samples for the latest Fabric release. For older Fabric versions, refer to the corresponding branches:
To use the Fabric samples, you need to download the Fabric Docker images and the Fabric CLI tools. First, make sure that you have installed all of the [Fabric prerequisites](https://hyperledger-fabric.readthedocs.io/en/latest/prereqs.html). You can then follow the instructions to [Install the Fabric Samples, Binaries, and Docker Images](https://hyperledger-fabric.readthedocs.io/en/latest/install.html) in the Fabric documentation. In addition to downloading the Fabric images and tool binaries, the Fabric samples will also be cloned to your local machine.
## Test network
The [Fabric test network](test-network) in the samples repository provides a Docker Compose based test network with two
Organization peers and an ordering service node. You can use it on your local machine to run the samples listed below.
You can also use it to deploy and test your own Fabric chaincodes and applications. To get started, see
the [test network tutorial](https://hyperledger-fabric.readthedocs.io/en/latest/test_network.html).
The [Kubernetes Test Network](test-network-k8s) sample builds upon the Compose network, constructing a Fabric
network with peer, orderer, and CA infrastructure nodes running on Kubernetes. In addition to providing a sample
Kubernetes guide, the Kube test network can be used as a platform to author and debug _cloud ready_ Fabric Client
applications on a development or CI workstation.
## Asset transfer samples and tutorials
The asset transfer series provides a series of sample smart contracts and applications to demonstrate how to store and transfer assets using Hyperledger Fabric.
Each sample and associated tutorial in the series demonstrates a different core capability in Hyperledger Fabric. The **Basic** sample provides an introduction on how
to write smart contracts and how to interact with a Fabric network using the Fabric SDKs. The **Ledger queries**, **Private data**, and **State-based endorsement**
samples demonstrate these additional capabilities. Finally, the **Secured agreement** sample demonstrates how to bring all the capabilities together to securely
transfer an asset in a more realistic transfer scenario.
| [Basic](asset-transfer-basic) | The Basic sample smart contract that allows you to create and transfer an asset by putting data on the ledger and retrieving it. This sample is recommended for new Fabric users. | [Writing your first application](https://hyperledger-fabric.readthedocs.io/en/latest/write_first_app.html) | Go, JavaScript, TypeScript, Java | Go, TypeScript, Java |
| [Ledger queries](asset-transfer-ledger-queries) | The ledger queries sample demonstrates range queries and transaction updates using range queries (applicable for both LevelDB and CouchDB state databases), and how to deploy an index with your chaincode to support JSON queries (applicable for CouchDB state database only). | [Using CouchDB](https://hyperledger-fabric.readthedocs.io/en/latest/couchdb_tutorial.html) | Go, JavaScript | Java, JavaScript |
| [Private data](asset-transfer-private-data) | This sample demonstrates the use of private data collections, how to manage private data collections with the chaincode lifecycle, and how the private data hash can be used to verify private data on the ledger. It also demonstrates how to control asset updates and transfers using client-based ownership and access control. | [Using Private Data](https://hyperledger-fabric.readthedocs.io/en/latest/private_data_tutorial.html) | Go, TypeScript, Java | TypeScript |
| [State-Based Endorsement](asset-transfer-sbe) | This sample demonstrates how to override the chaincode-level endorsement policy to set endorsement policies at the key-level (data/asset level). | [Using State-based endorsement](https://github.com/hyperledger/fabric-samples/tree/main/asset-transfer-sbe) | Java, TypeScript | JavaScript |
| [Secured agreement](asset-transfer-secured-agreement) | Smart contract that uses implicit private data collections, state-based endorsement, and organization-based ownership and access control to keep data private and securely transfer an asset with the consent of both the current owner and buyer. | [Secured asset transfer](https://hyperledger-fabric.readthedocs.io/en/latest/secured_asset_transfer/secured_private_asset_transfer_tutorial.html) | Go | TypeScript |
| [Events](asset-transfer-events) | The events sample demonstrates how smart contracts can emit events that are read by the applications interacting with the network. | [README](asset-transfer-events/README.md) | Go, JavaScript, Java | Go, TypeScript, Java |
| [Attribute-based access control](asset-transfer-abac) | Demonstrates the use of attribute and identity based access control using a simple asset transfer scenario | [README](asset-transfer-abac/README.md) | Go | _None_ |
## Full stack asset transfer guide
The [full stack asset transfer guide](full-stack-asset-transfer-guide#readme) workshop demonstrates how a generic asset transfer solution for Hyperledger Fabric can be developed and deployed. This covers chaincode development, client application development, and deployment to a production-like environment.
## Additional samples
Additional samples demonstrate various Fabric use cases and application patterns.
| [Off chain data](off_chain_data) | Learn how to use block events to build an off-chain database for reporting and analytics. | [Peer channel-based event services](https://hyperledger-fabric.readthedocs.io/en/latest/peer_event_services.html) |
| [Token SDK](token-sdk) | Sample REST API around the Hyperledger Labs [Token SDK](https://github.com/hyperledger-labs/fabric-token-sdk) for privacy friendly (zero knowledge proof) UTXO transactions. | [README](token-sdk/README.md) |
| [Token ERC-20](token-erc-20) | Smart contract demonstrating how to create and transfer fungible tokens using an account-based model. | [README](token-erc-20/README.md) |
| [Token UTXO](token-utxo) | Smart contract demonstrating how to create and transfer fungible tokens using a UTXO (unspent transaction output) model. | [README](token-utxo/README.md) |
| [Token ERC-1155](token-erc-1155) | Smart contract demonstrating how to create and transfer multiple tokens (both fungible and non-fungible) using an account based model. | [README](token-erc-1155/README.md) |
| [Token ERC-721](token-erc-721) | Smart contract demonstrating how to create and transfer non-fungible tokens using an account-based model. | [README](token-erc-721/README.md) |
| [High throughput](high-throughput) | Learn how you can design your smart contract to avoid transaction collisions in high volume environments. | [README](high-throughput/README.md) |
| [Simple Auction](auction-simple) | Run an auction where bids are kept private until the auction is closed, after which users can reveal their bid. | [README](auction-simple/README.md) |
| [Dutch Auction](auction-dutch) | Run an auction in which multiple items of the same type can be sold to more than one buyer. This example also includes the ability to add an auditor organization. | [README](auction-dutch/README.md) |
Please visit the [installation instructions](http://hyperledger-fabric.readthedocs.io/en/latest/samples.html).
## License <aname="license"></a>
Hyperledger Project source code files are made available under the Apache License, Version 2.0 (Apache-2.0), located in the [LICENSE](LICENSE) file. Hyperledger Project documentation files are made available under the Creative Commons Attribution 4.0 International License (CC-BY-4.0), available at http://creativecommons.org/licenses/by/4.0/.
Hyperledger Project source code files are made available under the Apache
License, Version 2.0 (Apache-2.0), located in the [LICENSE](LICENSE) file.
Hyperledger Project documentation files are made available under the Creative
Commons Attribution 4.0 International License (CC-BY-4.0), available at http://creativecommons.org/licenses/by/4.0/.
If you think you have discovered a security issue in any of the Hyperledger projects, we'd love to hear from you. We will take all security bugs seriously and if confirmed upon investigation we will patch it within a reasonable amount of time and release a public security bulletin discussing the impact and credit the discoverer.
There are two ways to report a security bug. The easiest is to email a description of the flaw and any related information (e.g. reproduction steps, version) to [security at hyperledger dot org](mailto:security@hyperledger.org).
The other way is to file a confidential security bug in the repository's [security advisories page](https://github.com/hyperledger/fabric/security/advisories). Guidance can be found in the GitHub documentation on [privately reporting a security vulnerability](https://docs.github.com/en/code-security/security-advisories/guidance-on-reporting-and-writing/privately-reporting-a-security-vulnerability).
The process by which the Hyperledger Security Team handles security bugs is documented further in our [Defect Response page](https://lf-hyperledger.atlassian.net/wiki/spaces/SEC/pages/20283618/Defect+Response) on our [wiki](https://lf-hyperledger.atlassian.net/wiki).
The `asset-transfer-abac` sample demonstrates the use of Attribute-based access control within the context of a simple asset transfer scenario. The sample also uses authorization based on individual client identities to allow the users that interact with the network to own assets on the blockchain ledger.
Attribute-Based Access Control (ABAC) refers to the ability to restrict access to certain functionality within a smart contract based on the attributes within a users certificate. For example, you may want certain functions within a smart contract to be used only by application administrators. ABAC allows organizations to provide elevated access to certain users without requiring those users be administrators of the network. For more information, see [Attribute-based access control](https://hyperledger-fabric-ca.readthedocs.io/en/latest/users-guide.html#attribute-based-access-control) in the Fabric CA users guide.
The `asset-transfer-abac` smart contract allows you to create assets that can be updated or transferred by the asset owner. However, the ability to create or remove assets from the ledger is restricted to identities with the `abac.creator=true` attribute. The identity that creates the asset is assigned as the asset owner. Only the owner can transfer the asset to a new owner or update the asset properties. In the course of the tutorial, we will use the Fabric CA client to create identities with the attribute required to create a new asset. We will then transfer the asset to another identity and demonstrate how the `GetID()` function can be used to enforce asset ownership. We will then use the owner identity to delete the asset. Both Attribute based access control and the `GetID()` function are provided by the [Client Identity Chaincode Library](https://github.com/hyperledger/fabric-chaincode-go/blob/master/pkg/cid/README.md).
## Start the network and deploy the smart contract
We can use the Fabric test network to deploy and interact with the `asset-transfer-abac` smart contract. Run the following command to change into the test network directory and bring down any running nodes:
```
cd fabric-samples/test-network
./network.sh down
```
Run the following command to deploy the test network using Certificate Authorities:
```
./network.sh up createChannel -ca
```
You can then use the test network script to deploy the `asset-transfer-abac` smart contract to a channel on the network:
```
./network.sh deployCC -ccn abac -ccp ../asset-transfer-abac/chaincode-go/ -ccl go
```
## Register identities with attributes
We can use the one of the test network Certificate Authorities to register and enroll identities with the attribute of `abac.creator=true`. First, we need to set the following environment variables in order to use the Fabric CA client.
```
export PATH=${PWD}/../bin:${PWD}:$PATH
export FABRIC_CFG_PATH=$PWD/../config/
```
We will create the identities using the Org1 CA. Set the Fabric CA client home to the MSP of the Org1 CA admin:
There are two ways to generate certificates with attributes added. We will use both methods and create two identities in the process. The first method is to specify that the attribute be added to the certificate by default when the identity is registered. The following command will register an identity named creator1 with the attribute of `abac.creator=true`.
The `ecert` suffix adds the attribute to the certificate automatically when the identity is enrolled. As a result, the following enroll command will contain the attribute that was provided in the registration command.
The second method is to request that the attribute be added upon enrollment. The following command will register an identity named creator2 with the same `abac.creator` attribute.
You can use either identity with the `abac.creator=true` attribute to create an asset using the `asset-transfer-abac` smart contract. We will set the following environment variables to use the first identity that was generated, creator1:
The result will list the creator1 identity as the asset owner. The `GetID()` API reads the name and issuer from the certificate of the identity that submitted the transaction and assigns that identity as the asset owner:
As the owner of Asset1, the creator1 identity has the ability to transfer the asset to another owner. In order to transfer the asset, the owner needs to provide the name and issuer of the new owner to the `TransferAsset` function. The `asset-transfer-abac` smart contract has a `GetSubmittingClientIdentity` function that allows users to retrieve their certificate information and provide it to the asset owner out of band (we omit this step). Issue the command below to transfer Asset1 to the user1 identity from Org1 that was created when the test network was deployed:
Now that the asset has been transferred, the new owner can update the asset properties. The smart contract uses the `GetID()` API to ensure that the update is being submitted by the asset owner. To demonstrate the difference between identity and attribute based access control, lets try to update the asset using the creator1 identity first:
Even though creator1 can create new assets, the smart contract detects that the transaction was not submitted by the identity that owns the asset, user1. The command returns the following error:
```
Error: endorsement failure during invoke. response: status:500 message:"submitting client not authorized to update asset, does not own asset"
```
Run the following command to operate as the asset owner by setting the MSP path to User1:
We can now update the asset. Run the following command to change the asset color from blue to green. All other aspects of the asset will remain unchanged.
While we are operating as User1, we can demonstrate attribute based access control by trying to create an asset using an identity without the `abac.creator=true` attribute. Run the following command to try to create Asset1 as User1:
The smart contract will return the following error:
```
Error: endorsement failure during invoke. response: status:500 message:"submitting client not authorized to create asset, does not have abac.creator role"
```
## Clean up
When you are finished, you can run the following command to bring down the test network:
- Connecting a client application to a Fabric blockchain network.
- Submitting smart contract transactions to update ledger state.
- Evaluating smart contract transactions to query ledger state.
- Handling errors in transaction invocation.
## About the sample
This sample includes smart contract and application code in multiple languages. This sample shows create, read, update, transfer and delete of an asset.
For a more detailed walk-through of the application code and client API usage, refer to the [Running a Fabric Application tutorial](https://hyperledger-fabric.readthedocs.io/en/latest/write_first_app.html) in the main Hyperledger Fabric documentation.
### Application
Follow the execution flow in the client application code, and corresponding output on running the application. Pay attention to the sequence of:
- Transaction invocations (console output like "**--> Submit Transaction**" and "**--> Evaluate Transaction**").
- Results returned by transactions (console output like "**\*\*\* Result**").
### Smart Contract
The smart contract (in folder `chaincode-xyz`) implements the following functions to support the application:
- CreateAsset
- ReadAsset
- UpdateAsset
- DeleteAsset
- TransferAsset
Note that the asset transfer implemented by the smart contract is a simplified scenario, without ownership validation, meant only to demonstrate how to invoke transactions.
## Running the sample
The Fabric test network is used to deploy and run this sample. Follow these steps in order:
1. Create the test network and a channel (from the `test-network` folder).
```
./network.sh up createChannel -c mychannel -ca
```
1. Deploy one of the smart contract implementations (from the `test-network` folder).
- To deploy the **TypeScript** chaincode implementation:
1. Run the application (from the `asset-transfer-basic` folder).
- To run the **TypeScript** sample application:
```shell
cd application-gateway-typescript
npm install
npm start
```
- To run the **JavaScript** sample application:
```shell
cd application-gateway-javascript
npm install
npm start
```
- To run the **Go** sample application:
```shell
cd application-gateway-go
go run .
```
- To run the **Java** sample application:
```shell
cd application-gateway-java
./gradlew run
```
## Clean up
When you are finished, you can bring down the test network (from the `test-network` folder). The command will remove all the nodes of the test network, and delete any ledger data that you created.
// Submit transaction, passing in the wrong number of arguments ,expected to throw an error containing details of any error responses from the smart contract.
fmt.Printf("Timeout waiting for transaction %s commit status: %s\n",commitStatusErr.TransactionID,commitStatusErr)
}else{
fmt.Printf("Error obtaining commit status for transaction %s with gRPC status %v: %s\n",commitStatusErr.TransactionID,status.Code(commitStatusErr),commitStatusErr)
}
}elseiferrors.As(err,&transactionErr){
// The error could be an EndorseError, SubmitError or CommitError.
This sample provides an introduction to how to use external builder and launcher scripts to run chaincode as an external service to your peer. For more information, see the [Chaincode as an external service](https://hyperledger-fabric.readthedocs.io/en/latest/cc_service.html) topic in the Fabric documentation.
**Note:** each organization in a real network would need to setup and host their own instance of the external service. In this tutorial, we use the same instance for both organizations for simplicity.
## Setting up the external builder and launcher
External Builders and Launchers is an advanced feature that typically requires custom packaging of the peer image so that it contains all the tools your builder and launcher require. This sample uses very simple (and crude) shell scripts that can be run directly within the default Fabric peer images.
Open the `config/core.yaml` file at the top of the `fabric-samples` directory. If you do not have this file, follow the instructions to [Install the Samples, Binaries and Docker Images](https://hyperledger-fabric.readthedocs.io/en/latest/install.html) to download the Fabric binaries and configuration files alongside the Fabric samples.
Modify the `externalBuilders` field in the `core.yaml` file to resemble the configuration below:
This update sets the name of the external builder as `external-sample-builder`, and the path of the builder to the scripts provided in this sample. Note that this is the path within the peer container, not your local machine.
To set the path within the peer container, you will need to modify the docker compose file to mount a couple of additional volumes. Open the file `test-network/compose/docker/docker-compose-test-net.yaml`, and add to the `volumes` section of both `peer0.org1.example.com` and `peer0.org2.example.com` the following two lines:
This update will mount the `core.yaml` that you modified into the peer container and override the configuration file within the peer image. The update also mounts the fabric-sample builder so that it can be found at the location that you specified in `core.yaml`. You also have the option of commenting out the line `- /var/run/docker.sock:/host/var/run/docker.sock`, since we no longer need to access the docker daemon from inside the peer container to launch the chaincode.
## Packaging and installing Chaincode
The Asset-Transfer-Basic external chaincode requires two environment variables to run, `CHAINCODE_SERVER_ADDRESS` and `CHAINCODE_ID`, which are described and set in the `chaincode.env` file.
You need to provide a `connection.json` configuration file to your peer in order to connect to the external Asset-Transfer-Basic service. The address specified in the `connection.json` must correspond to the `CHAINCODE_SERVER_ADDRESS` value in `chaincode.env`, which is `asset-transfer-basic.org1.example.com:9999` in our example.
Because we will run our chaincode as an external service, the chaincode itself does not need to be included in the chaincode
package that gets installed to each peer. Only the configuration and metadata information needs to be included
in the package. Since the packaging is trivial, we can manually create the chaincode package.
Open a new terminal and navigate to the `fabric-samples/asset-transfer-basic/chaincode-external` directory.
```
cd fabric-samples/asset-transfer-basic/chaincode-external
```
First, create a `code.tar.gz` archive containing the `connection.json` file:
```
tar cfz code.tar.gz connection.json
```
Then, create the chaincode package, including the `code.tar.gz` file and the supplied `metadata.json` file:
```
tar cfz asset-transfer-basic-external.tgz metadata.json code.tar.gz
```
You are now ready to deploy the external chaincode sample.
## Starting the test network
We will use the Fabric test network to run the external chaincode. Open a new terminal and navigate to the `fabric-samples/test-network` directory.
```
cd fabric-samples/test-network
```
Run the following command to deploy the test network and create a new channel:
```
./network.sh up createChannel -c mychannel -ca
```
We are now ready to deploy the external chaincode.
## Installing the external chaincode
We can't use the test network script to install an external chaincode so we will have to do a bit more work. However, we can still leverage part of the test-network scripts to make this easier.
From the `test-network` directory, set the following environment variables to use the Fabric binaries:
```
export PATH=${PWD}/../bin:$PATH
export FABRIC_CFG_PATH=$PWD/../config/
```
Run the following command to import functions from the `envVar.sh` script into your terminal. These functions allow you to act as either test network organization.
```
. ./scripts/envVar.sh
```
Run the following commands to install the `asset-transfer-basic-external.tar.gz` chaincode on org1. The `setGlobals` function simply sets the environment variables that allow you to act as org1 or org2.
Save the package ID that was returned by the command as an environment variable. The ID will not be the same for all users, so you need to set the variable using the ID from your command window:
## Running the Asset-Transfer-Basic external service
We are going to run the smart contract as an external service by first building and then starting a docker container. Open a new terminal and navigate back to the `chaincode-external` directory:
```
cd fabric-samples/asset-transfer-basic/chaincode-external
```
In this directory, open the `chaincode.env` file to set the `CHAINCODE_ID` variable to the same package ID that was returned by the `peer lifecycle chaincode queryinstalled` command. The value should be the same as the environment variable that you set in the previous terminal.
After you edit the `chaincode.env` file, you can use the `Dockerfile` to build an image of the external Asset-Transfer-Basic chaincode:
This will start and run the external chaincode service within the container.
## Deploy the Asset-Transfer-Basic external chaincode definition to the channel
Navigate back to the `test-network` directory to finish deploying the chaincode definition of the external smart contract to the channel. Make sure that your environment variables are still set.
The commands above approve the chaincode definition for the external chaincode and commits the definition to the channel. The resulting output should be similar to the following:
```
2020-08-05 15:41:44.982 PDT [chaincodeCmd] ClientWait -> INFO 001 txid [6bdbe040b99a45cc90a23ec21f02ea5da7be8b70590eb04ff3323ef77fdedfc7] committed with status (VALID) at localhost:7051
2020-08-05 15:41:44.983 PDT [chaincodeCmd] ClientWait -> INFO 002 txid [6bdbe040b99a45cc90a23ec21f02ea5da7be8b70590eb04ff3323ef77fdedfc7] committed with status (VALID) at localhost:9051
```
Now that we have started the chaincode service and deployed it to the channel, we can submit transactions as we would with a normal chaincode.
## Using the Asset-Transfer-Basic external chaincode
Open yet another terminal and navigate to the `fabric-samples/asset-transfer-basic/application-gateway-go` directory:
```
cd fabric-samples/asset-transfer-basic/application-gateway-go
```
Run the following commands to use the node application in this directory to test the external smart contract:
```
go run .
```
If all goes well, the program should run exactly the same as described in the "Writing Your First Application" tutorial.
## Enabling TLS for chaincode and peer communication
**Note:** This section uses an example of self-signed certificate. You may use your organization hosted CA to issue the certificate and generate a key for production deployment.
In the sample so far, you connected both peers in `test-network` to the single instance of chaincode server. However, if you would like to enable TLS between the peer nodes and the chaincode server, each peer node needs to have its own CA certificate. Enabling TLS is made possible at runtime in the chaincode.
- As a first step generate a keypair that can be used. Run these commands from the `fabric-samples/asset-transfer-basic/chaincode-external` directory.
_Find instructions to install `openssl` in [openssl.org](https://www.openssl.org/)_
- Generate a client key and cert for auth purpose. You need a key and cert generated from the CA of each organization. Peer nodes act as clients to chaincode server.
- Change the `connection.json` with the below contents. The `root_cert` parameter is the root CA certificate which the chaincode server is run with. You may run the below commands to get the certificate file contents as strings and copy them when needed.
- Follow the instructions in [Package](#packaging-and-installing-chaincode) and [Install](#installing-the-external-chaincode) steps for each organization. Remember that the chaincode server's address for the second organization is `asset-transfer-basic.org2.example.com:9999`.
- Copy the appropriate `CHAINCODE_ID` to both [chaincode1.env](./chaincode1.env) and [chaincode2.env](./chaincode2.env) files. Bring up the chaincode containers using the docker-compose command below
```
docker-compose up -f docker-compose-chaincode.yaml up --build -d
```
- Follow the instructions in [Finish Deployment](#finish-deploying-the-asset-transfer-basic-external-chaincode-) for each organization seperately.