Compare commits

...

535 commits

Author SHA1 Message Date
James Taylor
a2c40e6522
test-network-k8s: ghcr.io for Hyperledger images (#1416)
Some checks failed
Test Network BFT Orderer 🍟 / basic (java, cryptogen) (push) Has been cancelled
Test Network BFT Orderer 🍟 / basic (javascript, ca) (push) Has been cancelled
Test Network BFT Orderer 🍟 / basic (javascript, cryptogen) (push) Has been cancelled
Test Network BFT Orderer 🍟 / basic (typescript, ca) (push) Has been cancelled
Test Network BFT Orderer 🍟 / basic (typescript, cryptogen) (push) Has been cancelled
Test Network Events 💡 / events (go, events) (push) Has been cancelled
Test Network Events 💡 / events (java, events) (push) Has been cancelled
Test Network Events 💡 / events (javascript, events) (push) Has been cancelled
Test Network HSM 🍏 / hsm (go) (push) Has been cancelled
Test Network HSM 🍏 / hsm (java) (push) Has been cancelled
Test Network HSM 🍏 / hsm (javascript) (push) Has been cancelled
Test Network HSM 🍏 / hsm (typescript) (push) Has been cancelled
Kubernetes Test Network 🍒 / ccaas-java (push) Has been cancelled
Kubernetes Test Network 🍒 / ccaas-external (push) Has been cancelled
Kubernetes Test Network 🍒 / k8s-builder (push) Has been cancelled
Kubernetes Test Network 🍒 / multi-namespace (push) Has been cancelled
Kubernetes Test Network 🍒 / bft-orderer (push) Has been cancelled
Test Network Ledger 🥑 / basic (go, ledger) (push) Has been cancelled
Test Network Ledger 🥑 / basic (javascript, ledger) (push) Has been cancelled
Test Network Ledger 🥑 / basic (typescript, ledger) (push) Has been cancelled
Test Network Off Chain 🍔 / off-chain (go) (push) Has been cancelled
Test Network Off Chain 🍔 / off-chain (java) (push) Has been cancelled
Test Network Off Chain 🍔 / off-chain (javascript) (push) Has been cancelled
Test Network Off Chain 🍔 / off-chain (typescript) (push) Has been cancelled
Test Network Private 🔒 / private (go, private) (push) Has been cancelled
Test Network Private 🔒 / private (java, private) (push) Has been cancelled
Test Network Private 🔒 / private (typescript, private) (push) Has been cancelled
Test Network SBE 🎵 / SBE (java, sbe) (push) Has been cancelled
Test Network SBE 🎵 / SBE (typescript, sbe) (push) Has been cancelled
Test Network Secured 🔔 / secured (go, secured) (push) Has been cancelled
Default to using ghcr.io for Hyperledger images in the k8s test network

Signed-off-by: James Taylor <jamest@uk.ibm.com>
2026-05-21 11:30:24 +01:00
Arnav Vinod Deshpande
d999452f88
weak ordering implementation in sort.slice (#1414)
Signed-off-by: rootp1 <arnav.iitr@gmail.com>
2026-05-05 11:47:26 +01:00
dependabot[bot]
bf7e75c6c1
Bump actions/upload-artifact from 7.0.0 to 7.0.1 (#1401)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-13 10:36:17 +01:00
dependabot[bot]
33ecb67a89 Bump the npm_and_yarn group across 2 directories with 1 update
Bumps the npm_and_yarn group with 1 update in the /asset-transfer-basic/rest-api-typescript directory: [axios](https://github.com/axios/axios).
Bumps the npm_and_yarn group with 1 update in the /full-stack-asset-transfer-guide/applications/conga-cards directory: [axios](https://github.com/axios/axios).


Updates `axios` from 1.13.5 to 1.15.0
- [Release notes](https://github.com/axios/axios/releases)
- [Changelog](https://github.com/axios/axios/blob/v1.x/CHANGELOG.md)
- [Commits](https://github.com/axios/axios/compare/v1.13.5...v1.15.0)

Updates `axios` from 1.13.5 to 1.15.0
- [Release notes](https://github.com/axios/axios/releases)
- [Changelog](https://github.com/axios/axios/blob/v1.x/CHANGELOG.md)
- [Commits](https://github.com/axios/axios/compare/v1.13.5...v1.15.0)

---
updated-dependencies:
- dependency-name: axios
  dependency-version: 1.15.0
  dependency-type: indirect
  dependency-group: npm_and_yarn
- dependency-name: axios
  dependency-version: 1.15.0
  dependency-type: direct:production
  dependency-group: npm_and_yarn
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-13 12:32:39 +09:00
dependabot[bot]
da2240f993
Bump actions/upload-artifact from 6.0.0 to 7.0.0 (#1389)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-02 10:12:58 +00:00
dependabot[bot]
d845f6f47b
Bump @angular/core in rest-api-typescript (#1388)
- 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>
2026-02-27 11:29:33 +00:00
dependabot[bot]
3ec2523ec7
Bump asset-transfer-basic/rest-api-typescript dependencies (#1381)
- 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>
2026-02-27 09:48:51 +00:00
Mark S. Lewis
80a29f44af
Update Fabric to v2.5.15 and v3.1.4 (#1385)
These Fabric versions resolve compatibility issues with Docker engine
v29.

Signed-off-by: Mark S. Lewis <Mark.S.Lewis@outlook.com>
2026-02-27 11:14:28 +09:00
Mark S. Lewis
42ff1e629b
Fix ESLint failures (#1386)
- 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>
2026-02-26 13:20:40 +09:00
dependabot[bot]
4f70b668aa
Bump token-sdk indirect dependencies (#1382)
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>
2026-02-22 20:45:07 +00:00
Tatsuya Sato
385a35b744
Fix KIND cluster creation for test-network-k8s (#1375)
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>
2026-02-09 10:16:42 +00:00
dependabot[bot]
d669a3fccf
Bump actions/checkout from 5 to 6 (#1365)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-24 11:51:42 +00:00
Mark S. Lewis
5e9b5f725b Remove empty test-network Docker Compose files
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>
2025-11-17 13:29:14 -05:00
Mark S. Lewis
bdaeac199d
Update Go error handling for v1.10 client API (#1362)
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>
2025-11-10 09:53:58 +09:00
Mark S. Lewis
f865a9ea51
Fix private-data TypeScript chaincode (#1357)
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>
2025-11-04 10:55:27 -05:00
Mark S. Lewis
a72b2b5132
Remove obsolete version element from compose files (#1361)
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>
2025-11-04 10:52:28 -05:00
dulanting
a35f8b7cfc chore: remove repetitive words
Signed-off-by: dulanting <dulanting@outlook.jp>
2025-10-28 17:13:19 +09:00
dependabot[bot]
be2b835d4c
Bump brace-expansion from 1.1.11 to 1.1.12 (#1350)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-24 22:40:24 +01:00
Mark S. Lewis
c5539270f6
Update runtime and tool versions (#1354)
- 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>
2025-10-21 13:04:55 -04:00
dependabot[bot]
918077e4de
Bump actions/setup-java from 4 to 5 (#1346)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-21 10:55:07 +01:00
dependabot[bot]
74b73003e4
Bump actions/setup-node from 5 to 6 (#1355)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-21 09:57:36 +01:00
dependabot[bot]
dd3aab87ce
Bump quic-go from 0.48.2 to 0.49.1 (#1353)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-21 09:50:10 +01:00
dependabot[bot]
301db81411
Bump actions/checkout from 4 to 5 (#1345)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-19 00:56:35 +01:00
Mark S. Lewis
62f51d3efb
Support Java 25 (#1352)
- 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>
2025-10-06 12:26:52 -04:00
Mark S. Lewis
6130e1b9e8
Fix high-throughput sample (#1351)
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>
2025-10-06 21:36:09 +09:00
dependabot[bot]
ad1950554d
Bump actions/setup-node from 4 to 5 (#1348)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-09 09:35:08 +01:00
Mark S. Lewis
1a0afd858d
Use Gradle wrapper in asset-transfer-ledger-queries (#1349)
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>
2025-09-09 10:08:28 +09:00
dependabot[bot]
7f0f4a24fa
Bump the go_modules group across 17 directories with 2 updates (#1342)
- 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>
2025-07-28 18:10:42 +01:00
dependabot[bot]
5c09f5d619
Bump the go_modules group across 5 directories with 3 updates (#1341)
- 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>
2025-07-28 14:09:02 +01:00
James Taylor
4dd37dd29b
test-network-k8s: bump fabric-builder-k8s (#1340)
Signed-off-by: James Taylor <jamest@uk.ibm.com>
2025-07-28 12:33:42 +01:00
dependabot[bot]
7e1ddbccc0 Bump the go_modules group across 6 directories with 4 updates
Bumps the go_modules group with 1 update in the /high-throughput/application-go directory: [golang.org/x/net](https://github.com/golang/net).
Bumps the go_modules group with 2 updates in the /high-throughput/chaincode-go directory: [golang.org/x/net](https://github.com/golang/net) and google.golang.org/protobuf.
Bumps the go_modules group with 4 updates in the /token-sdk/auditor directory: [golang.org/x/net](https://github.com/golang/net), google.golang.org/protobuf, [github.com/golang/glog](https://github.com/golang/glog) and [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang).
Bumps the go_modules group with 2 updates in the /token-sdk/e2e directory: [golang.org/x/net](https://github.com/golang/net) and google.golang.org/protobuf.
Bumps the go_modules group with 4 updates in the /token-sdk/issuer directory: [golang.org/x/net](https://github.com/golang/net), google.golang.org/protobuf, [github.com/golang/glog](https://github.com/golang/glog) and [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang).
Bumps the go_modules group with 4 updates in the /token-sdk/owner directory: [golang.org/x/net](https://github.com/golang/net), google.golang.org/protobuf, [github.com/golang/glog](https://github.com/golang/glog) and [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang).


Updates `golang.org/x/net` from 0.41.0 to 0.42.0
- [Commits](https://github.com/golang/net/compare/v0.41.0...v0.42.0)

Updates `golang.org/x/net` from 0.41.0 to 0.42.0
- [Commits](https://github.com/golang/net/compare/v0.41.0...v0.42.0)

Updates `golang.org/x/net` from 0.41.0 to 0.42.0
- [Commits](https://github.com/golang/net/compare/v0.41.0...v0.42.0)

Updates `golang.org/x/net` from 0.41.0 to 0.42.0
- [Commits](https://github.com/golang/net/compare/v0.41.0...v0.42.0)

Updates `golang.org/x/net` from 0.41.0 to 0.42.0
- [Commits](https://github.com/golang/net/compare/v0.41.0...v0.42.0)

Updates `golang.org/x/net` from 0.41.0 to 0.42.0
- [Commits](https://github.com/golang/net/compare/v0.41.0...v0.42.0)

Updates `golang.org/x/net` from 0.9.0 to 0.38.0
- [Commits](https://github.com/golang/net/compare/v0.41.0...v0.42.0)

Updates `google.golang.org/protobuf` from 1.30.0 to 1.33.0

Updates `golang.org/x/net` from 0.9.0 to 0.38.0
- [Commits](https://github.com/golang/net/compare/v0.41.0...v0.42.0)

Updates `google.golang.org/protobuf` from 1.30.0 to 1.33.0

Updates `golang.org/x/net` from 0.9.0 to 0.38.0
- [Commits](https://github.com/golang/net/compare/v0.41.0...v0.42.0)

Updates `google.golang.org/protobuf` from 1.30.0 to 1.33.0

Updates `golang.org/x/net` from 0.9.0 to 0.38.0
- [Commits](https://github.com/golang/net/compare/v0.41.0...v0.42.0)

Updates `google.golang.org/protobuf` from 1.30.0 to 1.33.0

Updates `golang.org/x/net` from 0.9.0 to 0.38.0
- [Commits](https://github.com/golang/net/compare/v0.41.0...v0.42.0)

Updates `google.golang.org/protobuf` from 1.30.0 to 1.33.0

Updates `golang.org/x/net` from 0.9.0 to 0.38.0
- [Commits](https://github.com/golang/net/compare/v0.41.0...v0.42.0)

Updates `google.golang.org/protobuf` from 1.30.0 to 1.33.0

Updates `golang.org/x/net` from 0.28.0 to 0.38.0
- [Commits](https://github.com/golang/net/compare/v0.41.0...v0.42.0)

Updates `google.golang.org/protobuf` from 1.33.0 to 1.36.6

Updates `golang.org/x/net` from 0.28.0 to 0.38.0
- [Commits](https://github.com/golang/net/compare/v0.41.0...v0.42.0)

Updates `google.golang.org/protobuf` from 1.33.0 to 1.36.6

Updates `github.com/golang/glog` from 1.1.0 to 1.2.4
- [Release notes](https://github.com/golang/glog/releases)
- [Commits](https://github.com/golang/glog/compare/v1.1.0...v1.2.4)

Updates `github.com/prometheus/client_golang` from 1.19.1 to 1.22.0
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v1.19.1...v1.22.0)

Updates `golang.org/x/net` from 0.28.0 to 0.38.0
- [Commits](https://github.com/golang/net/compare/v0.41.0...v0.42.0)

Updates `google.golang.org/protobuf` from 1.33.0 to 1.36.6

Updates `golang.org/x/net` from 0.28.0 to 0.38.0
- [Commits](https://github.com/golang/net/compare/v0.41.0...v0.42.0)

Updates `google.golang.org/protobuf` from 1.33.0 to 1.36.6

Updates `github.com/golang/glog` from 1.1.0 to 1.2.4
- [Release notes](https://github.com/golang/glog/releases)
- [Commits](https://github.com/golang/glog/compare/v1.1.0...v1.2.4)

Updates `github.com/prometheus/client_golang` from 1.19.1 to 1.22.0
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v1.19.1...v1.22.0)

Updates `golang.org/x/net` from 0.28.0 to 0.38.0
- [Commits](https://github.com/golang/net/compare/v0.41.0...v0.42.0)

Updates `google.golang.org/protobuf` from 1.33.0 to 1.36.6

Updates `github.com/golang/glog` from 1.1.0 to 1.2.4
- [Release notes](https://github.com/golang/glog/releases)
- [Commits](https://github.com/golang/glog/compare/v1.1.0...v1.2.4)

Updates `github.com/prometheus/client_golang` from 1.19.1 to 1.22.0
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v1.19.1...v1.22.0)

Updates `golang.org/x/net` from 0.28.0 to 0.38.0
- [Commits](https://github.com/golang/net/compare/v0.41.0...v0.42.0)

Updates `google.golang.org/protobuf` from 1.33.0 to 1.36.6

Updates `golang.org/x/net` from 0.21.0 to 0.38.0
- [Commits](https://github.com/golang/net/compare/v0.41.0...v0.42.0)

Updates `google.golang.org/protobuf` from 1.33.0 to 1.36.6

Updates `golang.org/x/net` from 0.21.0 to 0.38.0
- [Commits](https://github.com/golang/net/compare/v0.41.0...v0.42.0)

Updates `google.golang.org/protobuf` from 1.33.0 to 1.36.6

Updates `golang.org/x/net` from 0.21.0 to 0.38.0
- [Commits](https://github.com/golang/net/compare/v0.41.0...v0.42.0)

Updates `google.golang.org/protobuf` from 1.33.0 to 1.36.6

Updates `golang.org/x/net` from 0.21.0 to 0.38.0
- [Commits](https://github.com/golang/net/compare/v0.41.0...v0.42.0)

Updates `google.golang.org/protobuf` from 1.33.0 to 1.36.6

Updates `golang.org/x/net` from 0.21.0 to 0.38.0
- [Commits](https://github.com/golang/net/compare/v0.41.0...v0.42.0)

Updates `google.golang.org/protobuf` from 1.33.0 to 1.36.6

Updates `golang.org/x/net` from 0.21.0 to 0.38.0
- [Commits](https://github.com/golang/net/compare/v0.41.0...v0.42.0)

Updates `google.golang.org/protobuf` from 1.33.0 to 1.36.6

Updates `golang.org/x/net` from 0.28.0 to 0.38.0
- [Commits](https://github.com/golang/net/compare/v0.41.0...v0.42.0)

Updates `google.golang.org/protobuf` from 1.33.0 to 1.36.6

Updates `golang.org/x/net` from 0.28.0 to 0.38.0
- [Commits](https://github.com/golang/net/compare/v0.41.0...v0.42.0)

Updates `google.golang.org/protobuf` from 1.33.0 to 1.36.6

Updates `github.com/golang/glog` from 1.1.0 to 1.2.4
- [Release notes](https://github.com/golang/glog/releases)
- [Commits](https://github.com/golang/glog/compare/v1.1.0...v1.2.4)

Updates `github.com/prometheus/client_golang` from 1.19.1 to 1.22.0
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v1.19.1...v1.22.0)

Updates `golang.org/x/net` from 0.28.0 to 0.38.0
- [Commits](https://github.com/golang/net/compare/v0.41.0...v0.42.0)

Updates `google.golang.org/protobuf` from 1.33.0 to 1.36.6

Updates `golang.org/x/net` from 0.28.0 to 0.38.0
- [Commits](https://github.com/golang/net/compare/v0.41.0...v0.42.0)

Updates `google.golang.org/protobuf` from 1.33.0 to 1.36.6

Updates `github.com/golang/glog` from 1.1.0 to 1.2.4
- [Release notes](https://github.com/golang/glog/releases)
- [Commits](https://github.com/golang/glog/compare/v1.1.0...v1.2.4)

Updates `github.com/prometheus/client_golang` from 1.19.1 to 1.22.0
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v1.19.1...v1.22.0)

Updates `golang.org/x/net` from 0.28.0 to 0.38.0
- [Commits](https://github.com/golang/net/compare/v0.41.0...v0.42.0)

Updates `google.golang.org/protobuf` from 1.33.0 to 1.36.6

Updates `github.com/golang/glog` from 1.1.0 to 1.2.4
- [Release notes](https://github.com/golang/glog/releases)
- [Commits](https://github.com/golang/glog/compare/v1.1.0...v1.2.4)

Updates `github.com/prometheus/client_golang` from 1.19.1 to 1.22.0
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v1.19.1...v1.22.0)

Updates `golang.org/x/net` from 0.28.0 to 0.38.0
- [Commits](https://github.com/golang/net/compare/v0.41.0...v0.42.0)

Updates `google.golang.org/protobuf` from 1.33.0 to 1.36.6

Updates `golang.org/x/net` from 0.28.0 to 0.38.0
- [Commits](https://github.com/golang/net/compare/v0.41.0...v0.42.0)

Updates `google.golang.org/protobuf` from 1.33.0 to 1.36.6

Updates `golang.org/x/net` from 0.28.0 to 0.38.0
- [Commits](https://github.com/golang/net/compare/v0.41.0...v0.42.0)

Updates `google.golang.org/protobuf` from 1.33.0 to 1.36.6

Updates `github.com/golang/glog` from 1.1.0 to 1.2.4
- [Release notes](https://github.com/golang/glog/releases)
- [Commits](https://github.com/golang/glog/compare/v1.1.0...v1.2.4)

Updates `github.com/prometheus/client_golang` from 1.19.1 to 1.22.0
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v1.19.1...v1.22.0)

Updates `golang.org/x/net` from 0.28.0 to 0.38.0
- [Commits](https://github.com/golang/net/compare/v0.41.0...v0.42.0)

Updates `google.golang.org/protobuf` from 1.33.0 to 1.36.6

Updates `golang.org/x/net` from 0.28.0 to 0.38.0
- [Commits](https://github.com/golang/net/compare/v0.41.0...v0.42.0)

Updates `google.golang.org/protobuf` from 1.33.0 to 1.36.6

Updates `github.com/golang/glog` from 1.1.0 to 1.2.4
- [Release notes](https://github.com/golang/glog/releases)
- [Commits](https://github.com/golang/glog/compare/v1.1.0...v1.2.4)

Updates `github.com/prometheus/client_golang` from 1.19.1 to 1.22.0
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v1.19.1...v1.22.0)

Updates `golang.org/x/net` from 0.28.0 to 0.38.0
- [Commits](https://github.com/golang/net/compare/v0.41.0...v0.42.0)

Updates `google.golang.org/protobuf` from 1.33.0 to 1.36.6

Updates `github.com/golang/glog` from 1.1.0 to 1.2.4
- [Release notes](https://github.com/golang/glog/releases)
- [Commits](https://github.com/golang/glog/compare/v1.1.0...v1.2.4)

Updates `github.com/prometheus/client_golang` from 1.19.1 to 1.22.0
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v1.19.1...v1.22.0)

Updates `golang.org/x/net` from 0.28.0 to 0.38.0
- [Commits](https://github.com/golang/net/compare/v0.41.0...v0.42.0)

Updates `google.golang.org/protobuf` from 1.33.0 to 1.36.6

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-version: 0.42.0
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: golang.org/x/net
  dependency-version: 0.42.0
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: golang.org/x/net
  dependency-version: 0.42.0
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: golang.org/x/net
  dependency-version: 0.42.0
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: golang.org/x/net
  dependency-version: 0.42.0
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: golang.org/x/net
  dependency-version: 0.42.0
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: golang.org/x/net
  dependency-version: 0.38.0
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: google.golang.org/protobuf
  dependency-version: 1.33.0
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: golang.org/x/net
  dependency-version: 0.38.0
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: google.golang.org/protobuf
  dependency-version: 1.33.0
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: golang.org/x/net
  dependency-version: 0.38.0
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: google.golang.org/protobuf
  dependency-version: 1.33.0
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: golang.org/x/net
  dependency-version: 0.38.0
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: google.golang.org/protobuf
  dependency-version: 1.33.0
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: golang.org/x/net
  dependency-version: 0.38.0
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: google.golang.org/protobuf
  dependency-version: 1.33.0
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: golang.org/x/net
  dependency-version: 0.38.0
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: google.golang.org/protobuf
  dependency-version: 1.33.0
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: golang.org/x/net
  dependency-version: 0.38.0
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: google.golang.org/protobuf
  dependency-version: 1.36.6
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: golang.org/x/net
  dependency-version: 0.38.0
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: google.golang.org/protobuf
  dependency-version: 1.36.6
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: github.com/golang/glog
  dependency-version: 1.2.4
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: github.com/prometheus/client_golang
  dependency-version: 1.22.0
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: golang.org/x/net
  dependency-version: 0.38.0
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: google.golang.org/protobuf
  dependency-version: 1.36.6
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: golang.org/x/net
  dependency-version: 0.38.0
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: google.golang.org/protobuf
  dependency-version: 1.36.6
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: github.com/golang/glog
  dependency-version: 1.2.4
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: github.com/prometheus/client_golang
  dependency-version: 1.22.0
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: golang.org/x/net
  dependency-version: 0.38.0
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: google.golang.org/protobuf
  dependency-version: 1.36.6
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: github.com/golang/glog
  dependency-version: 1.2.4
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: github.com/prometheus/client_golang
  dependency-version: 1.22.0
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: golang.org/x/net
  dependency-version: 0.38.0
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: google.golang.org/protobuf
  dependency-version: 1.36.6
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: golang.org/x/net
  dependency-version: 0.38.0
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: google.golang.org/protobuf
  dependency-version: 1.36.6
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: golang.org/x/net
  dependency-version: 0.38.0
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: google.golang.org/protobuf
  dependency-version: 1.36.6
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: golang.org/x/net
  dependency-version: 0.38.0
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: google.golang.org/protobuf
  dependency-version: 1.36.6
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: golang.org/x/net
  dependency-version: 0.38.0
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: google.golang.org/protobuf
  dependency-version: 1.36.6
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: golang.org/x/net
  dependency-version: 0.38.0
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: google.golang.org/protobuf
  dependency-version: 1.36.6
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: golang.org/x/net
  dependency-version: 0.38.0
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: google.golang.org/protobuf
  dependency-version: 1.36.6
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: golang.org/x/net
  dependency-version: 0.38.0
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: google.golang.org/protobuf
  dependency-version: 1.36.6
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: golang.org/x/net
  dependency-version: 0.38.0
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: google.golang.org/protobuf
  dependency-version: 1.36.6
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: github.com/golang/glog
  dependency-version: 1.2.4
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: github.com/prometheus/client_golang
  dependency-version: 1.22.0
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: golang.org/x/net
  dependency-version: 0.38.0
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: google.golang.org/protobuf
  dependency-version: 1.36.6
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: golang.org/x/net
  dependency-version: 0.38.0
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: google.golang.org/protobuf
  dependency-version: 1.36.6
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: github.com/golang/glog
  dependency-version: 1.2.4
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: github.com/prometheus/client_golang
  dependency-version: 1.22.0
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: golang.org/x/net
  dependency-version: 0.38.0
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: google.golang.org/protobuf
  dependency-version: 1.36.6
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: github.com/golang/glog
  dependency-version: 1.2.4
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: github.com/prometheus/client_golang
  dependency-version: 1.22.0
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: golang.org/x/net
  dependency-version: 0.38.0
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: google.golang.org/protobuf
  dependency-version: 1.36.6
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: golang.org/x/net
  dependency-version: 0.38.0
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: google.golang.org/protobuf
  dependency-version: 1.36.6
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: golang.org/x/net
  dependency-version: 0.38.0
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: google.golang.org/protobuf
  dependency-version: 1.36.6
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: github.com/golang/glog
  dependency-version: 1.2.4
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: github.com/prometheus/client_golang
  dependency-version: 1.22.0
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: golang.org/x/net
  dependency-version: 0.38.0
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: google.golang.org/protobuf
  dependency-version: 1.36.6
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: golang.org/x/net
  dependency-version: 0.38.0
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: google.golang.org/protobuf
  dependency-version: 1.36.6
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: github.com/golang/glog
  dependency-version: 1.2.4
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: github.com/prometheus/client_golang
  dependency-version: 1.22.0
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: golang.org/x/net
  dependency-version: 0.38.0
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: google.golang.org/protobuf
  dependency-version: 1.36.6
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: github.com/golang/glog
  dependency-version: 1.2.4
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: github.com/prometheus/client_golang
  dependency-version: 1.22.0
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: golang.org/x/net
  dependency-version: 0.38.0
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: google.golang.org/protobuf
  dependency-version: 1.36.6
  dependency-type: indirect
  dependency-group: go_modules
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-07-27 20:42:54 -04:00
Mark S. Lewis
4c97d4c12b
Use Fabric Gateway client API in high-throughput (#1338)
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>
2025-07-27 14:47:22 -04:00
dependabot[bot]
84089e8ee3
Bump express and @types/express (#1337)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-25 11:15:50 +01:00
Mark S. Lewis
7bee4f76d0
Update fabric-gateway to v1.8.0 (#1336)
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>
2025-07-25 17:10:49 +09:00
Mark S. Lewis
4fabd87648 Enhance Go off_chain_data for consistency
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>
2025-07-24 16:58:06 +09:00
Tatsuya Sato
cc85f96d9e
Bump fabric to v2.5.13 and v3.1.1 (#1328)
Signed-off-by: Tatsuya Sato <tatsuya.sato.so@hitachi.com>
2025-05-12 09:08:44 +01:00
David Enyeart
5fa5abbbcf Improve logging for test-network-nano-bash CA
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>
2025-04-15 09:07:30 +09:00
Aadithyan Raju
b82a309d91
NixOS support (Multi-Linux Distro Support) (#1310)
Signed-off-by: AadithyanRaju <aadithyan75@gmail.com>
Signed-off-by: Aadithyan Raju <93834376+AadithyanRaju@users.noreply.github.com>
2025-03-24 19:15:58 +00:00
Thomas Leung
16d6d751da update fabric operations console docs
Signed-off-by: Thomas Leung <thomas.leung@ibm.com>
2025-03-22 08:28:26 -04:00
Tatsuya Sato
f36309dbfe ci: Bump Fabric to v3.1.0 for BFT Orderer tests
Signed-off-by: Tatsuya Sato <tatsuya.sato.so@hitachi.com>
2025-03-18 23:45:47 -04:00
Dave Enyeart
bf0dded403
Bump couchdb to 3.4.2 (#1318)
Signed-off-by: David Enyeart <enyeart@us.ibm.com>
2025-03-18 18:57:54 +00:00
Mark S. Lewis
9df15968ce Detect node start using healthz
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>
2025-03-13 22:23:26 -04:00
Satoshi Ito
7daf8e406b Implement TypeScript version of asset-transfer-ledger-queries
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>
2025-03-14 11:13:07 +09:00
dependabot[bot]
2261bd5374
Bump the go_modules group across 26 directories with 6 updates (#1315)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-12 21:18:47 +00:00
dependabot[bot]
cfdfe967b6
Bump the npm_and_yarn group across 1 directory with 11 updates (#1252)
Bumps the npm_and_yarn group with 5 updates in the /asset-transfer-basic/rest-api-typescript directory:

| Package | From | To |
| --- | --- | --- |
| [express](https://github.com/expressjs/express) | `4.18.2` | `4.20.0` |
| [fabric-network](https://github.com/hyperledger/fabric-sdk-node) | `2.2.19` | `2.2.20` |
| [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse) | `7.22.20` | `7.25.6` |
| [braces](https://github.com/micromatch/braces) | `3.0.2` | `3.0.3` |
| [msgpackr](https://github.com/kriszyp/msgpackr) | `1.9.9` | `1.11.0` |

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-12 14:17:19 +00:00
Tatsuya Sato
9d62db6730
Bump fabric to v2.5.12 (#1314)
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>
2025-03-12 10:45:51 +00:00
Stanislav Jakuschevskij
6a5e5ddc12
Add off-chain-data go client application (#1269)
Signed-off-by: Stanislav Jakuschevskij <stas@two-giants.com>
2025-03-05 17:26:33 +00:00
Mark S. Lewis
aa0c9d3004
Pull Fabric images from GitHub Container Registry (#1307)
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>
2025-02-23 10:53:41 -05:00
Dave Enyeart
8547618f06
Fix intermittent errors with test-network ca (#1305)
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>
2025-02-21 10:41:13 +00:00
Dave Enyeart
50699a6801
Fix intermittent errors with test-network ca (#1304)
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>
2025-02-20 22:14:35 +00:00
David Enyeart
e1d8779f2a Add connection profile to test-network-nano-bash
Add connection profile to test-network-nano-bash
to enable legacy SDK apps.

Signed-off-by: David Enyeart <enyeart@us.ibm.com>
2025-02-19 15:21:29 +09:00
Dave Enyeart
839f79343b
Fix test-network-nano-bash orderer4 enrollment (#1302)
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>
2025-02-18 19:48:25 +00:00
Tatsuya Sato
63bb2282fe
test-network: Add support for using BFT consensus with CA (#1301)
Signed-off-by: Tatsuya Sato <tatsuya.sato.so@hitachi.com>
2025-02-18 17:44:43 +00:00
Mark S. Lewis
5e91d365d4 Update to Go 1.23
Go 1.24 was released on 2025-02-11. At this point Go 1.22 become an
unsupported Go runtime.

Signed-off-by: Mark S. Lewis <Mark.S.Lewis@outlook.com>
2025-02-12 08:34:17 -05:00
Dave Enyeart
0126ca518e
Update CA server bin path in test-network-nano-bash (#1299)
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>
2025-02-12 11:10:10 +00:00
Tatsuya Sato
b8d462c22a
Bump fabric to v2.5.11 (#1298)
Signed-off-by: Tatsuya Sato <tatsuya.sato.so@hitachi.com>
2025-02-03 09:52:12 +00:00
Tatsuya Sato
31c8ef0197
test-network-k8s: Add documentation for initial BFT orderer support (#1297)
Signed-off-by: Tatsuya Sato <tatsuya.sato.so@hitachi.com>
2025-01-30 14:20:18 +00:00
Tatsuya Sato
fcb6e69e0d
CI: Add BFT Orderer support (#1296)
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>
2025-01-29 09:47:34 +00:00
Tatsuya Sato
714bcb0a9f
test-network-k8s: Introduce initial support for BFT orderers (#1294)
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>
2025-01-27 10:06:03 +00:00
munapower
859c025e57
Translated into Spanish the Fabric Gateway section and minor corrections (#1292)
Signed-off-by: munapower <mmunaro@hotmail.com>
2025-01-17 15:14:45 +00:00
Tatsuya Sato
f174360f14
Update test-network-k8s to support both v2.5 and v3.0 (#1291)
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>
2025-01-16 23:15:00 +00:00
Mark S. Lewis
b50ae22f73
Fix shellcheck linting failure (#1293)
Signed-off-by: Mark S. Lewis <Mark.S.Lewis@outlook.com>
2025-01-16 17:26:21 -05:00
munapower
00bd6aa65c Fix issue 1289 with missing parameter in peer chaincode lifecycle command
Signed-off-by: munapower <mmunaro@hotmail.com>
2025-01-10 18:18:26 -05:00
Tatsuya Sato
858e3564a4
Update some old links (#1287)
Signed-off-by: Tatsuya Sato <tatsuya.sato.so@hitachi.com>
2025-01-07 10:59:19 +00:00
Mark S. Lewis
e1a64665db
Update fabric-contract-api-go to v2.2.0 (#1283)
Signed-off-by: Mark S. Lewis <Mark.S.Lewis@outlook.com>
2024-12-25 18:06:01 +09:00
leo
898d333efb
docs: Quotation marks are used incorrectly. (#1282)
Signed-off-by: RiceChuan <lc582041246@gmail.com>
2024-12-24 09:52:40 +00:00
Arne Rutjes
5e0e5a1550 make version regex posix compliant so that it works on mac
Signed-off-by: Arne Rutjes <arne123@gmail.com>
2024-12-16 16:06:42 -05:00
Mark S. Lewis
8538e32437
Update Gradle version and shadow plugin (#1278)
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>
2024-12-11 08:04:56 -05:00
Andi
b71a4587dc
chore: use errors.New to replace fmt.Errorf with no parameters (#1277)
Also remove repetitive words.

Signed-off-by: ChengenH <hce19970702@gmail.com>
2024-12-10 11:15:02 +00:00
Mark S. Lewis
15ab2e5da8
Fix invoke CLI commands in full-stack guide (#1276)
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>
2024-12-07 15:05:30 -05:00
Mark S. Lewis
b11239aac0
Update fabric-contract-api-go to v2.1.0 (#1275)
Signed-off-by: Mark S. Lewis <Mark.S.Lewis@outlook.com>
2024-12-07 08:36:56 -05:00
Mark S. Lewis
1aa3822788 Fix build with new microfab release
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>
2024-11-27 21:20:37 -05:00
David Enyeart
30b6186440 Update maintainers
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>
2024-11-12 09:07:30 -05:00
Tatsuya Sato
dd94aae3d5 Update chaincode container versions in k8s samples
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>
2024-11-07 17:13:06 -05:00
Mark S. Lewis
8136eb4f5e Update test-network chaincode container versions
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>
2024-11-06 19:38:53 +09:00
Stanislav Jakuschevskij
9b199d4e0b Add private data go application
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>
2024-10-31 16:30:25 -04:00
Mark S. Lewis
e23bc6714e Simplify Java client error-handling example
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>
2024-10-24 23:45:04 -04:00
Stanislav Jakuschevskij
51e3a533dc Remove cli from podman compose file
Signed-off-by: Stanislav Jakuschevskij <stas@two-giants.com>
2024-10-22 16:50:08 -04:00
Mark S. Lewis
f16e9e6de5 Consistent Go version in go.mod and go.work files
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>
2024-10-14 10:25:34 -04:00
Mark S. Lewis
b931df3a5f Explicitly specify hash in client applications
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>
2024-10-07 12:25:40 -04:00
Mark S. Lewis
e37e991c4c Update applications to use fabric-gateway v1.6.0
Signed-off-by: Mark S. Lewis <Mark.S.Lewis@outlook.com>
2024-09-25 13:18:45 +09:00
David Enyeart
137f365ec9 Bump ubuntu to 22.04 in CI
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>
2024-09-19 10:27:26 +09:00
Tatsuya Sato
ce5aa883ee test-network-k8s: Improve prereqs logic
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>
2024-08-21 12:29:22 -04:00
Tatsuya Sato
5c5e98bb3d Fix the default chaincode version to "1.0" in test-network
Signed-off-by: Tatsuya Sato <tatsuya.sato.so@hitachi.com>
2024-08-20 13:15:11 -04:00
Mark S. Lewis
3826626d00 Configure dependabot updates to GitHub Actions
Signed-off-by: Mark S. Lewis <Mark.S.Lewis@outlook.com>
2024-07-29 15:50:33 -04:00
takayuki-nagai
50b69f6157
Add document about how to benchmark the performance using Hyperledger Caliper (#1238)
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>
2024-07-17 17:46:23 +09:00
chinmayi
604a0a561b Fix directory path for chaincode-external
Signed-off-by: chinmayi <chinmayishaan2316@gmail.com>
2024-06-24 16:27:16 -04:00
Mark S. Lewis
110e732259 Update Go chaincode to fabric-contract-api-go/v2
Signed-off-by: Mark S. Lewis <Mark.S.Lewis@outlook.com>
2024-06-21 15:18:12 -04:00
Mark S. Lewis
7258b4f4ab Add JavaScript asset-transfer-basic application
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>
2024-06-21 12:16:31 -04:00
Mark S. Lewis
76088d0273 Remove legacy sample applications
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>
2024-06-19 10:38:52 -04:00
David Enyeart
e334b7527a Bump fabric to v2.5.9
Bump fabric to v2.5.9.

Signed-off-by: David Enyeart <enyeart@us.ibm.com>
2024-06-19 11:59:47 +09:00
Mark S. Lewis
c077dae79c Update TypeScript implementations
- 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>
2024-06-18 06:51:58 -04:00
Chris Elder
a4f0a2c5b2 Change CA ports in test-network-nano-bash
Signed-off-by: Chris Elder <celder@Chriss-MacBook-Pro.local>
2024-06-15 16:43:43 -04:00
Chris Elder
3622a5e383 Add chaincode logging for binary chaincode in test-network-nano-bash
- 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>
2024-06-14 13:10:53 -04:00
Mark S. Lewis
29e695187a Use more specific chaincode package versions
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>
2024-06-14 00:24:08 -04:00
Chris Elder
179bc96846 Add external builders for golang and node chaincode to test-network-nano-bash
The external builders will build and launch binary chaincode instead of docker containers.

Signed-off-by: Chris Elder <celder628@gmail.com>
2024-06-06 17:51:34 -04:00
Tatsuya Sato
e4af8fe198 test-network-k8s: bump k8s-builder and couchdb
Signed-off-by: Tatsuya Sato <tatsuya.sato.so@hitachi.com>
2024-06-04 12:56:19 -04:00
Mark S. Lewis
0ed34585e1 Update Node chaincode for v2.5.5 release
Signed-off-by: Mark S. Lewis <Mark.S.Lewis@outlook.com>
2024-06-03 15:27:51 -04:00
Chris Elder
3c63eac4e3 Add CA capability to test-network-nano-bash
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>
2024-05-28 23:31:18 -04:00
David Enyeart
92f028c08d Bump dependencies
Go to 1.22
CouchDB to 3.3.3
Fabric to 2.5.8
Fabric-CA to 1.5.11

Signed-off-by: David Enyeart <enyeart@us.ibm.com>
2024-05-28 11:38:28 +09:00
James Taylor
1058f9ffe1 Update test-network-k8s
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>
2024-05-27 13:49:37 +09:00
Mark S. Lewis
d3e2a90ad5 Update test dependencies for Java chaincode
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>
2024-05-21 22:19:39 -04:00
David Enyeart
bf61094231 Remove double quotes for env variables
Double quotes have caused issues in some environments,
e.g. see https://github.com/hyperledger/fabric/issues/4358

Signed-off-by: David Enyeart <enyeart@us.ibm.com>
2024-05-07 01:06:09 +09:00
Dave Enyeart
effe8ff980
Switch microfab to hyperledger-labs version (#1203)
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>
2024-05-03 10:03:27 +01:00
David Enyeart
2fa83c957a GHA: Use ubuntu-20.04 for local forks
GHA: Use ubuntu-20.04 for local forks
since local forks don't have access to fabric-ubuntu-20.04.

Signed-off-by: David Enyeart <enyeart@us.ibm.com>
2024-04-30 12:35:31 -04:00
David Enyeart
4763bcae8d test-network error message if jq not installed
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>
2024-04-30 14:48:25 +09:00
James Taylor
0db64487e5 Update nano test network
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>
2024-04-29 10:42:41 -04:00
Mark S. Lewis
42b9b60ebc Update Go gRPC dependency
grpc.Dial() is (soon to be) deprecated in current gRPC versions. Use grpc.NewClient() instead.

Signed-off-by: Mark S. Lewis <Mark.S.Lewis@outlook.com>
2024-04-24 16:24:37 +09:00
Tatsuya Sato
c691cf94a9 Refactor test-network post-decoupling fabric-tools image
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>
2024-04-18 13:41:28 -04:00
David Enyeart
820368571d test-network envVar.sh script improvement
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>
2024-04-12 12:55:48 +09:00
Mark S. Lewis
d4ce4cfadc Update asset-transfer-sbe/chaincode-java
Signed-off-by: Mark S. Lewis <Mark.S.Lewis@outlook.com>
2024-04-11 22:57:57 -04:00
Tatsuya Sato
02bcb44ad4 Fix docs and scripts for asset-transfer-basic as an external service
Signed-off-by: Tatsuya Sato <tatsuya.sato.so@hitachi.com>
2024-04-11 15:24:37 -04:00
Sam Yuan
ebbc419933
Decouple fabric tools image from fabric sample (#1186)
* Decouple fabric tools image from fabric sample
* update with review comments

Signed-off-by: Sam Yuan <yy19902439@126.com>
2024-04-06 19:07:18 +09:00
Mark S. Lewis
66c9992bf3 Add Go chaincode for asset-transfer-events
Signed-off-by: Mark S. Lewis <Mark.S.Lewis@outlook.com>
2024-04-03 13:47:31 -04:00
Mark S. Lewis
a5eea8cd5c Read first client cert from cert directory
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>
2024-03-04 09:50:43 -05:00
Mark S. Lewis
db86460086 Use latest v2.5 fabric-chaincode-java
- Update Gradle wrappers
- Update shadow plugin

Signed-off-by: Mark S. Lewis <Mark.S.Lewis@outlook.com>
2024-02-25 22:13:26 -05:00
Mark S. Lewis
6dc2fa4f81 Update GitHub action versions
Avoid using deprecated action versions based on Node versions prior to Node 18.

Signed-off-by: Mark S. Lewis <Mark.S.Lewis@outlook.com>
2024-02-25 22:11:28 -05:00
Arne Rutjes
a708af9159 add optional extra arguments to lifecycle commands for more flexibility
Signed-off-by: Arne Rutjes <arne123@gmail.com>
2024-02-09 09:16:58 -05:00
uniform64
02d9f8c58b add support for docker compose v2 (fix #730)
fix bugs in #1140

Signed-off-by: uniform64 <jiny2048@gmail.com>
2023-12-12 09:14:06 -05:00
uniform64
cdb126d061
add support for docker compose v2 (fix #730) (#1140)
* 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>
2023-12-11 08:13:25 +01:00
Tatsuya Sato
07e7ee4ab6
test-network: Update comments to reflect channel profile name changes (#1146)
Signed-off-by: Tatsuya Sato <tatsuya.sato.so@hitachi.com>
2023-12-11 08:08:47 +01:00
Mark S. Lewis
ce6e519fab Use Executor in asset-transfer-events/application-gateway-java
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>
2023-12-04 11:31:07 -05:00
Mark S. Lewis
c0a0104ca1 Fix test-network chaincode-as-a-service deployment
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>
2023-11-07 16:12:07 -05:00
Mark S. Lewis
0f4f62c340 Use fabric-gateway v1.4
Also update some GitHub Actions versions.

Signed-off-by: Mark S. Lewis <Mark.S.Lewis@outlook.com>
2023-10-25 17:30:29 +09:00
Chris Elder
e73bb717db Add chaincode utilities
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>
2023-10-10 12:24:23 -04:00
Arne Rutjes
99a1f49da0 add token sdk sample application
Signed-off-by: Arne Rutjes <arne123@gmail.com>
2023-10-10 09:00:23 -04:00
hexnikolas
62f304a98f Update AssetTransfer.java
added missing quotation mark (") in href

Signed-off-by: hexnikolas <114026707+hexnikolas@users.noreply.github.com>
2023-09-29 13:57:48 -04:00
Tatsuya Sato
23dc50c9ae FSAT: Update ansible playbooks for compatibility with K8s v1.25.x
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>
2023-09-29 13:57:10 -04:00
Tatsuya Sato
f4f3201c0e FSAT: Update fabric-operator for compatibility with v1.25.x
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>
2023-09-29 13:57:10 -04:00
Tatsuya Sato
d07bac37df Bump versions of software used in CI tests to latest
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>
2023-09-29 13:57:10 -04:00
Tatsuya Sato
bda72cac00 Move publishing of REST sample Image from AZP to GHA
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>
2023-09-28 12:38:43 -04:00
Arne Rutjes
98f748155b add a retry to the test-network ccaas chaincode init command
Without this, the init command fails if the chaincode container is not ready.

Signed-off-by: Arne Rutjes <arne123@gmail.com>
2023-09-27 08:14:33 -06:00
Aditya Joshi
9441772423 updated help message for CFSSL
Signed-off-by: Aditya Joshi <adityaprakashjoshi1@gmail.com>
2023-09-27 08:08:20 -06:00
Aditya Joshi
e63c7d564e cfssl to generating certificates
Signed-off-by: Aditya Joshi <adityaprakashjoshi1@gmail.com>
2023-09-27 08:08:20 -06:00
Mark S. Lewis
6e71f634e2 Fixes for build breakages
Signed-off-by: Mark S. Lewis <Mark.S.Lewis@outlook.com>
2023-09-19 13:08:40 -04:00
Mark S. Lewis
30f70f6e73 Update TypeScript HSM sample application
- 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>
2023-09-19 13:08:40 -04:00
Tatsuya Sato
f2c1c59c50 Fix OrdererEndpoints in test-network's bft sample
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>
2023-08-29 11:03:22 -04:00
Tatsuya Sato
7d5aaf11e2
Improve BFT sample on test-network (#1083)
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>
2023-08-28 15:38:14 +02:00
arkadipiven
eb16caf3d5 Fix test-network to work with BFT consensus.
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>
2023-08-22 10:54:41 -04:00
munapower
a6d8f44fdb minor documentation fixes smart contract dev
Signed-off-by: munapower <mmunaro@hotmail.com>
2023-07-28 14:19:58 +09:00
munapower
5870033fcb spanish translation smart contract dev
Signed-off-by: munapower <mmunaro@hotmail.com>
2023-07-28 14:19:58 +09:00
geekya215
9ee0aac2ae
fix typo in high-througput/README.md (#1073)
Signed-off-by: geekya215 <geekya215@gmail.com>
2023-07-14 17:42:13 +09:00
Zhaoxuan "Tony" Wu
c04253d554
fix(test-network): ignore the error output when killing CCAAS containers (#1063)
Signed-off-by: Tony Wu <tonywu3027@me.com>
2023-07-04 13:01:30 +09:00
yjwxfq
7671bdd7c6 Update token_contract.go, checking the input params > 0 in function sub().
Signed-off-by: yjwxfq <112159687+yjwxfq@users.noreply.github.com>
2023-06-20 12:21:41 -04:00
yjwxfq
9a4920d565 Update token_contract.go, modify the overflow judgment condition for function sub().
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>
2023-06-20 12:21:41 -04:00
Pushp Vashisht
bc3a6bfa05
Fix typo (#1048)
Signed-off-by: Pushp Vashisht <pushptyagi1@gmail.com>
2023-06-20 07:17:16 +02:00
Tatsuya Sato
2c0fe75438 Minor improvements on test-network-nano-bash
- Fix typos
- Update gitignore

Signed-off-by: Tatsuya Sato <tatsuya.sato.so@hitachi.com>
2023-06-16 16:45:22 -04:00
Tatsuya Sato
bb98f1e582 FSAT: Extend sleep time to stabilize integration test
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>
2023-06-16 16:44:36 -04:00
Dave Enyeart
ae9e7e8df8
test-network-nano-bash chaincode id and waitForEvent improvements (#1052)
- 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>
2023-06-09 21:48:39 +09:00
Arkadi Piven
81390fbbbf Fix nano-bash-bft sample to work with channel-participation.
remove dependency on deprecated system-channel.

Signed-off-by: Arkadi Piven <arkadi.piven@ibm.com>
Signed-off-by: arkadipiven <arkadi7770@gmail.com>
2023-06-07 10:17:46 -04:00
yjwxfq
20009ecd02 Update token_contract.go, modify the overflow judgment condition for function add()
Signed-off-by: yjwxfq <112159687+yjwxfq@users.noreply.github.com>
2023-06-06 15:26:09 -04:00
Ry Jones
2f11c4410f
chore(docs): fix discord link (#1044)
Signed-off-by: Ry Jones <ry@linux.com>
2023-05-25 16:41:02 +02:00
David Enyeart
5df2404b08 Nominate Tatsuya Sato as fabric-samples maintainer
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>
2023-05-22 07:53:42 -04:00
yunusemrekarakose
4691478bfb Update package.json
Signed-off-by: yunusemrekarakose <yemre05@hotmail.com.tr>
2023-05-17 13:40:30 -04:00
yunusemrekarakose
3d747bdcd3 Update package.json
Signed-off-by: yunusemrekarakose <yemre05@hotmail.com.tr>
2023-05-17 13:40:30 -04:00
Yunus Emre Karaköse
8f62557843 chaincode-typescript
Signed-off-by: YunusEmreKarakose <yemre05@hotmail.com.tr>
Signed-off-by: Ry Jones <ry@linux.com>
Signed-off-by: yunusemrekarakose <yemre05@hotmail.com.tr>
2023-05-17 13:40:30 -04:00
Tatsuya Sato
5c020f2a71 Update FSAT to use Fabric 2.5 by default
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>
2023-05-17 13:23:08 -04:00
Tatsuya Sato
f8f52cab71 test-network-k8s: Update k8s CC builder to 0.11.0
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>
2023-05-09 22:11:57 -04:00
David Enyeart
57127ac75a Update test-network-k8s to Fabric v2.5
Update test-network-k8s to use Fabric v2.5.

Signed-off-by: David Enyeart <enyeart@us.ibm.com>
2023-05-09 22:11:57 -04:00
Mark S. Lewis
e93cfacf1f Use Java gRPC instead of Netty API to establish TLS connections
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>
2023-05-08 14:17:21 -04:00
Dave Enyeart
84f9ba1dc4
Update CI to Fabric v2.5.1 (#1032)
Update CI to use Fabric v2.5.1.

Signed-off-by: David Enyeart <enyeart@us.ibm.com>
2023-05-05 13:34:07 +01:00
Dave Enyeart
e1d077582a
Bump CouchDB to 3.3.2 (#1028)
Bump CouchDB to 3.3.2.

Signed-off-by: David Enyeart <enyeart@us.ibm.com>
2023-05-05 13:26:28 +01:00
Dave Enyeart
9a382c8fab
Add test-network org3 affilication (#1026)
The org3 affiliation is needed when registering users for org3.

Signed-off-by: David Enyeart <enyeart@us.ibm.com>
2023-05-05 13:24:44 +01:00
Mark S. Lewis
628331d1a2 Fix error in full-stack-asset-transfer-guide docs
- 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>
2023-05-02 12:46:03 -04:00
Javier Ruiz
74c48ec5aa Fix DOKS section
Signed-off-by: Javier Ruiz <japi@kolokium.com>
2023-05-01 15:21:08 -04:00
Mark S. Lewis
3eaabe789c Fix build failure in full-stack-asset-transfer
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>
2023-04-27 16:07:36 -04:00
Arnaud J Le Hors
36ad010124 Fix erc-1155 sample README
Signed-off-by: Arnaud J Le Hors <lehors@us.ibm.com>
2023-04-24 17:27:08 -04:00
wisecoach
9e38280be2 fixed test-network-k8s/scripts/test_network.sh missing
fixed test-network-k8s/scripts/channel.sh missing

Signed-off-by: wisecoach <827165648@qq.com>
2023-04-24 17:11:12 -04:00
Ry Jones
c2f106adf1 chore(ci): use dedicated Fabric runners
Signed-off-by: Ry Jones <ry@linux.com>
2023-04-20 17:26:24 -07:00
Tatsuya Sato
aa153474f2
Fix npm problems on asset-transfer-basic/chaincode-typescript (#935)
* 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>
2023-04-20 17:18:43 +02:00
Krishnasuri Narayanam
2c831e4590
GetID to return clientId in base64 form (#771)
Signed-off-by: Krishnasuri Narayanam <knaraya3@in.ibm.com>
Signed-off-by: Arnaud J Le Hors <lehors@us.ibm.com>
Co-authored-by: Arnaud J Le Hors <lehors@us.ibm.com>
2023-04-20 15:28:52 +02:00
Ry Jones
21361ae7b4 Apply suggestions from code review
Signed-off-by: Ry Jones <ry@linux.com>
2023-04-19 08:18:16 -07:00
David Enyeart
73e4d98dd9 Cancel existing workflows on subsequent PR push
Cancel existing workflows on subsequent PR push.

Signed-off-by: David Enyeart <enyeart@us.ibm.com>
2023-04-19 08:18:16 -07:00
Matthew B White
7c42ff3d8e
Update the npm-shirnkwrap.json (node 16 used) (#1018)
Signed-off-by: Matthew B White <whitemat@uk.ibm.com>
2023-04-12 15:18:58 +02:00
Matthew B White
67ae2c9d02 Correct the private data collection information
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>
2023-03-22 16:19:56 -04:00
Dave Enyeart
75b8419113
Sample apps should exit code 1 upon failure (#1003)
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>
2023-03-17 13:18:18 +00:00
Dave Enyeart
00c561457f
Update samples to use Fabric v2.5.0-beta2 by default (#1006)
Update samples to use Fabric v2.5.0-beta2 by default.

Signed-off-by: David Enyeart <enyeart@us.ibm.com>
2023-03-17 13:17:39 +00:00
Dave Enyeart
efbecb6d10
Add debug logging to CI scripts (#1007)
Add debug logging to CI scripts.

Signed-off-by: David Enyeart <enyeart@us.ibm.com>
2023-03-17 13:11:30 +00:00
Dave Enyeart
97a400ea28
Bump couchdb to 3.2.2 (#1008)
Bump couchdb to 3.2.2.

Signed-off-by: David Enyeart <enyeart@us.ibm.com>
2023-03-17 13:08:55 +00:00
Dave Enyeart
dada89c710
Remove csr.hosts from msp enrollments (#1009)
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>
2023-03-17 13:08:03 +00:00
Mark S. Lewis
85fbbc0924 Fix Node HSM sample
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>
2023-03-14 11:33:21 -04:00
Dave Enyeart
eb787b7afa
Update Go and Go dependencies (#996)
* 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>
2023-03-07 14:44:33 +00:00
Dave Enyeart
488e74ed08
asset-transfer-basic CI improvements (#998)
* 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>
2023-03-07 09:43:10 +00:00
Tatsuya Sato
199e290f5e
Fix gradle version used in asset-transfer-basic/chaincode-java image build to 7 (#961)
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>
2023-03-02 12:05:44 +00:00
David Enyeart
128950edca Fix go lint issue
Fix go lint issue by running goimports.

Signed-off-by: David Enyeart <enyeart@us.ibm.com>
2023-03-02 00:44:36 -05:00
Dave Enyeart
f7b3a7703f Revert "Bump github.com/prometheus/client_golang (#932)"
This reverts commit a0b2822e71.
2023-03-01 11:51:42 -05:00
Dave Enyeart
1816d24732 Revert "Bump github.com/prometheus/client_golang (#933)"
This reverts commit fd4332d9c0.
2023-03-01 11:51:26 -05:00
David Enyeart
3af7eddcd3 Remove heritage chaincode samples
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>
2023-03-01 11:50:47 -05:00
David Enyeart
b8c2448bc6 Remove changelog script
Manual changelog is no longer created since github provides a changelog.

Signed-off-by: David Enyeart <enyeart@us.ibm.com>
2023-03-01 11:20:43 -05:00
dependabot[bot]
fd4332d9c0
Bump github.com/prometheus/client_golang (#933)
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.1.0 to 1.11.1.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v1.1.0...v1.11.1)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-23 16:18:03 +01:00
dependabot[bot]
a0b2822e71
Bump github.com/prometheus/client_golang (#932)
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.1.0 to 1.11.1.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v1.1.0...v1.11.1)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-23 16:07:47 +01:00
dependabot[bot]
c723d812e9
Bump github.com/prometheus/client_golang in /fabcar/go (#931)
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.1.0 to 1.11.1.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v1.1.0...v1.11.1)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-15 13:21:17 +01:00
Mark S. Lewis
10e9377555 Avoid explicit import of grpc-js or fabric-protos in TypeScript apps
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>
2023-02-10 11:36:41 -05:00
Matthew B White
cb886be466 Commercial Paper
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>
2023-01-31 21:25:52 -05:00
jkneubuh
c986c8d227
Run FSAT tests with 2.5 images, binaries, and trigger on all builds for regression coverage (#919)
Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
2023-01-27 09:49:52 -05:00
Matthew B White
5bc925a3d8
Add in 2.5 java test (#917)
Signed-off-by: Matthew B White <whitemat@uk.ibm.com>
2023-01-25 09:03:46 -05:00
HousniAbdellatife
406d7e9d36
fix java contract paperkey parameter in commercial paper example (#905)
Signed-off-by: HousniAbdellatife <abdellatife.housni@gmail.com>
2023-01-25 08:48:10 -05:00
dependabot[bot]
9b1de5e0b1
Bump minimatch in /asset-transfer-basic/rest-api-typescript (#887)
Bumps [minimatch](https://github.com/isaacs/minimatch) from 3.0.4 to 3.1.2.
- [Release notes](https://github.com/isaacs/minimatch/releases)
- [Changelog](https://github.com/isaacs/minimatch/blob/main/changelog.md)
- [Commits](https://github.com/isaacs/minimatch/compare/v3.0.4...v3.1.2)

---
updated-dependencies:
- dependency-name: minimatch
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-24 09:35:08 -05:00
dependabot[bot]
a231e12caa
Bump json5 in /asset-transfer-basic/rest-api-typescript (#898)
Bumps [json5](https://github.com/json5/json5) from 2.2.0 to 2.2.3.
- [Release notes](https://github.com/json5/json5/releases)
- [Changelog](https://github.com/json5/json5/blob/main/CHANGELOG.md)
- [Commits](https://github.com/json5/json5/compare/v2.2.0...v2.2.3)

---
updated-dependencies:
- dependency-name: json5
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-24 09:34:28 -05:00
dependabot[bot]
7c46fdb087
Bump cookiejar in /asset-transfer-basic/rest-api-typescript (#916)
Bumps [cookiejar](https://github.com/bmeck/node-cookiejar) from 2.1.2 to 2.1.4.
- [Release notes](https://github.com/bmeck/node-cookiejar/releases)
- [Commits](https://github.com/bmeck/node-cookiejar/commits)

---
updated-dependencies:
- dependency-name: cookiejar
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-24 08:47:59 -05:00
Matthew B White
795673dee3
Add in examples and notes on using PurgePrivateData (#878)
* 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>
2023-01-23 11:40:52 -05:00
jkneubuh
124adb43f9
run test suites with 2.5 binaries and images (#906)
* 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>
2023-01-18 16:05:40 +00:00
Arnaud J Le Hors
0fe4d091d2
Fix network.sh (#886)
This adds a missing reference to $CONTAINER_CLI.

Signed-off-by: Arnaud J Le Hors <lehors@us.ibm.com>
2023-01-18 09:16:05 -05:00
Rubén
bcb2e1c910
fix chaincodes typo (#900)
Signed-off-by: Rubén <20502699+rubcv@users.noreply.github.com>

Signed-off-by: Rubén <20502699+rubcv@users.noreply.github.com>
2023-01-18 09:14:38 -05:00
Sam Yuan
5095954756
doc: add zh version for Fabric Full Stack Development Workshop Cloud Native Fabric part (#901)
Signed-off-by: Sam Yuan <yy19902439@126.com>
2023-01-18 09:13:54 -05:00
Matthew B White
e7d3b41287
Swap to use the Helper Function to create policies (#908)
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>
2023-01-18 07:25:07 -05:00
Matthew B White
a70547dd94
Update the name of the certificate. (#902)
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>
2023-01-09 10:16:03 -05:00
Ramesh M
1e6fe3b261
Update 13-kube-public-cloud.md (#891)
Signed-off-by: Ramesh M <62267259+ramdisk-ott@users.noreply.github.com>
2023-01-03 14:06:55 -05:00
skypos99
b23274b945
Update 10-kube.md (#890)
Signed-off-by: skypos99 <116450739+skypos99@users.noreply.github.com>

Signed-off-by: skypos99 <116450739+skypos99@users.noreply.github.com>
2023-01-03 14:03:59 -05:00
Deepak Singh
09959b967d
Update org1-peer2.yaml (#882)
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>
2023-01-03 14:02:45 -05:00
Marcus Brandenburger
8d0e632d86
Clean up full-stack-asset-trasfer-guide docs (#889)
Remove old repository (hyperledgendary) link from readme diagram.

Signed-off-by: Marcus Brandenburger <bur@zurich.ibm.com>
2022-12-14 11:24:23 -05:00
Parameswaran Selvam
f838d6b5a8
added a check for prereq into deploycc script (#884)
Signed-off-by: Parameswaran Selvam <parselva@in.ibm.com>

Signed-off-by: Parameswaran Selvam <parselva@in.ibm.com>
2022-12-14 09:31:10 +01:00
dependabot[bot]
a96efaebde
Bump qs and express in /asset-transfer-basic/rest-api-typescript (#880)
Bumps [qs](https://github.com/ljharb/qs) to 6.11.0 and updates ancestor dependencies [qs](https://github.com/ljharb/qs), [qs](https://github.com/ljharb/qs) and [express](https://github.com/expressjs/express). These dependencies need to be updated together.


Updates `qs` from 6.10.2 to 6.11.0
- [Release notes](https://github.com/ljharb/qs/releases)
- [Changelog](https://github.com/ljharb/qs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ljharb/qs/compare/v6.10.2...v6.11.0)

Updates `qs` from 6.10.1 to 6.11.0
- [Release notes](https://github.com/ljharb/qs/releases)
- [Changelog](https://github.com/ljharb/qs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ljharb/qs/compare/v6.10.2...v6.11.0)

Updates `express` from 4.17.1 to 4.18.2
- [Release notes](https://github.com/expressjs/express/releases)
- [Changelog](https://github.com/expressjs/express/blob/master/History.md)
- [Commits](https://github.com/expressjs/express/compare/4.17.1...4.18.2)

---
updated-dependencies:
- dependency-name: qs
  dependency-type: indirect
- dependency-name: qs
  dependency-type: indirect
- dependency-name: express
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-14 09:23:23 +01:00
ali
05c06f4931
Fixed comment consistency problem (#844)
* 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>
2022-12-14 09:18:21 +01:00
Basil K Y
b2de360e1c
REST api added for asset transfer in Golang (#836)
* 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>
2022-12-14 09:16:09 +01:00
Mark S. Lewis
4109e741e4
Parse transaction creator to Identity in off_chain_data samples (#883)
Signed-off-by: Mark S. Lewis <mark_lewis@uk.ibm.com>

Signed-off-by: Mark S. Lewis <mark_lewis@uk.ibm.com>
2022-12-13 13:18:50 +00:00
Mark S. Lewis
a6028cd398
Fix asset-transfer-basic/application-gateway-go (#874)
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>
2022-11-30 13:21:49 +00:00
Satoshi Ito
22e1af4935
Minor fixes to the ingress setting (#850)
This patch fixes the ingress setting so that the peer-gateway works correctly.

Signed-off-by: Satoshi Ito <satoshi.ito.tf@hitachi.com>
2022-11-21 14:44:59 -05:00
Matthew B White
2e421139a0
Remove mistaken msp path (#873)
Signed-off-by: Matthew B White <whitemat@uk.ibm.com>

Signed-off-by: Matthew B White <whitemat@uk.ibm.com>
2022-11-18 15:54:08 +01:00
Josh Kneubuhl
fd2fffbd43 review feedback: un-pin fabric CLI targets
Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
2022-11-15 16:08:24 -05:00
Josh Kneubuhl
94a1542782 Run Full Stack Asset Transfer Guide tests on GHA
Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
2022-11-15 16:08:24 -05:00
Josh Kneubuhl
38a36c65d3 Move the remaining sample tests from Azure to GHA
Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
2022-11-15 11:18:11 -05:00
Josh Kneubuhl
b7b06b9de3 Move Kube Test Network tests from Azure -> GHA
Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
2022-11-14 22:55:18 -05:00
Josh Kneubuhl
156f6d42fb Delete commercial paper and fabcar tests from Azure
Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
2022-11-14 16:25:27 -05:00
jkneubuh
0ce94bbb9b
Move lint and test-network-basic tests from Azure to GHA - READY FOR MERGE (#862)
* Move Test Network Basic tests from Azure to GHA

Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>

* Move linters from Azure to GHA

Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>

* Apply review comments - pin java, node, and go runtimes

Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>

Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
2022-11-14 13:36:55 +00:00
Josh Kneubuhl
34734cfff2 Add FSAT appdev E2E test
Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
2022-11-11 13:18:29 -05:00
jkneubuh
60a61b8241
Only run GHA on PRs targeting the mainline (#860)
Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>

Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
2022-11-11 10:16:58 -05:00
jkneubuh
e908a30d3a
Activate GHA on the fabric-samples project (#859)
Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>

Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
2022-11-11 13:21:26 +00:00
Ry Jones
2c5ce16f0b Default branch
Add issues

Signed-off-by: Ry Jones <ry@linux.com>
2022-11-10 10:03:03 -08:00
jkneubuh
a299e18e26
Moves the Full Stack Asset Transfer Development Guide to fabric-samples (#852)
* 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>
2022-11-10 10:40:27 -05:00
Tatsuya Sato
49749c6584
Minor fixes and improvements to test-network-k8s (#849)
Signed-off-by: Tatsuya Sato <tatsuya.sato.so@hitachi.com>

Signed-off-by: Tatsuya Sato <tatsuya.sato.so@hitachi.com>
2022-10-26 05:43:26 -04:00
Mark S. Lewis
63cc77bdc3
Avoid usage of deprecated ioutil Go package (#843)
* 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>
2022-10-25 07:04:39 -04:00
Mark S. Lewis
c323c95807
Update samples to use fabric-gateway v1.1.1 (#842)
Signed-off-by: Mark S. Lewis <mark_lewis@uk.ibm.com>

Signed-off-by: Mark S. Lewis <mark_lewis@uk.ibm.com>
2022-10-20 17:43:55 +01:00
yjwxfq
6b989299e0
Fix chaincode/abstore, add parameter judgment when the transaction makes payment. (#825)
Signed-off-by: yjwxfq <yjwxfq@163.com>

Signed-off-by: yjwxfq <yjwxfq@163.com>
2022-10-20 15:49:47 +01:00
James Taylor
0aa853e0c3 Update go chaincode samples
Update to the latest github.com/hyperledger/fabric-contract-api-go

Signed-off-by: James Taylor <jamest@uk.ibm.com>
2022-10-18 15:28:20 -04:00
dependabot[bot]
ea533d61b9
Bump passport in /asset-transfer-basic/rest-api-typescript (#828)
Bumps [passport](https://github.com/jaredhanson/passport) from 0.4.1 to 0.6.0.
- [Release notes](https://github.com/jaredhanson/passport/releases)
- [Changelog](https://github.com/jaredhanson/passport/blob/master/CHANGELOG.md)
- [Commits](https://github.com/jaredhanson/passport/compare/v0.4.1...v0.6.0)

---
updated-dependencies:
- dependency-name: passport
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-09 17:48:14 +02:00
dependabot[bot]
3841318020
Bump moment-timezone in /asset-transfer-basic/rest-api-typescript (#821)
Bumps [moment-timezone](https://github.com/moment/moment-timezone) from 0.5.33 to 0.5.37.
- [Release notes](https://github.com/moment/moment-timezone/releases)
- [Changelog](https://github.com/moment/moment-timezone/blob/develop/changelog.md)
- [Commits](https://github.com/moment/moment-timezone/compare/0.5.33...0.5.37)

---
updated-dependencies:
- dependency-name: moment-timezone
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-09 17:47:05 +02:00
dependabot[bot]
a4245810a0
Bump jsrsasign in /asset-transfer-basic/rest-api-typescript (#795)
Bumps [jsrsasign](https://github.com/kjur/jsrsasign) from 10.5.1 to 10.5.26.
- [Release notes](https://github.com/kjur/jsrsasign/releases)
- [Changelog](https://github.com/kjur/jsrsasign/blob/master/ChangeLog.txt)
- [Commits](https://github.com/kjur/jsrsasign/compare/10.5.1...10.5.26)

---
updated-dependencies:
- dependency-name: jsrsasign
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-09 14:33:44 +02:00
dependabot[bot]
f39e55e6f5
Bump moment in /asset-transfer-basic/rest-api-typescript (#794)
Bumps [moment](https://github.com/moment/moment) from 2.29.2 to 2.29.4.
- [Release notes](https://github.com/moment/moment/releases)
- [Changelog](https://github.com/moment/moment/blob/develop/CHANGELOG.md)
- [Commits](https://github.com/moment/moment/compare/2.29.2...2.29.4)

---
updated-dependencies:
- dependency-name: moment
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-09 14:33:01 +02:00
James Taylor
4eff55b75b
Fix test network chaincode deploy (#827)
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>
2022-09-09 12:33:27 +01:00
James Taylor
01da596ae1 Update nano test network
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>
2022-08-29 02:31:49 -04:00
Basil K Y
d1b3253cc5
separate namespace for each organization (#817)
* 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>
2022-08-26 12:39:45 -04:00
dependabot[bot]
70c5aa7a28
Bump nconf in /asset-transfer-basic/rest-api-typescript (#722)
Bumps [nconf](https://github.com/flatiron/nconf) from 0.11.3 to 0.11.4.
- [Release notes](https://github.com/flatiron/nconf/releases)
- [Changelog](https://github.com/indexzero/nconf/blob/master/CHANGELOG.md)
- [Commits](https://github.com/flatiron/nconf/compare/v0.11.3...v0.11.4)

---
updated-dependencies:
- dependency-name: nconf
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-26 09:46:10 +02:00
Arnaud J Le Hors
eb3acf34eb
Update CHAINCODE_AS_A_SERVICE_TUTORIAL.md (#804)
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>
2022-08-22 17:13:06 -04:00
Stefan Obermeier
cd4db0bc8b
use existing const instead of local string (#815)
Signed-off-by: Stefan Obermeier <st.obermeier@seeburger.de>

Signed-off-by: Stefan Obermeier <st.obermeier@seeburger.de>
2022-08-19 15:50:56 -04:00
jkneubuh
1e8fd5cd56
Update k8s CC builder to v7.2; Use *.localho.st loopback domain; Optionally bind docker reg to 0.0.0.0 (#811)
* Update k8s builder to v0.7.1

Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>

* Add LOCAL_REGISTRY_INTERFACE option to bind the insecure docker registry to alternate NICs

Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>

* Switch from *.vcap.me -> *.localho.st for the default loopback domain name

Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
2022-08-08 12:05:48 +01:00
jkneubuh
9f9cec7195
Run RCAADMIN registration on the host OS, not in k8s (#809)
* 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>
2022-08-05 13:17:05 +01:00
Arnaud J Le Hors
a1b7d20ebe Clarifies podman instructions for test-network
Also reverts to using install-fabric.sh which is preferred over bootstrap.sh.

Signed-off-by: Arnaud J Le Hors <lehors@us.ibm.com>
2022-08-03 13:38:06 -04:00
Arnaud J Le Hors
6ede244d2b Use alpine based gradle image to build basic transfer java CC container
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>
2022-08-03 12:07:20 -04:00
Arnaud J Le Hors
bfe8f6e04d Update podman support information
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>
2022-08-03 12:06:39 -04:00
Arnaud J Le Hors
8403da7386 Fix vulnerabilities in typescript chaincode deps
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>
2022-08-03 12:00:58 -04:00
Mark S. Lewis
51397fe78a
Add getCreator() to parsed transaction in off_chain_data sample (#806)
Example of how the client identity that submitted a transaction can be obtained.

Signed-off-by: Mark S. Lewis <mark_lewis@uk.ibm.com>
2022-08-03 11:35:31 +01:00
jkneubuh
cb4355125f
Feature/ca v1.5.5 (#788)
* 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>
2022-08-01 14:58:12 +01:00
Matthew B White
4bbffdf2f2
Update Node.js dockerfile (#805)
Signed-off-by: Matthew B White <whitemat@uk.ibm.com>
2022-08-01 11:50:47 +00:00
Mark S. Lewis
41717d76f2
Fix link in off_chain_data README (#793)
Signed-off-by: Mark S. Lewis <mark_lewis@uk.ibm.com>
2022-07-18 08:56:17 +01:00
Saptha Surendran
6aa3017ccb
Added hsm samples using Gateway (#759)
* Added hsmm Samples using Gateway

Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>

* Used asset-transfer-basic chaincode

Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>

* moved samples under asset-transfer-basic

Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>

* ci pipeline changes

Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>

* HSM config path changed

Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>

* added pkcs11 enabled ca

Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>

* HSM template added

Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>

* moved  binaries to fabric  samples bin
added go mod and go sum
Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>

* Gopath reverrted back to localDirectory

Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>

* go mod added and cleanup

Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>

* test file directory

Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>

* test file directory

Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>

* migrate to latest gateway and go version

Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>

* hsm script changes
Readme changes
Added npm prepare

Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>

* moved samples out of asset-transfer-basic

Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>

* Name changes

Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>

* code refactor

Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>

* go vet by tag

Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>

* pkcs11 tag added to lint script

Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>

* Readme updates

Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>

* application-typescript code refactor

Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>

* readme note added

Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>
2022-07-15 09:18:30 -04:00
Dave Enyeart
f32f77b129
Update secured asset transfer sample (#781)
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>
2022-07-13 14:09:14 -04:00
destinysky
9f844e5de3
Fix namespace in k8s configuration files (#784)
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>
2022-07-04 08:36:36 -04:00
Mark S. Lewis
12f59398ba
Fix asset-transfer-events sample Java chaincode (#782)
- 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>
2022-07-01 12:28:52 +01:00
Mark S. Lewis
f8e7bfe803
Update Gateway samples for v1.1 release (#779)
- 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>
2022-06-30 15:46:32 +01:00
Satoshi Ito
3d3f15ce30
Fix test-network-k8s docs (#776)
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>
2022-06-24 12:21:24 -04:00
Rajat Sharma
d270488450 minor documentation updated
Signed-off-by: Rajat Sharma <connecttorajat@outlook.com>
2022-06-23 07:44:44 -04:00
Rajat Sharma
654335ebd4 readme updated to resolve minor issues.
Signed-off-by: Rajat Sharma <connecttorajat@outlook.com>
2022-06-23 07:44:44 -04:00
Josh Kneubuhl
15a4772493 Bump chaincode builder to v0.6.0 : +couchdb indexes
Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
2022-06-22 16:19:12 -04:00
dependabot[bot]
05c1a1459f
Bump protobufjs in /asset-transfer-basic/rest-api-typescript (#755)
Bumps [protobufjs](https://github.com/protobufjs/protobuf.js) from 6.11.2 to 6.11.3.
- [Release notes](https://github.com/protobufjs/protobuf.js/releases)
- [Changelog](https://github.com/protobufjs/protobuf.js/blob/v6.11.3/CHANGELOG.md)
- [Commits](https://github.com/protobufjs/protobuf.js/compare/v6.11.2...v6.11.3)

---
updated-dependencies:
- dependency-name: protobufjs
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-21 18:13:38 -04:00
fraVlaca
a26eae23e1
added fixes to documentation and readmes + small fix to erc721 and erc 20 java chaincode gradle.settings (#773)
Signed-off-by: fraVlaca <ocsenarf@outlook.com>
2022-06-21 17:40:25 -04:00
fraVlaca
d65bcf8ad1
added last fixes for asset-transfer-secured-agreement (#772)
Signed-off-by: fraVlaca <ocsenarf@outlook.com>
2022-06-21 13:10:06 -04:00
Rajat Sharma
8c3534baa3 ERC20: changes made to prevent subtraction overflow
Signed-off-by: Rajat Sharma <connecttorajat@outlook.com>
2022-06-20 08:54:33 -04:00
Rajat Sharma
dc015eb3eb ERC1155: subtraction overflow issue resolved
Signed-off-by: Rajat Sharma <connecttorajat@outlook.com>
2022-06-20 08:54:33 -04:00
Rajat Sharma
fc2494aebd ERC20: check for token initialized changed
Signed-off-by: Rajat Sharma <connecttorajat@outlook.com>
2022-06-15 11:06:03 -04:00
Rajat Sharma
194aff808d ERC:721 check for key already present changed
Signed-off-by: Rajat Sharma <connecttorajat@outlook.com>
2022-06-15 11:06:03 -04:00
Rajat Sharma
e00841bd10 function CheckInitialized renamed
Signed-off-by: Rajat Sharma <connecttorajat@outlook.com>
2022-06-15 11:06:03 -04:00
Rajat Sharma
ef42c0a094 check for Intitialized changed
Signed-off-by: Rajat Sharma <connecttorajat@outlook.com>
2022-06-15 11:06:03 -04:00
Mark S. Lewis
adfd850e64 Use new default call options API in Java off_chain_data sample
Also use hyperlinks for easier navigation to code mentioned in the README.

Signed-off-by: Mark S. Lewis <mark_lewis@uk.ibm.com>
2022-06-14 11:34:10 -04:00
Zakaria Hossain Foysal
8ca50df4ff
Update setOrgEnv.sh (#748)
Type found in line 36 of setOrgEnv.sh file

Signed-off-by: Zakaria Hossain Foysal <zakaria15-9556@diu.edu.bd>
2022-05-26 13:55:02 +01:00
jkneubuh
525ff9f590
Feature/fabric builder k8s (#739)
* 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>
2022-05-26 13:52:25 +01:00
Mark S. Lewis
636a273a48
Java off-chain data store sample using Fabric Gateway (#749)
Also minor implementation changes to TypeScript sample for better consistency between implementations.

Signed-off-by: Mark S. Lewis <mark_lewis@uk.ibm.com>
2022-05-26 13:42:41 +01:00
fraVlaca
94867dd517
updated and improved asset-transfer-secured-agreement sample (#751)
Signed-off-by: fraVlaca <ocsenarf@outlook.com>
2022-05-26 13:42:01 +01:00
sapthasurendran
4681fe7865
Secured agreement samples using gateway (#630)
* initial commit

Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>

Code refactor

Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>

* readme

Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>

* lint fix

Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>

* adopted best practises

Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>

* code refactor

Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>

* updated azure pipeline to include the app

Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>

* mapped json and client object

Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>

* Moved contract interactions to contractWrapper

Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>

* salt value unexported

Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>

* moved try catch from contract wrapper to app

Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>

* contract wrapper refactor
moved interfaces from utils to contract wrapper

Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>

* exported data objects

Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>
2022-05-23 14:17:10 +01:00
fiadanza
8662b10c58
fix to replace 443 with NGINX_HTTPS_PORT (#745)
Signed-off-by: fiadanza <francesco.iadanza@gmail.com>
2022-05-19 06:16:39 -04:00
Ry Jones
eb0a616261 Remove commercial paper reference
Fixes #740

Signed-off-by: Ry Jones <ry@linux.com>
2022-05-18 12:10:00 -07:00
Tommy TIAN
9d04fc9a2e
fix typo in asset-transfer-basic (#744)
Signed-off-by: Tommy TIAN <xtianae@connect.ust.hk>
2022-05-18 12:27:08 -04:00
fraVlaca
67a1166396 added fixes to erc token samples and documentation
Signed-off-by: fraVlaca <ocsenarf@outlook.com>
2022-05-18 07:54:36 -04:00
Mark S. Lewis
05791d30bc
Off-chain data sample using Fabric Gateway client API (#736)
Signed-off-by: Mark S. Lewis <mark_lewis@uk.ibm.com>
2022-05-17 12:49:22 +01:00
D
17d5b96493 fix error message in deployCC
Signed-off-by: D <d_kelsey@uk.ibm.com>
2022-05-13 06:28:31 -04:00
fraVlaca
5f71466295
updated erc tokens samples (#731)
Signed-off-by: fraVlaca <ocsenarf@outlook.com>
2022-05-11 10:35:10 -04:00
Tatsuya Sato
2d32a8e7e3
test-network-k8s: Add CC debugging procedures for Linux (#735)
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>
2022-05-11 10:25:31 -04:00
Obadah Hammoud
d3a61e1d4f Update marbles_chaincode.go
Signed-off-by: Obadah Hammoud <obadah.hammoud@outlook.com>
2022-05-09 17:41:43 -04:00
Josh Kneubuhl
fd205a1ac0 fix two README / doc bugs
Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
2022-05-09 13:43:13 -04:00
Josh Kneubuhl
0322313a9a Includes new 'cluster init' target; Prints errors to the STDOUT
Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
2022-05-09 13:43:13 -04:00
Josh Kneubuhl
f730b804cd Refine README with CPU/RAM/Docker/Rancher limits; Adds a 10s effort to delivery client connection
Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
2022-05-09 13:43:13 -04:00
Josh Kneubuhl
3a12817c4f test network runs on containerd AND mobyd
Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
2022-05-09 13:43:13 -04:00
Josh Kneubuhl
b8a6d8efbb fix a whitespace error in the OSX resolver section
Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
2022-05-09 13:43:13 -04:00
Josh Kneubuhl
366d162453 Add a note / workaround section to address slow DNS resolution on Mac
Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
2022-05-09 13:43:13 -04:00
Josh Kneubuhl
47faca36e0 Add a workaround for DNS timeouts when connecting to the orderers
Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
2022-05-09 13:43:13 -04:00
Josh Kneubuhl
914102e814 Someday, somewhere, someone will complain that 128Mi is not enough to run Fabric.
Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
2022-05-09 13:43:13 -04:00
Josh Kneubuhl
4c04b450c6 Increase the connection timeout for peer client commands - vcap DNS is too slow to resolve in 3s
Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
2022-05-09 13:43:13 -04:00
Josh Kneubuhl
7537cafcf3 Use vcap.me as CI is not able to modify the /etc/hosts with a dummy DNS domain
Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
2022-05-09 13:43:13 -04:00
Josh Kneubuhl
a02320e1cc Move the DNS quickstart section into the prereqs
Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
2022-05-09 13:43:13 -04:00
Josh Kneubuhl
49fa452864 Address review feedback - better prereq checks
Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
2022-05-09 13:43:13 -04:00
Josh Kneubuhl
9ca1cc7c63 Add configuration / guide notes on running the test network on Rancher
Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
2022-05-09 13:43:13 -04:00
Josh Kneubuhl
551250636d Run the Kube Test Network on Rancher / k3s
Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
2022-05-09 13:43:13 -04:00
Mark S. Lewis
f2fbfa410f
Enable engine-strict checks for TypeScript Gateway samples (#726)
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>
2022-04-29 15:59:50 +01:00
jkneubuh
eeb4e611c7
Provide clear guidance for debugging Java chaincode as a service #684 (#724)
* 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>
2022-04-26 15:33:14 +01:00
James Taylor
5ad54564db
Allow custom peer images for test-network-k8s (#725)
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>
2022-04-25 15:18:52 +00:00
Tatsuya Sato
5b72281114
test-network-k8s: Remove kubectl binary (#720)
Since kubectl binary is mistakenly added again in PR#714,
this patch removes it.

Signed-off-by: Tatsuya Sato <tatsuya.sato.so@hitachi.com>
2022-04-20 10:20:08 -04:00
Renjith K N
2ac6902996
Java chaincode implementation of ERC-20 token standard. (#714)
* Java erc20 chaincode implementation Signed-off-by: renjithpta <renjithkn@gmail.com>

Signed-off-by: renjithpta <renjithkn@gmail.com>

* Java erc20 chaincode implementation Signed-off-by: renjithpta <renjithkn@gmail.com>

Signed-off-by: renjithpta <renjithkn@gmail.com>

* Java erc20 chaincode implementation Signed-off-by: renjithpta <renjithkn@gmail.com>

Signed-off-by: renjithpta <renjithkn@gmail.com>

* Java erc20 token standard chaincode implementation Signed-off-by: renjithpta <renjithkn@gmail.com>

Signed-off-by: renjithpta <renjithkn@gmail.com>
2022-04-19 07:39:53 -04:00
Tatsuya Sato
92c6916223
test-network-k8s: Remove kubectl binary (#719)
Since kubectl binary is mistakenly added in PR#713,
this patch removes it.

Signed-off-by: Tatsuya Sato <tatsuya.sato.so@hitachi.com>
2022-04-19 07:30:42 -04:00
Tatsuya Sato
5f88d951cf
test-network-k8s: Some minor improvements (#718)
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>
2022-04-19 07:29:52 -04:00
dependabot[bot]
c4886eda11
Bump moment in /asset-transfer-basic/rest-api-typescript (#711)
Bumps [moment](https://github.com/moment/moment) from 2.29.1 to 2.29.2.
- [Release notes](https://github.com/moment/moment/releases)
- [Changelog](https://github.com/moment/moment/blob/develop/CHANGELOG.md)
- [Commits](https://github.com/moment/moment/compare/2.29.1...2.29.2)

---
updated-dependencies:
- dependency-name: moment
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-18 09:40:29 -04:00
Tatsuya Sato
2df09e554d
Fix typos and broken links in docs (#712)
Signed-off-by: Tatsuya Sato <tatsuya.sato.so@hitachi.com>
2022-04-18 09:36:49 -04:00
Basil K Y
fdcf07dc25
fix wrong indentationin in the connection profile generated for Org 3 (#715)
Signed-off-by: Basil K Y <techiebasil@gmail.com>
2022-04-18 06:38:48 -04:00
Tatsuya Sato
f8df5452d8
test-network-k8s: Support for Loading images for rest sample to KIND (#713)
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>
2022-04-18 06:13:20 -04:00
jkneubuh
5414889399
fixes #708 : ca enrollments should be made with the ROOT CA cert (#710)
Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
2022-04-08 17:05:42 +01:00
renjithpta
1617406795
Java erc721 token standard chaincode implementation. (#709)
* Java ERC721 token standard chaincode implementation Signed-off-by: renjithpta <renjithkn@gmail.com>

Signed-off-by: renjithpta <renjithkn@gmail.com>

* Java erc20 nft token standard chaincode implementation. Signed-off-by: renjithpta <renjithkn@gmail.com>

Signed-off-by: renjithpta <renjithkn@gmail.com>
2022-04-08 11:49:52 -04:00
jkneubuh
40bfa49a80
Updates the README and documentation guide for the Kube test network's usage of Nginx ingress (#697)
* Update test-network-k8s README and docs with new Nginx Ingress

Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>

* Update cert paths in application_connection target

Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
2022-04-04 04:25:59 -04:00
Matthew B White
99e7ae8536
CORS Enablement (#696)
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>
2022-04-01 09:35:57 -04:00
Matthew B White
0262d264d8
Add in a -not -path option to find to prevent the command finding (#699)
hidden directories (typically .git) to lint

Signed-off-by: Matthew B White <whitemat@uk.ibm.com>
2022-04-01 08:40:28 -04:00
jkneubuh
a3ae179efb
test-network-k8s : Connect to Fabric services via Nginx Ingress - READY FOR MERGE (#692)
* 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>
2022-03-31 17:12:51 +01:00
Matthew B White
9fa171f824
Update the REST Example (#689)
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>
2022-03-31 08:19:34 -04:00
Dave Kelsey
57919f528d
fix chaincode breakage in asset-transfer-basic (#694)
only broken in main branch, not in release-2.2

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

Co-authored-by: D <d_kelsey@uk.ibm.com>
2022-03-31 08:38:05 +01:00
James Wilson
e1fb6269dc
Fix typo (#683)
* Fix Typo

Set up as two words functions as a verb.

Signed-off-by: James Wilson <jgwilson1214@gmail.com>
2022-03-23 15:18:22 +01:00
Charalampos Argyriou
bb57b3cf8f
Override default port of CA connection (#678)
Signed-off-by: Charalarg <charalarg@gmail.com>
2022-03-16 15:28:25 -04:00
sapthasurendran
f01eeab663
Private data samples migration (#574)
Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>

Updated application flow

Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>

Add grpc dependency in package.json

Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>

Update CI pipelines to run new app
Updated application description in package.json
Fixed chaincode name
Code Refactor
Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>
2022-03-09 08:51:48 +00:00
Yuki Kondo
70cce456d4
fix docs: Chaincode-as-a-service tutorial (#663)
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>
2022-03-09 08:49:34 +00:00
Dave Enyeart
2f3e9ffe3e
Fix ledger queries sample (#655)
-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>
2022-03-09 08:49:03 +00:00
Arnaud J Le Hors
8d7f3ca037
Fix sample external chaincode Dockerfile (#645)
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>
2022-03-09 08:47:59 +00:00
Arnaud J Le Hors
daf08981dd
Add external chaincode service for Nano Test Network (#650)
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>
2022-03-09 08:47:31 +00:00
James Taylor
4d2d51214c
Remove bash dependency from test network nano (#671)
The scripts do not require bash so switch to sh and add shellcheck linting

Signed-off-by: James Taylor <jamest@uk.ibm.com>
2022-03-09 08:46:56 +00:00
Dave Enyeart
67d3c65847
Update test-network-k8s to use two digit version (#668)
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>
2022-03-03 18:16:19 -05:00
D
b2d74ddbab fix addOrg3 for test network
Also added testing addOrg3 to build pipeline

Signed-off-by: D <d_kelsey@uk.ibm.com>
2022-03-03 17:14:49 -05:00
jkneubuh
dcc5e5650c
Update test network to fabric 2.4.3 (#660)
Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
2022-02-28 08:07:14 -05:00
Dave Enyeart
f50b52ad56
Remove duplicate erc-721 Go chaincode sample (#656)
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>
2022-02-23 09:34:40 +01:00
Matias Salimbene
5b480ce597
refactor folder structure to match other token samples (#652)
* go port to token-erc-721

Signed-off-by: Matias Salimbene <matias.saimbene@gmail.com>
Signed-off-by: Matias Salimbene <matias.salimbene@gmail.com>

* refactor folder structure

Signed-off-by: Matias Salimbene <matias.salimbene@gmail.com>

* refactor folder structure

Signed-off-by: Matias Salimbene <matias.salimbene@gmail.com>

* refactor chaincode go folder structure

Signed-off-by: Matias Salimbene <matias.salimbene@gmail.com>

* refactor folder struncture

Signed-off-by: Matias Salimbene <matias.salimbene@gmail.com>

Co-authored-by: Matias Salimbene <matias.saimbene@gmail.com>
2022-02-21 13:10:18 +00:00
Sam Yuan
2457b387c4
impl for couchdb supports in test0network8s as hardcode (#651)
* 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>
2022-02-21 06:07:24 -05:00
Kieran O Mahony
50a6dd62ad
Issue 602 (#641)
* 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>
2022-02-20 22:43:01 -05:00
Arnaud J Le Hors
75bdde97cd
Improve REST sample README (#647)
Add that one needs to have the ledger initialized for the sample to
work.

Signed-off-by: Arnaud J Le Hors <lehors@us.ibm.com>
2022-02-17 16:55:26 +00:00
Matias Salimbene
c309c364ce
go port to token-erc-721 (#625)
Signed-off-by: Matias Salimbene <matias.saimbene@gmail.com>

Co-authored-by: Matias Salimbene <matias.saimbene@gmail.com>
2022-02-15 14:58:51 +00:00
dependabot[bot]
6739199db2
Bump follow-redirects in /asset-transfer-basic/rest-api-typescript (#643)
Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.14.7 to 1.14.8.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.14.7...v1.14.8)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-15 15:36:23 +01:00
Charalampos Argyriou
f3db0572d0
test-network-k8s: High availability on application connection profiles (#639)
* Add peer gateway-svc as dnsNames on each peer's certificate

Signed-off-by: Charalarg <charalarg@gmail.com>

* Replace peer1 connections with gateway-svc in connection profiles of applications

Signed-off-by: Charalarg <charalarg@gmail.com>

* Update the org2 peer Gateway CSR host aliases to reference org2

Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>

Co-authored-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
2022-02-14 04:54:09 -05:00
Mark S. Lewis
bee24a7615
Add README to asset-transfer-basic sample (#638)
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>
2022-02-10 13:52:46 +00:00
Mark S. Lewis
58606efc06
Java gateway application sample for asset-transfer-events (#628)
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>
2022-02-09 09:59:14 +00:00
jkneubuh
fee6a44fcd
Run a basic-asset-transfer CI test on Kubernetes (#637)
Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
2022-02-08 15:51:02 +00:00
Matthew B White
19b8f6bcbd
Podman experimental and not native MacOs (#636)
Signed-off-by: Matthew B White <whitemat@uk.ibm.com>
2022-02-08 15:39:39 +01:00
Matthew B White
ecbf3f5db1
Support for using podman with the test-network (#596)
* 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>
2022-02-08 06:41:56 -05:00
Matthew B White
b50611575b
Make network.sh more tolerant (#634)
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>
2022-02-08 12:08:59 +01:00
jkneubuh
35be8f7425
Employs the Kubernetes cert-manager for storage and organization of TLS certificates. (#612)
Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
2022-02-08 09:31:09 +00:00
James Taylor
e7074ba941
Update REST sample with Redis password (#629)
Signed-off-by: James Taylor <jamest@uk.ibm.com>
2022-02-04 14:27:40 +00:00
James Taylor
5edae7c444
Update samples to use published fabric-rest-sample (#626)
Signed-off-by: James Taylor <jamest@uk.ibm.com>
2022-02-03 12:15:29 -05:00
Mark S. Lewis
a492d7d241
Fixes to TypeScript asset-transfer-events to match Go sample (#619)
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>
2022-02-03 10:13:54 -05:00
Ry Jones
975c9773bd Add credentials
Signed-off-by: Ry Jones <ry@linux.com>
2022-02-03 05:30:12 -08:00
Mark S. Lewis
d652275ef0
Run Go Gateway events sample in CI (#620)
Signed-off-by: Mark S. Lewis <mark_lewis@uk.ibm.com>
2022-02-02 14:50:21 -05:00
sapthasurendran
1a79d131b4
Asset-Transfer-Events Migration to Use Fabric-Gateway (#565)
* 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>
2022-02-02 17:01:42 +00:00
James Taylor
980da6f8aa
Add REST sample to CI (#611)
Build, test, and publish the REST server sample

Signed-off-by: James Taylor <jamest@uk.ibm.com>
2022-02-02 16:34:08 +00:00
Kieran O Mahony
62d9b03125
updating readme with all samples (#618)
* 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>
2022-02-02 16:23:24 +00:00
Dave Kelsey
893bc29bbe
further grafana dashboard improvements (#614)
- 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>
2022-02-02 15:30:09 +00:00
Dave Enyeart
9e9b8d3138
Update test-network to use org level ca-cert.pem (#609)
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>
2022-02-02 09:03:20 +00:00
James Taylor
5d3cc66c25
Convert comments to tsdoc in REST sample (#606)
Signed-off-by: James Taylor <jamest@uk.ibm.com>
2022-02-01 17:12:07 +01:00
Dave Kelsey
e2d351ed61
Minor improvement to test network docs (#607)
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>
2022-02-01 15:53:30 +00:00
Dave Kelsey
f79190e88b
Update the grafana dashboard (#610)
Addresses some incorrect queries

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

Co-authored-by: D <d_kelsey@uk.ibm.com>
2022-02-01 15:51:53 +00:00
Arnaud J Le Hors
730976a70e
Fix CHAINCODE_AS_A_SERVICE_TUTORIAL.md (#598)
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>
2022-01-29 16:19:50 -05:00
Mark S. Lewis
6f2b9c9d9a
Fix markdown logical structure in asset-transfer-events/README.md (#601)
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>
2022-01-27 20:19:49 +01:00
Mark S. Lewis
e33943cf4c
Refactor of asset transfer events Go sample for Fabric Gateway (#600)
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>
2022-01-27 09:39:16 -05:00
deeptiraom
e372006be7
client java application using gateway api in java sdk (#572)
* 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>
2022-01-27 13:57:14 +00:00
Mark S. Lewis
2581f10984
Asset transfer events Go sample for Fabric Gateway (#597)
Signed-off-by: Mark S. Lewis <mark_lewis@uk.ibm.com>
2022-01-26 16:52:53 -05:00
Mark S. Lewis
0f877fad4d
Remove JCenter as a Gradle package repository (#589)
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>
2022-01-26 16:29:09 -05:00
fraVlaca
77431f5b39
add prometheus/grafana performances sample into test-network directory (#576)
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>
2022-01-20 09:37:37 +00:00
dependabot[bot]
84c101fb8a
Bump follow-redirects in /asset-transfer-basic/rest-api-typescript (#584)
Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.14.6 to 1.14.7.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.14.6...v1.14.7)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-19 14:36:23 +01:00
Eugene
e0d11fe8de
remove shift after verbose (#586)
Signed-off-by: eugene9467 <eugene@kth.tw>

Co-authored-by: eugene9467 <eugene@kth.tw>
2022-01-19 14:35:20 +01:00
Vinay Aggarwal
29ff95e2c6
Added 'jq' to prerequisite and readme for k8s test network (#582)
Signed-off-by: Vinay <vinayaggarwal@softwaysolutions.com>

Co-authored-by: Vinay <vinayaggarwal@softwaysolutions.com>
2022-01-14 13:13:06 -05:00
sapthasurendran
48fe95ee30
Added missing dependency,Updated ci pipelines to include gateway go application (#577)
Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>
2022-01-12 13:41:38 +00:00
James Taylor
887e4a3578
Update REST sample readme (#575)
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>
2022-01-12 10:38:44 +00:00
Mark S. Lewis
3457690148
Default timeouts for basic Gateway TypeScript sample (#573)
Signed-off-by: Mark S. Lewis <mark_lewis@uk.ibm.com>
2022-01-07 15:37:13 +00:00
Justin Yang
0d7fa171d1
test-network: Fix a indentation for readability (#568)
Additionally, remove a trailing white space

Signed-off-by: Justin Yang <justin.yang@themedium.io>
2021-12-22 09:56:10 -05:00
Matthew B White
e07a9ff86b
Adding examples of CCAAS and support into the test-network-k8s (#527)
* 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>
2021-12-17 14:09:03 +00:00
Matthew B White
96623f1bd5
Adding examples of CCAAS and support into the test-network (#560)
- 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>
2021-12-17 13:18:22 +00:00
James Taylor
ad20a5178d
Add build status to readme (#564)
Signed-off-by: James Taylor <jamest@uk.ibm.com>
2021-12-16 11:37:05 +00:00
Matthew B White
c646c5904f
Merge pull request #510 from jt-nti/rest-sample
Initial REST sample
2021-12-15 17:27:53 +00:00
James Taylor
dd59991b57 Merge remote-tracking branch 'fabric-rest-sample/prepare-samples-pr' into rest-sample 2021-12-15 14:26:49 +00:00
James Taylor
af2f6e005c Prepare REST sample for fabric-samples repository
Signed-off-by: James Taylor <jamest@uk.ibm.com>
2021-12-15 14:25:09 +00:00
James Taylor
fce803af24 Add jobs spec tests
Signed-off-by: James Taylor <jamest@uk.ibm.com>
2021-12-15 14:24:58 +00:00
James Taylor
dfe79f7fb4 Add comments to jobs.ts
Signed-off-by: James Taylor <jamest@uk.ibm.com>
2021-12-15 14:24:34 +00:00
sapthasurendran
0208892429
Go samples Migration to fabric-gateway (#561)
* go packages

Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>

* Go sample Migration  to fabric-gateway

Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>

lint script changes

Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>

lint fixes

Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>

Upgrade go to 1.16

Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>

add go mod

Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>

To match with docs

Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>

lint updates

Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>
2021-12-15 10:26:46 +00:00
James Taylor
5447e3534d Add node, and npm version requirements
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>
2021-12-14 14:31:24 +00:00
James Taylor
711f1f560b Use app.locals to store contracts and jobq
“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>
2021-12-14 14:31:24 +00:00
James Taylor
66199000ca Fix lint errors
Signed-off-by: James Taylor <jamest@uk.ibm.com>
2021-12-14 14:31:24 +00:00
James Taylor
5d92abc52d Clarify retry logic
Improve the separation between Fabric logic and the job queue implementation details

Signed-off-by: James Taylor <jamest@uk.ibm.com>
2021-12-14 14:31:24 +00:00
James Taylor
b0256a57b5 Signpost configuration details
Signed-off-by: James Taylor <jamest@uk.ibm.com>
2021-12-14 14:31:24 +00:00
James Taylor
5a32d803c9 Use user credentials
Use User1 certificate and private key for org1 and org2 instead of Admin credentials

Signed-off-by: James Taylor <jamest@uk.ibm.com>
2021-12-14 14:31:24 +00:00
James Taylor
2d7da062d8 Update Dockerfile
Fabric is on alpine 3.14 so update the sample to match

Signed-off-by: James Taylor <jamest@uk.ibm.com>
2021-12-14 14:31:24 +00:00
James Taylor
b1bc6663b8 Update readme
Minor changes for Fabric 2.4 and the main branch of fabric-samples

Signed-off-by: James Taylor <jamest@uk.ibm.com>
2021-12-14 14:31:24 +00:00
James Taylor
ad3fd7e832 Update retry logic
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>
2021-12-14 14:31:23 +00:00
Josh Kneubuhl
3e49e92703 wrong Dockerfile path - try again
Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
2021-12-14 14:31:23 +00:00
Josh Kneubuhl
211523eb9f Set up a GitHub action to publish the image to ghcr.io/hyperledgendary/fabric-rest-sample
Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
2021-12-14 14:31:23 +00:00
James Taylor
0456a9e94c Move error related functions to errors.ts
Signed-off-by: James Taylor <jamest@uk.ibm.com>
2021-12-14 14:31:23 +00:00
James Taylor
fd269237d4 Add comments to fabric.ts
Signed-off-by: James Taylor <jamest@uk.ibm.com>
2021-12-14 14:31:23 +00:00
James Taylor
00a2dea50b Add block event listener config
Signed-off-by: James Taylor <jamest@uk.ibm.com>
2021-12-14 14:31:23 +00:00
James Taylor
f1a9fea77d Fix lint errors
Signed-off-by: James Taylor <jamest@uk.ibm.com>
2021-12-14 14:31:23 +00:00
James Taylor
e6738818e5 Update readmes
Move usage instructions to the node sample directory and add overview/next steps
to top level readme

Signed-off-by: James Taylor <jamest@uk.ibm.com>
2021-12-14 14:31:23 +00:00
sapthasurendran
9aec7ffd2a Clear Transaction when no contract found
Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>
2021-12-14 14:31:23 +00:00
James Taylor
bf91df7ef3 Update transaction retry to use correct user
Also improves test coverage

Signed-off-by: James Taylor <jamest@uk.ibm.com>
2021-12-14 14:31:21 +00:00
James Taylor
82b1249f4e Improve Docker support
- 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>
2021-12-14 14:31:21 +00:00
James Taylor
5d1adddd03 Refactor health routes in to separate file
Signed-off-by: James Taylor <jamest@uk.ibm.com>
2021-12-14 14:31:21 +00:00
James Taylor
45683b2a1a Simplify fabric code
Attempt to make fabric code easier to document

Signed-off-by: James Taylor <jamest@uk.ibm.com>
2021-12-14 14:31:21 +00:00
James Taylor
862080773e Initial API tests
Signed-off-by: James Taylor <jamest@uk.ibm.com>
2021-12-14 14:31:21 +00:00
sapthasurendran
6477333743 redis mock class
code cleanup

created fabric.spec

redis testcases and additional checks

Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>
2021-12-14 14:31:21 +00:00
James Taylor
f904adbf6f Add config spec tests
Signed-off-by: James Taylor <jamest@uk.ibm.com>
2021-12-14 14:31:20 +00:00
James Taylor
e81a7a8b46 Update port number config
Discovered that env-var will validate port numbers, which is nice

Signed-off-by: James Taylor <jamest@uk.ibm.com>
2021-12-14 14:31:20 +00:00
sapthasurendran
5bea58e501 retry condition moved to startretryloop
Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>
2021-12-14 14:31:20 +00:00
sapthasurendran
b8509490ad retry count check
build err fix

retry condition testcase

retryCount to maxRetryCount

Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>
2021-12-14 14:31:18 +00:00
sapthasurendran
73049e0153 docker file for app
readme update for docker

added dockerignore

added dumb-init

env var added to compose

readme update

Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>
2021-12-14 14:31:17 +00:00
James Taylor
4277f4a68f Fix dist output
The jest.config.ts file was causing unintended changes to the dist folder

Signed-off-by: James Taylor <jamest@uk.ibm.com>
2021-12-14 14:31:15 +00:00
James Taylor
9f48a42418 Initial test framework
Add Jest test framework

Signed-off-by: James Taylor <jamest@uk.ibm.com>
2021-12-14 14:31:15 +00:00
sapthasurendran
9ae66c76da switch gateway based on user org
Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>

initialized fabric components to global app const

getcontractforOrg for transaction router

removed org and reused identityOrg1

env.sample file update

liveness api update

Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>
2021-12-14 14:31:15 +00:00
James Taylor
05f7026e58 Update api key header
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>
2021-12-14 14:31:13 +00:00
sapthasurendran
c3a34ef559 apikey auth for Org1
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>
2021-12-14 14:31:13 +00:00
sapthasurendran
d4318c381a liveness
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>
2021-12-14 14:31:12 +00:00
sapthasurendran
fc769cfcb0 event handler strategy changes
Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>
2021-12-14 14:31:11 +00:00
sapthasurendran
31b08b9151 removed txn commit event handler
Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>
2021-12-14 14:31:10 +00:00
sapthasurendran
5d6e916436 changed getContract arg
Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>
2021-12-14 14:31:09 +00:00
sapthasurendran
550e95f091 Added blockEvent handler
Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>
2021-12-14 14:31:05 +00:00
sapthasurendran
804f4a6468 added getNetwork functionality
Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>
2021-12-14 14:31:00 +00:00
James Taylor
19e28d817b Fix retry
Adding multiple contracts had broken the retry loop

Signed-off-by: James Taylor <jamest@uk.ibm.com>
2021-12-14 14:14:57 +00:00
James Taylor
3667dd9322 Add Jira link to readme
Also adds new transactions endpoint example

Signed-off-by: James Taylor <jamest@uk.ibm.com>
2021-12-14 14:14:56 +00:00
James Taylor
432da5defd Add get transaction endpoint
Signed-off-by: James Taylor <jamest@uk.ibm.com>
2021-12-14 14:14:56 +00:00
James Taylor
60aedf1b82 Refactor transaction logic
Remove duplication and handle errors from the asset transfer smart contract

Signed-off-by: James Taylor <jamest@uk.ibm.com>
2021-12-14 14:14:56 +00:00
James Taylor
273fc2833a Add REST Client demo file
Add demo file for use with the REST Client for Visual Studio Code

Signed-off-by: James Taylor <jamest@uk.ibm.com>
2021-12-14 14:14:56 +00:00
James Taylor
400367e8a6 Add get all assets endpoint
Signed-off-by: James Taylor <jamest@uk.ibm.com>
2021-12-14 14:14:56 +00:00
James Taylor
d810128fcd Add patch endpoint
Signed-off-by: James Taylor <jamest@uk.ibm.com>
2021-12-14 14:14:56 +00:00
James Taylor
8250359db6 Add delete and put endpoints
Signed-off-by: James Taylor <jamest@uk.ibm.com>
2021-12-14 14:14:56 +00:00
James Taylor
8ebca62b40 Fix lint errors
Signed-off-by: James Taylor <jamest@uk.ibm.com>
2021-12-14 14:14:56 +00:00
James Taylor
f06f1eed4b Update logging
Signed-off-by: James Taylor <jamest@uk.ibm.com>
2021-12-14 14:14:56 +00:00
James Taylor
d9e0de606b Update readme
Signed-off-by: James Taylor <jamest@uk.ibm.com>
2021-12-14 14:14:56 +00:00
James Taylor
3b50404763 Initial create asset logic
Signed-off-by: James Taylor <jamest@uk.ibm.com>
2021-12-14 14:14:56 +00:00
James Taylor
324f1c8683 Specify query handler strategy
Avoid load on a single peer by specifying the PREFER_MSPID_SCOPE_ROUND_ROBIN
strategy

Signed-off-by: James Taylor <jamest@uk.ibm.com>
2021-12-14 14:14:56 +00:00
James Taylor
9c98450946 Initial asset route
Signed-off-by: James Taylor <jamest@uk.ibm.com>
2021-12-14 14:14:56 +00:00
James Taylor
1f8bc889cf Enable alwaysStrict compile option
Signed-off-by: James Taylor <jamest@uk.ibm.com>
2021-12-14 14:14:56 +00:00
James Taylor
063b21dd3f Initial REST API skeleton
Signed-off-by: James Taylor <jamest@uk.ibm.com>
2021-12-14 14:14:56 +00:00
James Taylor
bbf7096e44 Initial commit
Signed-off-by: James Taylor <jamest@uk.ibm.com>
2021-12-14 14:14:39 +00:00
Mark S. Lewis
72559dfbb5
More Gateway asset-transfer-basic tweaks to support docs (#556)
Signed-off-by: Mark S. Lewis <mark_lewis@uk.ibm.com>
2021-12-10 08:51:21 +00:00
sapthasurendran
9df7e9f86d
Configtxlator script changes (#552)
Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>
2021-12-09 11:37:38 +00:00
Baran Kılıç
06d67ecbfa
Add acknowledgement text for erc1155 chaincode (#554)
Signed-off-by: Baran Kılıç <baran.kilic@boun.edu.tr>
2021-12-09 10:21:16 +00:00
Mark S. Lewis
f151039f8a
Updates to asset-transfer-basic Gateway sample to align with docs (#553)
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>
2021-12-09 10:20:52 +00:00
sapthasurendran
e963ddc726
lint Fix (#555)
Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>
2021-12-09 09:44:25 +00:00
David Faulstich Diniz Reis
7fd6edb662
Query assets with pagination functions of marbles02 and asset_transfer_ledger_chaincode chaincodes without ResponseMetadata fetchedRecordsCount and bookmark (#547)
Signed-off-by: David Faulstich Diniz Reis <davidfdr@gmail.com>
2021-11-25 15:51:51 +00:00
fraVlaca
ce66638035
Extend test network to support prometheus/grafana performances framework (#542)
Signed-off-by: fraVlaca <ocsenarf@outlook.com>
2021-11-24 16:04:42 +00:00
Matthew B White
a97e8d1267
Get label for chaincode from metadata.json (#509)
Signed-off-by: Matthew B White <whitemat@uk.ibm.com>
2021-11-22 08:25:38 -05:00
sapthasurendran
3d17cf066d
Updated fabric-gateway changes and added node14 dependency (#539)
Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>
2021-11-22 08:55:14 +00:00
Dave Enyeart
f898a3768d
Update test-network-k8s readme with High Availability doc link (#540)
Signed-off-by: David Enyeart <enyeart@us.ibm.com>
2021-11-22 08:54:39 +00:00
Dave Enyeart
22c54b4690
Fix test network nano peer4 id (#541)
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>
2021-11-22 08:54:14 +00:00
jkneubuh
ab19b8e01d
Address Issue #511 with docs and better error handling (#533)
* 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>
2021-11-19 16:09:58 +00:00
Matthew B White
d19a7e4b02
Setup basic HA features for the Peers (#532)
- 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>
2021-11-19 16:08:26 +00:00
denyeart
271dfbb9bc
Nominate Josh Kneubuhl as fabric-samples maintainer (#536)
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>
2021-11-15 08:36:43 +00:00
James Taylor
60d5d3e218
Update application-gateway-typescript (#531)
The fabric-gateway node module has been renamed to @hyperledger/fabric-gateway

Signed-off-by: James Taylor <jamest@uk.ibm.com>
2021-11-11 09:35:50 +00:00
denyeart
4640ab2e69
Retire dormant maintainers (#535)
Several fabric-samples maintainers have moved on to other projects.
See maintainer policies at
https://hyperledger-fabric.readthedocs.io/en/latest/CONTRIBUTING.html#becoming-a-maintainer

Signed-off-by: David Enyeart <enyeart@us.ibm.com>
2021-11-10 21:15:21 +01:00
James Taylor
d2eef4786d
Update node version in CI (#534)
Several Fabric projects have updated their supported node versions and 16.x is the active LTS version

Signed-off-by: James Taylor <jamest@uk.ibm.com>
2021-11-10 17:17:18 +00:00
jkneubuh
8183da6666
Add an option to stage docker images locally to KIND (#528)
Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
2021-11-10 09:56:57 +00:00
Tatsuya Sato
8c1c36ae09 Fix type error when using the latest sort-keys-recursive
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>
2021-11-05 11:47:55 -04:00
Sam Yuan
0a1efc45cd
nit fixs (#519)
1. busybox latest image tag
2. pull images with more images
3. load images to kind cluster at local

Signed-off-by: Sam Yuan <yy19902439@126.com>
2021-11-02 15:43:31 +00:00
Matthew B White
6627cd6d65 review cmts
Signed-off-by: Matthew B White <whitemat@uk.ibm.com>
2021-11-01 16:15:30 -04:00
Matthew B White
337584045d Updated logging
- 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>
2021-11-01 16:15:30 -04:00
Matthew B White
cc8123bdc5 Remove temporary buildfiles
Signed-off-by: Matthew B White <whitemat@uk.ibm.com>
2021-11-01 16:12:58 -04:00
jkneubuh
1b1ef046c1
Allow overrides of the docker registry for fabric images (#518)
Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
2021-10-27 16:24:26 +01:00
Justin Yang
d47b2c286a
test-network: Make the regexp of checking version more strict (#515)
Signed-off-by: Justin Yang <justin.yang@themedium.io>
2021-10-26 11:24:15 +01:00
denyeart
3ba21b4f11
Fix function comment in asset-transfer-ledger-queries (#502)
Fix typo in function comment.

Thanks to RobertBetschinger for finding this issue.

Signed-off-by: David Enyeart <enyeart@us.ibm.com>
2021-10-26 11:22:42 +01:00
Sam Yuan
d81684fa0a
resolve for #512 (#513)
Signed-off-by: Sam Yuan <yy19902439@126.com>
2021-10-25 16:02:06 +01:00
sapthasurendran
5355fb1b39 Asset Transfer typescript app using fabric-gateway
Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>

Added Fabric gateway and removed ca,tslint dependencies

Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>

eslint migration

Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>

Added gitignore

Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>

Transaction Flow Changes

Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>

Removed serviceClient import,removed outer try catch from main

Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>

updated fabric-gateway version

Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>

transaction verification flow change

Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>

Improved main function readability

Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>

extra comments

Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>

Updated fabric-gateway to latest

Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>
2021-10-15 09:51:16 -04:00
jkneubuh
576b2e74c9
Do not weep for the KIND prototype. The [new one](test-network-k8s) is much better. (#503)
"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>
2021-10-07 14:08:22 -04:00
jkneubuh
30fb81a341
Run the fabric test network on Kubernetes (#498)
* 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>
2021-10-06 15:50:39 +00:00
Matthew B White
3ba63b15d6
Update go.mod (#500)
Signed-off-by: Matthew B White <whitemat@uk.ibm.com>
2021-10-06 11:35:43 -04:00
nao
216d422f11
Fix: Cannot launch chaincode in nano bash in Linux (#468)
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>
2021-10-06 13:34:04 +01:00
sapthasurendran
56a1bf3e19
* Made consistent lint command (#495)
* Removed global install of lint modules
* Fixed Lint Issues

Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>

added lint script forapplication javascript

Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>

updated lint command  for chaincode javascript

Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>

updated lint script

Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>

remove installing dependencies

Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>

added lint script to js projects

Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>

added more lint scripts

Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>

added more lint scripts

Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>

added missing npm lint command

Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>

added missing eslint npm module

Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>

Fix missing npm lint command

Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>

added missing eslint npm module to auction-simple javascctipt app

Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>

added eslint npm module

Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>

added eslint dependency

Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>

added eslint dependency

Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>

added eslint dependency

Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>

Single command for ts js lint

Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>

Fix or condition in lint.sh

Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>
2021-10-06 13:33:29 +01:00
denyeart
ee959a2eb0
Update to Go 1.16.7 (#491)
Update Go to 1.16.7 and run "go mod tidy"
to clean up go modules in samples.

Signed-off-by: David Enyeart <enyeart@us.ibm.com>
2021-10-01 09:16:56 +01:00
Baran Kılıç
98028c7da0 Fix ERC1155 chaincode indeterminism caused by iterating maps in Go
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>
2021-09-29 17:23:35 -04:00
Indranil Majumder
c1615b31ee Checking both the old and new lifecycle name
Signed-off-by: Indranil Majumder <indranil.majumder@navis.com>
2021-09-29 17:14:35 -04:00
Indranil Majumder
7a727eb69a changes to support couchdb 3.1.1
Signed-off-by: Indranil Majumder <indranil.majumder@navis.com>
2021-09-29 17:14:35 -04:00
jkneubuh
5860027ac8
kubernetes test network : initial commit (#471)
* 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>
2021-09-09 14:04:07 +01:00
Matthew B White
a97c0b0359
Add in a setEnvOrg script (#487)
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>
2021-09-08 14:54:11 +00:00
nikhil550
38e08da13b
Rm docker files mount for CLI container (#479)
Signed-off-by: Nikhil Gupta <ngupta@triplepointliquidity.com>

Co-authored-by: Nikhil Gupta <ngupta@triplepointliquidity.com>
Co-authored-by: Arnaud J Le Hors <lehors@us.ibm.com>
2021-09-07 14:22:26 +00:00
fraVlaca
53f0ef0d92
updated chaincodes for asset-transfer-basic in order to show good example on how achieving determinism over json (#486)
* 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>
2021-09-06 13:47:25 +01:00
Luciano da Silva Ribas
bd559c81c8
Fixed state deserialize which is an uint enum in contract definition. (#467)
Signed-off-by: Luciano da Silva Ribas <luciano.ribas+git@gmail.com>

Co-authored-by: Matthew B White <mbwhite@users.noreply.github.com>
2021-09-03 08:16:35 +00:00
QQ喵
42c456ffda
Clean install folder for Java (#475)
Signed-off-by: gqqnbig <gqqnb2005@gmail.com>

Co-authored-by: Matthew B White <mbwhite@users.noreply.github.com>
2021-09-03 07:54:36 +00:00
nao
b8edd6593f
Fix: logspec output (#470)
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>
2021-09-03 08:09:51 +01:00
Arnaud J Le Hors
2b47c9f0c0
Update Compose Spec & VM Spec Version (#482)
Based on PR 449 by Brett Logan <lindluni@github.com>

Signed-off-by: Arnaud J Le Hors <lehors@us.ibm.com>
2021-09-02 10:26:14 +01:00
Baran Kılıç
36fb3a9273
Add ERC1155 chaincode in Go (#463)
Signed-off-by: Baran Kılıç <baran.kilic@boun.edu.tr>
2021-09-01 23:05:57 +02:00
fraVlaca
da65e20f7d
Updated dependencies for Json and fabric-chaincode-shim:2.+ in java samples (#481)
* 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>
2021-09-01 20:19:15 +02:00
Jason Yellick
a470b20944 Retire Jason Yellick as maintainer.
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>
2021-08-30 23:03:08 -04:00
denyeart
2663a07765
Test network nano bash - initial commit (#450)
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>
2021-08-11 13:53:47 +01:00
Tatsuya Sato
8890d49d19
Fix typo (#466)
Signed-off-by: Tatsuya Sato <tatsuya.sato.so@hitachi.com>
2021-08-02 13:33:25 -04:00
Saliou
fb648c519d
change docker-compose version from 2 to 2.4 on folder addOrg3/docker (#448)
* 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>
2021-08-02 11:50:19 +02:00
nao
31ef28e647
Support docker.sock in rootless mode (#447)
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>
2021-07-26 16:11:14 +02:00
James Taylor
f84754ea3b
Update CreateAsset txn in basic js and ts sample (#460)
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>
2021-07-16 14:10:12 -04:00
ankitm123
f38845ecab
chore: minor simplification of configtx yaml (#459)
We dont need << as we are not adding or overwriting any values.

Signed-off-by: ankitm123 <ankitmohapatra123@gmail.com>
2021-07-12 17:42:23 +02:00
Yuki Kondo
d5d8ff1539
Fix off_chain_data to put data to off-chain database (#457)
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>
2021-07-07 16:40:46 -04:00
Dave Kelsey
0d64a1b70c
New HSM Typescript Sample (#455)
Signed-off-by: D <d_kelsey@uk.ibm.com>

Co-authored-by: D <d_kelsey@uk.ibm.com>
2021-07-06 11:48:34 +01:00
yuppieghost
04806b604d
Update asset_transfer_ledger_chaincode.js (#452)
fabric 2.x use **txId ** in res.value

Signed-off-by: yuppieghost <wjj315315@gmail.com>
2021-07-06 08:36:17 +01:00
Varad Ramamoorthy
5e933c10cb
expose operations port (#453)
Signed-off-by: Varad Ramamoorthy <varad@us.ibm.com>
2021-06-30 16:07:54 -04:00
nikhil550
1cd71fd26a
Add dutch auction sample with auditor (#426)
Signed-off-by: NIKHIL E GUPTA <ngupta@symbridge.com>
2021-05-24 22:01:54 +02:00
Dave Kelsey
9f07960dae
Correct Javascript Chaincode (#445)
- In CreateAsset, await was never called on putState causing issues
especially with tools such as caliper and is not correct practice.
Unfortunately all the other examples use `return` which works but is
actually not the idiomatic way of handling promises, so here await is
chosen rather than return

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

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

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

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

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

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

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

* Update the chaincode.env with new options

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

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

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

* Add docker compose file for running chaincodes

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

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

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

* Introduce crypto directory and ignore the pem contents

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

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

* Instructions on TLS enabled external chaincode server

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

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

* Enable chaincode to work without TLS as well

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Thanks

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

* Double quote variables evaluations that depends on $PWD

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

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

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

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

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

* remove unnecessary leading space trimming

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

* resolved conflict with master

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

Signed-off-by: Julian Castrence <juliancastrence@ibm.com>
2021-01-19 20:55:19 -05:00
Brett Logan
622cf52814 Update Fabric Dependency Version
Signed-off-by: Brett Logan <brett.t.logan@ibm.com>
2021-01-19 13:02:01 -05:00
1341 changed files with 142389 additions and 30458 deletions

View file

@ -1,16 +1,17 @@
#
# SPDX-License-Identifier: Apache-2.0
#
root = true root = true
[*] [*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8 charset = utf-8
trim_trailing_whitespace = true indent_style = space
insert_final_newline = true insert_final_newline = true
trim_trailing_whitespace = true
[*.{mj,cj,j,t}s]
indent_size = 4
quote_type = single
[*.json]
indent_size = 4
[*.md] [*.md]
trim_trailing_whitespace = false max_line_length = off

53
.github/actions/fsat-setup/action.yaml vendored Normal file
View file

@ -0,0 +1,53 @@
name: Set up the Full Stack Asset Transfer Guide Dependencies
description: Set up the Full Stack Asset Transfer Guide Dependencies
inputs:
node-version:
description: Version of node
default: "lts/*"
just-version:
description: Just Version
default: "1.43.0"
k9s-version:
description: k9s Version
default: v0.50.15
fabric-version:
description: Version of Hyperledger Fabric
default: "2.5.15"
ca-version:
description: Version of Hyperledger Fabric CA
default: "1.5.15"
runs:
using: "composite"
steps:
- uses: actions/setup-node@v6
with:
node-version: ${{ inputs.node-version }}
cache: "npm"
cache-dependency-path: "**/package-lock.json"
- name: Install k9s
shell: bash
run: |
curl --fail --silent --show-error -L https://github.com/derailed/k9s/releases/download/${{ inputs.k9s-version }}/k9s_Linux_amd64.tar.gz -o /tmp/k9s_Linux_amd64.tar.gz
tar -zxf /tmp/k9s_Linux_amd64.tar.gz -C /usr/local/bin k9s
sudo chown root /usr/local/bin/k9s
sudo chmod 755 /usr/local/bin/k9s
- name: Install just
uses: taiki-e/install-action@v2
with:
tool: just@${{ inputs.just-version }}
- name: Install weft
shell: bash
run: |
npm install -g @hyperledger-labs/weft
- name: Install fabric CLI
shell: bash
working-directory: full-stack-asset-transfer-guide
run: |
curl -sSL https://raw.githubusercontent.com/hyperledger/fabric/main/scripts/install-fabric.sh \
| bash -s -- binary --fabric-version ${{ inputs.fabric-version }} --ca-version ${{ inputs.ca-version }}
echo ${PWD}/bin >> $GITHUB_PATH

View file

@ -0,0 +1,63 @@
name: Set up Test Network Runner
description: Set up the Test Network Runtime
inputs:
go-version:
description: Version of go
default: stable
node-version:
description: Version of node
default: "lts/*"
java-version:
description: Version of JDK
default: 25.x
fabric-version:
description: Version of Hyperledger Fabric
default: 2.5.15
ca-version:
description: Version of Hyperledger Fabric CA
default: 1.5.15
runs:
using: "composite"
steps:
- uses: actions/setup-go@v6
with:
go-version: ${{ inputs.go-version }}
cache-dependency-path: "**/go.sum"
- uses: actions/setup-node@v6
with:
node-version: ${{ inputs.node-version }}
cache: "npm"
cache-dependency-path: "**/package-lock.json"
- uses: actions/setup-java@v5
with:
distribution: temurin
java-version: ${{ inputs.java-version }}
cache: gradle
- name: Install fabric CLI
shell: bash
run: |
curl -sSL https://raw.githubusercontent.com/hyperledger/fabric/main/scripts/install-fabric.sh \
| bash -s -- binary --fabric-version ${{ inputs.fabric-version }} --ca-version ${{ inputs.ca-version }}
echo ${PWD}/bin >> $GITHUB_PATH
- name: Pull Fabric Docker Images
shell: bash
run: |
curl -sSL https://raw.githubusercontent.com/hyperledger/fabric/main/scripts/install-fabric.sh \
| bash -s -- docker --fabric-version ${{ inputs.fabric-version }} --ca-version ${{ inputs.ca-version }}
- name: Pull chaincode container images
shell: bash
run: |
docker pull ghcr.io/hyperledger/fabric-nodeenv:2.5
docker tag ghcr.io/hyperledger/fabric-nodeenv:2.5 hyperledger/fabric-nodeenv:2.5
docker pull ghcr.io/hyperledger/fabric-javaenv:2.5
docker tag ghcr.io/hyperledger/fabric-javaenv:2.5 hyperledger/fabric-javaenv:2.5
- name: Install retry CLI
shell: bash
run: curl -sSL https://raw.githubusercontent.com/kadwanev/retry/master/retry -o ./bin/retry && chmod +x ./bin/retry

6
.github/dependabot.yml vendored Normal file
View file

@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: weekly

View file

@ -1,10 +1,10 @@
repository: repository:
name: fabric-samples name: fabric-samples
description: null description: Samples for Hyperledger Fabric
homepage: https://wiki.hyperledger.org/display/fabric homepage: https://lf-hyperledger.atlassian.net/wiki/spaces/fabric
default_branch: master default_branch: main
has_downloads: true has_downloads: true
has_issues: false has_issues: true
has_projects: false has_projects: false
has_wiki: false has_wiki: false
archived: false archived: false

65
.github/workflows/lint.yaml vendored Normal file
View file

@ -0,0 +1,65 @@
#
# SPDX-License-Identifier: Apache-2.0
#
name: Lint 🎉
run-name: ${{ github.actor }} is linting fabric-samples 🎉
on:
workflow_dispatch:
push:
branches: ["main", "release-2.5"]
pull_request:
branches: ["main", "release-2.5"]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
NODE_VER: "lts/*"
JAVA_VER: 25.x
jobs:
go:
runs-on: ${{ github.repository == 'hyperledger/fabric-samples' && 'fabric-ubuntu-22.04' || 'ubuntu-22.04' }}
steps:
- uses: actions/setup-go@v6
with:
go-version: stable
- uses: actions/checkout@v6
- run: go install golang.org/x/tools/cmd/goimports@latest
- run: ci/scripts/lint-go.sh
typescript:
runs-on: ${{ github.repository == 'hyperledger/fabric-samples' && 'fabric-ubuntu-22.04' || 'ubuntu-22.04' }}
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: ${{ env.NODE_VER }}
- run: ci/scripts/lint-typescript.sh
javascript:
runs-on: ${{ github.repository == 'hyperledger/fabric-samples' && 'fabric-ubuntu-22.04' || 'ubuntu-22.04' }}
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: ${{ env.NODE_VER }}
- run: ci/scripts/lint-javascript.sh
java:
runs-on: ${{ github.repository == 'hyperledger/fabric-samples' && 'fabric-ubuntu-22.04' || 'ubuntu-22.04' }}
steps:
- uses: actions/checkout@v6
- uses: actions/setup-java@v5
with:
distribution: temurin
java-version: ${{ env.JAVA_VER }}
- run: ci/scripts/lint-java.sh
shell:
runs-on: ${{ github.repository == 'hyperledger/fabric-samples' && 'fabric-ubuntu-22.04' || 'ubuntu-22.04' }}
steps:
- uses: actions/checkout@v6
- run: ci/scripts/lint-shell.sh

58
.github/workflows/rest-sample.yaml vendored Normal file
View file

@ -0,0 +1,58 @@
#
# SPDX-License-Identifier: Apache-2.0
#
name: REST Sample 🐧
run-name: ${{ github.actor }} is testing the REST Sample 🐧
env:
NODE_VER: "lts/*"
on:
workflow_dispatch:
push:
branches: ["main", "release-2.5"]
paths: ["asset-transfer-basic/rest-api-typescript/**"]
pull_request:
branches: ["main", "release-2.5"]
paths: ["asset-transfer-basic/rest-api-typescript/**"]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
test-sample:
runs-on: ${{ github.repository == 'hyperledger/fabric-samples' && 'fabric-ubuntu-22.04' || 'ubuntu-22.04' }}
steps:
- name: Checkout
uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: ${{ env.NODE_VER }}
cache: "npm"
cache-dependency-path: "**/package-lock.json"
- name: Install REST Sample Dependencies
working-directory: asset-transfer-basic/rest-api-typescript
run: npm install
- name: Build REST Sample Application
run: npm run build
working-directory: asset-transfer-basic/rest-api-typescript
- name: Test REST Sample Application
run: npm test
working-directory: asset-transfer-basic/rest-api-typescript
- name: Build REST Sample Docker Image
run: docker build -t ghcr.io/hyperledger/fabric-rest-sample .
working-directory: asset-transfer-basic/rest-api-typescript
- name: Publish REST Sample Docker Image
if: github.event_name == 'push' && (github.ref == 'refs/heads/main')
run: |
echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin
docker push ghcr.io/hyperledger/fabric-rest-sample:latest
working-directory: asset-transfer-basic/rest-api-typescript

59
.github/workflows/test-fsat.yaml vendored Normal file
View file

@ -0,0 +1,59 @@
name: Full Stack Asset Transfer Guide 🚀
run-name: ${{ github.actor }} is testing the Full Stack Asset Transfer Guide 🚀
on:
workflow_dispatch:
pull_request:
branches:
- "main"
- "release-2.5"
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
ansible:
runs-on: ${{ github.repository == 'hyperledger/fabric-samples' && 'fabric-ubuntu-22.04' || 'ubuntu-22.04' }}
steps:
- uses: actions/checkout@v6
- name: Set up Full Stack Runtime
uses: ./.github/actions/fsat-setup
- run: just test-ansible
working-directory: full-stack-asset-transfer-guide
appdev:
runs-on: ${{ github.repository == 'hyperledger/fabric-samples' && 'fabric-ubuntu-22.04' || 'ubuntu-22.04' }}
steps:
- uses: actions/checkout@v6
- name: Set up Full Stack Runtime
uses: ./.github/actions/fsat-setup
- run: just test-appdev
working-directory: full-stack-asset-transfer-guide
chaincode:
runs-on: ${{ github.repository == 'hyperledger/fabric-samples' && 'fabric-ubuntu-22.04' || 'ubuntu-22.04' }}
steps:
- uses: actions/checkout@v6
- name: Set up Full Stack Runtime
uses: ./.github/actions/fsat-setup
- run: just test-chaincode
working-directory: full-stack-asset-transfer-guide
cloud:
runs-on: ${{ github.repository == 'hyperledger/fabric-samples' && 'fabric-ubuntu-22.04' || 'ubuntu-22.04' }}
steps:
- uses: actions/checkout@v6
- name: Set up Full Stack Runtime
uses: ./.github/actions/fsat-setup
- run: just test-cloud
working-directory: full-stack-asset-transfer-guide
console:
runs-on: ${{ github.repository == 'hyperledger/fabric-samples' && 'fabric-ubuntu-22.04' || 'ubuntu-22.04' }}
steps:
- uses: actions/checkout@v6
- name: Set up Full Stack Runtime
uses: ./.github/actions/fsat-setup
- run: just test-console
working-directory: full-stack-asset-transfer-guide

View file

@ -0,0 +1,49 @@
#
# SPDX-License-Identifier: Apache-2.0
#
name: Test High Throughput
run-name: ${{ github.actor }} is running the High Throughput tests
on:
workflow_dispatch:
push:
branches: ["main", "release-2.5"]
pull_request:
branches: ["main", "release-2.5"]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
basic:
runs-on: ${{ github.repository == 'hyperledger/fabric-samples' && 'fabric-ubuntu-22.04' || 'ubuntu-22.04' }}
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Set up test network runtime
uses: ./.github/actions/test-network-setup
- name: Start Fabric
working-directory: high-throughput
run: ./startFabric.sh
- name: Test High Throughput
working-directory: high-throughput/application-go
run: |
go run . manyUpdates testvar1 100 +
go run . prune testvar1
go run . get testvar1
go run . update testvar1 100 +
go run . get testvar1
go run . delete testvar1
go run . manyUpdatesTraditional testvar2 100 +
go run . getstandard testvar2
go run . updatestandard testvar2 100 +
go run . getstandard testvar2
go run . delstandard testvar2
- name: Stop Fabric
working-directory: high-throughput
run: ./networkDown.sh

View file

@ -0,0 +1,39 @@
#
# SPDX-License-Identifier: Apache-2.0
#
name: Test Network Basic 🔎
run-name: ${{ github.actor }} is running the Test Network Basic tests 🔎
on:
workflow_dispatch:
push:
branches: [ "main", "release-2.5" ]
pull_request:
branches: [ "main", "release-2.5" ]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
basic:
runs-on: ${{ github.repository == 'hyperledger/fabric-samples' && 'fabric-ubuntu-22.04' || 'ubuntu-22.04' }}
strategy:
matrix:
chaincode-language:
- go
- javascript
- typescript
- java
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Set up the test network runtime
uses: ./.github/actions/test-network-setup
- name: Run Test Network Basic
working-directory: test-network
run: ../ci/scripts/run-test-network-basic.sh
env:
CHAINCODE_LANGUAGE: ${{ matrix.chaincode-language }}

View file

@ -0,0 +1,49 @@
#
# SPDX-License-Identifier: Apache-2.0
#
name: Test Network BFT Orderer 🍟
run-name: ${{ github.actor }} is running the Test Network with BFT Orderer tests 🍟
on:
workflow_dispatch:
push:
branches: ["main"]
pull_request:
branches: ["main"]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
basic:
runs-on: ${{ github.repository == 'hyperledger/fabric-samples' && 'fabric-ubuntu-22.04' || 'ubuntu-22.04' }}
strategy:
matrix:
chaincode-language:
- go
- javascript
- typescript
- java
crypto:
- cryptogen
- ca
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Set up the test network runtime
uses: ./.github/actions/test-network-setup
# Note: The default Fabric version for CI is currently the latest LTS (v2.5.x).
# To test BFT Orderers, Fabric v3.x is explicitly specified here.
with:
fabric-version: 3.1.4
- name: Run Test Network with BFT Orderers
working-directory: test-network
run: ../ci/scripts/run-test-network-basic.sh
env:
CHAINCODE_LANGUAGE: ${{ matrix.chaincode-language }}
ORDERER_TYPE: bft
CRYPTO: ${{ matrix.crypto }}

View file

@ -0,0 +1,41 @@
#
# SPDX-License-Identifier: Apache-2.0
#
name: Test Network Events 💡
run-name: ${{ github.actor }} is running the Test Network Events tests 💡
on:
workflow_dispatch:
push:
branches: [ "main", "release-2.5" ]
pull_request:
branches: [ "main", "release-2.5" ]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
events:
runs-on: ${{ github.repository == 'hyperledger/fabric-samples' && 'fabric-ubuntu-22.04' || 'ubuntu-22.04' }}
strategy:
matrix:
chaincode-language:
- go
- javascript
- java
chaincode-name:
- events
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Set up the test network runtime
uses: ./.github/actions/test-network-setup
- name: Run Test
working-directory: test-network
run: ../ci/scripts/run-test-network-events.sh
env:
CHAINCODE_NAME: ${{ matrix.chaincode-name }}
CHAINCODE_LANGUAGE: ${{ matrix.chaincode-language }}

51
.github/workflows/test-network-hsm.yaml vendored Normal file
View file

@ -0,0 +1,51 @@
#
# SPDX-License-Identifier: Apache-2.0
#
name: Test Network HSM 🍏
run-name: ${{ github.actor }} is running the Test Network HSM tests 🍏
on:
workflow_dispatch:
push:
branches: [ "main", "release-2.5" ]
pull_request:
branches: [ "main", "release-2.5" ]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
hsm:
runs-on: ${{ github.repository == 'hyperledger/fabric-samples' && 'fabric-ubuntu-22.04' || 'ubuntu-22.04' }}
strategy:
matrix:
chaincode-language:
- go
- javascript
- typescript
- java
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Set up the test network runtime
uses: ./.github/actions/test-network-setup
- name: Install SoftHSM
run: sudo apt install -y softhsm2
- name: Set up SoftHSM
env:
TMPDIR: ${{ runner.temp }}
SOFTHSM2_CONF: ${{ github.workspace }}/softhsm2.conf
run: |
echo "directories.tokendir = ${TMPDIR}" > "${SOFTHSM2_CONF}"
softhsm2-util --init-token --slot 0 --label "ForFabric" --pin 98765432 --so-pin 1234
- name: Run Test Network HSM
working-directory: test-network
env:
CHAINCODE_LANGUAGE: ${{ matrix.chaincode-language }}
SOFTHSM2_CONF: ${{ github.workspace }}/softhsm2.conf
run: ../ci/scripts/run-test-network-hsm.sh

124
.github/workflows/test-network-k8s.yaml vendored Normal file
View file

@ -0,0 +1,124 @@
#
# SPDX-License-Identifier: Apache-2.0
#
name: Kubernetes Test Network 🍒
run-name: ${{ github.actor }} is testing the Kubernetes Test Network 🍒
on:
workflow_dispatch:
push:
branches: [ "main", "release-2.5" ]
pull_request:
branches: [ "main", "release-2.5" ]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
ccaas-java:
runs-on: ${{ github.repository == 'hyperledger/fabric-samples' && 'fabric-ubuntu-22.04' || 'ubuntu-22.04' }}
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Test the network
id: run-test
working-directory: test-network-k8s
run: ../ci/scripts/run-k8s-test-network-basic.sh
env:
CLIENT_LANGUAGE: typescript
CHAINCODE_LANGUAGE: java
- name: Upload failure logs
if: ${{ failure() && steps.run-test.conclusion == 'failure' }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: ${{ github.job }}-logs
path: test-network-k8s/network-debug.log
ccaas-external:
runs-on: ${{ github.repository == 'hyperledger/fabric-samples' && 'fabric-ubuntu-22.04' || 'ubuntu-22.04' }}
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Test the network
id: run-test
working-directory: test-network-k8s
run: ../ci/scripts/run-k8s-test-network-basic.sh
env:
CLIENT_LANGUAGE: typescript
CHAINCODE_LANGUAGE: external
- name: Upload failure logs
if: ${{ failure() && steps.run-test.conclusion == 'failure' }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: ${{ github.job }}-logs
path: test-network-k8s/network-debug.log
k8s-builder:
runs-on: ${{ github.repository == 'hyperledger/fabric-samples' && 'fabric-ubuntu-22.04' || 'ubuntu-22.04' }}
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Test the network
id: run-test
working-directory: test-network-k8s
run: ../ci/scripts/run-k8s-test-network-basic.sh
env:
CHAINCODE_NAME: basic
CHAINCODE_LANGUAGE: java
CHAINCODE_BUILDER: k8s
- name: Upload failure logs
if: ${{ failure() && steps.run-test.conclusion == 'failure' }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: ${{ github.job }}-logs
path: test-network-k8s/network-debug.log
multi-namespace:
runs-on: ${{ github.repository == 'hyperledger/fabric-samples' && 'fabric-ubuntu-22.04' || 'ubuntu-22.04' }}
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Test the network
id: run-test
working-directory: test-network-k8s
run: ../ci/scripts/run-k8s-test-network-basic.sh
env:
ORG0_NS: org0-namespace
ORG1_NS: org1-namespace
ORG2_NS: org2-namespace
CHAINCODE_NAME: basic
CHAINCODE_LANGUAGE: java
CHAINCODE_BUILDER: k8s
- name: Upload failure logs
if: ${{ failure() && steps.run-test.conclusion == 'failure' }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: ${{ github.job }}-logs
path: test-network-k8s/network-debug.log
bft-orderer:
runs-on: ${{ github.repository == 'hyperledger/fabric-samples' && 'fabric-ubuntu-22.04' || 'ubuntu-22.04' }}
# This job requires Fabric v3.0 or later, which is only supported on 'main'.
# Ensure it does not run on 'release-2.5' or earlier versions.
if: ${{ github.ref == 'refs/heads/main' || github.event.pull_request.base.ref == 'main' }}
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Test the network
id: run-test
working-directory: test-network-k8s
run: ../ci/scripts/run-k8s-test-network-basic.sh
env:
CLIENT_LANGUAGE: typescript
CHAINCODE_LANGUAGE: java
# Note: The default Fabric version for CI is currently the latest LTS (v2.5.x).
# To test BFT Orderers, Fabric v3.x is explicitly specified here.
FABRIC_VERSION: '3.1'
ORDERER_TYPE: bft
- name: Upload failure logs
if: ${{ failure() && steps.run-test.conclusion == 'failure' }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: ${{ github.job }}-logs
path: test-network-k8s/network-debug.log

View file

@ -0,0 +1,41 @@
#
# SPDX-License-Identifier: Apache-2.0
#
name: Test Network Ledger 🥑
run-name: ${{ github.actor }} is running the Test Network Ledger tests 🥑
on:
workflow_dispatch:
push:
branches: [ "main", "release-2.5" ]
pull_request:
branches: [ "main", "release-2.5" ]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
basic:
runs-on: ${{ github.repository == 'hyperledger/fabric-samples' && 'fabric-ubuntu-22.04' || 'ubuntu-22.04' }}
strategy:
matrix:
chaincode-language:
- go
- javascript
- typescript
chaincode-name:
- ledger
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Set up the test network runtime
uses: ./.github/actions/test-network-setup
- name: Run Test
working-directory: test-network
run: ../ci/scripts/run-test-network-ledger.sh
env:
CHAINCODE_NAME: ${{ matrix.chaincode-name }}
CHAINCODE_LANGUAGE: ${{ matrix.chaincode-language }}

View file

@ -0,0 +1,39 @@
#
# SPDX-License-Identifier: Apache-2.0
#
name: Test Network Off Chain 🍔
run-name: ${{ github.actor }} is running the Test Network Off Chain tests 🍔
on:
workflow_dispatch:
push:
branches: [ "main", "release-2.5" ]
pull_request:
branches: [ "main", "release-2.5" ]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
off-chain:
runs-on: ${{ github.repository == 'hyperledger/fabric-samples' && 'fabric-ubuntu-22.04' || 'ubuntu-22.04' }}
strategy:
matrix:
chaincode-language:
- go
- javascript
- typescript
- java
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Set up the test network runtime
uses: ./.github/actions/test-network-setup
- name: Run Test Network Off Chain
working-directory: test-network
env:
CHAINCODE_LANGUAGE: ${{ matrix.chaincode-language }}
run: ../ci/scripts/run-test-network-off-chain.sh

View file

@ -0,0 +1,41 @@
#
# SPDX-License-Identifier: Apache-2.0
#
name: Test Network Private 🔒
run-name: ${{ github.actor }} is running the Test Network Private tests 🔒
on:
workflow_dispatch:
push:
branches: ["main", "release-2.5"]
pull_request:
branches: ["main", "release-2.5"]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
private:
runs-on: ${{ github.repository == 'hyperledger/fabric-samples' && 'fabric-ubuntu-22.04' || 'ubuntu-22.04' }}
strategy:
matrix:
chaincode-language:
- go
- java
- typescript
chaincode-name:
- private
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Set up the test network runtime
uses: ./.github/actions/test-network-setup
- name: Run Test
working-directory: test-network
run: ../ci/scripts/run-test-network-private.sh
env:
CHAINCODE_NAME: ${{ matrix.chaincode-name }}
CHAINCODE_LANGUAGE: ${{ matrix.chaincode-language }}

40
.github/workflows/test-network-sbe.yaml vendored Normal file
View file

@ -0,0 +1,40 @@
#
# SPDX-License-Identifier: Apache-2.0
#
name: Test Network SBE 🎵
run-name: ${{ github.actor }} is running the Test Network SBE tests 🎵
on:
workflow_dispatch:
push:
branches: [ "main", "release-2.5" ]
pull_request:
branches: [ "main", "release-2.5" ]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
SBE:
runs-on: ${{ github.repository == 'hyperledger/fabric-samples' && 'fabric-ubuntu-22.04' || 'ubuntu-22.04' }}
strategy:
matrix:
chaincode-language:
- typescript
- java
chaincode-name:
- sbe
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Set up the test network runtime
uses: ./.github/actions/test-network-setup
- name: Run Test
working-directory: test-network
run: ../ci/scripts/run-test-network-sbe.sh
env:
CHAINCODE_NAME: ${{ matrix.chaincode-name }}
CHAINCODE_LANGUAGE: ${{ matrix.chaincode-language }}

View file

@ -0,0 +1,39 @@
#
# SPDX-License-Identifier: Apache-2.0
#
name: Test Network Secured 🔔
run-name: ${{ github.actor }} is running the Test Network Secured tests 🔔
on:
workflow_dispatch:
push:
branches: [ "main", "release-2.5" ]
pull_request:
branches: [ "main", "release-2.5" ]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
secured:
runs-on: ${{ github.repository == 'hyperledger/fabric-samples' && 'fabric-ubuntu-22.04' || 'ubuntu-22.04' }}
strategy:
matrix:
chaincode-language:
- go
chaincode-name:
- secured
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Set up the test network runtime
uses: ./.github/actions/test-network-setup
- name: Run Test
working-directory: test-network
run: ../ci/scripts/run-test-network-secured.sh
env:
CHAINCODE_NAME: ${{ matrix.chaincode-name }}
CHAINCODE_LANGUAGE: ${{ matrix.chaincode-language }}

20
.gitignore vendored
View file

@ -4,9 +4,6 @@
.#* .#*
# Vim file artifacts # Vim file artifacts
.*.sw* .*.sw*
# installed platform-specific binaries
/bin
/config
.DS_Store .DS_Store
.project .project
# omit Go vendor directories # omit Go vendor directories
@ -18,4 +15,19 @@ vendor/
node_modules/ node_modules/
# Ignore Gradle build output directory # Ignore Gradle build output directory
build build
package-lock.json # Ignore Maven build output directory
target
# Eclipse
.classpath
.settings
# installed Fabric binaries etc.
/bin/
builders/
config/
external-chaincode/
install-fabric.sh
# override the ignore of all config/ folders
!full-stack-asset-transfer-guide/infrastructure/sample-network/config

View file

@ -1,4 +1,4 @@
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
# Fabric Samples Maintaners # Fabric Samples Maintainers
* @hyperledger/fabric-samples-maintainers * @hyperledger/fabric-samples-maintainers

View file

@ -2,7 +2,7 @@ Code of Conduct Guidelines
========================== ==========================
Please review the Hyperledger [Code of Please review the Hyperledger [Code of
Conduct](https://wiki.hyperledger.org/community/hyperledger-project-code-of-conduct) Conduct](https://lf-hyperledger.atlassian.net/wiki/spaces/HYP/pages/19595281/Hyperledger+Code+of+Conduct)
before participating. It is important that we keep things civil. before participating. It is important that we keep things civil.
<a rel="license" href="http://creativecommons.org/licenses/by/4.0/"><img alt="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 <a rel="license" href="http://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution 4.0 International License</a>. <a rel="license" href="http://creativecommons.org/licenses/by/4.0/"><img alt="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 <a rel="license" href="http://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution 4.0 International License</a>.

View file

@ -3,18 +3,12 @@ Maintainers
fabric-samples uses a non-author code review policy, requiring a single approval from a non-author maintainer. fabric-samples uses a non-author code review policy, requiring a single approval from a non-author maintainer.
| Name | GitHub | Chat | email | | Name | GitHub | Discord ID | email |
|---------------------------|------------------|----------------|-------------------------------------| |---------------------------|------------------|------------------|-------------------------------------|
| Arnaud Le Hors | lehors | lehors | lehors@us.ibm.com | | Dave Enyeart | denyeart | Dave Enyeart | enyeart@us.ibm.com |
| Bret Harrison | harrisob | bretharrison | harrisob@us.ibm.com | | Mark Lewis | bestbeforetoday | bestbeforetoday | Mark.S.Lewis@outlook.com |
| Chris Ferris | christo4ferris | cbf | chris.ferris@gmail.com | | Tatsuya Sato | satota2 | satota2 | tatsuya.sato.so@hitachi.com |
| Dave Enyeart | denyeart | dave.enyeart | enyeart@us.ibm.com |
| Gari Singh | mastersingh24 | mastersingh24 | gari.r.singh@gmail.com |
| Jason Yellick | jyellick | jyellick | jyellick@us.ibm.com |
| Matthew B White | mbwhite | mbwhite | whitemat@uk.ibm.com |
| Nikhil Gupta | nikhil550 | negupta | nikhilg550@gmail.com |
| Simon Stone | sstone1 | sstone1 | sstone1@uk.ibm.com |
Also: Please see the [Release Manager section](https://github.com/hyperledger/fabric/blob/master/MAINTAINERS.md) Also: Please see the [Release Manager section](https://github.com/hyperledger/fabric/blob/main/MAINTAINERS.md)
<a rel="license" href="http://creativecommons.org/licenses/by/4.0/"><img alt="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 <a rel="license" href="http://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution 4.0 International License</a>. <a rel="license" href="http://creativecommons.org/licenses/by/4.0/"><img alt="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 <a rel="license" href="http://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution 4.0 International License</a>.

View file

@ -4,6 +4,11 @@
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). 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:
- [release-2.2](https://github.com/hyperledger/fabric-samples/tree/release-2.2)
- [release-1.4](https://github.com/hyperledger/fabric-samples/tree/release-1.4)
## Getting started with the Fabric samples ## Getting started with the Fabric samples
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. 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.
@ -15,6 +20,12 @@ Organization peers and an ordering service node. You can use it on your local ma
You can also use it to deploy and test your own Fabric chaincodes and applications. To get started, see 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 [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 ## 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. The asset transfer series provides a series of sample smart contracts and applications to demonstrate how to store and transfer assets using Hyperledger Fabric.
@ -25,15 +36,17 @@ transfer an asset in a more realistic transfer scenario.
| **Smart Contract** | **Description** | **Tutorial** | **Smart contract languages** | **Application languages** | | **Smart Contract** | **Description** | **Tutorial** | **Smart contract languages** | **Application languages** |
| -----------|------------------------------|----------|---------|---------| | -----------|------------------------------|----------|---------|---------|
| [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, JavaScript, TypeScript, Java | | [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 | | [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, 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/master/asset-transfer-sbe) | Java, TypeScript | JavaScript | | [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 | 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) | JavaScript, Java | JavaScript | | [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 | | [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
@ -41,15 +54,16 @@ Additional samples demonstrate various Fabric use cases and application patterns
| **Sample** | **Description** | **Documentation** | | **Sample** | **Description** | **Documentation** |
| -------------|------------------------------|------------------| | -------------|------------------------------|------------------|
| [Commercial paper](commercial-paper) | Explore a use case and detailed application development tutorial in which two organizations use a blockchain network to trade commercial paper. | [Commercial paper tutorial](https://hyperledger-fabric.readthedocs.io/en/latest/tutorial/commercial_paper.html) | | [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) |
| [Off chain data](off_chain_data) | Learn how to use the Peer channel-based event services 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 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 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) | | [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) |
| [Auction](auction) | Run an auction where bids are kept private until the auction is closed, after which users can reveal their bid | [README](auction/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) |
| [Chaincode](chaincode) | A set of other sample smart contracts, many of which were used in tutorials prior to the asset transfer sample series. | | | [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) |
| [Interest rate swaps](interest_rate_swaps) | **Deprecated in favor of state based endorsement asset transfer sample** | |
| [Fabcar](fabcar) | **Deprecated in favor of basic asset transfer sample** | |
## License <a name="license"></a> ## License <a name="license"></a>

View file

@ -6,7 +6,6 @@ If you think you have discovered a security issue in any of the Hyperledger proj
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). 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 our [JIRA bug tracking system](https://jira.hyperledger.org). Be sure to set the “Security Level” to “Security issue”. 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://wiki.hyperledger.org/display/HYP/Defect+Response) on our [wiki](https://wiki.hyperledger.org).
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).

View file

@ -40,34 +40,34 @@ export FABRIC_CA_CLIENT_HOME=${PWD}/organizations/peerOrganizations/org1.example
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`. 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`.
``` ```
fabric-ca-client register --id.name creator1 --id.secret creator1pw --id.type client --id.affiliation org1 --id.attrs 'abac.creator=true:ecert' --tls.certfiles ${PWD}/organizations/fabric-ca/org1/tls-cert.pem fabric-ca-client register --id.name creator1 --id.secret creator1pw --id.type client --id.affiliation org1 --id.attrs 'abac.creator=true:ecert' --tls.certfiles "${PWD}/organizations/fabric-ca/org1/tls-cert.pem"
``` ```
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 `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.
``` ```
fabric-ca-client enroll -u https://creator1:creator1pw@localhost:7054 --caname ca-org1 -M ${PWD}/organizations/peerOrganizations/org1.example.com/users/creator1@org1.example.com/msp --tls.certfiles ${PWD}/organizations/fabric-ca/org1/tls-cert.pem fabric-ca-client enroll -u https://creator1:creator1pw@localhost:7054 --caname ca-org1 -M "${PWD}/organizations/peerOrganizations/org1.example.com/users/creator1@org1.example.com/msp" --tls.certfiles "${PWD}/organizations/fabric-ca/org1/tls-cert.pem"
``` ```
Now that we have enrolled the identity, run the command below to copy the Node OU configuration file into the creator1 MSP folder. Now that we have enrolled the identity, run the command below to copy the Node OU configuration file into the creator1 MSP folder.
``` ```
cp ${PWD}/organizations/peerOrganizations/org1.example.com/msp/config.yaml ${PWD}/organizations/peerOrganizations/org1.example.com/users/creator1@org1.example.com/msp/config.yaml cp "${PWD}/organizations/peerOrganizations/org1.example.com/msp/config.yaml" "${PWD}/organizations/peerOrganizations/org1.example.com/users/creator1@org1.example.com/msp/config.yaml"
``` ```
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. 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.
``` ```
fabric-ca-client register --id.name creator2 --id.secret creator2pw --id.type client --id.affiliation org1 --id.attrs 'abac.creator=true:' --tls.certfiles ${PWD}/organizations/fabric-ca/org1/tls-cert.pem fabric-ca-client register --id.name creator2 --id.secret creator2pw --id.type client --id.affiliation org1 --id.attrs 'abac.creator=true:' --tls.certfiles "${PWD}/organizations/fabric-ca/org1/tls-cert.pem"
``` ```
The following enroll command will add the attribute to the certificate: The following enroll command will add the attribute to the certificate:
``` ```
fabric-ca-client enroll -u https://creator2:creator2pw@localhost:7054 --caname ca-org1 --enrollment.attrs "abac.creator" -M ${PWD}/organizations/peerOrganizations/org1.example.com/users/creator2@org1.example.com/msp --tls.certfiles ${PWD}/organizations/fabric-ca/org1/tls-cert.pem fabric-ca-client enroll -u https://creator2:creator2pw@localhost:7054 --caname ca-org1 --enrollment.attrs "abac.creator" -M "${PWD}/organizations/peerOrganizations/org1.example.com/users/creator2@org1.example.com/msp" --tls.certfiles "${PWD}/organizations/fabric-ca/org1/tls-cert.pem"
``` ```
Run the command below to copy the Node OU configuration file into the creator2 MSP folder. Run the command below to copy the Node OU configuration file into the creator2 MSP folder.
``` ```
cp ${PWD}/organizations/peerOrganizations/org1.example.com/msp/config.yaml ${PWD}/organizations/peerOrganizations/org1.example.com/users/creator2@org1.example.com/msp/config.yaml cp "${PWD}/organizations/peerOrganizations/org1.example.com/msp/config.yaml" "${PWD}/organizations/peerOrganizations/org1.example.com/users/creator2@org1.example.com/msp/config.yaml"
``` ```
## Create an asset ## Create an asset
@ -76,16 +76,16 @@ You can use either identity with the `abac.creator=true` attribute to create an
``` ```
export CORE_PEER_TLS_ENABLED=true export CORE_PEER_TLS_ENABLED=true
export CORE_PEER_LOCALMSPID="Org1MSP" export CORE_PEER_LOCALMSPID=Org1MSP
export CORE_PEER_MSPCONFIGPATH=${PWD}/organizations/peerOrganizations/org1.example.com/users/creator1@org1.example.com/msp export CORE_PEER_MSPCONFIGPATH=${PWD}/organizations/peerOrganizations/org1.example.com/users/creator1@org1.example.com/msp
export CORE_PEER_TLS_ROOTCERT_FILE=${PWD}/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt export CORE_PEER_TLS_ROOTCERT_FILE=${PWD}/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt
export CORE_PEER_ADDRESS=localhost:7051 export CORE_PEER_ADDRESS=localhost:7051
export TARGET_TLS_OPTIONS="-o localhost:7050 --ordererTLSHostnameOverride orderer.example.com --tls --cafile ${PWD}/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem --peerAddresses localhost:7051 --tlsRootCertFiles ${PWD}/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt --peerAddresses localhost:9051 --tlsRootCertFiles ${PWD}/organizations/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt" export TARGET_TLS_OPTIONS=(-o localhost:7050 --ordererTLSHostnameOverride orderer.example.com --tls --cafile "${PWD}/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem" --peerAddresses localhost:7051 --tlsRootCertFiles "${PWD}/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt" --peerAddresses localhost:9051 --tlsRootCertFiles "${PWD}/organizations/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt")
``` ```
Run the following command to create Asset1: Run the following command to create Asset1:
``` ```
peer chaincode invoke $TARGET_TLS_OPTIONS -C mychannel -n abac -c '{"function":"CreateAsset","Args":["Asset1","blue","20","100"]}' peer chaincode invoke "${TARGET_TLS_OPTIONS[@]}" -C mychannel -n abac -c '{"function":"CreateAsset","Args":["Asset1","blue","20","100"]}'
``` ```
You can use the command below to query the asset on the ledger: You can use the command below to query the asset on the ledger:
@ -102,7 +102,7 @@ The result will list the creator1 identity as the asset owner. The `GetID()` API
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: 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:
``` ```
export RECIPIENT="x509::CN=user1,OU=client,O=Hyperledger,ST=North Carolina,C=US::CN=ca.org1.example.com,O=org1.example.com,L=Durham,ST=North Carolina,C=US" export RECIPIENT="x509::CN=user1,OU=client,O=Hyperledger,ST=North Carolina,C=US::CN=ca.org1.example.com,O=org1.example.com,L=Durham,ST=North Carolina,C=US"
peer chaincode invoke $TARGET_TLS_OPTIONS -C mychannel -n abac -c '{"function":"TransferAsset","Args":["Asset1","'"$RECIPIENT"'"]}' peer chaincode invoke "${TARGET_TLS_OPTIONS[@]}" -C mychannel -n abac -c '{"function":"TransferAsset","Args":["Asset1","'"$RECIPIENT"'"]}'
``` ```
Query the ledger to verify that the asset has a new owner: Query the ledger to verify that the asset has a new owner:
``` ```
@ -117,7 +117,7 @@ We can see that Asset1 with is now owned by User1:
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: 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:
``` ```
peer chaincode invoke $TARGET_TLS_OPTIONS -C mychannel -n abac -c '{"function":"UpdateAsset","Args":["Asset1","green","20","100"]}' peer chaincode invoke "${TARGET_TLS_OPTIONS[@]}" -C mychannel -n abac -c '{"function":"UpdateAsset","Args":["Asset1","green","20","100"]}'
``` ```
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: 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:
@ -132,7 +132,7 @@ export CORE_PEER_MSPCONFIGPATH=${PWD}/organizations/peerOrganizations/org1.examp
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. 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.
``` ```
peer chaincode invoke $TARGET_TLS_OPTIONS -C mychannel -n abac -c '{"function":"UpdateAsset","Args":["Asset1","green","20","100"]}' peer chaincode invoke "${TARGET_TLS_OPTIONS[@]}" -C mychannel -n abac -c '{"function":"UpdateAsset","Args":["Asset1","green","20","100"]}'
``` ```
Run the query command again to verify that the asset has changed color: Run the query command again to verify that the asset has changed color:
``` ```
@ -147,7 +147,7 @@ The result will display that Asset1 is now green:
The owner also has the ability to delete the asset. Run the following command to remove Asset1 from the ledger: The owner also has the ability to delete the asset. Run the following command to remove Asset1 from the ledger:
``` ```
peer chaincode invoke $TARGET_TLS_OPTIONS -C mychannel -n abac -c '{"function":"DeleteAsset","Args":["Asset1"]}' peer chaincode invoke "${TARGET_TLS_OPTIONS[@]}" -C mychannel -n abac -c '{"function":"DeleteAsset","Args":["Asset1"]}'
``` ```
If you query the ledger once more, you will see that Asset1 no longer exists: If you query the ledger once more, you will see that Asset1 no longer exists:
@ -157,7 +157,7 @@ peer chaincode query -C mychannel -n abac -c '{"function":"ReadAsset","Args":["A
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: 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:
``` ```
peer chaincode invoke $TARGET_TLS_OPTIONS -C mychannel -n abac -c '{"function":"CreateAsset","Args":["Asset2","red","20","100"]}' peer chaincode invoke "${TARGET_TLS_OPTIONS[@]}" -C mychannel -n abac -c '{"function":"CreateAsset","Args":["Asset2","red","20","100"]}'
``` ```
The smart contract will return the following error: The smart contract will return the following error:

View file

@ -1,5 +1,26 @@
module github.com/hyperledger/fabric-samples/asset-transfer-abac/chaincode-go module github.com/hyperledger/fabric-samples/asset-transfer-abac/chaincode-go
go 1.15 go 1.23.0
require github.com/hyperledger/fabric-contract-api-go v1.1.1 require github.com/hyperledger/fabric-contract-api-go/v2 v2.2.0
require (
github.com/go-openapi/jsonpointer v0.21.0 // indirect
github.com/go-openapi/jsonreference v0.21.0 // indirect
github.com/go-openapi/spec v0.21.0 // indirect
github.com/go-openapi/swag v0.23.0 // indirect
github.com/hyperledger/fabric-chaincode-go/v2 v2.0.0 // indirect
github.com/hyperledger/fabric-protos-go-apiv2 v0.3.4 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
github.com/xeipuuv/gojsonschema v1.2.0 // indirect
golang.org/x/net v0.38.0 // indirect
golang.org/x/sys v0.31.0 // indirect
golang.org/x/text v0.23.0 // indirect
google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f // indirect
google.golang.org/grpc v1.71.0 // indirect
google.golang.org/protobuf v1.36.4 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

View file

@ -1,138 +1,81 @@
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/DATA-DOG/go-txdb v0.1.3/go.mod h1:DhAhxMXZpUJVGnT+p9IbzJoRKvlArO2pkHjnGX7o0n0=
github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI=
github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M=
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=
github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk=
github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE=
github.com/cucumber/godog v0.8.0/go.mod h1:Cp3tEV1LRAyH/RuCThcxHS/+9ORZ+FMzPva2AZ5Ki+A=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-openapi/jsonpointer v0.19.3 h1:gihV7YNZK1iK6Tgwwsxo2rJbD1GTbdm72325Bq8FI3w= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
github.com/go-openapi/jsonreference v0.19.2 h1:o20suLFB4Ri0tuzpWtyHlh7E7HnkqTNLq6aR6WVNS1w= github.com/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1rr/O9oNQ=
github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= github.com/go-openapi/jsonpointer v0.21.0/go.mod h1:IUyH9l/+uyhIYQ/PXVA41Rexl+kOkAPDdXEYns6fzUY=
github.com/go-openapi/spec v0.19.4 h1:ixzUSnHTd6hCemgtAJgluaTSGYpLNpJY4mA2DIkdOAo= github.com/go-openapi/jsonreference v0.21.0 h1:Rs+Y7hSXT83Jacb7kFyjn4ijOuVGSvOdF2+tg1TRrwQ=
github.com/go-openapi/spec v0.19.4/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo= github.com/go-openapi/jsonreference v0.21.0/go.mod h1:LmZmgsrTkVg9LG4EaHeY8cBDslNPMo06cago5JNLkm4=
github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/spec v0.21.0 h1:LTVzPc3p/RzRnkQqLRndbAzjY0d0BCL72A6j3CdL9ZY=
github.com/go-openapi/swag v0.19.5 h1:lTz6Ys4CmqqCQmZPBlbQENR1/GucA2bzYTE12Pw4tFY= github.com/go-openapi/spec v0.21.0/go.mod h1:78u6VdPw81XU44qEWGhtr982gJ5BWg2c0I5XwVMotYk=
github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+GrE=
github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ=
github.com/gobuffalo/envy v1.7.0 h1:GlXgaiBkmrYMHco6t4j7SacKO4XUjvh5pwXh0f4uxXU= github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
github.com/gobuffalo/envy v1.7.0/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
github.com/gobuffalo/logger v1.0.0/go.mod h1:2zbswyIUa45I+c+FLXuWl9zSWEiVuthsk8ze5s8JvPs= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/gobuffalo/packd v0.3.0 h1:eMwymTkA1uXsqxS0Tpoop3Lc0u3kTfiMBE6nKtQU4g4= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/gobuffalo/packd v0.3.0/go.mod h1:zC7QkmNkYVGKPw4tHpBQ+ml7W/3tIebgeo1b36chA3Q= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/gobuffalo/packr v1.30.1 h1:hu1fuVR3fXEZR7rXNW3h8rqSML8EVAf6KNm0NKO/wKg= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/gobuffalo/packr v1.30.1/go.mod h1:ljMyFO2EcrnzsHsN99cvbq055Y9OhRrIaviy289eRuk= github.com/hyperledger/fabric-chaincode-go/v2 v2.0.0 h1:IhkHfrl5X/fVnmB6pWeCYCdIJRi9bxj+WTnVN8DtW3c=
github.com/gobuffalo/packr/v2 v2.5.1/go.mod h1:8f9c96ITobJlPzI44jj+4tHnEKNt0xXWSVlXRN9X1Iw= github.com/hyperledger/fabric-chaincode-go/v2 v2.0.0/go.mod h1:PHHaFffjw7p7n9bmCfcm7RqDqYdivNEsJdiNIKZo5Lk=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/hyperledger/fabric-contract-api-go/v2 v2.2.0 h1:rmUoBmciB0GL/miqcbJmJbgp5QTWoJUrZo+CNxrNLF4=
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/hyperledger/fabric-contract-api-go/v2 v2.2.0/go.mod h1:FeWeO/jwGjiME7ak3GufqKIcwkejtzrDG4QxbfKydWs=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/hyperledger/fabric-protos-go-apiv2 v0.3.4 h1:YJrd+gMaeY0/vsN0aS0QkEKTivGoUnSRIXxGJ7KI+Pc=
github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= github.com/hyperledger/fabric-protos-go-apiv2 v0.3.4/go.mod h1:bau/6AJhvEcu9GKKYHlDXAxXKzYNfhP6xu2GXuxEcFk=
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/hyperledger/fabric-chaincode-go v0.0.0-20200424173110-d7076418f212 h1:1i4lnpV8BDgKOLi1hgElfBqdHXjXieSuj8629mwBZ8o= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/hyperledger/fabric-chaincode-go v0.0.0-20200424173110-d7076418f212/go.mod h1:N7H3sA7Tx4k/YzFq7U0EPdqJtqvM4Kild0JoCc7C0Dc= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/hyperledger/fabric-contract-api-go v1.1.1 h1:gDhOC18gjgElNZ85kFWsbCQq95hyUP/21n++m0Sv6B0= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/hyperledger/fabric-contract-api-go v1.1.1/go.mod h1:+39cWxbh5py3NtXpRA63rAH7NzXyED+QJx1EZr0tJPo= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=
github.com/hyperledger/fabric-protos-go v0.0.0-20190919234611-2a87503ac7c9/go.mod h1:xVYTjK4DtZRBxZ2D9aE4y6AbLaPwue2o/criQyQbVD0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
github.com/hyperledger/fabric-protos-go v0.0.0-20200424173316-dd554ba3746e h1:9PS5iezHk/j7XriSlNuSQILyCOfcZ9wZ3/PiucmSE8E= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/hyperledger/fabric-protos-go v0.0.0-20200424173316-dd554ba3746e/go.mod h1:xVYTjK4DtZRBxZ2D9aE4y6AbLaPwue2o/criQyQbVD0=
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc=
github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg=
github.com/karrick/godirwalk v1.10.12/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e h1:hB2xlXdHp/pmPZq0y3QnmWAArdw9PqbmotexnWx/FU8=
github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8=
github.com/rogpeppe/go-internal v1.3.0 h1:RR9dF3JtopPvtkroDZuVD7qquD0bnHlKSqaQhgwt8yk= github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g=
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ=
github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU=
github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo=
github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY=
github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0=
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f h1:J9EGpcZtP0E/raorCMxlFGSTBrsSlaDGf3jU/qvAE2c=
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb h1:zGWFAtiMcyryUHoUjUJX0/lt1H2+i2Ka2n+D3DImSNo=
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHovont7NscjpAxXsDA8S8BMYve8Y5+7cuRE7R0= github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHovont7NscjpAxXsDA8S8BMYve8Y5+7cuRE7R0=
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ=
github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74= github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74=
github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y=
github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA=
golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= go.opentelemetry.io/otel v1.34.0 h1:zRLXxLCgL1WyKsPVrgbSdMN4c0FMkDAskSTQP+0hdUY=
golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= go.opentelemetry.io/otel v1.34.0/go.mod h1:OWFPOQ+h4G8xpyjgqo4SxJYdDQ/qmRH+wivy7zzx9oI=
golang.org/x/crypto v0.0.0-20190621222207-cc06ce4a13d4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= go.opentelemetry.io/otel/metric v1.34.0 h1:+eTR3U0MyfWjRDhmFMxe2SsW64QrZ84AOhvqS7Y+PoQ=
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= go.opentelemetry.io/otel/metric v1.34.0/go.mod h1:CEDrp0fy2D0MvkXE+dPV7cMi8tWZwX3dmaIhwPOaqHE=
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= go.opentelemetry.io/otel/sdk v1.34.0 h1:95zS4k/2GOy069d321O8jWgYsW3MzVV+KuSPKp7Wr1A=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= go.opentelemetry.io/otel/sdk v1.34.0/go.mod h1:0e/pNiaMAqaykJGKbi+tSjWfNNHMTxoC9qANsCzbyxU=
golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= go.opentelemetry.io/otel/sdk/metric v1.34.0 h1:5CeK9ujjbFVL5c1PhLuStg1wxA7vQv7ce1EK0Gyvahk=
golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= go.opentelemetry.io/otel/sdk/metric v1.34.0/go.mod h1:jQ/r8Ze28zRKoNRdkjCZxfs6YvBTG1+YIqyFVFYec5w=
golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297 h1:k7pJ2yAPLPgbskkFdhRCsA77k2fySZ1zf2zCjvQCiIM= go.opentelemetry.io/otel/trace v1.34.0 h1:+ouXS2V8Rd4hp4580a8q23bg0azF2nI8cqLYnC8mh/k=
golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= go.opentelemetry.io/otel/trace v1.34.0/go.mod h1:Svm7lSjQD7kG7KJ/MUHPVXSDGz2OX4h0M2jHBhmSfRE=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/net v0.38.0 h1:vRMAPTMaeGqVhG5QyLJHqNDwecKTomGeqbnfZyKlBI8=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/net v0.38.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8=
golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.23.0 h1:D71I7dUrlY+VX0gQShAThNGHFxZ13dGLBHQLVl1mJlY=
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4=
golang.org/x/sys v0.0.0-20190515120540-06a5c4944438/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f h1:BWUVssLB0HVOSY78gIdvk1dTVYtT1y8SBWtPYuTJ/6w=
golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM=
golang.org/x/sys v0.0.0-20190710143415-6ec70d6a5542 h1:6ZQFf1D2YYDDI7eSwW8adlkkavTB9sw5I24FVtEvNUQ= google.golang.org/grpc v1.71.0 h1:kF77BGdPTQ4/JZWMlb9VpJ5pa25aqvVqogsxNHHdeBg=
golang.org/x/sys v0.0.0-20190710143415-6ec70d6a5542/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= google.golang.org/grpc v1.71.0/go.mod h1:H0GRtasmQOh9LkFoCPDu3ZrwUtD1YGE+b2vYBYd/8Ec=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= google.golang.org/protobuf v1.36.4 h1:6A3ZDJHn/eNqc1i+IdefRzy/9PokBTPvcqMySR7NNIM=
golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= google.golang.org/protobuf v1.36.4/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20190624180213-70d37148ca0c/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
google.golang.org/genproto v0.0.0-20180831171423-11092d34479b h1:lohp5blsw53GBXtLyLNaTXPXS9pJ1tiTw61ZHUoE9Qw=
google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
google.golang.org/grpc v1.23.0 h1:AzbTB6ux+okLTzP8Ru1Xs41C303zdcfEht7MQnYJt5A=
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10=
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=

View file

@ -5,7 +5,7 @@ import (
"encoding/json" "encoding/json"
"fmt" "fmt"
"github.com/hyperledger/fabric-contract-api-go/contractapi" "github.com/hyperledger/fabric-contract-api-go/v2/contractapi"
) )
// SmartContract provides functions for managing an Asset // SmartContract provides functions for managing an Asset
@ -28,7 +28,7 @@ func (s *SmartContract) CreateAsset(ctx contractapi.TransactionContextInterface,
// Demonstrate the use of Attribute-Based Access Control (ABAC) by checking // Demonstrate the use of Attribute-Based Access Control (ABAC) by checking
// to see if the caller has the "abac.creator" attribute with a value of true; // to see if the caller has the "abac.creator" attribute with a value of true;
// if not, return an error. // if not, return an error.
//
err := ctx.GetClientIdentity().AssertAttributeValue("abac.creator", "true") err := ctx.GetClientIdentity().AssertAttributeValue("abac.creator", "true")
if err != nil { if err != nil {
return fmt.Errorf("submitting client not authorized to create asset, does not have abac.creator role") return fmt.Errorf("submitting client not authorized to create asset, does not have abac.creator role")

View file

@ -7,7 +7,7 @@ package main
import ( import (
"log" "log"
"github.com/hyperledger/fabric-contract-api-go/contractapi" "github.com/hyperledger/fabric-contract-api-go/v2/contractapi"
abac "github.com/hyperledger/fabric-samples/asset-transfer-abac/chaincode-go/smart-contract" abac "github.com/hyperledger/fabric-samples/asset-transfer-abac/chaincode-go/smart-contract"
) )

View file

@ -0,0 +1,107 @@
# Asset transfer basic sample
The asset transfer basic sample demonstrates:
- 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:
```shell
./network.sh deployCC -ccn basic -ccp ../asset-transfer-basic/chaincode-typescript/ -ccl typescript
```
- To deploy the **JavaScript** chaincode implementation:
```shell
./network.sh deployCC -ccn basic -ccp ../asset-transfer-basic/chaincode-javascript/ -ccl javascript
```
- To deploy the **Go** chaincode implementation:
```shell
./network.sh deployCC -ccn basic -ccp ../asset-transfer-basic/chaincode-go/ -ccl go
```
- To deploy the **Java** chaincode implementation:
```shell
./network.sh deployCC -ccn basic -ccp ../asset-transfer-basic/chaincode-java/ -ccl java
```
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.
```shell
./network.sh down
```

View file

@ -0,0 +1,275 @@
/*
Copyright 2021 IBM All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package main
import (
"bytes"
"context"
"crypto/x509"
"encoding/json"
"errors"
"fmt"
"os"
"path"
"time"
"github.com/hyperledger/fabric-gateway/pkg/client"
"github.com/hyperledger/fabric-gateway/pkg/hash"
"github.com/hyperledger/fabric-gateway/pkg/identity"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials"
"google.golang.org/grpc/status"
)
const (
mspID = "Org1MSP"
cryptoPath = "../../test-network/organizations/peerOrganizations/org1.example.com"
certPath = cryptoPath + "/users/User1@org1.example.com/msp/signcerts"
keyPath = cryptoPath + "/users/User1@org1.example.com/msp/keystore"
tlsCertPath = cryptoPath + "/peers/peer0.org1.example.com/tls/ca.crt"
peerEndpoint = "dns:///localhost:7051"
gatewayPeer = "peer0.org1.example.com"
)
var now = time.Now()
var assetId = fmt.Sprintf("asset%d", now.Unix()*1e3+int64(now.Nanosecond())/1e6)
func main() {
// The gRPC client connection should be shared by all Gateway connections to this endpoint
clientConnection := newGrpcConnection()
defer clientConnection.Close()
id := newIdentity()
sign := newSign()
// Create a Gateway connection for a specific client identity
gw, err := client.Connect(
id,
client.WithSign(sign),
client.WithHash(hash.SHA256),
client.WithClientConnection(clientConnection),
// Default timeouts for different gRPC calls
client.WithEvaluateTimeout(5*time.Second),
client.WithEndorseTimeout(15*time.Second),
client.WithSubmitTimeout(5*time.Second),
client.WithCommitStatusTimeout(1*time.Minute),
)
if err != nil {
panic(err)
}
defer gw.Close()
// Override default values for chaincode and channel name as they may differ in testing contexts.
chaincodeName := "basic"
if ccname := os.Getenv("CHAINCODE_NAME"); ccname != "" {
chaincodeName = ccname
}
channelName := "mychannel"
if cname := os.Getenv("CHANNEL_NAME"); cname != "" {
channelName = cname
}
network := gw.GetNetwork(channelName)
contract := network.GetContract(chaincodeName)
initLedger(contract)
getAllAssets(contract)
createAsset(contract)
readAssetByID(contract)
transferAssetAsync(contract)
exampleErrorHandling(contract)
}
// newGrpcConnection creates a gRPC connection to the Gateway server.
func newGrpcConnection() *grpc.ClientConn {
certificatePEM, err := os.ReadFile(tlsCertPath)
if err != nil {
panic(fmt.Errorf("failed to read TLS certifcate file: %w", err))
}
certificate, err := identity.CertificateFromPEM(certificatePEM)
if err != nil {
panic(err)
}
certPool := x509.NewCertPool()
certPool.AddCert(certificate)
transportCredentials := credentials.NewClientTLSFromCert(certPool, gatewayPeer)
connection, err := grpc.NewClient(peerEndpoint, grpc.WithTransportCredentials(transportCredentials))
if err != nil {
panic(fmt.Errorf("failed to create gRPC connection: %w", err))
}
return connection
}
// newIdentity creates a client identity for this Gateway connection using an X.509 certificate.
func newIdentity() *identity.X509Identity {
certificatePEM, err := readFirstFile(certPath)
if err != nil {
panic(fmt.Errorf("failed to read certificate file: %w", err))
}
certificate, err := identity.CertificateFromPEM(certificatePEM)
if err != nil {
panic(err)
}
id, err := identity.NewX509Identity(mspID, certificate)
if err != nil {
panic(err)
}
return id
}
// newSign creates a function that generates a digital signature from a message digest using a private key.
func newSign() identity.Sign {
privateKeyPEM, err := readFirstFile(keyPath)
if err != nil {
panic(fmt.Errorf("failed to read private key file: %w", err))
}
privateKey, err := identity.PrivateKeyFromPEM(privateKeyPEM)
if err != nil {
panic(err)
}
sign, err := identity.NewPrivateKeySign(privateKey)
if err != nil {
panic(err)
}
return sign
}
func readFirstFile(dirPath string) ([]byte, error) {
dir, err := os.Open(dirPath)
if err != nil {
return nil, err
}
fileNames, err := dir.Readdirnames(1)
if err != nil {
return nil, err
}
return os.ReadFile(path.Join(dirPath, fileNames[0]))
}
// This type of transaction would typically only be run once by an application the first time it was started after its
// initial deployment. A new version of the chaincode deployed later would likely not need to run an "init" function.
func initLedger(contract *client.Contract) {
fmt.Printf("\n--> Submit Transaction: InitLedger, function creates the initial set of assets on the ledger \n")
_, err := contract.SubmitTransaction("InitLedger")
if err != nil {
panic(fmt.Errorf("failed to submit transaction: %w", err))
}
fmt.Printf("*** Transaction committed successfully\n")
}
// Evaluate a transaction to query ledger state.
func getAllAssets(contract *client.Contract) {
fmt.Println("\n--> Evaluate Transaction: GetAllAssets, function returns all the current assets on the ledger")
evaluateResult, err := contract.EvaluateTransaction("GetAllAssets")
if err != nil {
panic(fmt.Errorf("failed to evaluate transaction: %w", err))
}
result := formatJSON(evaluateResult)
fmt.Printf("*** Result:%s\n", result)
}
// Submit a transaction synchronously, blocking until it has been committed to the ledger.
func createAsset(contract *client.Contract) {
fmt.Printf("\n--> Submit Transaction: CreateAsset, creates new asset with ID, Color, Size, Owner and AppraisedValue arguments \n")
_, err := contract.SubmitTransaction("CreateAsset", assetId, "yellow", "5", "Tom", "1300")
if err != nil {
panic(fmt.Errorf("failed to submit transaction: %w", err))
}
fmt.Printf("*** Transaction committed successfully\n")
}
// Evaluate a transaction by assetID to query ledger state.
func readAssetByID(contract *client.Contract) {
fmt.Printf("\n--> Evaluate Transaction: ReadAsset, function returns asset attributes\n")
evaluateResult, err := contract.EvaluateTransaction("ReadAsset", assetId)
if err != nil {
panic(fmt.Errorf("failed to evaluate transaction: %w", err))
}
result := formatJSON(evaluateResult)
fmt.Printf("*** Result:%s\n", result)
}
// Submit transaction asynchronously, blocking until the transaction has been sent to the orderer, and allowing
// this thread to process the chaincode response (e.g. update a UI) without waiting for the commit notification
func transferAssetAsync(contract *client.Contract) {
fmt.Printf("\n--> Async Submit Transaction: TransferAsset, updates existing asset owner")
submitResult, commit, err := contract.SubmitAsync("TransferAsset", client.WithArguments(assetId, "Mark"))
if err != nil {
panic(fmt.Errorf("failed to submit transaction asynchronously: %w", err))
}
fmt.Printf("\n*** Successfully submitted transaction to transfer ownership from %s to Mark. \n", string(submitResult))
fmt.Println("*** Waiting for transaction commit.")
if commitStatus, err := commit.Status(); err != nil {
panic(fmt.Errorf("failed to get commit status: %w", err))
} else if !commitStatus.Successful {
panic(fmt.Errorf("transaction %s failed to commit with status: %d", commitStatus.TransactionID, int32(commitStatus.Code)))
}
fmt.Printf("*** Transaction committed successfully\n")
}
// Submit transaction, passing in the wrong number of arguments ,expected to throw an error containing details of any error responses from the smart contract.
func exampleErrorHandling(contract *client.Contract) {
fmt.Println("\n--> Submit Transaction: UpdateAsset asset70, asset70 does not exist and should return an error")
_, err := contract.SubmitTransaction("UpdateAsset", "asset70", "blue", "5", "Tomoko", "300")
if err == nil {
panic("******** FAILED to return an error")
}
fmt.Println("*** Successfully caught the error:")
var commitStatusErr *client.CommitStatusError
var transactionErr *client.TransactionError
if errors.As(err, &commitStatusErr) {
if errors.Is(err, context.DeadlineExceeded) {
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)
}
} else if errors.As(err, &transactionErr) {
// The error could be an EndorseError, SubmitError or CommitError.
fmt.Println(err)
fmt.Printf("TransactionID: %s\n", transactionErr.TransactionID)
} else {
panic(fmt.Errorf("unexpected error type %T: %w", err, err))
}
}
// Format JSON data
func formatJSON(data []byte) string {
var prettyJSON bytes.Buffer
if err := json.Indent(&prettyJSON, data, "", " "); err != nil {
panic(fmt.Errorf("failed to parse JSON: %w", err))
}
return prettyJSON.String()
}

View file

@ -0,0 +1,18 @@
module assetTransfer
go 1.24.0
require (
github.com/hyperledger/fabric-gateway v1.10.0
google.golang.org/grpc v1.76.0
)
require (
github.com/hyperledger/fabric-protos-go-apiv2 v0.3.7 // indirect
github.com/miekg/pkcs11 v1.1.1 // indirect
golang.org/x/net v0.42.0 // indirect
golang.org/x/sys v0.35.0 // indirect
golang.org/x/text v0.28.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20250804133106-a7a43d27e69b // indirect
google.golang.org/protobuf v1.36.10 // indirect
)

View file

@ -0,0 +1,52 @@
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI=
github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/hyperledger/fabric-gateway v1.10.0 h1:x5z/pofdVYIqgMo9QWejubfAZYCSt94WdUPj4Wipdeg=
github.com/hyperledger/fabric-gateway v1.10.0/go.mod h1:fSFS1vQkPZq6inNvzsnI/7PCaKSU+UZOZ6uAuau0Yq0=
github.com/hyperledger/fabric-protos-go-apiv2 v0.3.7 h1:sQ5qv8vQQfwewa1JlCiSCC8dLElmaU2/frLolpgibEY=
github.com/hyperledger/fabric-protos-go-apiv2 v0.3.7/go.mod h1:bJnwzfv03oZQeCc863pdGTDgf5nmCy6Za3RAE7d2XsQ=
github.com/miekg/pkcs11 v1.1.1 h1:Ugu9pdy6vAYku5DEpVWVFPYnzV+bxB+iRdbuFSu7TvU=
github.com/miekg/pkcs11 v1.1.1/go.mod h1:XsNlhZGX73bx86s2hdc/FuaLm2CPZJemRLMA+WTFxgs=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY=
github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA=
go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A=
go.opentelemetry.io/otel v1.37.0 h1:9zhNfelUvx0KBfu/gb+ZgeAfAgtWrfHJZcAqFC228wQ=
go.opentelemetry.io/otel v1.37.0/go.mod h1:ehE/umFRLnuLa/vSccNq9oS1ErUlkkK71gMcN34UG8I=
go.opentelemetry.io/otel/metric v1.37.0 h1:mvwbQS5m0tbmqML4NqK+e3aDiO02vsf/WgbsdpcPoZE=
go.opentelemetry.io/otel/metric v1.37.0/go.mod h1:04wGrZurHYKOc+RKeye86GwKiTb9FKm1WHtO+4EVr2E=
go.opentelemetry.io/otel/sdk v1.37.0 h1:ItB0QUqnjesGRvNcmAcU0LyvkVyGJ2xftD29bWdDvKI=
go.opentelemetry.io/otel/sdk v1.37.0/go.mod h1:VredYzxUvuo2q3WRcDnKDjbdvmO0sCzOvVAiY+yUkAg=
go.opentelemetry.io/otel/sdk/metric v1.37.0 h1:90lI228XrB9jCMuSdA0673aubgRobVZFhbjxHHspCPc=
go.opentelemetry.io/otel/sdk/metric v1.37.0/go.mod h1:cNen4ZWfiD37l5NhS+Keb5RXVWZWpRE+9WyVCpbo5ps=
go.opentelemetry.io/otel/trace v1.37.0 h1:HLdcFNbRQBE2imdSEgm/kwqmQj1Or1l/7bW6mxVK7z4=
go.opentelemetry.io/otel/trace v1.37.0/go.mod h1:TlgrlQ+PtQO5XFerSPUYG0JSgGyryXewPGyayAWSBS0=
golang.org/x/net v0.42.0 h1:jzkYrhi3YQWD6MLBJcsklgQsoAcw89EcZbJw8Z614hs=
golang.org/x/net v0.42.0/go.mod h1:FF1RA5d3u7nAYA4z2TkclSCKh68eSXtiFwcWQpPXdt8=
golang.org/x/sys v0.35.0 h1:vz1N37gP5bs89s7He8XuIYXpyY0+QlsKmzipCbUtyxI=
golang.org/x/sys v0.35.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
golang.org/x/text v0.28.0 h1:rhazDwis8INMIwQ4tpjLDzUhx6RlXqZNPEM0huQojng=
golang.org/x/text v0.28.0/go.mod h1:U8nCwOR8jO/marOQ0QbDiOngZVEBB7MAiitBuMjXiNU=
gonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk=
gonum.org/v1/gonum v0.16.0/go.mod h1:fef3am4MQ93R2HHpKnLk4/Tbh/s0+wqD5nfa6Pnwy4E=
google.golang.org/genproto/googleapis/rpc v0.0.0-20250804133106-a7a43d27e69b h1:zPKJod4w6F1+nRGDI9ubnXYhU9NSWoFAijkHkUXeTK8=
google.golang.org/genproto/googleapis/rpc v0.0.0-20250804133106-a7a43d27e69b/go.mod h1:qQ0YXyHHx3XkvlzUtpXDkS29lDSafHMZBAZDc03LQ3A=
google.golang.org/grpc v1.76.0 h1:UnVkv1+uMLYXoIz6o7chp59WfQUYA2ex/BXQ9rHZu7A=
google.golang.org/grpc v1.76.0/go.mod h1:Ju12QI8M6iQJtbcsV+awF5a4hfJMLi4X0JLo94ULZ6c=
google.golang.org/protobuf v1.36.10 h1:AYd7cD/uASjIL6Q9LiTjz8JLcrh/88q5UObnmY3aOOE=
google.golang.org/protobuf v1.36.10/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

View file

@ -0,0 +1,37 @@
/*
* This file was generated by the Gradle 'init' task.
*
* This generated file contains a sample Java project to get you started.
* For more details take a look at the Java Quickstart chapter in the Gradle
* User Manual available at https://docs.gradle.org/6.5/userguide/tutorial_java_projects.html
*/
plugins {
// Apply the application plugin to add support for building a CLI application.
id 'application'
}
ext {
javaMainClass = "application.java.App"
}
repositories {
mavenCentral()
}
dependencies {
implementation 'org.hyperledger.fabric:fabric-gateway:1.10.0'
implementation platform('com.google.protobuf:protobuf-bom:4.33.0')
implementation platform('io.grpc:grpc-bom:1.76.0')
compileOnly 'io.grpc:grpc-api'
runtimeOnly 'io.grpc:grpc-netty-shaded'
implementation 'com.google.code.gson:gson:2.13.2'
}
compileJava {
options.release = 11
}
application {
// Define the main class for the application.
mainClass = 'App'
}

View file

@ -1,5 +1,7 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists

View file

@ -0,0 +1,252 @@
#!/bin/sh
#
# Copyright © 2015-2021 the original authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#
##############################################################################
#
# Gradle start up script for POSIX generated by Gradle.
#
# Important for running:
#
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
# noncompliant, but you have some other compliant shell such as ksh or
# bash, then to run this script, type that shell name before the whole
# command line, like:
#
# ksh Gradle
#
# Busybox and similar reduced shells will NOT work, because this script
# requires all of these POSIX shell features:
# * functions;
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
# * compound commands having a testable exit status, especially «case»;
# * various built-in commands including «command», «set», and «ulimit».
#
# Important for patching:
#
# (2) This script targets any POSIX shell, so it avoids extensions provided
# by Bash, Ksh, etc; in particular arrays are avoided.
#
# The "traditional" practice of packing multiple parameters into a
# space-separated string is a well documented source of bugs and security
# problems, so this is (mostly) avoided, by progressively accumulating
# options in "$@", and eventually passing that to Java.
#
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
# see the in-line comments for details.
#
# There are tweaks for specific operating systems such as AIX, CygWin,
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
#
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
app_path=$0
# Need this for daisy-chained symlinks.
while
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
[ -h "$app_path" ]
do
ls=$( ls -ld "$app_path" )
link=${ls#*' -> '}
case $link in #(
/*) app_path=$link ;; #(
*) app_path=$APP_HOME$link ;;
esac
done
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
' "$PWD" ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
warn () {
echo "$*"
} >&2
die () {
echo
echo "$*"
echo
exit 1
} >&2
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "$( uname )" in #(
CYGWIN* ) cygwin=true ;; #(
Darwin* ) darwin=true ;; #(
MSYS* | MINGW* ) msys=true ;; #(
NONSTOP* ) nonstop=true ;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD=$JAVA_HOME/jre/sh/java
else
JAVACMD=$JAVA_HOME/bin/java
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD=java
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi
# Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
fi
# Collect all arguments for the java command, stacking in reverse order:
# * args from the command line
# * the main class name
# * -classpath
# * -D...appname settings
# * --module-path (only if needed)
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
# For Cygwin or MSYS, switch paths to Windows format before running java
if "$cygwin" || "$msys" ; then
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
JAVACMD=$( cygpath --unix "$JAVACMD" )
# Now convert the arguments - kludge to limit ourselves to /bin/sh
for arg do
if
case $arg in #(
-*) false ;; # don't mess with options #(
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
[ -e "$t" ] ;; #(
*) false ;;
esac
then
arg=$( cygpath --path --ignore --mixed "$arg" )
fi
# Roll the args list around exactly as many times as the number of
# args, so each arg winds up back in the position where it started, but
# possibly modified.
#
# NB: a `for` loop captures its iteration list before it begins, so
# changing the positional parameters here affects neither the number of
# iterations, nor the values presented in `arg`.
shift # remove old arg
set -- "$@" "$arg" # push replacement arg
done
fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
org.gradle.wrapper.GradleWrapperMain \
"$@"
# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi
# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
#
# In Bash we could simply go:
#
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
# set -- "${ARGS[@]}" "$@"
#
# but POSIX shell has neither arrays nor command substitution, so instead we
# post-process each arg (as a line of input to sed) to backslash-escape any
# character that might be a shell metacharacter, then use eval to reverse
# that process (while maintaining the separation between arguments), and wrap
# the whole thing up as a single "set" statement.
#
# This will of course break if any of these variables contains a newline or
# an unmatched quote.
#
eval "set -- $(
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
xargs -n1 |
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
tr '\n' ' '
)" '"$@"'
exec "$JAVACMD" "$@"

View file

@ -1,104 +1,94 @@
@rem @rem
@rem Copyright 2015 the original author or authors. @rem Copyright 2015 the original author or authors.
@rem @rem
@rem Licensed under the Apache License, Version 2.0 (the "License"); @rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License. @rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at @rem You may obtain a copy of the License at
@rem @rem
@rem https://www.apache.org/licenses/LICENSE-2.0 @rem https://www.apache.org/licenses/LICENSE-2.0
@rem @rem
@rem Unless required by applicable law or agreed to in writing, software @rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS, @rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and @rem See the License for the specific language governing permissions and
@rem limitations under the License. @rem limitations under the License.
@rem @rem
@rem SPDX-License-Identifier: Apache-2.0
@if "%DEBUG%" == "" @echo off @rem
@rem ##########################################################################
@rem @if "%DEBUG%"=="" @echo off
@rem Gradle startup script for Windows @rem ##########################################################################
@rem @rem
@rem ########################################################################## @rem Gradle startup script for Windows
@rem
@rem Set local scope for the variables with windows NT shell @rem ##########################################################################
if "%OS%"=="Windows_NT" setlocal
@rem Set local scope for the variables with windows NT shell
set DIRNAME=%~dp0 if "%OS%"=="Windows_NT" setlocal
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0 set DIRNAME=%~dp0
set APP_HOME=%DIRNAME% if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
@rem Resolve any "." and ".." in APP_HOME to make it shorter. set APP_BASE_NAME=%~n0
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi set APP_HOME=%DIRNAME%
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. @rem Resolve any "." and ".." in APP_HOME to make it shorter.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Find java.exe @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
if defined JAVA_HOME goto findJavaFromJavaHome set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
set JAVA_EXE=java.exe @rem Find java.exe
%JAVA_EXE% -version >NUL 2>&1 if defined JAVA_HOME goto findJavaFromJavaHome
if "%ERRORLEVEL%" == "0" goto init
set JAVA_EXE=java.exe
echo. %JAVA_EXE% -version >NUL 2>&1
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. if %ERRORLEVEL% equ 0 goto execute
echo.
echo Please set the JAVA_HOME variable in your environment to match the echo. 1>&2
echo location of your Java installation. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
goto fail echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=% goto fail
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
:findJavaFromJavaHome
if exist "%JAVA_EXE%" goto init set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% if exist "%JAVA_EXE%" goto execute
echo.
echo Please set the JAVA_HOME variable in your environment to match the echo. 1>&2
echo location of your Java installation. echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
goto fail echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2
:init
@rem Get command-line arguments, handling Windows variants goto fail
if not "%OS%" == "Windows_NT" goto win9xME_args :execute
@rem Setup the command line
:win9xME_args
@rem Slurp the command line arguments. set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
set CMD_LINE_ARGS=
set _SKIP=2
@rem Execute Gradle
:win9xME_args_slurp "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
if "x%~1" == "x" goto execute
:end
set CMD_LINE_ARGS=%* @rem End local scope for the variables with windows NT shell
if %ERRORLEVEL% equ 0 goto mainEnd
:execute
@rem Setup the command line :fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar rem the _cmd.exe /c_ return code!
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
@rem Execute Gradle if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% exit /b %EXIT_CODE%
:end :mainEnd
@rem End local scope for the variables with windows NT shell if "%OS%"=="Windows_NT" endlocal
if "%ERRORLEVEL%"=="0" goto mainEnd
:omega
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega

View file

@ -0,0 +1,101 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.hyperledger.fabric.example</groupId>
<artifactId>asset-transfer-basic</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.release>11</maven.compiler.release>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-bom</artifactId>
<version>4.33.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-bom</artifactId>
<version>1.76.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.hyperledger.fabric</groupId>
<artifactId>fabric-gateway</artifactId>
<version>1.10.0</version>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-api</artifactId>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-netty-shaded</artifactId>
<scope>runtime</scope>
</dependency>
</dependencies>
<build>
<pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be
moved to parent pom) -->
<plugins>
<!-- clean lifecycle, see
https://maven.apache.org/ref/current/maven-core/lifecycles.html#clean_Lifecycle -->
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>3.4.0</version>
</plugin>
<!-- default lifecycle, jar packaging: see
https://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging -->
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.3.1</version>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.13.0</version>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.3.0</version>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>3.4.2</version>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>3.1.2</version>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>3.1.2</version>
</plugin>
<!-- site lifecycle, see
https://maven.apache.org/ref/current/maven-core/lifecycles.html#site_Lifecycle -->
<plugin>
<artifactId>maven-site-plugin</artifactId>
<version>3.12.1</version>
</plugin>
<plugin>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>3.6.1</version>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>

View file

@ -7,4 +7,4 @@
* in the user manual at https://docs.gradle.org/6.5/userguide/multi_project_builds.html * in the user manual at https://docs.gradle.org/6.5/userguide/multi_project_builds.html
*/ */
rootProject.name = 'application-java' rootProject.name = 'asset-transfer-basic'

View file

@ -0,0 +1,244 @@
/*
* Copyright IBM Corp. All Rights Reserved.
*
* SPDX-License-Identifier: Apache-2.0
*/
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonParser;
import io.grpc.Grpc;
import io.grpc.ManagedChannel;
import io.grpc.TlsChannelCredentials;
import org.hyperledger.fabric.client.CommitException;
import org.hyperledger.fabric.client.CommitStatusException;
import org.hyperledger.fabric.client.Contract;
import org.hyperledger.fabric.client.EndorseException;
import org.hyperledger.fabric.client.Gateway;
import org.hyperledger.fabric.client.GatewayException;
import org.hyperledger.fabric.client.Hash;
import org.hyperledger.fabric.client.SubmitException;
import org.hyperledger.fabric.client.identity.Identities;
import org.hyperledger.fabric.client.identity.Identity;
import org.hyperledger.fabric.client.identity.Signer;
import org.hyperledger.fabric.client.identity.Signers;
import org.hyperledger.fabric.client.identity.X509Identity;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.security.InvalidKeyException;
import java.security.cert.CertificateException;
import java.time.Instant;
import java.util.concurrent.TimeUnit;
public final class App {
private static final String MSP_ID = System.getenv().getOrDefault("MSP_ID", "Org1MSP");
private static final String CHANNEL_NAME = System.getenv().getOrDefault("CHANNEL_NAME", "mychannel");
private static final String CHAINCODE_NAME = System.getenv().getOrDefault("CHAINCODE_NAME", "basic");
// Path to crypto materials.
private static final Path CRYPTO_PATH = Paths.get("../../test-network/organizations/peerOrganizations/org1.example.com");
// Path to user certificate.
private static final Path CERT_DIR_PATH = CRYPTO_PATH.resolve(Paths.get("users/User1@org1.example.com/msp/signcerts"));
// Path to user private key directory.
private static final Path KEY_DIR_PATH = CRYPTO_PATH.resolve(Paths.get("users/User1@org1.example.com/msp/keystore"));
// Path to peer tls certificate.
private static final Path TLS_CERT_PATH = CRYPTO_PATH.resolve(Paths.get("peers/peer0.org1.example.com/tls/ca.crt"));
// Gateway peer end point.
private static final String PEER_ENDPOINT = "localhost:7051";
private static final String OVERRIDE_AUTH = "peer0.org1.example.com";
private final Contract contract;
private final String assetId = "asset" + Instant.now().toEpochMilli();
private final Gson gson = new GsonBuilder().setPrettyPrinting().create();
public static void main(final String[] args) throws Exception {
// The gRPC client connection should be shared by all Gateway connections to
// this endpoint.
var channel = newGrpcConnection();
var builder = Gateway.newInstance()
.identity(newIdentity())
.signer(newSigner())
.hash(Hash.SHA256)
.connection(channel)
// Default timeouts for different gRPC calls
.evaluateOptions(options -> options.withDeadlineAfter(5, TimeUnit.SECONDS))
.endorseOptions(options -> options.withDeadlineAfter(15, TimeUnit.SECONDS))
.submitOptions(options -> options.withDeadlineAfter(5, TimeUnit.SECONDS))
.commitStatusOptions(options -> options.withDeadlineAfter(1, TimeUnit.MINUTES));
try (var gateway = builder.connect()) {
new App(gateway).run();
} finally {
channel.shutdownNow().awaitTermination(5, TimeUnit.SECONDS);
}
}
private static ManagedChannel newGrpcConnection() throws IOException {
var credentials = TlsChannelCredentials.newBuilder()
.trustManager(TLS_CERT_PATH.toFile())
.build();
return Grpc.newChannelBuilder(PEER_ENDPOINT, credentials)
.overrideAuthority(OVERRIDE_AUTH)
.build();
}
private static Identity newIdentity() throws IOException, CertificateException {
try (var certReader = Files.newBufferedReader(getFirstFilePath(CERT_DIR_PATH))) {
var certificate = Identities.readX509Certificate(certReader);
return new X509Identity(MSP_ID, certificate);
}
}
private static Signer newSigner() throws IOException, InvalidKeyException {
try (var keyReader = Files.newBufferedReader(getFirstFilePath(KEY_DIR_PATH))) {
var privateKey = Identities.readPrivateKey(keyReader);
return Signers.newPrivateKeySigner(privateKey);
}
}
private static Path getFirstFilePath(Path dirPath) throws IOException {
try (var keyFiles = Files.list(dirPath)) {
return keyFiles.findFirst().orElseThrow();
}
}
public App(final Gateway gateway) {
// Get a network instance representing the channel where the smart contract is
// deployed.
var network = gateway.getNetwork(CHANNEL_NAME);
// Get the smart contract from the network.
contract = network.getContract(CHAINCODE_NAME);
}
public void run() throws GatewayException, CommitException {
// Initialize a set of asset data on the ledger using the chaincode 'InitLedger' function.
initLedger();
// Return all the current assets on the ledger.
getAllAssets();
// Create a new asset on the ledger.
createAsset();
// Update an existing asset asynchronously.
transferAssetAsync();
// Get the asset details by assetID.
readAssetById();
// Update an asset which does not exist.
updateNonExistentAsset();
}
/**
* This type of transaction would typically only be run once by an application
* the first time it was started after its initial deployment. A new version of
* the chaincode deployed later would likely not need to run an "init" function.
*/
private void initLedger() throws EndorseException, SubmitException, CommitStatusException, CommitException {
System.out.println("\n--> Submit Transaction: InitLedger, function creates the initial set of assets on the ledger");
contract.submitTransaction("InitLedger");
System.out.println("*** Transaction committed successfully");
}
/**
* Evaluate a transaction to query ledger state.
*/
private void getAllAssets() throws GatewayException {
System.out.println("\n--> Evaluate Transaction: GetAllAssets, function returns all the current assets on the ledger");
var result = contract.evaluateTransaction("GetAllAssets");
System.out.println("*** Result: " + prettyJson(result));
}
private String prettyJson(final byte[] json) {
return prettyJson(new String(json, StandardCharsets.UTF_8));
}
private String prettyJson(final String json) {
var parsedJson = JsonParser.parseString(json);
return gson.toJson(parsedJson);
}
/**
* Submit a transaction synchronously, blocking until it has been committed to
* the ledger.
*/
private void createAsset() throws EndorseException, SubmitException, CommitStatusException, CommitException {
System.out.println("\n--> Submit Transaction: CreateAsset, creates new asset with ID, Color, Size, Owner and AppraisedValue arguments");
contract.submitTransaction("CreateAsset", assetId, "yellow", "5", "Tom", "1300");
System.out.println("*** Transaction committed successfully");
}
/**
* Submit transaction asynchronously, allowing the application to process the
* smart contract response (e.g. update a UI) while waiting for the commit
* notification.
*/
private void transferAssetAsync() throws EndorseException, SubmitException, CommitStatusException {
System.out.println("\n--> Async Submit Transaction: TransferAsset, updates existing asset owner");
var commit = contract.newProposal("TransferAsset")
.addArguments(assetId, "Saptha")
.build()
.endorse()
.submitAsync();
var result = commit.getResult();
var oldOwner = new String(result, StandardCharsets.UTF_8);
System.out.println("*** Successfully submitted transaction to transfer ownership from " + oldOwner + " to Saptha");
System.out.println("*** Waiting for transaction commit");
var status = commit.getStatus();
if (!status.isSuccessful()) {
throw new RuntimeException("Transaction " + status.getTransactionId() +
" failed to commit with status code " + status.getCode());
}
System.out.println("*** Transaction committed successfully");
}
private void readAssetById() throws GatewayException {
System.out.println("\n--> Evaluate Transaction: ReadAsset, function returns asset attributes");
var evaluateResult = contract.evaluateTransaction("ReadAsset", assetId);
System.out.println("*** Result:" + prettyJson(evaluateResult));
}
/**
* submitTransaction() will throw an error containing details of any error
* responses from the smart contract.
*/
private void updateNonExistentAsset() {
try {
System.out.println("\n--> Submit Transaction: UpdateAsset asset70, asset70 does not exist and should return an error");
contract.submitTransaction("UpdateAsset", "asset70", "blue", "5", "Tomoko", "300");
System.out.println("******** FAILED to return an error");
} catch (EndorseException | SubmitException | CommitStatusException e) {
System.out.println("*** Successfully caught the error:");
e.printStackTrace(System.out);
System.out.println("Transaction ID: " + e.getTransactionId());
} catch (CommitException e) {
System.out.println("*** Successfully caught the error:");
e.printStackTrace(System.out);
System.out.println("Transaction ID: " + e.getTransactionId());
System.out.println("Status code: " + e.getCode());
}
}
}

View file

@ -2,13 +2,10 @@
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
# #
# Coverage directory used by tools like istanbul # Coverage directory used by tools like istanbul
coverage coverage
# Dependency directories # Dependency directories
node_modules/ node_modules/
jspm_packages/ jspm_packages/
package-lock.json
wallet
!wallet/.gitkeep

View file

@ -0,0 +1 @@
engine-strict=true

View file

@ -0,0 +1,15 @@
import js from '@eslint/js';
import globals from 'globals';
export default [
js.configs.recommended,
{
languageOptions: {
ecmaVersion: 2023,
sourceType: 'commonjs',
globals: {
...globals.node,
},
},
},
];

View file

@ -0,0 +1,25 @@
{
"name": "asset-transfer-basic",
"version": "1.0.0",
"description": "Asset Transfer Basic Application implemented in JavaScript using fabric-gateway",
"engines": {
"node": ">=20"
},
"scripts": {
"lint": "eslint src",
"pretest": "npm run lint",
"start": "node src/app.js"
},
"engineStrict": true,
"author": "Hyperledger",
"license": "Apache-2.0",
"dependencies": {
"@grpc/grpc-js": "^1.14.0",
"@hyperledger/fabric-gateway": "^1.10.0"
},
"devDependencies": {
"@eslint/js": "^9.5.0",
"eslint": "^9.5.0",
"globals": "^15.6.0"
}
}

View file

@ -0,0 +1,301 @@
/*
* Copyright IBM Corp. All Rights Reserved.
*
* SPDX-License-Identifier: Apache-2.0
*/
const grpc = require('@grpc/grpc-js');
const { connect, hash, signers } = require('@hyperledger/fabric-gateway');
const crypto = require('node:crypto');
const fs = require('node:fs/promises');
const path = require('node:path');
const { TextDecoder } = require('node:util');
const channelName = envOrDefault('CHANNEL_NAME', 'mychannel');
const chaincodeName = envOrDefault('CHAINCODE_NAME', 'basic');
const mspId = envOrDefault('MSP_ID', 'Org1MSP');
// Path to crypto materials.
const cryptoPath = envOrDefault(
'CRYPTO_PATH',
path.resolve(
__dirname,
'..',
'..',
'..',
'test-network',
'organizations',
'peerOrganizations',
'org1.example.com'
)
);
// Path to user private key directory.
const keyDirectoryPath = envOrDefault(
'KEY_DIRECTORY_PATH',
path.resolve(
cryptoPath,
'users',
'User1@org1.example.com',
'msp',
'keystore'
)
);
// Path to user certificate directory.
const certDirectoryPath = envOrDefault(
'CERT_DIRECTORY_PATH',
path.resolve(
cryptoPath,
'users',
'User1@org1.example.com',
'msp',
'signcerts'
)
);
// Path to peer tls certificate.
const tlsCertPath = envOrDefault(
'TLS_CERT_PATH',
path.resolve(cryptoPath, 'peers', 'peer0.org1.example.com', 'tls', 'ca.crt')
);
// Gateway peer endpoint.
const peerEndpoint = envOrDefault('PEER_ENDPOINT', 'localhost:7051');
// Gateway peer SSL host name override.
const peerHostAlias = envOrDefault('PEER_HOST_ALIAS', 'peer0.org1.example.com');
const utf8Decoder = new TextDecoder();
const assetId = `asset${String(Date.now())}`;
async function main() {
displayInputParameters();
// The gRPC client connection should be shared by all Gateway connections to this endpoint.
const client = await newGrpcConnection();
const gateway = connect({
client,
identity: await newIdentity(),
signer: await newSigner(),
hash: hash.sha256,
// Default timeouts for different gRPC calls
evaluateOptions: () => {
return { deadline: Date.now() + 5000 }; // 5 seconds
},
endorseOptions: () => {
return { deadline: Date.now() + 15000 }; // 15 seconds
},
submitOptions: () => {
return { deadline: Date.now() + 5000 }; // 5 seconds
},
commitStatusOptions: () => {
return { deadline: Date.now() + 60000 }; // 1 minute
},
});
try {
// Get a network instance representing the channel where the smart contract is deployed.
const network = gateway.getNetwork(channelName);
// Get the smart contract from the network.
const contract = network.getContract(chaincodeName);
// Initialize a set of asset data on the ledger using the chaincode 'InitLedger' function.
await initLedger(contract);
// Return all the current assets on the ledger.
await getAllAssets(contract);
// Create a new asset on the ledger.
await createAsset(contract);
// Update an existing asset asynchronously.
await transferAssetAsync(contract);
// Get the asset details by assetID.
await readAssetByID(contract);
// Update an asset which does not exist.
await updateNonExistentAsset(contract);
} finally {
gateway.close();
client.close();
}
}
main().catch((error) => {
console.error('******** FAILED to run the application:', error);
process.exitCode = 1;
});
async function newGrpcConnection() {
const tlsRootCert = await fs.readFile(tlsCertPath);
const tlsCredentials = grpc.credentials.createSsl(tlsRootCert);
return new grpc.Client(peerEndpoint, tlsCredentials, {
'grpc.ssl_target_name_override': peerHostAlias,
});
}
async function newIdentity() {
const certPath = await getFirstDirFileName(certDirectoryPath);
const credentials = await fs.readFile(certPath);
return { mspId, credentials };
}
async function getFirstDirFileName(dirPath) {
const files = await fs.readdir(dirPath);
const file = files[0];
if (!file) {
throw new Error(`No files in directory: ${dirPath}`);
}
return path.join(dirPath, file);
}
async function newSigner() {
const keyPath = await getFirstDirFileName(keyDirectoryPath);
const privateKeyPem = await fs.readFile(keyPath);
const privateKey = crypto.createPrivateKey(privateKeyPem);
return signers.newPrivateKeySigner(privateKey);
}
/**
* This type of transaction would typically only be run once by an application the first time it was started after its
* initial deployment. A new version of the chaincode deployed later would likely not need to run an "init" function.
*/
async function initLedger(contract) {
console.log(
'\n--> Submit Transaction: InitLedger, function creates the initial set of assets on the ledger'
);
await contract.submitTransaction('InitLedger');
console.log('*** Transaction committed successfully');
}
/**
* Evaluate a transaction to query ledger state.
*/
async function getAllAssets(contract) {
console.log(
'\n--> Evaluate Transaction: GetAllAssets, function returns all the current assets on the ledger'
);
const resultBytes = await contract.evaluateTransaction('GetAllAssets');
const resultJson = utf8Decoder.decode(resultBytes);
const result = JSON.parse(resultJson);
console.log('*** Result:', result);
}
/**
* Submit a transaction synchronously, blocking until it has been committed to the ledger.
*/
async function createAsset(contract) {
console.log(
'\n--> Submit Transaction: CreateAsset, creates new asset with ID, Color, Size, Owner and AppraisedValue arguments'
);
await contract.submitTransaction(
'CreateAsset',
assetId,
'yellow',
'5',
'Tom',
'1300'
);
console.log('*** Transaction committed successfully');
}
/**
* Submit transaction asynchronously, allowing the application to process the smart contract response (e.g. update a UI)
* while waiting for the commit notification.
*/
async function transferAssetAsync(contract) {
console.log(
'\n--> Async Submit Transaction: TransferAsset, updates existing asset owner'
);
const commit = await contract.submitAsync('TransferAsset', {
arguments: [assetId, 'Saptha'],
});
const oldOwner = utf8Decoder.decode(commit.getResult());
console.log(
`*** Successfully submitted transaction to transfer ownership from ${oldOwner} to Saptha`
);
console.log('*** Waiting for transaction commit');
const status = await commit.getStatus();
if (!status.successful) {
throw new Error(
`Transaction ${
status.transactionId
} failed to commit with status code ${String(status.code)}`
);
}
console.log('*** Transaction committed successfully');
}
async function readAssetByID(contract) {
console.log(
'\n--> Evaluate Transaction: ReadAsset, function returns asset attributes'
);
const resultBytes = await contract.evaluateTransaction(
'ReadAsset',
assetId
);
const resultJson = utf8Decoder.decode(resultBytes);
const result = JSON.parse(resultJson);
console.log('*** Result:', result);
}
/**
* submitTransaction() will throw an error containing details of any error responses from the smart contract.
*/
async function updateNonExistentAsset(contract) {
console.log(
'\n--> Submit Transaction: UpdateAsset asset70, asset70 does not exist and should return an error'
);
try {
await contract.submitTransaction(
'UpdateAsset',
'asset70',
'blue',
'5',
'Tomoko',
'300'
);
console.log('******** FAILED to return an error');
} catch (error) {
console.log('*** Successfully caught the error: \n', error);
}
}
/**
* envOrDefault() will return the value of an environment variable, or a default value if the variable is undefined.
*/
function envOrDefault(key, defaultValue) {
return process.env[key] || defaultValue;
}
/**
* displayInputParameters() will print the global scope parameters used by the main driver routine.
*/
function displayInputParameters() {
console.log(`channelName: ${channelName}`);
console.log(`chaincodeName: ${chaincodeName}`);
console.log(`mspId: ${mspId}`);
console.log(`cryptoPath: ${cryptoPath}`);
console.log(`keyDirectoryPath: ${keyDirectoryPath}`);
console.log(`certDirectoryPath: ${certDirectoryPath}`);
console.log(`tlsCertPath: ${tlsCertPath}`);
console.log(`peerEndpoint: ${peerEndpoint}`);
console.log(`peerHostAlias: ${peerHostAlias}`);
}

View file

@ -12,4 +12,3 @@ jspm_packages/
# Compiled TypeScript files # Compiled TypeScript files
dist dist

View file

@ -0,0 +1 @@
engine-strict=true

View file

@ -0,0 +1,14 @@
import js from '@eslint/js';
import { defineConfig } from 'eslint/config';
import tseslint from 'typescript-eslint';
export default defineConfig(js.configs.recommended, ...tseslint.configs.strictTypeChecked, {
languageOptions: {
ecmaVersion: 2023,
sourceType: 'module',
parserOptions: {
project: 'tsconfig.json',
tsconfigRootDir: import.meta.dirname,
},
},
});

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,33 @@
{
"name": "asset-transfer-basic",
"version": "1.0.0",
"description": "Asset Transfer Basic Application implemented in typeScript using fabric-gateway",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
"engines": {
"node": ">=20"
},
"scripts": {
"build": "tsc",
"build:watch": "tsc -w",
"lint": "eslint src",
"prepare": "npm run build",
"pretest": "npm run lint",
"start": "node dist/app.js"
},
"engineStrict": true,
"author": "Hyperledger",
"license": "Apache-2.0",
"dependencies": {
"@grpc/grpc-js": "^1.14.0",
"@hyperledger/fabric-gateway": "^1.10.0"
},
"devDependencies": {
"@eslint/js": "^10.0.1",
"@tsconfig/node20": "^20.1.9",
"@types/node": "^20.19.33",
"eslint": "^10.0.2",
"typescript": "~5.8",
"typescript-eslint": "^8.56.1"
}
}

View file

@ -0,0 +1,247 @@
/*
* Copyright IBM Corp. All Rights Reserved.
*
* SPDX-License-Identifier: Apache-2.0
*/
import * as grpc from '@grpc/grpc-js';
import { connect, Contract, hash, Identity, Signer, signers } from '@hyperledger/fabric-gateway';
import * as crypto from 'crypto';
import { promises as fs } from 'fs';
import * as path from 'path';
import { TextDecoder } from 'util';
const channelName = envOrDefault('CHANNEL_NAME', 'mychannel');
const chaincodeName = envOrDefault('CHAINCODE_NAME', 'basic');
const mspId = envOrDefault('MSP_ID', 'Org1MSP');
// Path to crypto materials.
const cryptoPath = envOrDefault('CRYPTO_PATH', path.resolve(__dirname, '..', '..', '..', 'test-network', 'organizations', 'peerOrganizations', 'org1.example.com'));
// Path to user private key directory.
const keyDirectoryPath = envOrDefault('KEY_DIRECTORY_PATH', path.resolve(cryptoPath, 'users', 'User1@org1.example.com', 'msp', 'keystore'));
// Path to user certificate directory.
const certDirectoryPath = envOrDefault('CERT_DIRECTORY_PATH', path.resolve(cryptoPath, 'users', 'User1@org1.example.com', 'msp', 'signcerts'));
// Path to peer tls certificate.
const tlsCertPath = envOrDefault('TLS_CERT_PATH', path.resolve(cryptoPath, 'peers', 'peer0.org1.example.com', 'tls', 'ca.crt'));
// Gateway peer endpoint.
const peerEndpoint = envOrDefault('PEER_ENDPOINT', 'localhost:7051');
// Gateway peer SSL host name override.
const peerHostAlias = envOrDefault('PEER_HOST_ALIAS', 'peer0.org1.example.com');
const utf8Decoder = new TextDecoder();
const assetId = `asset${String(Date.now())}`;
async function main(): Promise<void> {
displayInputParameters();
// The gRPC client connection should be shared by all Gateway connections to this endpoint.
const client = await newGrpcConnection();
const gateway = connect({
client,
identity: await newIdentity(),
signer: await newSigner(),
hash: hash.sha256,
// Default timeouts for different gRPC calls
evaluateOptions: () => {
return { deadline: Date.now() + 5000 }; // 5 seconds
},
endorseOptions: () => {
return { deadline: Date.now() + 15000 }; // 15 seconds
},
submitOptions: () => {
return { deadline: Date.now() + 5000 }; // 5 seconds
},
commitStatusOptions: () => {
return { deadline: Date.now() + 60000 }; // 1 minute
},
});
try {
// Get a network instance representing the channel where the smart contract is deployed.
const network = gateway.getNetwork(channelName);
// Get the smart contract from the network.
const contract = network.getContract(chaincodeName);
// Initialize a set of asset data on the ledger using the chaincode 'InitLedger' function.
await initLedger(contract);
// Return all the current assets on the ledger.
await getAllAssets(contract);
// Create a new asset on the ledger.
await createAsset(contract);
// Update an existing asset asynchronously.
await transferAssetAsync(contract);
// Get the asset details by assetID.
await readAssetByID(contract);
// Update an asset which does not exist.
await updateNonExistentAsset(contract)
} finally {
gateway.close();
client.close();
}
}
main().catch((error: unknown) => {
console.error('******** FAILED to run the application:', error);
process.exitCode = 1;
});
async function newGrpcConnection(): Promise<grpc.Client> {
const tlsRootCert = await fs.readFile(tlsCertPath);
const tlsCredentials = grpc.credentials.createSsl(tlsRootCert);
return new grpc.Client(peerEndpoint, tlsCredentials, {
'grpc.ssl_target_name_override': peerHostAlias,
});
}
async function newIdentity(): Promise<Identity> {
const certPath = await getFirstDirFileName(certDirectoryPath);
const credentials = await fs.readFile(certPath);
return { mspId, credentials };
}
async function getFirstDirFileName(dirPath: string): Promise<string> {
const files = await fs.readdir(dirPath);
const file = files[0];
if (!file) {
throw new Error(`No files in directory: ${dirPath}`);
}
return path.join(dirPath, file);
}
async function newSigner(): Promise<Signer> {
const keyPath = await getFirstDirFileName(keyDirectoryPath);
const privateKeyPem = await fs.readFile(keyPath);
const privateKey = crypto.createPrivateKey(privateKeyPem);
return signers.newPrivateKeySigner(privateKey);
}
/**
* This type of transaction would typically only be run once by an application the first time it was started after its
* initial deployment. A new version of the chaincode deployed later would likely not need to run an "init" function.
*/
async function initLedger(contract: Contract): Promise<void> {
console.log('\n--> Submit Transaction: InitLedger, function creates the initial set of assets on the ledger');
await contract.submitTransaction('InitLedger');
console.log('*** Transaction committed successfully');
}
/**
* Evaluate a transaction to query ledger state.
*/
async function getAllAssets(contract: Contract): Promise<void> {
console.log('\n--> Evaluate Transaction: GetAllAssets, function returns all the current assets on the ledger');
const resultBytes = await contract.evaluateTransaction('GetAllAssets');
const resultJson = utf8Decoder.decode(resultBytes);
const result: unknown = JSON.parse(resultJson);
console.log('*** Result:', result);
}
/**
* Submit a transaction synchronously, blocking until it has been committed to the ledger.
*/
async function createAsset(contract: Contract): Promise<void> {
console.log('\n--> Submit Transaction: CreateAsset, creates new asset with ID, Color, Size, Owner and AppraisedValue arguments');
await contract.submitTransaction(
'CreateAsset',
assetId,
'yellow',
'5',
'Tom',
'1300',
);
console.log('*** Transaction committed successfully');
}
/**
* Submit transaction asynchronously, allowing the application to process the smart contract response (e.g. update a UI)
* while waiting for the commit notification.
*/
async function transferAssetAsync(contract: Contract): Promise<void> {
console.log('\n--> Async Submit Transaction: TransferAsset, updates existing asset owner');
const commit = await contract.submitAsync('TransferAsset', {
arguments: [assetId, 'Saptha'],
});
const oldOwner = utf8Decoder.decode(commit.getResult());
console.log(`*** Successfully submitted transaction to transfer ownership from ${oldOwner} to Saptha`);
console.log('*** Waiting for transaction commit');
const status = await commit.getStatus();
if (!status.successful) {
throw new Error(`Transaction ${status.transactionId} failed to commit with status code ${String(status.code)}`);
}
console.log('*** Transaction committed successfully');
}
async function readAssetByID(contract: Contract): Promise<void> {
console.log('\n--> Evaluate Transaction: ReadAsset, function returns asset attributes');
const resultBytes = await contract.evaluateTransaction('ReadAsset', assetId);
const resultJson = utf8Decoder.decode(resultBytes);
const result: unknown = JSON.parse(resultJson);
console.log('*** Result:', result);
}
/**
* submitTransaction() will throw an error containing details of any error responses from the smart contract.
*/
async function updateNonExistentAsset(contract: Contract): Promise<void>{
console.log('\n--> Submit Transaction: UpdateAsset asset70, asset70 does not exist and should return an error');
try {
await contract.submitTransaction(
'UpdateAsset',
'asset70',
'blue',
'5',
'Tomoko',
'300',
);
console.log('******** FAILED to return an error');
} catch (error) {
console.log('*** Successfully caught the error: \n', error);
}
}
/**
* envOrDefault() will return the value of an environment variable, or a default value if the variable is undefined.
*/
function envOrDefault(key: string, defaultValue: string): string {
return process.env[key] || defaultValue;
}
/**
* displayInputParameters() will print the global scope parameters used by the main driver routine.
*/
function displayInputParameters(): void {
console.log(`channelName: ${channelName}`);
console.log(`chaincodeName: ${chaincodeName}`);
console.log(`mspId: ${mspId}`);
console.log(`cryptoPath: ${cryptoPath}`);
console.log(`keyDirectoryPath: ${keyDirectoryPath}`);
console.log(`certDirectoryPath: ${certDirectoryPath}`);
console.log(`tlsCertPath: ${tlsCertPath}`);
console.log(`peerEndpoint: ${peerEndpoint}`);
console.log(`peerHostAlias: ${peerHostAlias}`);
}

View file

@ -0,0 +1,15 @@
{
"extends": "@tsconfig/node20/tsconfig.json",
"compilerOptions": {
"outDir": "dist",
"declaration": true,
"declarationMap": true,
"sourceMap": true,
"noUnusedLocals": true,
"noImplicitReturns": true,
"noUncheckedIndexedAccess": true,
"forceConsistentCasingInFileNames": true
},
"include": ["src/"],
"exclude": ["**/*.spec.*"]
}

View file

@ -1,4 +0,0 @@
wallet
!wallet/.gitkeep
keystore

View file

@ -1,155 +0,0 @@
/*
Copyright 2020 IBM All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package main
import (
"fmt"
"io/ioutil"
"log"
"os"
"path/filepath"
"github.com/hyperledger/fabric-sdk-go/pkg/core/config"
"github.com/hyperledger/fabric-sdk-go/pkg/gateway"
)
func main() {
log.Println("============ application-golang starts ============")
err := os.Setenv("DISCOVERY_AS_LOCALHOST", "true")
if err != nil {
log.Fatalf("Error setting DISCOVERY_AS_LOCALHOST environemnt variable: %v", err)
}
wallet, err := gateway.NewFileSystemWallet("wallet")
if err != nil {
log.Fatalf("Failed to create wallet: %v", err)
}
if !wallet.Exists("appUser") {
err = populateWallet(wallet)
if err != nil {
log.Fatalf("Failed to populate wallet contents: %v", err)
}
}
ccpPath := filepath.Join(
"..",
"..",
"test-network",
"organizations",
"peerOrganizations",
"org1.example.com",
"connection-org1.yaml",
)
gw, err := gateway.Connect(
gateway.WithConfig(config.FromFile(filepath.Clean(ccpPath))),
gateway.WithIdentity(wallet, "appUser"),
)
if err != nil {
log.Fatalf("Failed to connect to gateway: %v", err)
}
defer gw.Close()
network, err := gw.GetNetwork("mychannel")
if err != nil {
log.Fatalf("Failed to get network: %v", err)
}
contract := network.GetContract("basic")
log.Println("--> Submit Transaction: InitLedger, function creates the initial set of assets on the ledger")
result, err := contract.SubmitTransaction("InitLedger")
if err != nil {
log.Fatalf("Failed to Submit transaction: %v", err)
}
log.Println(string(result))
log.Println("--> Evaluate Transaction: GetAllAssets, function returns all the current assets on the ledger")
result, err = contract.EvaluateTransaction("GetAllAssets")
if err != nil {
log.Fatalf("Failed to evaluate transaction: %v", err)
}
log.Println(string(result))
log.Println("--> Submit Transaction: CreateAsset, creates new asset with ID, color, owner, size, and appraisedValue arguments")
result, err = contract.SubmitTransaction("CreateAsset", "asset13", "yellow", "5", "Tom", "1300")
if err != nil {
log.Fatalf("Failed to Submit transaction: %v", err)
}
log.Println(string(result))
log.Println("--> Evaluate Transaction: ReadAsset, function returns an asset with a given assetID")
result, err = contract.EvaluateTransaction("ReadAsset", "asset13")
if err != nil {
log.Fatalf("Failed to evaluate transaction: %v\n", err)
}
log.Println(string(result))
log.Println("--> Evaluate Transaction: AssetExists, function returns 'true' if an asset with given assetID exist")
result, err = contract.EvaluateTransaction("AssetExists", "asset1")
if err != nil {
log.Fatalf("Failed to evaluate transaction: %v\n", err)
}
log.Println(string(result))
log.Println("--> Submit Transaction: TransferAsset asset1, transfer to new owner of Tom")
_, err = contract.SubmitTransaction("TransferAsset", "asset1", "Tom")
if err != nil {
log.Fatalf("Failed to Submit transaction: %v", err)
}
log.Println("--> Evaluate Transaction: ReadAsset, function returns 'asset1' attributes")
result, err = contract.EvaluateTransaction("ReadAsset", "asset1")
if err != nil {
log.Fatalf("Failed to evaluate transaction: %v", err)
}
log.Println(string(result))
log.Println("============ application-golang ends ============")
}
func populateWallet(wallet *gateway.Wallet) error {
log.Println("============ Populating wallet ============")
credPath := filepath.Join(
"..",
"..",
"test-network",
"organizations",
"peerOrganizations",
"org1.example.com",
"users",
"User1@org1.example.com",
"msp",
)
certPath := filepath.Join(credPath, "signcerts", "cert.pem")
// read the certificate pem
cert, err := ioutil.ReadFile(filepath.Clean(certPath))
if err != nil {
return err
}
keyDir := filepath.Join(credPath, "keystore")
// there's a single file in this dir containing the private key
files, err := ioutil.ReadDir(keyDir)
if err != nil {
return err
}
if len(files) != 1 {
return fmt.Errorf("keystore folder should have contain one file")
}
keyPath := filepath.Join(keyDir, files[0].Name())
key, err := ioutil.ReadFile(filepath.Clean(keyPath))
if err != nil {
return err
}
identity := gateway.NewX509Identity("Org1MSP", string(cert), string(key))
return wallet.Put("appUser", identity)
}

View file

@ -1,5 +0,0 @@
module asset-transfer-basic
go 1.14
require github.com/hyperledger/fabric-sdk-go v1.0.0-rc1

View file

@ -1,277 +0,0 @@
bitbucket.org/liamstask/goose v0.0.0-20150115234039-8488cc47d90c/go.mod h1:hSVuE3qU7grINVSwrmzHfpg9k87ALBk+XaualNyUzI4=
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/GeertJohan/go.incremental v1.0.0/go.mod h1:6fAjUhbVuX1KcMD3c8TEgVUqmo4seqhv0i0kdATSkM0=
github.com/GeertJohan/go.rice v1.0.0/go.mod h1:eH6gbSOAUv07dQuZVnBmoDP8mgsM1rtixis4Tib9if0=
github.com/Knetic/govaluate v3.0.0+incompatible h1:7o6+MAPhYTCF0+fdvoz1xDedhRb4f6s9Tn1Tt7/WTEg=
github.com/Knetic/govaluate v3.0.0+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0=
github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g=
github.com/akavel/rsrc v0.8.0/go.mod h1:uLoCtb9J+EyAqh+26kdrTgmzRBFPGOolLWKpdxkKq+c=
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973 h1:xJ4a3vCFaGF/jqvzLMYoU8P317H5OQ+Via4RmuPwCS0=
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/certifi/gocertifi v0.0.0-20180118203423-deb3ae2ef261/go.mod h1:GJKEexRPVJrBSOjoqN5VNOIKJ5Q3RViH6eu3puDRwx4=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/cloudflare/backoff v0.0.0-20161212185259-647f3cdfc87a/go.mod h1:rzgs2ZOiguV6/NpiDgADjRLPNyZlApIWxKpkT+X8SdY=
github.com/cloudflare/cfssl v0.0.0-20180223231731-4e2dcbde5004 h1:lkAMpLVBDaj17e85keuznYcH5rqI438v41pKcBl4ZxQ=
github.com/cloudflare/cfssl v0.0.0-20180223231731-4e2dcbde5004/go.mod h1:yMWuSON2oQp+43nFtAV/uvKQIFpSPerB57DCt9t8sSA=
github.com/cloudflare/cfssl v1.4.1 h1:vScfU2DrIUI9VPHBVeeAQ0q5A+9yshO1Gz+3QoUQiKw=
github.com/cloudflare/cfssl v1.4.1/go.mod h1:KManx/OJPb5QY+y0+o/898AMcM128sF0bURvoVUSjTo=
github.com/cloudflare/go-metrics v0.0.0-20151117154305-6a9aea36fb41/go.mod h1:eaZPlJWD+G9wseg1BuRXlHnjntPMrywMsyxf+LTOdP4=
github.com/cloudflare/redoctober v0.0.0-20171127175943-746a508df14c/go.mod h1:6Se34jNoqrd8bTxrmJB2Bg2aoZ2CdSXonils9NsiNgo=
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
github.com/daaku/go.zipexe v1.0.0/go.mod h1:z8IiR6TsVLEYKwXAoE/I+8ys/sDkgTzSL0CLnGVd57E=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/getsentry/raven-go v0.0.0-20180121060056-563b81fc02b7/go.mod h1:KungGk8q33+aIAZUIVWZDr2OfAEBsO49PX4NzFV5kcQ=
github.com/go-kit/kit v0.8.0 h1:Wz+5lgoB0kkuqLEc6NVmwRknTKP6dTGbSqvhZtBI/j0=
github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
github.com/go-logfmt/logfmt v0.4.0 h1:MP4Eh7ZCb31lleYCFuwm0oe4/YGak+5l1vA2NOE80nA=
github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
github.com/go-sql-driver/mysql v1.3.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w=
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
github.com/gogo/protobuf v1.1.1 h1:72R+M5VuhED/KujmZVcIquuo8mBgX4oVda//DQb3PXo=
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
github.com/golang/mock v1.2.0 h1:28o5sBqPkBsMGnC6b4MvE2TzSr5/AT4c/1fLqVGIwlk=
github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
github.com/golang/mock v1.4.3 h1:GV+pQPG/EUUbkh47niozDcADz6go/dUwhVzdUQHIVRw=
github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs=
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.3 h1:gyjaxf+svBWX08ZjK86iN9geUJF0H6gp2IRKX6Nf6/I=
github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
github.com/google/certificate-transparency-go v0.0.0-20180222191210-5ab67e519c93 h1:qdfmdGwtm13OVx+AxguOWUTbgmXGn2TbdUHipo3chMg=
github.com/google/certificate-transparency-go v0.0.0-20180222191210-5ab67e519c93/go.mod h1:QeJfpSbVSfYc7RgB3gJFj9cbuQMMchQxrWXz8Ruopmg=
github.com/google/certificate-transparency-go v1.0.21 h1:Yf1aXowfZ2nuboBsg7iYGLmwsOARdV86pfH3g95wXmE=
github.com/google/certificate-transparency-go v1.0.21/go.mod h1:QeJfpSbVSfYc7RgB3gJFj9cbuQMMchQxrWXz8Ruopmg=
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/hashicorp/hcl v0.0.0-20180404174102-ef8a98b0bbce h1:xdsDDbiBDQTKASoGEZ+pEmF1OnWuu8AQ9I8iNbHNeno=
github.com/hashicorp/hcl v0.0.0-20180404174102-ef8a98b0bbce/go.mod h1:oZtUIOe8dh44I2q6ScRibXws4Ajl+d+nod3AaR9vL5w=
github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
github.com/hyperledger/fabric-config v0.0.5 h1:khRkm8U9Ghdg8VmZfptgzCFlCzrka8bPfUkM+/j6Zlg=
github.com/hyperledger/fabric-config v0.0.5/go.mod h1:YpITBI/+ZayA3XWY5lF302K7PAsFYjEEPM/zr3hegA8=
github.com/hyperledger/fabric-lib-go v1.0.0 h1:UL1w7c9LvHZUSkIvHTDGklxFv2kTeva1QI2emOVc324=
github.com/hyperledger/fabric-lib-go v1.0.0/go.mod h1:H362nMlunurmHwkYqR5uHL2UDWbQdbfz74n8kbCFsqc=
github.com/hyperledger/fabric-protos-go v0.0.0-20191121202242-f5500d5e3e85 h1:bNgEcCg5NVRWs/T+VUEfhgh5Olx/N4VB+0+ybW+oSuA=
github.com/hyperledger/fabric-protos-go v0.0.0-20191121202242-f5500d5e3e85/go.mod h1:xVYTjK4DtZRBxZ2D9aE4y6AbLaPwue2o/criQyQbVD0=
github.com/hyperledger/fabric-protos-go v0.0.0-20200424173316-dd554ba3746e/go.mod h1:xVYTjK4DtZRBxZ2D9aE4y6AbLaPwue2o/criQyQbVD0=
github.com/hyperledger/fabric-protos-go v0.0.0-20200707132912-fee30f3ccd23 h1:SEbB3yH4ISTGRifDamYXAst36gO2kM855ndMJlsv+pc=
github.com/hyperledger/fabric-protos-go v0.0.0-20200707132912-fee30f3ccd23/go.mod h1:xVYTjK4DtZRBxZ2D9aE4y6AbLaPwue2o/criQyQbVD0=
github.com/hyperledger/fabric-sdk-go v1.0.0-beta1.0.20200526155846-219a09aadc0f h1:eAkJx0+8PBbfP6xZxVRD2agk9W7oDbqllxO+ERgnKJk=
github.com/hyperledger/fabric-sdk-go v1.0.0-beta1.0.20200526155846-219a09aadc0f/go.mod h1:/s224b8NLvOJOCIqBvWd9O6u7GE33iuIOT6OfcTE1OE=
github.com/hyperledger/fabric-sdk-go v1.0.0-beta2 h1:FBYygns0Qga+mQ4PXycyTU5m4N9KAZM+Ttf7agiV7M8=
github.com/hyperledger/fabric-sdk-go v1.0.0-beta2/go.mod h1:/s224b8NLvOJOCIqBvWd9O6u7GE33iuIOT6OfcTE1OE=
github.com/hyperledger/fabric-sdk-go v1.0.0-beta3.0.20201006151309-9c426dcc5096 h1:veml7LmfavSHqF8w8z/PGGlfdXvmx5SstQIH6Nyy87c=
github.com/hyperledger/fabric-sdk-go v1.0.0-beta3.0.20201006151309-9c426dcc5096/go.mod h1:qWE9Syfg1KbwNjtILk70bJLilnmCvllIYFCSY/pa1RU=
github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
github.com/jmhodges/clock v0.0.0-20160418191101-880ee4c33548/go.mod h1:hGT6jSUVzF6no3QaDSMLGLEHtHSBSefs+MgcDWnmhmo=
github.com/jmoiron/sqlx v0.0.0-20180124204410-05cef0741ade/go.mod h1:IiEW3SEiiErVyFdH8NTuWjSifiEQKUoyK3LNqr2kCHU=
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
github.com/kisielk/sqlstruct v0.0.0-20150923205031-648daed35d49/go.mod h1:yyMNCyc/Ib3bDTKd379tNMpB/7/H5TjM2Y9QJ5THLbE=
github.com/kisom/goutils v1.1.0/go.mod h1:+UBTfd78habUYWFbNWTJNG+jNG/i/lGURakr4A/yNRw=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg=
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515 h1:T+h1c/A9Gawja4Y9mFVWj2vyii2bbUNDw3kt9VxK2EY=
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kylelemons/go-gypsy v0.0.0-20160905020020-08cad365cd28/go.mod h1:T/T7jsxVqf9k/zYOqbgNAsANsjxTd1Yq3htjDhQ1H0c=
github.com/lib/pq v0.0.0-20180201184707-88edab080323/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
github.com/magiconair/properties v1.7.6 h1:U+1DqNen04MdEPgFiIwdOUiqZ8qPa37xgogX/sd3+54=
github.com/magiconair/properties v1.7.6/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
github.com/magiconair/properties v1.8.1 h1:ZC2Vc7/ZFkGmsVC9KvOjumD+G5lXy2RtTKyzRKO2BQ4=
github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
github.com/mattn/go-sqlite3 v1.10.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc=
github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU=
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
github.com/miekg/pkcs11 v0.0.0-20190329070431-55f3fac3af27/go.mod h1:WCBAbTOdfhHhz7YXujeZMF7owC4tPb1naKFsgfUISjo=
github.com/miekg/pkcs11 v1.0.3/go.mod h1:XsNlhZGX73bx86s2hdc/FuaLm2CPZJemRLMA+WTFxgs=
github.com/mitchellh/mapstructure v0.0.0-20180220230111-00c29f56e238 h1:+MZW2uvHgN8kYvksEN3f7eFL2wpzk0GxmlFsMybWc7E=
github.com/mitchellh/mapstructure v0.0.0-20180220230111-00c29f56e238/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
github.com/mitchellh/mapstructure v1.3.2 h1:mRS76wmkOn3KkKAyXDu42V+6ebnXWIztFSYGN7GeoRg=
github.com/mitchellh/mapstructure v1.3.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/mreiferson/go-httpclient v0.0.0-20160630210159-31f0106b4474/go.mod h1:OQA4XLvDbMgS8P0CevmM4m9Q3Jq4phKUzcocxuGJ5m8=
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
github.com/nkovacs/streamquote v0.0.0-20170412213628-49af9bddb229/go.mod h1:0aYXnNPJ8l7uZxf45rWW1a/uME32OF0rhiYGNQ2oF2E=
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/gomega v1.4.2/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA=
github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk=
github.com/pelletier/go-toml v1.1.0 h1:cmiOvKzEunMsAxyhXSzpL5Q1CRKpVv0KQsnAIcSEVYM=
github.com/pelletier/go-toml v1.1.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
github.com/pelletier/go-toml v1.8.0 h1:Keo9qb7iRJs2voHvunFtuuYFsbWeOBh8/P9v/kVMFtw=
github.com/pelletier/go-toml v1.8.0/go.mod h1:D6yutnOGMveHEPV7VQOuvI/gXY61bv+9bAOTRnLElKs=
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/prometheus/client_golang v0.8.0 h1:1921Yw9Gc3iSc4VQh3PIoOqgPCZS7G/4xQNVUp8Mda8=
github.com/prometheus/client_golang v0.8.0/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo=
github.com/prometheus/client_golang v1.1.0 h1:BQ53HtBmfOitExawJ6LokA4x8ov/z0SYYb0+HxJfRI8=
github.com/prometheus/client_golang v1.1.0/go.mod h1:I1FGZT9+L76gKKOs5djB6ezCbFQP1xR9D75/vuwEF3g=
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910 h1:idejC8f05m9MGOsuEi1ATq9shN03HrxNkD/luQvxCv8=
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4 h1:gQz4mCbXsO+nc9n1hCxHcGA3Zx3Eo+UHZoInFGUIXNM=
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/common v0.0.0-20180518154759-7600349dcfe1 h1:osmNoEW2SCW3L7EX0km2LYM8HKpNWRiouxjE3XHkyGc=
github.com/prometheus/common v0.0.0-20180518154759-7600349dcfe1/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro=
github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
github.com/prometheus/common v0.6.0 h1:kRhiuYSXR3+uv2IbVbZhUxK5zVD/2pp3Gd2PpvPkpEo=
github.com/prometheus/common v0.6.0/go.mod h1:eBmuwkDJBwy6iBfxCBob6t6dR6ENT/y+J+Zk0j9GMYc=
github.com/prometheus/procfs v0.0.0-20180705121852-ae68e2d4c00f h1:c9M4CCa6g8WURSsbrl3lb/w/G1Z5xZpYvhhjdcVDOkE=
github.com/prometheus/procfs v0.0.0-20180705121852-ae68e2d4c00f/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
github.com/prometheus/procfs v0.0.3 h1:CTwfnzjQ+8dS6MhHHu4YswVAD99sL2wjPqP+VkURmKE=
github.com/prometheus/procfs v0.0.3/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ=
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
github.com/sirupsen/logrus v1.3.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
github.com/spf13/afero v1.1.0 h1:bopulORc2JeYaxfHLvJa5NzxviA9PoWhpiiJkru7Ji4=
github.com/spf13/afero v1.1.0/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ=
github.com/spf13/afero v1.3.1 h1:GPTpEAuNr98px18yNQ66JllNil98wfRZ/5Ukny8FeQA=
github.com/spf13/afero v1.3.1/go.mod h1:5KUK8ByomD5Ti5Artl0RtHeI5pTF7MIDuXL3yY520V4=
github.com/spf13/cast v1.2.0 h1:HHl1DSRbEQN2i8tJmtS6ViPyHx35+p51amrdsiTCrkg=
github.com/spf13/cast v1.2.0/go.mod h1:r2rcYCSwa1IExKTDiTfzaxqT2FNHs8hODu4LnUfgKEg=
github.com/spf13/cast v1.3.1 h1:nFm6S0SMdyzrzcmThSipiEubIDy8WEXKNZ0UOgiRpng=
github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
github.com/spf13/jwalterweatherman v0.0.0-20180109140146-7c0cea34c8ec h1:2ZXvIUGghLpdTVHR1UfvfrzoVlZaE/yOWC5LueIHZig=
github.com/spf13/jwalterweatherman v0.0.0-20180109140146-7c0cea34c8ec/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo=
github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk=
github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo=
github.com/spf13/pflag v1.0.1 h1:aCvUg6QPl3ibpQUxyLkrEkCHtPqYJL4x9AuhqVqFis4=
github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/spf13/viper v1.0.2 h1:Ncr3ZIuJn322w2k1qmzXDnkLAdQMlJqBa9kfAH+irso=
github.com/spf13/viper v1.0.2/go.mod h1:A8kyI5cUJhb8N+3pkfONlcEcZbueH6nhAm0Fq7SrnBM=
github.com/spf13/viper v1.1.1 h1:/8JBRFO4eoHu1TmpsLgNBq1CQgRUg4GolYlEFieqJgo=
github.com/spf13/viper v1.1.1/go.mod h1:A8kyI5cUJhb8N+3pkfONlcEcZbueH6nhAm0Fq7SrnBM=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4=
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8=
github.com/weppos/publicsuffix-go v0.4.0/go.mod h1:z3LCPQ38eedDQSwmsSRW4Y7t2L8Ln16JPQ02lHAdn5k=
github.com/weppos/publicsuffix-go v0.5.0 h1:rutRtjBJViU/YjcI5d80t4JAVvDltS6bciJg2K1HrLU=
github.com/weppos/publicsuffix-go v0.5.0/go.mod h1:z3LCPQ38eedDQSwmsSRW4Y7t2L8Ln16JPQ02lHAdn5k=
github.com/ziutek/mymysql v1.5.4/go.mod h1:LMSpPZ6DbqWFxNCHW77HeMg9I646SAhApZ/wKdgO/C0=
github.com/zmap/rc2 v0.0.0-20131011165748-24b9757f5521/go.mod h1:3YZ9o3WnatTIZhuOtot4IcUfzoKVjUHqu6WALIyI0nE=
github.com/zmap/zcertificate v0.0.0-20180516150559-0e3d58b1bac4/go.mod h1:5iU54tB79AMBcySS0R2XIyZBAVmeHranShAFELYx7is=
github.com/zmap/zcrypto v0.0.0-20190729165852-9051775e6a2e h1:mvOa4+/DXStR4ZXOks/UsjeFdn5O5JpLUtzqk9U8xXw=
github.com/zmap/zcrypto v0.0.0-20190729165852-9051775e6a2e/go.mod h1:w7kd3qXHh8FNaczNjslXqvFQiv5mMWRXlL9klTUAHc8=
github.com/zmap/zlint v0.0.0-20190806154020-fd021b4cfbeb h1:vxqkjztXSaPVDc8FQCdHTaejm2x747f6yPbnu1h2xkg=
github.com/zmap/zlint v0.0.0-20190806154020-fd021b4cfbeb/go.mod h1:29UiAJNsiVdvTBFCJW8e3q6dcDbOoPkhMgttOSCIMMY=
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 h1:VklqNMn3ovrHsnt90PveolxSbWFaJdECFbxSq0Mqo2M=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d h1:1ZiEyfaQIg3Qh0EoqpwAakHVhecoE5wlSg5GjnafJGw=
golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190311183353-d8887717615a h1:oWX7TPOiFAMXLq8o0ikBYfCJVlRHBcsciT5bXOrH628=
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190613194153-d28f0bde5980 h1:dfGZHvZk057jK2MCeWus/TowKpJ8y4AmooUzdBSR9GU=
golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a h1:1BGLXjeY4akVXGgbC9HugT3Jv3hCI0z56oJR5vAMgBU=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3 h1:4y9KwBHBgBNwDbtu44R5o1fdOCQUEXhbk/P4A9WmJq0=
golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
google.golang.org/genproto v0.0.0-20190327125643-d831d65fe17d h1:XB2jc5XQ9uhizGTS2vWcN01bc4dI6z3C4KY5MQm8SS8=
google.golang.org/genproto v0.0.0-20190327125643-d831d65fe17d/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55 h1:gSJIx1SDwno+2ElGhA4+qG2zF97qiUzTM+rQ0klBOcE=
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
google.golang.org/grpc v1.23.0 h1:AzbTB6ux+okLTzP8Ru1Xs41C303zdcfEht7MQnYJt5A=
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=
google.golang.org/grpc v1.29.1 h1:EC2SB8S04d2r73uptxphDSUG+kTKVgjRPF+N3xpxRB4=
google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk=
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
gopkg.in/yaml.v2 v2.2.1 h1:mUhvW9EsL+naU5Q3cakzfE91YhliOondGd6ZrsDBHQE=
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU=
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=

View file

@ -1,6 +0,0 @@
#
# https://help.github.com/articles/dealing-with-line-endings/
#
# These are explicitly windows files and should use crlf
*.bat text eol=crlf

View file

@ -1,43 +0,0 @@
/*
* This file was generated by the Gradle 'init' task.
*
* This generated file contains a sample Java project to get you started.
* For more details take a look at the Java Quickstart chapter in the Gradle
* User Manual available at https://docs.gradle.org/6.5/userguide/tutorial_java_projects.html
*/
plugins {
// Apply the java plugin to add support for Java
id 'java'
// Apply the application plugin to add support for building a CLI application.
id 'application'
}
ext {
javaMainClass = "application.java.App"
}
repositories {
// Use jcenter for resolving dependencies.
// You can declare any Maven/Ivy/file repository here.
jcenter()
}
dependencies {
// This dependency is used by the application.
implementation 'com.google.guava:guava:29.0-jre'
implementation 'org.hyperledger.fabric:fabric-gateway-java:2.1.1'
}
application {
// Define the main class for the application.
mainClassName = 'application.java.App'
}
// task for running the app after building dependencies
task runApp(type: Exec) {
dependsOn build
group = "Execution"
description = "Run the main class with ExecTask"
commandLine "java", "-classpath", sourceSets.main.runtimeClasspath.getAsPath(), javaMainClass
}

View file

@ -1,185 +0,0 @@
#!/usr/bin/env sh
#
# Copyright 2015 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn () {
echo "$*"
}
die () {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin or MSYS, switch paths to Windows format before running java
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=`expr $i + 1`
done
case $i in
0) set -- ;;
1) set -- "$args0" ;;
2) set -- "$args0" "$args1" ;;
3) set -- "$args0" "$args1" "$args2" ;;
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=`save "$@"`
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
exec "$JAVACMD" "$@"

View file

@ -1,116 +0,0 @@
/*
* Copyright IBM Corp. All Rights Reserved.
*
* SPDX-License-Identifier: Apache-2.0
*/
// Running TestApp:
// gradle runApp
package application.java;
import java.nio.file.Path;
import java.nio.file.Paths;
import org.hyperledger.fabric.gateway.Contract;
import org.hyperledger.fabric.gateway.Gateway;
import org.hyperledger.fabric.gateway.Network;
import org.hyperledger.fabric.gateway.Wallet;
import org.hyperledger.fabric.gateway.Wallets;
public class App {
static {
System.setProperty("org.hyperledger.fabric.sdk.service_discovery.as_localhost", "true");
}
// helper function for getting connected to the gateway
public static Gateway connect() throws Exception{
// Load a file system based wallet for managing identities.
Path walletPath = Paths.get("wallet");
Wallet wallet = Wallets.newFileSystemWallet(walletPath);
// load a CCP
Path networkConfigPath = Paths.get("..", "..", "test-network", "organizations", "peerOrganizations", "org1.example.com", "connection-org1.yaml");
Gateway.Builder builder = Gateway.createBuilder();
builder.identity(wallet, "appUser").networkConfig(networkConfigPath).discovery(true);
return builder.connect();
}
public static void main(String[] args) throws Exception {
// enrolls the admin and registers the user
try {
EnrollAdmin.main(null);
RegisterUser.main(null);
} catch (Exception e) {
System.err.println(e);
}
// connect to the network and invoke the smart contract
try (Gateway gateway = connect()) {
// get the network and contract
Network network = gateway.getNetwork("mychannel");
Contract contract = network.getContract("basic");
byte[] result;
System.out.println("Submit Transaction: InitLedger creates the initial set of assets on the ledger.");
contract.submitTransaction("InitLedger");
System.out.println("\n");
result = contract.evaluateTransaction("GetAllAssets");
System.out.println("Evaluate Transaction: GetAllAssets, result: " + new String(result));
System.out.println("\n");
System.out.println("Submit Transaction: CreateAsset asset13");
//CreateAsset creates an asset with ID asset13, color yellow, owner Tom, size 5 and appraisedValue of 1300
contract.submitTransaction("CreateAsset", "asset13", "yellow", "5", "Tom", "1300");
System.out.println("\n");
System.out.println("Evaluate Transaction: ReadAsset asset13");
// ReadAsset returns an asset with given assetID
result = contract.evaluateTransaction("ReadAsset", "asset13");
System.out.println("result: " + new String(result));
System.out.println("\n");
System.out.println("Evaluate Transaction: AssetExists asset1");
// AssetExists returns "true" if an asset with given assetID exist
result = contract.evaluateTransaction("AssetExists", "asset1");
System.out.println("result: " + new String(result));
System.out.println("\n");
System.out.println("Submit Transaction: UpdateAsset asset1, new AppraisedValue : 350");
// UpdateAsset updates an existing asset with new properties. Same args as CreateAsset
contract.submitTransaction("UpdateAsset", "asset1", "blue", "5", "Tomoko", "350");
System.out.println("\n");
System.out.println("Evaluate Transaction: ReadAsset asset1");
result = contract.evaluateTransaction("ReadAsset", "asset1");
System.out.println("result: " + new String(result));
try {
System.out.println("\n");
System.out.println("Submit Transaction: UpdateAsset asset70");
//Non existing asset asset70 should throw Error
contract.submitTransaction("UpdateAsset", "asset70", "blue", "5", "Tomoko", "300");
} catch (Exception e) {
System.err.println("Expected an error on UpdateAsset of non-existing Asset: " + e);
}
System.out.println("\n");
System.out.println("Submit Transaction: TransferAsset asset1 from owner Tomoko > owner Tom");
// TransferAsset transfers an asset with given ID to new owner Tom
contract.submitTransaction("TransferAsset", "asset1", "Tom");
System.out.println("\n");
System.out.println("Evaluate Transaction: ReadAsset asset1");
result = contract.evaluateTransaction("ReadAsset", "asset1");
System.out.println("result: " + new String(result));
}
catch(Exception e){
System.err.println(e);
}
}
}

View file

@ -1,53 +0,0 @@
/*
* Copyright IBM Corp. All Rights Reserved.
*
* SPDX-License-Identifier: Apache-2.0
*/
package application.java;
import java.nio.file.Paths;
import java.util.Properties;
import org.hyperledger.fabric.gateway.Wallet;
import org.hyperledger.fabric.gateway.Wallets;
import org.hyperledger.fabric.gateway.Identities;
import org.hyperledger.fabric.gateway.Identity;
import org.hyperledger.fabric.sdk.Enrollment;
import org.hyperledger.fabric.sdk.security.CryptoSuite;
import org.hyperledger.fabric.sdk.security.CryptoSuiteFactory;
import org.hyperledger.fabric_ca.sdk.EnrollmentRequest;
import org.hyperledger.fabric_ca.sdk.HFCAClient;
public class EnrollAdmin {
public static void main(String[] args) throws Exception {
// Create a CA client for interacting with the CA.
Properties props = new Properties();
props.put("pemFile",
"../../test-network/organizations/peerOrganizations/org1.example.com/ca/ca.org1.example.com-cert.pem");
props.put("allowAllHostNames", "true");
HFCAClient caClient = HFCAClient.createNewInstance("https://localhost:7054", props);
CryptoSuite cryptoSuite = CryptoSuiteFactory.getDefault().getCryptoSuite();
caClient.setCryptoSuite(cryptoSuite);
// Create a wallet for managing identities
Wallet wallet = Wallets.newFileSystemWallet(Paths.get("wallet"));
// Check to see if we've already enrolled the admin user.
if (wallet.get("admin") != null) {
System.out.println("An identity for the admin user \"admin\" already exists in the wallet");
return;
}
// Enroll the admin user, and import the new identity into the wallet.
final EnrollmentRequest enrollmentRequestTLS = new EnrollmentRequest();
enrollmentRequestTLS.addHost("localhost");
enrollmentRequestTLS.setProfile("tls");
Enrollment enrollment = caClient.enroll("admin", "adminpw", enrollmentRequestTLS);
Identity user = Identities.newX509Identity("Org1MSP", enrollment);
wallet.put("admin", user);
System.out.println("Successfully enrolled user \"admin\" and imported it into the wallet");
}
}

View file

@ -1,107 +0,0 @@
/*
SPDX-License-Identifier: Apache-2.0
*/
package application.java;
import java.nio.file.Paths;
import java.security.PrivateKey;
import java.util.Properties;
import java.util.Set;
import org.hyperledger.fabric.gateway.Wallet;
import org.hyperledger.fabric.gateway.Wallets;
import org.hyperledger.fabric.gateway.Identities;
import org.hyperledger.fabric.gateway.Identity;
import org.hyperledger.fabric.gateway.X509Identity;
import org.hyperledger.fabric.sdk.Enrollment;
import org.hyperledger.fabric.sdk.User;
import org.hyperledger.fabric.sdk.security.CryptoSuite;
import org.hyperledger.fabric.sdk.security.CryptoSuiteFactory;
import org.hyperledger.fabric_ca.sdk.HFCAClient;
import org.hyperledger.fabric_ca.sdk.RegistrationRequest;
public class RegisterUser {
public static void main(String[] args) throws Exception {
// Create a CA client for interacting with the CA.
Properties props = new Properties();
props.put("pemFile",
"../../test-network/organizations/peerOrganizations/org1.example.com/ca/ca.org1.example.com-cert.pem");
props.put("allowAllHostNames", "true");
HFCAClient caClient = HFCAClient.createNewInstance("https://localhost:7054", props);
CryptoSuite cryptoSuite = CryptoSuiteFactory.getDefault().getCryptoSuite();
caClient.setCryptoSuite(cryptoSuite);
// Create a wallet for managing identities
Wallet wallet = Wallets.newFileSystemWallet(Paths.get("wallet"));
// Check to see if we've already enrolled the user.
if (wallet.get("appUser") != null) {
System.out.println("An identity for the user \"appUser\" already exists in the wallet");
return;
}
X509Identity adminIdentity = (X509Identity)wallet.get("admin");
if (adminIdentity == null) {
System.out.println("\"admin\" needs to be enrolled and added to the wallet first");
return;
}
User admin = new User() {
@Override
public String getName() {
return "admin";
}
@Override
public Set<String> getRoles() {
return null;
}
@Override
public String getAccount() {
return null;
}
@Override
public String getAffiliation() {
return "org1.department1";
}
@Override
public Enrollment getEnrollment() {
return new Enrollment() {
@Override
public PrivateKey getKey() {
return adminIdentity.getPrivateKey();
}
@Override
public String getCert() {
return Identities.toPemString(adminIdentity.getCertificate());
}
};
}
@Override
public String getMspId() {
return "Org1MSP";
}
};
// Register the user, enroll the user, and import the new identity into the wallet.
RegistrationRequest registrationRequest = new RegistrationRequest("appUser");
registrationRequest.setAffiliation("org1.department1");
registrationRequest.setEnrollmentID("appUser");
String enrollmentSecret = caClient.register(registrationRequest, admin);
Enrollment enrollment = caClient.enroll("appUser", enrollmentSecret);
Identity user = Identities.newX509Identity("Org1MSP", enrollment);
wallet.put("appUser", user);
System.out.println("Successfully enrolled user \"appUser\" and imported it into the wallet");
}
}

View file

@ -1,19 +0,0 @@
# initialize root logger with level ERROR for stdout and fout
log4j.rootLogger=ERROR,stdout,fout
# set the log level for these components
log4j.logger.com.endeca=INFO
log4j.logger.com.endeca.itl.web.metrics=INFO
# add a ConsoleAppender to the logger stdout to write to the console
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
# use a simple message format
log4j.appender.stdout.layout.ConversionPattern=%m%n
# add a FileAppender to the logger fout
log4j.appender.fout=org.apache.log4j.FileAppender
# create a log file
log4j.appender.fout.File=crawl.log
log4j.appender.fout.layout=org.apache.log4j.PatternLayout
# use a more detailed message pattern
log4j.appender.fout.layout.ConversionPattern=%p\t%d{ISO8601}\t%r\t%c\t[%t]\t%m%n

View file

@ -1,36 +0,0 @@
/*
* SPDX-License-Identifier: Apache-2.0
*/
module.exports = {
env: {
node: true,
mocha: true
},
parserOptions: {
ecmaVersion: 8,
sourceType: 'script'
},
extends: "eslint:recommended",
rules: {
indent: ['error', 'tab'],
'linebreak-style': ['error', 'unix'],
quotes: ['error', 'single'],
semi: ['error', 'always'],
'no-unused-vars': ['error', { args: 'none' }],
'no-console': 'off',
curly: 'error',
eqeqeq: 'error',
'no-throw-literal': 'error',
strict: 'error',
'no-var': 'error',
'dot-notation': 'error',
'no-trailing-spaces': 'error',
'no-use-before-define': 'error',
'no-useless-call': 'error',
'no-with': 'error',
'operator-linebreak': 'error',
yoda: 'error',
'quote-props': ['error', 'as-needed']
}
};

View file

@ -1,180 +0,0 @@
/*
* Copyright IBM Corp. All Rights Reserved.
*
* SPDX-License-Identifier: Apache-2.0
*/
'use strict';
const { Gateway, Wallets } = require('fabric-network');
const FabricCAServices = require('fabric-ca-client');
const path = require('path');
const { buildCAClient, registerAndEnrollUser, enrollAdmin } = require('../../test-application/javascript/CAUtil.js');
const { buildCCPOrg1, buildWallet } = require('../../test-application/javascript/AppUtil.js');
const channelName = 'mychannel';
const chaincodeName = 'basic';
const mspOrg1 = 'Org1MSP';
const walletPath = path.join(__dirname, 'wallet');
const org1UserId = 'appUser';
function prettyJSONString(inputString) {
return JSON.stringify(JSON.parse(inputString), null, 2);
}
// pre-requisites:
// - fabric-sample two organization test-network setup with two peers, ordering service,
// and 2 certificate authorities
// ===> from directory /fabric-samples/test-network
// ./network.sh up createChannel -ca
// - Use any of the asset-transfer-basic chaincodes deployed on the channel "mychannel"
// with the chaincode name of "basic". The following deploy command will package,
// install, approve, and commit the javascript chaincode, all the actions it takes
// to deploy a chaincode to a channel.
// ===> from directory /fabric-samples/test-network
// ./network.sh deployCC -ccn basic -ccp ../asset-transfer-basic/chaincode-javascript/ -ccl javascript
// - Be sure that node.js is installed
// ===> from directory /fabric-samples/asset-transfer-basic/application-javascript
// node -v
// - npm installed code dependencies
// ===> from directory /fabric-samples/asset-transfer-basic/application-javascript
// npm install
// - to run this test application
// ===> from directory /fabric-samples/asset-transfer-basic/application-javascript
// node app.js
// NOTE: If you see kind an error like these:
/*
2020-08-07T20:23:17.590Z - error: [DiscoveryService]: send[mychannel] - Channel:mychannel received discovery error:access denied
******** FAILED to run the application: Error: DiscoveryService: mychannel error: access denied
OR
Failed to register user : Error: fabric-ca request register failed with errors [[ { code: 20, message: 'Authentication failure' } ]]
******** FAILED to run the application: Error: Identity not found in wallet: appUser
*/
// Delete the /fabric-samples/asset-transfer-basic/application-javascript/wallet directory
// and retry this application.
//
// The certificate authority must have been restarted and the saved certificates for the
// admin and application user are not valid. Deleting the wallet store will force these to be reset
// with the new certificate authority.
//
/**
* A test application to show basic queries operations with any of the asset-transfer-basic chaincodes
* -- How to submit a transaction
* -- How to query and check the results
*
* To see the SDK workings, try setting the logging to show on the console before running
* export HFC_LOGGING='{"debug":"console"}'
*/
async function main() {
try {
// build an in memory object with the network configuration (also known as a connection profile)
const ccp = buildCCPOrg1();
// build an instance of the fabric ca services client based on
// the information in the network configuration
const caClient = buildCAClient(FabricCAServices, ccp, 'ca.org1.example.com');
// setup the wallet to hold the credentials of the application user
const wallet = await buildWallet(Wallets, walletPath);
// in a real application this would be done on an administrative flow, and only once
await enrollAdmin(caClient, wallet, mspOrg1);
// in a real application this would be done only when a new user was required to be added
// and would be part of an administrative flow
await registerAndEnrollUser(caClient, wallet, mspOrg1, org1UserId, 'org1.department1');
// Create a new gateway instance for interacting with the fabric network.
// In a real application this would be done as the backend server session is setup for
// a user that has been verified.
const gateway = new Gateway();
try {
// setup the gateway instance
// The user will now be able to create connections to the fabric network and be able to
// submit transactions and query. All transactions submitted by this gateway will be
// signed by this user using the credentials stored in the wallet.
await gateway.connect(ccp, {
wallet,
identity: org1UserId,
discovery: { enabled: true, asLocalhost: true } // using asLocalhost as this gateway is using a fabric network deployed locally
});
// Build a network instance based on the channel where the smart contract is deployed
const network = await gateway.getNetwork(channelName);
// Get the contract from the network.
const contract = network.getContract(chaincodeName);
// Initialize a set of asset data on the channel using the chaincode 'InitLedger' function.
// This type of transaction would only be run once by an application the first time it was started after it
// deployed the first time. Any updates to the chaincode deployed later would likely not need to run
// an "init" type function.
console.log('\n--> Submit Transaction: InitLedger, function creates the initial set of assets on the ledger');
await contract.submitTransaction('InitLedger');
console.log('*** Result: committed');
// Let's try a query type operation (function).
// This will be sent to just one peer and the results will be shown.
console.log('\n--> Evaluate Transaction: GetAllAssets, function returns all the current assets on the ledger');
let result = await contract.evaluateTransaction('GetAllAssets');
console.log(`*** Result: ${prettyJSONString(result.toString())}`);
// Now let's try to submit a transaction.
// This will be sent to both peers and if both peers endorse the transaction, the endorsed proposal will be sent
// to the orderer to be committed by each of the peer's to the channel ledger.
console.log('\n--> Submit Transaction: CreateAsset, creates new asset with ID, color, owner, size, and appraisedValue arguments');
result = await contract.submitTransaction('CreateAsset', 'asset13', 'yellow', '5', 'Tom', '1300');
console.log('*** Result: committed');
if (`${result}` !== '') {
console.log(`*** Result: ${prettyJSONString(result.toString())}`);
}
console.log('\n--> Evaluate Transaction: ReadAsset, function returns an asset with a given assetID');
result = await contract.evaluateTransaction('ReadAsset', 'asset13');
console.log(`*** Result: ${prettyJSONString(result.toString())}`);
console.log('\n--> Evaluate Transaction: AssetExists, function returns "true" if an asset with given assetID exist');
result = await contract.evaluateTransaction('AssetExists', 'asset1');
console.log(`*** Result: ${prettyJSONString(result.toString())}`);
console.log('\n--> Submit Transaction: UpdateAsset asset1, change the appraisedValue to 350');
await contract.submitTransaction('UpdateAsset', 'asset1', 'blue', '5', 'Tomoko', '350');
console.log('*** Result: committed');
console.log('\n--> Evaluate Transaction: ReadAsset, function returns "asset1" attributes');
result = await contract.evaluateTransaction('ReadAsset', 'asset1');
console.log(`*** Result: ${prettyJSONString(result.toString())}`);
try {
// How about we try a transactions where the executing chaincode throws an error
// Notice how the submitTransaction will throw an error containing the error thrown by the chaincode
console.log('\n--> Submit Transaction: UpdateAsset asset70, asset70 does not exist and should return an error');
await contract.submitTransaction('UpdateAsset', 'asset70', 'blue', '5', 'Tomoko', '300');
console.log('******** FAILED to return an error');
} catch (error) {
console.log(`*** Successfully caught the error: \n ${error}`);
}
console.log('\n--> Submit Transaction: TransferAsset asset1, transfer to new owner of Tom');
await contract.submitTransaction('TransferAsset', 'asset1', 'Tom');
console.log('*** Result: committed');
console.log('\n--> Evaluate Transaction: ReadAsset, function returns "asset1" attributes');
result = await contract.evaluateTransaction('ReadAsset', 'asset1');
console.log(`*** Result: ${prettyJSONString(result.toString())}`);
} finally {
// Disconnect from the gateway when the application is closing
// This will close all connections to the network
gateway.disconnect();
}
} catch (error) {
console.error(`******** FAILED to run the application: ${error}`);
}
}
main();

View file

@ -1,16 +0,0 @@
{
"name": "asset-transfer-basic",
"version": "1.0.0",
"description": "Asset-transfer-basic application implemented in JavaScript",
"engines": {
"node": ">=12",
"npm": ">=5"
},
"engineStrict": true,
"author": "Hyperledger",
"license": "Apache-2.0",
"dependencies": {
"fabric-ca-client": "^2.2.4",
"fabric-network": "^2.2.4"
}
}

View file

@ -1,50 +0,0 @@
{
"name": "asset-transfer-basic",
"version": "1.0.0",
"description": "Asset Transfer Basic contract implemented in TypeScript",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
"engines": {
"node": ">=12",
"npm": ">=5"
},
"scripts": {
"lint": "tslint -c tslint.json 'src/**/*.ts'",
"pretest": "npm run lint",
"start": "npm run build && node dist/app.js",
"build": "tsc",
"build:watch": "tsc -w",
"prepublishOnly": "npm run build"
},
"engineStrict": true,
"author": "Hyperledger",
"license": "Apache-2.0",
"dependencies": {
"fabric-ca-client": "^2.2.4",
"fabric-network": "^2.2.4"
},
"devDependencies": {
"tslint": "^5.11.0",
"typescript": "^3.1.6"
},
"nyc": {
"extension": [
".ts",
".tsx"
],
"exclude": [
"coverage/**",
"dist/**"
],
"reporter": [
"text-summary",
"html"
],
"all": true,
"check-coverage": true,
"statements": 100,
"branches": 100,
"functions": 100,
"lines": 100
}
}

View file

@ -1,171 +0,0 @@
/*
* Copyright IBM Corp. All Rights Reserved.
*
* SPDX-License-Identifier: Apache-2.0
*/
import { Gateway, GatewayOptions } from 'fabric-network';
import * as path from 'path';
import { buildCCPOrg1, buildWallet, prettyJSONString } from './utils//AppUtil';
import { buildCAClient, enrollAdmin, registerAndEnrollUser } from './utils/CAUtil';
const channelName = 'mychannel';
const chaincodeName = 'basic';
const mspOrg1 = 'Org1MSP';
const walletPath = path.join(__dirname, 'wallet');
const org1UserId = 'appUser';
// pre-requisites:
// - fabric-sample two organization test-network setup with two peers, ordering service,
// and 2 certificate authorities
// ===> from directory /fabric-samples/test-network
// ./network.sh up createChannel -ca
// - Use any of the asset-transfer-basic chaincodes deployed on the channel "mychannel"
// with the chaincode name of "basic". The following deploy command will package,
// install, approve, and commit the javascript chaincode, all the actions it takes
// to deploy a chaincode to a channel.
// ===> from directory /fabric-samples/test-network
// ./network.sh deployCC -ccn basic -ccp ../asset-transfer-basic/chaincode-typescript/ -ccl javascript
// - Be sure that node.js is installed
// ===> from directory /fabric-samples/asset-transfer-basic/application-typescript
// node -v
// - npm installed code dependencies
// ===> from directory /fabric-samples/asset-transfer-basic/application-typescript
// npm install
// - to run this test application
// ===> from directory /fabric-samples/asset-transfer-basic/application-typescript
// npm start
// NOTE: If you see kind an error like these:
/*
2020-08-07T20:23:17.590Z - error: [DiscoveryService]: send[mychannel] - Channel:mychannel received discovery error:access denied
******** FAILED to run the application: Error: DiscoveryService: mychannel error: access denied
OR
Failed to register user : Error: fabric-ca request register failed with errors [[ { code: 20, message: 'Authentication failure' } ]]
******** FAILED to run the application: Error: Identity not found in wallet: appUser
*/
// Delete the /fabric-samples/asset-transfer-basic/application-typescript/wallet directory
// and retry this application.
//
// The certificate authority must have been restarted and the saved certificates for the
// admin and application user are not valid. Deleting the wallet store will force these to be reset
// with the new certificate authority.
//
/**
* A test application to show basic queries operations with any of the asset-transfer-basic chaincodes
* -- How to submit a transaction
* -- How to query and check the results
*
* To see the SDK workings, try setting the logging to show on the console before running
* export HFC_LOGGING='{"debug":"console"}'
*/
async function main() {
try {
// build an in memory object with the network configuration (also known as a connection profile)
const ccp = buildCCPOrg1();
// build an instance of the fabric ca services client based on
// the information in the network configuration
const caClient = buildCAClient(ccp, 'ca.org1.example.com');
// setup the wallet to hold the credentials of the application user
const wallet = await buildWallet(walletPath);
// in a real application this would be done on an administrative flow, and only once
await enrollAdmin(caClient, wallet, mspOrg1);
// in a real application this would be done only when a new user was required to be added
// and would be part of an administrative flow
await registerAndEnrollUser(caClient, wallet, mspOrg1, org1UserId, 'org1.department1');
// Create a new gateway instance for interacting with the fabric network.
// In a real application this would be done as the backend server session is setup for
// a user that has been verified.
const gateway = new Gateway();
const gatewayOpts: GatewayOptions = {
wallet,
identity: org1UserId,
discovery: { enabled: true, asLocalhost: true }, // using asLocalhost as this gateway is using a fabric network deployed locally
};
try {
// setup the gateway instance
// The user will now be able to create connections to the fabric network and be able to
// submit transactions and query. All transactions submitted by this gateway will be
// signed by this user using the credentials stored in the wallet.
await gateway.connect(ccp, gatewayOpts);
// Build a network instance based on the channel where the smart contract is deployed
const network = await gateway.getNetwork(channelName);
// Get the contract from the network.
const contract = network.getContract(chaincodeName);
// Initialize a set of asset data on the channel using the chaincode 'InitLedger' function.
// This type of transaction would only be run once by an application the first time it was started after it
// deployed the first time. Any updates to the chaincode deployed later would likely not need to run
// an "init" type function.
console.log('\n--> Submit Transaction: InitLedger, function creates the initial set of assets on the ledger');
await contract.submitTransaction('InitLedger');
console.log('*** Result: committed');
// Let's try a query type operation (function).
// This will be sent to just one peer and the results will be shown.
console.log('\n--> Evaluate Transaction: GetAllAssets, function returns all the current assets on the ledger');
let result = await contract.evaluateTransaction('GetAllAssets');
console.log(`*** Result: ${prettyJSONString(result.toString())}`);
// Now let's try to submit a transaction.
// This will be sent to both peers and if both peers endorse the transaction, the endorsed proposal will be sent
// to the orderer to be committed by each of the peer's to the channel ledger.
console.log('\n--> Submit Transaction: CreateAsset, creates new asset with ID, color, owner, size, and appraisedValue arguments');
await contract.submitTransaction('CreateAsset', 'asset13', 'yellow', '5', 'Tom', '1300');
console.log('*** Result: committed');
console.log('\n--> Evaluate Transaction: ReadAsset, function returns an asset with a given assetID');
result = await contract.evaluateTransaction('ReadAsset', 'asset13');
console.log(`*** Result: ${prettyJSONString(result.toString())}`);
console.log('\n--> Evaluate Transaction: AssetExists, function returns "true" if an asset with given assetID exist');
result = await contract.evaluateTransaction('AssetExists', 'asset1');
console.log(`*** Result: ${prettyJSONString(result.toString())}`);
console.log('\n--> Submit Transaction: UpdateAsset asset1, change the appraisedValue to 350');
await contract.submitTransaction('UpdateAsset', 'asset1', 'blue', '5', 'Tomoko', '350');
console.log('*** Result: committed');
console.log('\n--> Evaluate Transaction: ReadAsset, function returns "asset1" attributes');
result = await contract.evaluateTransaction('ReadAsset', 'asset1');
console.log(`*** Result: ${prettyJSONString(result.toString())}`);
try {
// How about we try a transactions where the executing chaincode throws an error
// Notice how the submitTransaction will throw an error containing the error thrown by the chaincode
console.log('\n--> Submit Transaction: UpdateAsset asset70, asset70 does not exist and should return an error');
await contract.submitTransaction('UpdateAsset', 'asset70', 'blue', '5', 'Tomoko', '300');
console.log('******** FAILED to return an error');
} catch (error) {
console.log(`*** Successfully caught the error: \n ${error}`);
}
console.log('\n--> Submit Transaction: TransferAsset asset1, transfer to new owner of Tom');
await contract.submitTransaction('TransferAsset', 'asset1', 'Tom');
console.log('*** Result: committed');
console.log('\n--> Evaluate Transaction: ReadAsset, function returns "asset1" attributes');
result = await contract.evaluateTransaction('ReadAsset', 'asset1');
console.log(`*** Result: ${prettyJSONString(result.toString())}`);
} finally {
// Disconnect from the gateway when the application is closing
// This will close all connections to the network
gateway.disconnect();
}
} catch (error) {
console.error(`******** FAILED to run the application: ${error}`);
}
}
main();

View file

@ -1,72 +0,0 @@
/*
* Copyright IBM Corp. All Rights Reserved.
*
* SPDX-License-Identifier: Apache-2.0
*/
import { Wallet, Wallets } from 'fabric-network';
import * as fs from 'fs';
import * as path from 'path';
const buildCCPOrg1 = (): Record<string, any> => {
// load the common connection configuration file
const ccpPath = path.resolve(__dirname, '..', '..', '..', '..', 'test-network',
'organizations', 'peerOrganizations', 'org1.example.com', 'connection-org1.json');
const fileExists = fs.existsSync(ccpPath);
if (!fileExists) {
throw new Error(`no such file or directory: ${ccpPath}`);
}
const contents = fs.readFileSync(ccpPath, 'utf8');
// build a JSON object from the file contents
const ccp = JSON.parse(contents);
console.log(`Loaded the network configuration located at ${ccpPath}`);
return ccp;
};
const buildCCPOrg2 = (): Record<string, any> => {
// load the common connection configuration file
const ccpPath = path.resolve(__dirname, '..', '..', '..', '..', 'test-network',
'organizations', 'peerOrganizations', 'org2.example.com', 'connection-org2.json');
const fileExists = fs.existsSync(ccpPath);
if (!fileExists) {
throw new Error(`no such file or directory: ${ccpPath}`);
}
const contents = fs.readFileSync(ccpPath, 'utf8');
// build a JSON object from the file contents
const ccp = JSON.parse(contents);
console.log(`Loaded the network configuration located at ${ccpPath}`);
return ccp;
};
const buildWallet = async (walletPath: string): Promise<Wallet> => {
// Create a new wallet : Note that wallet is for managing identities.
let wallet: Wallet;
if (walletPath) {
wallet = await Wallets.newFileSystemWallet(walletPath);
console.log(`Built a file system wallet at ${walletPath}`);
} else {
wallet = await Wallets.newInMemoryWallet();
console.log('Built an in memory wallet');
}
return wallet;
};
const prettyJSONString = (inputString: string): string => {
if (inputString) {
return JSON.stringify(JSON.parse(inputString), null, 2);
} else {
return inputString;
}
};
export {
buildCCPOrg1,
buildCCPOrg2,
buildWallet,
prettyJSONString,
};

View file

@ -1,104 +0,0 @@
/*
* Copyright IBM Corp. All Rights Reserved.
*
* SPDX-License-Identifier: Apache-2.0
*/
import * as FabricCAServices from 'fabric-ca-client';
import { Wallet } from 'fabric-network';
const adminUserId = 'admin';
const adminUserPasswd = 'adminpw';
/**
*
* @param {*} ccp
*/
const buildCAClient = (ccp: Record<string, any>, caHostName: string): FabricCAServices => {
// Create a new CA client for interacting with the CA.
const caInfo = ccp.certificateAuthorities[caHostName]; // lookup CA details from config
const caTLSCACerts = caInfo.tlsCACerts.pem;
const caClient = new FabricCAServices(caInfo.url, { trustedRoots: caTLSCACerts, verify: false }, caInfo.caName);
console.log(`Built a CA Client named ${caInfo.caName}`);
return caClient;
};
const enrollAdmin = async (caClient: FabricCAServices, wallet: Wallet, orgMspId: string): Promise<void> => {
try {
// Check to see if we've already enrolled the admin user.
const identity = await wallet.get(adminUserId);
if (identity) {
console.log('An identity for the admin user already exists in the wallet');
return;
}
// Enroll the admin user, and import the new identity into the wallet.
const enrollment = await caClient.enroll({ enrollmentID: adminUserId, enrollmentSecret: adminUserPasswd });
const x509Identity = {
credentials: {
certificate: enrollment.certificate,
privateKey: enrollment.key.toBytes(),
},
mspId: orgMspId,
type: 'X.509',
};
await wallet.put(adminUserId, x509Identity);
console.log('Successfully enrolled admin user and imported it into the wallet');
} catch (error) {
console.error(`Failed to enroll admin user : ${error}`);
}
};
const registerAndEnrollUser = async (caClient: FabricCAServices, wallet: Wallet, orgMspId: string, userId: string, affiliation: string): Promise<void> => {
try {
// Check to see if we've already enrolled the user
const userIdentity = await wallet.get(userId);
if (userIdentity) {
console.log(`An identity for the user ${userId} already exists in the wallet`);
return;
}
// Must use an admin to register a new user
const adminIdentity = await wallet.get(adminUserId);
if (!adminIdentity) {
console.log('An identity for the admin user does not exist in the wallet');
console.log('Enroll the admin user before retrying');
return;
}
// build a user object for authenticating with the CA
const provider = wallet.getProviderRegistry().getProvider(adminIdentity.type);
const adminUser = await provider.getUserContext(adminIdentity, adminUserId);
// Register the user, enroll the user, and import the new identity into the wallet.
// if affiliation is specified by client, the affiliation value must be configured in CA
const secret = await caClient.register({
affiliation,
enrollmentID: userId,
role: 'client',
}, adminUser);
const enrollment = await caClient.enroll({
enrollmentID: userId,
enrollmentSecret: secret,
});
const x509Identity = {
credentials: {
certificate: enrollment.certificate,
privateKey: enrollment.key.toBytes(),
},
mspId: orgMspId,
type: 'X.509',
};
await wallet.put(userId, x509Identity);
console.log(`Successfully registered and enrolled user ${userId} and imported it into the wallet`);
} catch (error) {
console.error(`Failed to register user : ${error}`);
}
};
export {
buildCAClient,
enrollAdmin,
registerAndEnrollUser,
};

View file

@ -1,23 +0,0 @@
{
"defaultSeverity": "error",
"extends": [
"tslint:recommended"
],
"jsRules": {},
"rules": {
"indent": [true, "spaces", 4],
"linebreak-style": [true, "LF"],
"quotemark": [true, "single"],
"semicolon": [true, "always"],
"no-console": false,
"curly": true,
"triple-equals": true,
"no-string-throw": true,
"no-var-keyword": true,
"no-trailing-whitespace": true,
"object-literal-key-quotes": [true, "as-needed"],
"object-literal-sort-keys": false,
"max-line-length": false
},
"rulesDirectory": []
}

View file

@ -1,2 +1,3 @@
*.tar.gz *.tar.gz
*.tgz *.tgz
crypto/*.pem

View file

@ -2,10 +2,7 @@
# #
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
ARG GO_VER=1.14.4 FROM golang:alpine
ARG ALPINE_VER=3.12
FROM golang:${GO_VER}-alpine${ALPINE_VER}
WORKDIR /go/src/github.com/hyperledger/fabric-samples/asset-transfer-basic/chaincode-external WORKDIR /go/src/github.com/hyperledger/fabric-samples/asset-transfer-basic/chaincode-external
COPY . . COPY . .

View file

@ -1,46 +1,50 @@
# Asset-Transfer-Basic as an external service # Asset-Transfer-Basic as an external service
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_launcher.html) topic in the Fabric documentation. 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. For simplification purpose, in this sample we use the same instance for both organizations. **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 ## 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. For this sample we use very simple (and crude) shell scripts that can be run directly within the default Fabric peer images. 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` hierarchy. Note that this file comes along with the Fabric binaries, so if you don't have it, follow the [Install the Samples, Binaries and Docker Images](https://hyperledger-fabric.readthedocs.io/en/latest/install.html) instructions in the Hyperledger Fabric documentation to download the binaries and config files. 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:
Modify the field `externalBuilders` as the following:
``` ```
externalBuilders: externalBuilders:
- path: /opt/gopath/src/github.com/hyperledger/fabric-samples/asset-transfer-basic/chaincode-external/sampleBuilder - path: /opt/gopath/src/github.com/hyperledger/fabric-samples/asset-transfer-basic/chaincode-external/sampleBuilder
name: external-sample-builder name: external-sample-builder
``` ```
This configuration 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 container compose file to mount a couple of additional volumes. 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.
Open the file `test-network/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:
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:
``` ```
- ../..:/opt/gopath/src/github.com/hyperledger/fabric-samples - ../..:/opt/gopath/src/github.com/hyperledger/fabric-samples
- ../../config/core.yaml:/etc/hyperledger/fabric/core.yaml - ../../config/core.yaml:/etc/hyperledger/peercfg/core.yaml
``` ```
This will mount the fabric-sample builder into the peer container so that it can be found at the location specified in the config file, 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.
and override the peer's core.yaml config file within the fabric-peer image so that the config file modified above is used.
## Packaging and installing 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. 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.
The peer needs a corresponding `connection.json` configuration file so that it can connect to the external Asset-Transfer-Basic service. 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.
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 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 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. 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: First, create a `code.tar.gz` archive containing the `connection.json` file:
``` ```
@ -53,109 +57,196 @@ Then, create the chaincode package, including the `code.tar.gz` file and the sup
tar cfz asset-transfer-basic-external.tgz metadata.json code.tar.gz tar cfz asset-transfer-basic-external.tgz metadata.json code.tar.gz
``` ```
You are now ready to use the external chaincode. We will use the `test-network` sample to get a network setup and make use of it. You are now ready to deploy the external chaincode sample.
## Starting the test network ## Starting the test network
In a different terminal, from the `test-network` sample directory starts the network using the following command: 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 ./network.sh up createChannel -c mychannel -ca
``` ```
This starts the test network and creates the channel. We will now proceed to installing our external chaincode package. We are now ready to deploy the external chaincode.
## Installing the external chaincode ## Installing the external chaincode
We can't use the `test-network/network.sh` script to install our external chaincode so we will have to do a bit more work by hand but we can still leverage part of the test-network scripts to make this easier. 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.
First, get the functions to setup your environment as needed by running the following command (this assumes you are still in the `test-network` directory): 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 . ./scripts/envVar.sh
``` ```
Install the `asset-transfer-basic-external.tar.gz` chaincode on org1: 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.
``` ```
setGlobals 1 setGlobals 1
../bin/peer lifecycle chaincode install ../asset-transfer-basic/chaincode-external/asset-transfer-basic-external.tgz peer lifecycle chaincode install ../asset-transfer-basic/chaincode-external/asset-transfer-basic-external.tgz
``` ```
setGlobals simply defines a bunch of environment variables suitable to act as one organization or another, org1 or org2. Install the chaincode package on the org2 peer:
Install it on org2:
``` ```
setGlobals 2 setGlobals 2
../bin/peer lifecycle chaincode install ../asset-transfer-basic/chaincode-external/asset-transfer-basic-external.tgz peer lifecycle chaincode install ../asset-transfer-basic/chaincode-external/asset-transfer-basic-external.tgz
``` ```
This will output the chaincode pakage identifier such as `basic_1.0:0262396ccaffaa2174bc09f750f742319c4f14d60b16334d2c8921b6842c090c` that you will need to use in the following commands. Run the following command to query the package ID of the chaincode that you just installed:
For convenience it is best to store your package id value in an environment variable so that it can be referenced in later commands:
```
export PKGID=basic_1.0:0262396ccaffaa2174bc09f750f742319c4f14d60b16334d2c8921b6842c090
```
If needed, you can query the installed chaincode to get its package-id:
``` ```
setGlobals 1 setGlobals 1
../bin/peer lifecycle chaincode queryinstalled --peerAddresses localhost:7051 --tlsRootCertFiles organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt peer lifecycle chaincode queryinstalled --peerAddresses localhost:7051 --tlsRootCertFiles organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt
``` ```
Edit the `chaincode.env` file in the `fabric-samples/asset-transfer-basic/chaincode-external` directory as necessary to set the `CHAINCODE_ID` variable to the chaincode package-id obtained above. The command will return output similar to the following:
```
Installed chaincodes on peer:
Package ID: basic_1.0:ecfc83f251b7c2d9ef376bc3fc20fc6b9744c0fc0a8923092af6542af94790c3, Label: basic_1.0
```
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:
```
export CHAINCODE_ID=basic_1.0:ecfc83f251b7c2d9ef376bc3fc20fc6b9744c0fc0a8923092af6542af94790c3
```
## Running the Asset-Transfer-Basic external service ## Running the Asset-Transfer-Basic external service
To run the service in a container, from a different terminal, build an Asset-Transfer-Basic docker image, using the supplied `Dockerfile`, using the following command in the `fabric-samples/asset-transfer-basic/chaincode-external` directory: 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:
``` ```
docker build -t hyperledger/asset-transfer-basic . docker build -t hyperledger/asset-transfer-basic .
``` ```
Then, start the Asset-Transfer-Basic service: You can then run the image to start the Asset-Transfer-Basic service:
``` ```
docker run -it --rm --name asset-transfer-basic.org1.example.com --hostname asset-transfer-basic.org1.example.com --env-file chaincode.env --network=net_test hyperledger/asset-transfer-basic docker run -it --rm --name asset-transfer-basic.org1.example.com --hostname asset-transfer-basic.org1.example.com --env-file chaincode.env --network=fabric_test hyperledger/asset-transfer-basic
``` ```
This will start the container and start the external chaincode service within it. This will start and run the external chaincode service within the container.
## Finish deploying the Asset-Transfer-Basic external chaincode ## Deploy the Asset-Transfer-Basic external chaincode definition to the channel
Finishing the deployment of the chaincode on the test network can be done from the terminal you started the network from with the following commands (make sure the package-id is set to the value you received above): 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.
``` ```
setGlobals 2 setGlobals 2
../bin/peer lifecycle chaincode approveformyorg -o localhost:7050 --ordererTLSHostnameOverride orderer.example.com --tls --cafile $PWD/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem --channelID mychannel --name basic --version 1.0 --package-id $PKGID --sequence 1 peer lifecycle chaincode approveformyorg -o localhost:7050 --ordererTLSHostnameOverride orderer.example.com --tls --cafile "$PWD/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem" --channelID mychannel --name basic --version 1.0 --package-id $CHAINCODE_ID --sequence 1
setGlobals 1 setGlobals 1
../bin/peer lifecycle chaincode approveformyorg -o localhost:7050 --ordererTLSHostnameOverride orderer.example.com --tls --cafile $PWD/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem --channelID mychannel --name basic --version 1.0 --package-id $PKGID --sequence 1 peer lifecycle chaincode approveformyorg -o localhost:7050 --ordererTLSHostnameOverride orderer.example.com --tls --cafile "$PWD/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem" --channelID mychannel --name basic --version 1.0 --package-id $CHAINCODE_ID --sequence 1
../bin/peer lifecycle chaincode commit -o localhost:7050 --ordererTLSHostnameOverride orderer.example.com --tls --cafile $PWD/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem --channelID mychannel --name basic --peerAddresses localhost:7051 --tlsRootCertFiles $PWD/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt --peerAddresses localhost:9051 --tlsRootCertFiles organizations/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt --version 1.0 --sequence 1 peer lifecycle chaincode commit -o localhost:7050 --ordererTLSHostnameOverride orderer.example.com --tls --cafile "$PWD/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem" --channelID mychannel --name basic --peerAddresses localhost:7051 --tlsRootCertFiles "$PWD/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt" --peerAddresses localhost:9051 --tlsRootCertFiles organizations/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt --version 1.0 --sequence 1
``` ```
This approves the chaincode definition for both orgs and commits it using org1. This should result in an output similar to: 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.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 2020-08-05 15:41:44.983 PDT [chaincodeCmd] ClientWait -> INFO 002 txid [6bdbe040b99a45cc90a23ec21f02ea5da7be8b70590eb04ff3323ef77fdedfc7] committed with status (VALID) at localhost:9051
``` ```
Now that the chaincode is deployed to the channel, and started as an external service, it can be used as normal. 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 ## Using the Asset-Transfer-Basic external chaincode
From yet another terminal, go to `fabric-samples/asset-transfer-basic/application-javascript` and use the node application to test the chaincode you just installed with the following commands: Open yet another terminal and navigate to the `fabric-samples/asset-transfer-basic/application-gateway-go` directory:
``` ```
rm -rf wallet # in case you ran this before cd fabric-samples/asset-transfer-basic/application-gateway-go
npm install
node app.js
``` ```
If all goes well, it should run exactly the same as described in the "Writing Your First Application" tutorial. 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/)_
For `org1.example.com`
```
openssl req -nodes -x509 -newkey rsa:4096 -keyout crypto/key1.pem -out crypto/cert1.pem -subj "/C=IN/ST=KA/L=Bangalore/O=example Inc/OU=Developer/CN=asset-transfer-basic.org1.example.com/emailAddress=dev@asset-transfer-basic.org1.example.com"
```
For `org2.example.com`
```
openssl req -nodes -x509 -newkey rsa:4096 -keyout crypto/key2.pem -out crypto/cert2.pem -subj "/C=IN/ST=KA/L=Bangalore/O=example Inc/OU=Developer/CN=asset-transfer-basic.org2.example.com/emailAddress=dev@asset-transfer-basic.org2.example.com"
```
- Copy the CA file contents for both `org1.example.com` & `org2.example.com`
```
cp ../../test-network/organizations/peerOrganizations/org1.example.com/ca/ca.org1.example.com-cert.pem crypto/rootcert1.pem
cp ../../test-network/organizations/peerOrganizations/org2.example.com/ca/ca.org2.example.com-cert.pem crypto/rootcert2.pem
```
- 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.
```
awk 'NF {sub(/\r/, ""); printf "%s\\n",$0;}' crypto/cert1.pem
awk 'NF {sub(/\r/, ""); printf "%s\\n",$0;}' crypto/cert2.pem
```
Similarly, replace the `client_key` and the `client_cert` contents with the values from the previous step.
```
{
"address": "asset-transfer-basic.org1.example.com:9999",
"dial_timeout": "10s",
"tls_required": true,
"client_auth_required": true,
"client_key": "-----BEGIN PRIVATE KEY----- ... -----END PRIVATE KEY-----",
"client_cert": "-----BEGIN CERTIFICATE---- ... -----END CERTIFICATE-----",
"root_cert": "-----BEGIN CERTIFICATE---- ... -----END CERTIFICATE-----"
}
```
- 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.

View file

@ -9,9 +9,10 @@ import (
"fmt" "fmt"
"log" "log"
"os" "os"
"strconv"
"github.com/hyperledger/fabric-chaincode-go/shim" "github.com/hyperledger/fabric-chaincode-go/v2/shim"
"github.com/hyperledger/fabric-contract-api-go/contractapi" "github.com/hyperledger/fabric-contract-api-go/v2/contractapi"
) )
type serverConfig struct { type serverConfig struct {
@ -119,7 +120,7 @@ func (s *SmartContract) UpdateAsset(ctx contractapi.TransactionContextInterface,
return fmt.Errorf("the asset %s does not exist", id) return fmt.Errorf("the asset %s does not exist", id)
} }
// overwritting original asset with new asset // overwriting original asset with new asset
asset := Asset{ asset := Asset{
ID: id, ID: id,
Color: color, Color: color,
@ -136,7 +137,7 @@ func (s *SmartContract) UpdateAsset(ctx contractapi.TransactionContextInterface,
return ctx.GetStub().PutState(id, assetJSON) return ctx.GetStub().PutState(id, assetJSON)
} }
// DeleteAsset deletes an given asset from the world state. // DeleteAsset deletes a given asset from the world state.
func (s *SmartContract) DeleteAsset(ctx contractapi.TransactionContextInterface, id string) error { func (s *SmartContract) DeleteAsset(ctx contractapi.TransactionContextInterface, id string) error {
exists, err := s.AssetExists(ctx, id) exists, err := s.AssetExists(ctx, id)
if err != nil { if err != nil {
@ -159,20 +160,27 @@ func (s *SmartContract) AssetExists(ctx contractapi.TransactionContextInterface,
return assetJSON != nil, nil return assetJSON != nil, nil
} }
// TransferAsset updates the owner field of asset with given id in world state. // TransferAsset updates the owner field of asset with given id in world state, and returns the old owner.
func (s *SmartContract) TransferAsset(ctx contractapi.TransactionContextInterface, id string, newOwner string) error { func (s *SmartContract) TransferAsset(ctx contractapi.TransactionContextInterface, id string, newOwner string) (string, error) {
asset, err := s.ReadAsset(ctx, id) asset, err := s.ReadAsset(ctx, id)
if err != nil { if err != nil {
return err return "", err
} }
oldOwner := asset.Owner
asset.Owner = newOwner asset.Owner = newOwner
assetJSON, err := json.Marshal(asset) assetJSON, err := json.Marshal(asset)
if err != nil { if err != nil {
return err return "", err
} }
return ctx.GetStub().PutState(id, assetJSON) err = ctx.GetStub().PutState(id, assetJSON)
if err != nil {
return "", err
}
return oldOwner, nil
} }
// GetAllAssets returns all assets found in world state // GetAllAssets returns all assets found in world state
@ -221,15 +229,69 @@ func main() {
} }
server := &shim.ChaincodeServer{ server := &shim.ChaincodeServer{
CCID: config.CCID, CCID: config.CCID,
Address: config.Address, Address: config.Address,
CC: chaincode, CC: chaincode,
TLSProps: shim.TLSProperties{ TLSProps: getTLSProperties(),
Disabled: true,
},
} }
if err := server.Start(); err != nil { if err := server.Start(); err != nil {
log.Panicf("error starting asset-transfer-basic chaincode: %s", err) log.Panicf("error starting asset-transfer-basic chaincode: %s", err)
} }
} }
func getTLSProperties() shim.TLSProperties {
// Check if chaincode is TLS enabled
tlsDisabledStr := getEnvOrDefault("CHAINCODE_TLS_DISABLED", "true")
key := getEnvOrDefault("CHAINCODE_TLS_KEY", "")
cert := getEnvOrDefault("CHAINCODE_TLS_CERT", "")
clientCACert := getEnvOrDefault("CHAINCODE_CLIENT_CA_CERT", "")
// convert tlsDisabledStr to boolean
tlsDisabled := getBoolOrDefault(tlsDisabledStr, false)
var keyBytes, certBytes, clientCACertBytes []byte
var err error
if !tlsDisabled {
keyBytes, err = os.ReadFile(key)
if err != nil {
log.Panicf("error while reading the crypto file: %s", err)
}
certBytes, err = os.ReadFile(cert)
if err != nil {
log.Panicf("error while reading the crypto file: %s", err)
}
}
// Did not request for the peer cert verification
if clientCACert != "" {
clientCACertBytes, err = os.ReadFile(clientCACert)
if err != nil {
log.Panicf("error while reading the crypto file: %s", err)
}
}
return shim.TLSProperties{
Disabled: tlsDisabled,
Key: keyBytes,
Cert: certBytes,
ClientCACerts: clientCACertBytes,
}
}
func getEnvOrDefault(env, defaultVal string) string {
value, ok := os.LookupEnv(env)
if !ok {
value = defaultVal
}
return value
}
// Note that the method returns default value if the string
// cannot be parsed!
func getBoolOrDefault(value string, defaultVal bool) bool {
parsed, err := strconv.ParseBool(value)
if err != nil {
return defaultVal
}
return parsed
}

View file

@ -6,3 +6,19 @@ CHAINCODE_SERVER_ADDRESS=asset-transfer-basic.org1.example.com:9999
# on install. The `peer lifecycle chaincode queryinstalled` command can be # on install. The `peer lifecycle chaincode queryinstalled` command can be
# used to get the ID after install if required # used to get the ID after install if required
CHAINCODE_ID=basic_1.0:0262396ccaffaa2174bc09f750f742319c4f14d60b16334d2c8921b6842c090c CHAINCODE_ID=basic_1.0:0262396ccaffaa2174bc09f750f742319c4f14d60b16334d2c8921b6842c090c
# Optional parameters that will be used for TLS connection between peer node
# and the chaincode.
# TLS is disabled by default, uncomment the following line to enable TLS connection
# CHAINCODE_TLS_DISABLED=false
# Following variables will be ignored if TLS is not enabled.
# They need to be in PEM format
# CHAINCODE_TLS_KEY=/path/to/private/key/file
# CHAINCODE_TLS_CERT=/path/to/public/cert/file
# The following variable will be used by the chaincode server to verify the
# connection from the peer node.
# Note that when this is set a single chaincode server cannot be shared
# across organizations unless their root CA is same.
# CHAINCODE_CLIENT_CA_CERT=/path/to/peer/organization/root/ca/cert/file

View file

@ -0,0 +1,24 @@
# CHAINCODE_SERVER_ADDRESS must be set to the host and port where the peer can
# connect to the chaincode server
CHAINCODE_SERVER_ADDRESS=asset-transfer-basic.org1.example.com:9999
# CHAINCODE_ID must be set to the Package ID that is assigned to the chaincode
# on install. The `peer lifecycle chaincode queryinstalled` command can be
# used to get the ID after install if required
CHAINCODE_ID=basic_1.0:6726c6b6d8ff66fcf5710b72c6ce512d24f118c51c3de510b3d43e51fa592a7d
# Optional parameters that will be used for TLS connection between peer node
# and the chaincode.
# TLS is disabled by default, uncomment the following line to enable TLS connection
CHAINCODE_TLS_DISABLED=false
# Following variables will be ignored if TLS is not enabled.
# They need to be in PEM format
CHAINCODE_TLS_KEY=/crypto/key1.pem
CHAINCODE_TLS_CERT=/crypto/cert1.pem
# The following variable will be used by the chaincode server to verify the
# connection from the peer node.
# Note that when this is set a single chaincode server cannot be shared
# across organizations unless their root CA is same.
CHAINCODE_CLIENT_CA_CERT=/crypto/rootcert1.pem

View file

@ -0,0 +1,24 @@
# CHAINCODE_SERVER_ADDRESS must be set to the host and port where the peer can
# connect to the chaincode server
CHAINCODE_SERVER_ADDRESS=asset-transfer-basic.org2.example.com:9999
# CHAINCODE_ID must be set to the Package ID that is assigned to the chaincode
# on install. The `peer lifecycle chaincode queryinstalled` command can be
# used to get the ID after install if required
CHAINCODE_ID=basic_1.0:e8f9052385e3763ecf5635591155da05d8efbb6905ccbfc1c7229eb6bd28df1b
# Optional parameters that will be used for TLS connection between peer node
# and the chaincode.
# TLS is disabled by default, uncomment the following line to enable TLS connection
CHAINCODE_TLS_DISABLED=false
# Following variables will be ignored if TLS is not enabled.
# They need to be in PEM format
CHAINCODE_TLS_KEY=/crypto/key2.pem
CHAINCODE_TLS_CERT=/crypto/cert2.pem
# The following variable will be used by the chaincode server to verify the
# connection from the peer node.
# Note that when this is set a single chaincode server cannot be shared
# across organizations unless their root CA is same.
CHAINCODE_CLIENT_CA_CERT=/crypto/rootcert2.pem

View file

@ -0,0 +1,30 @@
networks:
docker_test:
external: true
services:
asset-transfer-basic.org1.example.com:
build: .
container_name: asset-transfer-basic.org1.example.com
hostname: asset-transfer-basic.org1.example.com
volumes:
- ./crypto:/crypto
env_file:
- chaincode1.env
networks:
docker_test:
expose:
- 9999
asset-transfer-basic.org2.example.com:
build: .
container_name: asset-transfer-basic.org2.example.com
hostname: asset-transfer-basic.org2.example.com
volumes:
- ./crypto:/crypto
env_file:
- chaincode2.env
networks:
docker_test:
expose:
- 9999

View file

@ -1,8 +1,28 @@
module github.com/hyperledger/fabric-samples/asset-transfer-basic/chaincode-external module github.com/hyperledger/fabric-samples/asset-transfer-basic/chaincode-external
go 1.14 go 1.23.0
require ( require (
github.com/hyperledger/fabric-chaincode-go v0.0.0-20200424173110-d7076418f212 github.com/hyperledger/fabric-chaincode-go/v2 v2.0.0
github.com/hyperledger/fabric-contract-api-go v1.1.0 github.com/hyperledger/fabric-contract-api-go/v2 v2.2.0
)
require (
github.com/go-openapi/jsonpointer v0.21.0 // indirect
github.com/go-openapi/jsonreference v0.21.0 // indirect
github.com/go-openapi/spec v0.21.0 // indirect
github.com/go-openapi/swag v0.23.0 // indirect
github.com/hyperledger/fabric-protos-go-apiv2 v0.3.4 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
github.com/xeipuuv/gojsonschema v1.2.0 // indirect
golang.org/x/net v0.38.0 // indirect
golang.org/x/sys v0.31.0 // indirect
golang.org/x/text v0.23.0 // indirect
google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f // indirect
google.golang.org/grpc v1.71.0 // indirect
google.golang.org/protobuf v1.36.4 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
) )

View file

@ -1,146 +1,81 @@
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/DATA-DOG/go-txdb v0.1.3/go.mod h1:DhAhxMXZpUJVGnT+p9IbzJoRKvlArO2pkHjnGX7o0n0=
github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI=
github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M=
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=
github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk=
github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE=
github.com/cucumber/godog v0.8.0/go.mod h1:Cp3tEV1LRAyH/RuCThcxHS/+9ORZ+FMzPva2AZ5Ki+A=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-openapi/jsonpointer v0.19.3 h1:gihV7YNZK1iK6Tgwwsxo2rJbD1GTbdm72325Bq8FI3w= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
github.com/go-openapi/jsonreference v0.19.2 h1:o20suLFB4Ri0tuzpWtyHlh7E7HnkqTNLq6aR6WVNS1w= github.com/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1rr/O9oNQ=
github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= github.com/go-openapi/jsonpointer v0.21.0/go.mod h1:IUyH9l/+uyhIYQ/PXVA41Rexl+kOkAPDdXEYns6fzUY=
github.com/go-openapi/spec v0.19.4 h1:ixzUSnHTd6hCemgtAJgluaTSGYpLNpJY4mA2DIkdOAo= github.com/go-openapi/jsonreference v0.21.0 h1:Rs+Y7hSXT83Jacb7kFyjn4ijOuVGSvOdF2+tg1TRrwQ=
github.com/go-openapi/spec v0.19.4/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo= github.com/go-openapi/jsonreference v0.21.0/go.mod h1:LmZmgsrTkVg9LG4EaHeY8cBDslNPMo06cago5JNLkm4=
github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/spec v0.21.0 h1:LTVzPc3p/RzRnkQqLRndbAzjY0d0BCL72A6j3CdL9ZY=
github.com/go-openapi/swag v0.19.5 h1:lTz6Ys4CmqqCQmZPBlbQENR1/GucA2bzYTE12Pw4tFY= github.com/go-openapi/spec v0.21.0/go.mod h1:78u6VdPw81XU44qEWGhtr982gJ5BWg2c0I5XwVMotYk=
github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+GrE=
github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ=
github.com/gobuffalo/envy v1.7.0 h1:GlXgaiBkmrYMHco6t4j7SacKO4XUjvh5pwXh0f4uxXU= github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
github.com/gobuffalo/envy v1.7.0/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
github.com/gobuffalo/logger v1.0.0/go.mod h1:2zbswyIUa45I+c+FLXuWl9zSWEiVuthsk8ze5s8JvPs= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/gobuffalo/packd v0.3.0 h1:eMwymTkA1uXsqxS0Tpoop3Lc0u3kTfiMBE6nKtQU4g4= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/gobuffalo/packd v0.3.0/go.mod h1:zC7QkmNkYVGKPw4tHpBQ+ml7W/3tIebgeo1b36chA3Q= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/gobuffalo/packr v1.30.1 h1:hu1fuVR3fXEZR7rXNW3h8rqSML8EVAf6KNm0NKO/wKg= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/gobuffalo/packr v1.30.1/go.mod h1:ljMyFO2EcrnzsHsN99cvbq055Y9OhRrIaviy289eRuk= github.com/hyperledger/fabric-chaincode-go/v2 v2.0.0 h1:IhkHfrl5X/fVnmB6pWeCYCdIJRi9bxj+WTnVN8DtW3c=
github.com/gobuffalo/packr/v2 v2.5.1/go.mod h1:8f9c96ITobJlPzI44jj+4tHnEKNt0xXWSVlXRN9X1Iw= github.com/hyperledger/fabric-chaincode-go/v2 v2.0.0/go.mod h1:PHHaFffjw7p7n9bmCfcm7RqDqYdivNEsJdiNIKZo5Lk=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= github.com/hyperledger/fabric-contract-api-go/v2 v2.2.0 h1:rmUoBmciB0GL/miqcbJmJbgp5QTWoJUrZo+CNxrNLF4=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/hyperledger/fabric-contract-api-go/v2 v2.2.0/go.mod h1:FeWeO/jwGjiME7ak3GufqKIcwkejtzrDG4QxbfKydWs=
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/hyperledger/fabric-protos-go-apiv2 v0.3.4 h1:YJrd+gMaeY0/vsN0aS0QkEKTivGoUnSRIXxGJ7KI+Pc=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/hyperledger/fabric-protos-go-apiv2 v0.3.4/go.mod h1:bau/6AJhvEcu9GKKYHlDXAxXKzYNfhP6xu2GXuxEcFk=
github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/hyperledger/fabric-chaincode-go v0.0.0-20200424173110-d7076418f212 h1:1i4lnpV8BDgKOLi1hgElfBqdHXjXieSuj8629mwBZ8o= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/hyperledger/fabric-chaincode-go v0.0.0-20200424173110-d7076418f212/go.mod h1:N7H3sA7Tx4k/YzFq7U0EPdqJtqvM4Kild0JoCc7C0Dc= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/hyperledger/fabric-contract-api-go v1.1.0 h1:K9uucl/6eX3NF0/b+CGIiO1IPm1VYQxBkpnVGJur2S4= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=
github.com/hyperledger/fabric-contract-api-go v1.1.0/go.mod h1:nHWt0B45fK53owcFpLtAe8DH0Q5P068mnzkNXMPSL7E= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
github.com/hyperledger/fabric-protos-go v0.0.0-20190919234611-2a87503ac7c9/go.mod h1:xVYTjK4DtZRBxZ2D9aE4y6AbLaPwue2o/criQyQbVD0=
github.com/hyperledger/fabric-protos-go v0.0.0-20200424173316-dd554ba3746e h1:9PS5iezHk/j7XriSlNuSQILyCOfcZ9wZ3/PiucmSE8E=
github.com/hyperledger/fabric-protos-go v0.0.0-20200424173316-dd554ba3746e/go.mod h1:xVYTjK4DtZRBxZ2D9aE4y6AbLaPwue2o/criQyQbVD0=
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc=
github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg=
github.com/karrick/godirwalk v1.10.12/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs=
github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA=
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e h1:hB2xlXdHp/pmPZq0y3QnmWAArdw9PqbmotexnWx/FU8=
github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8=
github.com/rogpeppe/go-internal v1.3.0 h1:RR9dF3JtopPvtkroDZuVD7qquD0bnHlKSqaQhgwt8yk= github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g=
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ=
github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU=
github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo=
github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY=
github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4= github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0=
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f h1:J9EGpcZtP0E/raorCMxlFGSTBrsSlaDGf3jU/qvAE2c=
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb h1:zGWFAtiMcyryUHoUjUJX0/lt1H2+i2Ka2n+D3DImSNo=
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHovont7NscjpAxXsDA8S8BMYve8Y5+7cuRE7R0= github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHovont7NscjpAxXsDA8S8BMYve8Y5+7cuRE7R0=
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ=
github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74= github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74=
github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y=
github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA=
golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= go.opentelemetry.io/otel v1.34.0 h1:zRLXxLCgL1WyKsPVrgbSdMN4c0FMkDAskSTQP+0hdUY=
golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= go.opentelemetry.io/otel v1.34.0/go.mod h1:OWFPOQ+h4G8xpyjgqo4SxJYdDQ/qmRH+wivy7zzx9oI=
golang.org/x/crypto v0.0.0-20190621222207-cc06ce4a13d4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= go.opentelemetry.io/otel/metric v1.34.0 h1:+eTR3U0MyfWjRDhmFMxe2SsW64QrZ84AOhvqS7Y+PoQ=
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= go.opentelemetry.io/otel/metric v1.34.0/go.mod h1:CEDrp0fy2D0MvkXE+dPV7cMi8tWZwX3dmaIhwPOaqHE=
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= go.opentelemetry.io/otel/sdk v1.34.0 h1:95zS4k/2GOy069d321O8jWgYsW3MzVV+KuSPKp7Wr1A=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= go.opentelemetry.io/otel/sdk v1.34.0/go.mod h1:0e/pNiaMAqaykJGKbi+tSjWfNNHMTxoC9qANsCzbyxU=
golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= go.opentelemetry.io/otel/sdk/metric v1.34.0 h1:5CeK9ujjbFVL5c1PhLuStg1wxA7vQv7ce1EK0Gyvahk=
golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= go.opentelemetry.io/otel/sdk/metric v1.34.0/go.mod h1:jQ/r8Ze28zRKoNRdkjCZxfs6YvBTG1+YIqyFVFYec5w=
golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297 h1:k7pJ2yAPLPgbskkFdhRCsA77k2fySZ1zf2zCjvQCiIM= go.opentelemetry.io/otel/trace v1.34.0 h1:+ouXS2V8Rd4hp4580a8q23bg0azF2nI8cqLYnC8mh/k=
golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= go.opentelemetry.io/otel/trace v1.34.0/go.mod h1:Svm7lSjQD7kG7KJ/MUHPVXSDGz2OX4h0M2jHBhmSfRE=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/net v0.38.0 h1:vRMAPTMaeGqVhG5QyLJHqNDwecKTomGeqbnfZyKlBI8=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/net v0.38.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8=
golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.23.0 h1:D71I7dUrlY+VX0gQShAThNGHFxZ13dGLBHQLVl1mJlY=
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4=
golang.org/x/sys v0.0.0-20190515120540-06a5c4944438/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f h1:BWUVssLB0HVOSY78gIdvk1dTVYtT1y8SBWtPYuTJ/6w=
golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM=
golang.org/x/sys v0.0.0-20190710143415-6ec70d6a5542 h1:6ZQFf1D2YYDDI7eSwW8adlkkavTB9sw5I24FVtEvNUQ= google.golang.org/grpc v1.71.0 h1:kF77BGdPTQ4/JZWMlb9VpJ5pa25aqvVqogsxNHHdeBg=
golang.org/x/sys v0.0.0-20190710143415-6ec70d6a5542/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= google.golang.org/grpc v1.71.0/go.mod h1:H0GRtasmQOh9LkFoCPDu3ZrwUtD1YGE+b2vYBYd/8Ec=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= google.golang.org/protobuf v1.36.4 h1:6A3ZDJHn/eNqc1i+IdefRzy/9PokBTPvcqMySR7NNIM=
golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= google.golang.org/protobuf v1.36.4/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20190624180213-70d37148ca0c/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
google.golang.org/genproto v0.0.0-20180831171423-11092d34479b h1:lohp5blsw53GBXtLyLNaTXPXS9pJ1tiTw61ZHUoE9Qw=
google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
google.golang.org/grpc v1.23.0 h1:AzbTB6ux+okLTzP8Ru1Xs41C303zdcfEht7MQnYJt5A=
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10=
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=

View file

@ -1,4 +1,4 @@
#!/bin/sh #!/bin/bash
set -euo pipefail set -euo pipefail

View file

@ -1,4 +1,4 @@
#!/bin/sh #!/usr/bin/env bash
set -euo pipefail set -euo pipefail

View file

@ -1,4 +1,4 @@
#!/bin/sh #!/usr/bin/env bash
set -euo pipefail set -euo pipefail

View file

@ -7,7 +7,7 @@ package main
import ( import (
"log" "log"
"github.com/hyperledger/fabric-contract-api-go/contractapi" "github.com/hyperledger/fabric-contract-api-go/v2/contractapi"
"github.com/hyperledger/fabric-samples/asset-transfer-basic/chaincode-go/chaincode" "github.com/hyperledger/fabric-samples/asset-transfer-basic/chaincode-go/chaincode"
) )

View file

@ -4,9 +4,9 @@ package mocks
import ( import (
"sync" "sync"
"github.com/golang/protobuf/ptypes/timestamp" "github.com/hyperledger/fabric-chaincode-go/v2/shim"
"github.com/hyperledger/fabric-chaincode-go/shim" "github.com/hyperledger/fabric-protos-go-apiv2/peer"
"github.com/hyperledger/fabric-protos-go/peer" "google.golang.org/protobuf/types/known/timestamppb"
) )
type ChaincodeStub struct { type ChaincodeStub struct {
@ -388,19 +388,19 @@ type ChaincodeStub struct {
getTxIDReturnsOnCall map[int]struct { getTxIDReturnsOnCall map[int]struct {
result1 string result1 string
} }
GetTxTimestampStub func() (*timestamp.Timestamp, error) GetTxTimestampStub func() (*timestamppb.Timestamp, error)
getTxTimestampMutex sync.RWMutex getTxTimestampMutex sync.RWMutex
getTxTimestampArgsForCall []struct { getTxTimestampArgsForCall []struct {
} }
getTxTimestampReturns struct { getTxTimestampReturns struct {
result1 *timestamp.Timestamp result1 *timestamppb.Timestamp
result2 error result2 error
} }
getTxTimestampReturnsOnCall map[int]struct { getTxTimestampReturnsOnCall map[int]struct {
result1 *timestamp.Timestamp result1 *timestamppb.Timestamp
result2 error result2 error
} }
InvokeChaincodeStub func(string, [][]byte, string) peer.Response InvokeChaincodeStub func(string, [][]byte, string) *peer.Response
invokeChaincodeMutex sync.RWMutex invokeChaincodeMutex sync.RWMutex
invokeChaincodeArgsForCall []struct { invokeChaincodeArgsForCall []struct {
arg1 string arg1 string
@ -408,10 +408,22 @@ type ChaincodeStub struct {
arg3 string arg3 string
} }
invokeChaincodeReturns struct { invokeChaincodeReturns struct {
result1 peer.Response result1 *peer.Response
} }
invokeChaincodeReturnsOnCall map[int]struct { invokeChaincodeReturnsOnCall map[int]struct {
result1 peer.Response result1 *peer.Response
}
PurgePrivateDataStub func(string, string) error
purgePrivateDataMutex sync.RWMutex
purgePrivateDataArgsForCall []struct {
arg1 string
arg2 string
}
purgePrivateDataReturns struct {
result1 error
}
purgePrivateDataReturnsOnCall map[int]struct {
result1 error
} }
PutPrivateDataStub func(string, string, []byte) error PutPrivateDataStub func(string, string, []byte) error
putPrivateDataMutex sync.RWMutex putPrivateDataMutex sync.RWMutex
@ -506,15 +518,16 @@ func (fake *ChaincodeStub) CreateCompositeKey(arg1 string, arg2 []string) (strin
arg1 string arg1 string
arg2 []string arg2 []string
}{arg1, arg2Copy}) }{arg1, arg2Copy})
stub := fake.CreateCompositeKeyStub
fakeReturns := fake.createCompositeKeyReturns
fake.recordInvocation("CreateCompositeKey", []interface{}{arg1, arg2Copy}) fake.recordInvocation("CreateCompositeKey", []interface{}{arg1, arg2Copy})
fake.createCompositeKeyMutex.Unlock() fake.createCompositeKeyMutex.Unlock()
if fake.CreateCompositeKeyStub != nil { if stub != nil {
return fake.CreateCompositeKeyStub(arg1, arg2) return stub(arg1, arg2)
} }
if specificReturn { if specificReturn {
return ret.result1, ret.result2 return ret.result1, ret.result2
} }
fakeReturns := fake.createCompositeKeyReturns
return fakeReturns.result1, fakeReturns.result2 return fakeReturns.result1, fakeReturns.result2
} }
@ -570,15 +583,16 @@ func (fake *ChaincodeStub) DelPrivateData(arg1 string, arg2 string) error {
arg1 string arg1 string
arg2 string arg2 string
}{arg1, arg2}) }{arg1, arg2})
stub := fake.DelPrivateDataStub
fakeReturns := fake.delPrivateDataReturns
fake.recordInvocation("DelPrivateData", []interface{}{arg1, arg2}) fake.recordInvocation("DelPrivateData", []interface{}{arg1, arg2})
fake.delPrivateDataMutex.Unlock() fake.delPrivateDataMutex.Unlock()
if fake.DelPrivateDataStub != nil { if stub != nil {
return fake.DelPrivateDataStub(arg1, arg2) return stub(arg1, arg2)
} }
if specificReturn { if specificReturn {
return ret.result1 return ret.result1
} }
fakeReturns := fake.delPrivateDataReturns
return fakeReturns.result1 return fakeReturns.result1
} }
@ -630,15 +644,16 @@ func (fake *ChaincodeStub) DelState(arg1 string) error {
fake.delStateArgsForCall = append(fake.delStateArgsForCall, struct { fake.delStateArgsForCall = append(fake.delStateArgsForCall, struct {
arg1 string arg1 string
}{arg1}) }{arg1})
stub := fake.DelStateStub
fakeReturns := fake.delStateReturns
fake.recordInvocation("DelState", []interface{}{arg1}) fake.recordInvocation("DelState", []interface{}{arg1})
fake.delStateMutex.Unlock() fake.delStateMutex.Unlock()
if fake.DelStateStub != nil { if stub != nil {
return fake.DelStateStub(arg1) return stub(arg1)
} }
if specificReturn { if specificReturn {
return ret.result1 return ret.result1
} }
fakeReturns := fake.delStateReturns
return fakeReturns.result1 return fakeReturns.result1
} }
@ -689,15 +704,16 @@ func (fake *ChaincodeStub) GetArgs() [][]byte {
ret, specificReturn := fake.getArgsReturnsOnCall[len(fake.getArgsArgsForCall)] ret, specificReturn := fake.getArgsReturnsOnCall[len(fake.getArgsArgsForCall)]
fake.getArgsArgsForCall = append(fake.getArgsArgsForCall, struct { fake.getArgsArgsForCall = append(fake.getArgsArgsForCall, struct {
}{}) }{})
stub := fake.GetArgsStub
fakeReturns := fake.getArgsReturns
fake.recordInvocation("GetArgs", []interface{}{}) fake.recordInvocation("GetArgs", []interface{}{})
fake.getArgsMutex.Unlock() fake.getArgsMutex.Unlock()
if fake.GetArgsStub != nil { if stub != nil {
return fake.GetArgsStub() return stub()
} }
if specificReturn { if specificReturn {
return ret.result1 return ret.result1
} }
fakeReturns := fake.getArgsReturns
return fakeReturns.result1 return fakeReturns.result1
} }
@ -741,15 +757,16 @@ func (fake *ChaincodeStub) GetArgsSlice() ([]byte, error) {
ret, specificReturn := fake.getArgsSliceReturnsOnCall[len(fake.getArgsSliceArgsForCall)] ret, specificReturn := fake.getArgsSliceReturnsOnCall[len(fake.getArgsSliceArgsForCall)]
fake.getArgsSliceArgsForCall = append(fake.getArgsSliceArgsForCall, struct { fake.getArgsSliceArgsForCall = append(fake.getArgsSliceArgsForCall, struct {
}{}) }{})
stub := fake.GetArgsSliceStub
fakeReturns := fake.getArgsSliceReturns
fake.recordInvocation("GetArgsSlice", []interface{}{}) fake.recordInvocation("GetArgsSlice", []interface{}{})
fake.getArgsSliceMutex.Unlock() fake.getArgsSliceMutex.Unlock()
if fake.GetArgsSliceStub != nil { if stub != nil {
return fake.GetArgsSliceStub() return stub()
} }
if specificReturn { if specificReturn {
return ret.result1, ret.result2 return ret.result1, ret.result2
} }
fakeReturns := fake.getArgsSliceReturns
return fakeReturns.result1, fakeReturns.result2 return fakeReturns.result1, fakeReturns.result2
} }
@ -796,15 +813,16 @@ func (fake *ChaincodeStub) GetBinding() ([]byte, error) {
ret, specificReturn := fake.getBindingReturnsOnCall[len(fake.getBindingArgsForCall)] ret, specificReturn := fake.getBindingReturnsOnCall[len(fake.getBindingArgsForCall)]
fake.getBindingArgsForCall = append(fake.getBindingArgsForCall, struct { fake.getBindingArgsForCall = append(fake.getBindingArgsForCall, struct {
}{}) }{})
stub := fake.GetBindingStub
fakeReturns := fake.getBindingReturns
fake.recordInvocation("GetBinding", []interface{}{}) fake.recordInvocation("GetBinding", []interface{}{})
fake.getBindingMutex.Unlock() fake.getBindingMutex.Unlock()
if fake.GetBindingStub != nil { if stub != nil {
return fake.GetBindingStub() return stub()
} }
if specificReturn { if specificReturn {
return ret.result1, ret.result2 return ret.result1, ret.result2
} }
fakeReturns := fake.getBindingReturns
return fakeReturns.result1, fakeReturns.result2 return fakeReturns.result1, fakeReturns.result2
} }
@ -851,15 +869,16 @@ func (fake *ChaincodeStub) GetChannelID() string {
ret, specificReturn := fake.getChannelIDReturnsOnCall[len(fake.getChannelIDArgsForCall)] ret, specificReturn := fake.getChannelIDReturnsOnCall[len(fake.getChannelIDArgsForCall)]
fake.getChannelIDArgsForCall = append(fake.getChannelIDArgsForCall, struct { fake.getChannelIDArgsForCall = append(fake.getChannelIDArgsForCall, struct {
}{}) }{})
stub := fake.GetChannelIDStub
fakeReturns := fake.getChannelIDReturns
fake.recordInvocation("GetChannelID", []interface{}{}) fake.recordInvocation("GetChannelID", []interface{}{})
fake.getChannelIDMutex.Unlock() fake.getChannelIDMutex.Unlock()
if fake.GetChannelIDStub != nil { if stub != nil {
return fake.GetChannelIDStub() return stub()
} }
if specificReturn { if specificReturn {
return ret.result1 return ret.result1
} }
fakeReturns := fake.getChannelIDReturns
return fakeReturns.result1 return fakeReturns.result1
} }
@ -903,15 +922,16 @@ func (fake *ChaincodeStub) GetCreator() ([]byte, error) {
ret, specificReturn := fake.getCreatorReturnsOnCall[len(fake.getCreatorArgsForCall)] ret, specificReturn := fake.getCreatorReturnsOnCall[len(fake.getCreatorArgsForCall)]
fake.getCreatorArgsForCall = append(fake.getCreatorArgsForCall, struct { fake.getCreatorArgsForCall = append(fake.getCreatorArgsForCall, struct {
}{}) }{})
stub := fake.GetCreatorStub
fakeReturns := fake.getCreatorReturns
fake.recordInvocation("GetCreator", []interface{}{}) fake.recordInvocation("GetCreator", []interface{}{})
fake.getCreatorMutex.Unlock() fake.getCreatorMutex.Unlock()
if fake.GetCreatorStub != nil { if stub != nil {
return fake.GetCreatorStub() return stub()
} }
if specificReturn { if specificReturn {
return ret.result1, ret.result2 return ret.result1, ret.result2
} }
fakeReturns := fake.getCreatorReturns
return fakeReturns.result1, fakeReturns.result2 return fakeReturns.result1, fakeReturns.result2
} }
@ -958,15 +978,16 @@ func (fake *ChaincodeStub) GetDecorations() map[string][]byte {
ret, specificReturn := fake.getDecorationsReturnsOnCall[len(fake.getDecorationsArgsForCall)] ret, specificReturn := fake.getDecorationsReturnsOnCall[len(fake.getDecorationsArgsForCall)]
fake.getDecorationsArgsForCall = append(fake.getDecorationsArgsForCall, struct { fake.getDecorationsArgsForCall = append(fake.getDecorationsArgsForCall, struct {
}{}) }{})
stub := fake.GetDecorationsStub
fakeReturns := fake.getDecorationsReturns
fake.recordInvocation("GetDecorations", []interface{}{}) fake.recordInvocation("GetDecorations", []interface{}{})
fake.getDecorationsMutex.Unlock() fake.getDecorationsMutex.Unlock()
if fake.GetDecorationsStub != nil { if stub != nil {
return fake.GetDecorationsStub() return stub()
} }
if specificReturn { if specificReturn {
return ret.result1 return ret.result1
} }
fakeReturns := fake.getDecorationsReturns
return fakeReturns.result1 return fakeReturns.result1
} }
@ -1010,15 +1031,16 @@ func (fake *ChaincodeStub) GetFunctionAndParameters() (string, []string) {
ret, specificReturn := fake.getFunctionAndParametersReturnsOnCall[len(fake.getFunctionAndParametersArgsForCall)] ret, specificReturn := fake.getFunctionAndParametersReturnsOnCall[len(fake.getFunctionAndParametersArgsForCall)]
fake.getFunctionAndParametersArgsForCall = append(fake.getFunctionAndParametersArgsForCall, struct { fake.getFunctionAndParametersArgsForCall = append(fake.getFunctionAndParametersArgsForCall, struct {
}{}) }{})
stub := fake.GetFunctionAndParametersStub
fakeReturns := fake.getFunctionAndParametersReturns
fake.recordInvocation("GetFunctionAndParameters", []interface{}{}) fake.recordInvocation("GetFunctionAndParameters", []interface{}{})
fake.getFunctionAndParametersMutex.Unlock() fake.getFunctionAndParametersMutex.Unlock()
if fake.GetFunctionAndParametersStub != nil { if stub != nil {
return fake.GetFunctionAndParametersStub() return stub()
} }
if specificReturn { if specificReturn {
return ret.result1, ret.result2 return ret.result1, ret.result2
} }
fakeReturns := fake.getFunctionAndParametersReturns
return fakeReturns.result1, fakeReturns.result2 return fakeReturns.result1, fakeReturns.result2
} }
@ -1066,15 +1088,16 @@ func (fake *ChaincodeStub) GetHistoryForKey(arg1 string) (shim.HistoryQueryItera
fake.getHistoryForKeyArgsForCall = append(fake.getHistoryForKeyArgsForCall, struct { fake.getHistoryForKeyArgsForCall = append(fake.getHistoryForKeyArgsForCall, struct {
arg1 string arg1 string
}{arg1}) }{arg1})
stub := fake.GetHistoryForKeyStub
fakeReturns := fake.getHistoryForKeyReturns
fake.recordInvocation("GetHistoryForKey", []interface{}{arg1}) fake.recordInvocation("GetHistoryForKey", []interface{}{arg1})
fake.getHistoryForKeyMutex.Unlock() fake.getHistoryForKeyMutex.Unlock()
if fake.GetHistoryForKeyStub != nil { if stub != nil {
return fake.GetHistoryForKeyStub(arg1) return stub(arg1)
} }
if specificReturn { if specificReturn {
return ret.result1, ret.result2 return ret.result1, ret.result2
} }
fakeReturns := fake.getHistoryForKeyReturns
return fakeReturns.result1, fakeReturns.result2 return fakeReturns.result1, fakeReturns.result2
} }
@ -1130,15 +1153,16 @@ func (fake *ChaincodeStub) GetPrivateData(arg1 string, arg2 string) ([]byte, err
arg1 string arg1 string
arg2 string arg2 string
}{arg1, arg2}) }{arg1, arg2})
stub := fake.GetPrivateDataStub
fakeReturns := fake.getPrivateDataReturns
fake.recordInvocation("GetPrivateData", []interface{}{arg1, arg2}) fake.recordInvocation("GetPrivateData", []interface{}{arg1, arg2})
fake.getPrivateDataMutex.Unlock() fake.getPrivateDataMutex.Unlock()
if fake.GetPrivateDataStub != nil { if stub != nil {
return fake.GetPrivateDataStub(arg1, arg2) return stub(arg1, arg2)
} }
if specificReturn { if specificReturn {
return ret.result1, ret.result2 return ret.result1, ret.result2
} }
fakeReturns := fake.getPrivateDataReturns
return fakeReturns.result1, fakeReturns.result2 return fakeReturns.result1, fakeReturns.result2
} }
@ -1200,15 +1224,16 @@ func (fake *ChaincodeStub) GetPrivateDataByPartialCompositeKey(arg1 string, arg2
arg2 string arg2 string
arg3 []string arg3 []string
}{arg1, arg2, arg3Copy}) }{arg1, arg2, arg3Copy})
stub := fake.GetPrivateDataByPartialCompositeKeyStub
fakeReturns := fake.getPrivateDataByPartialCompositeKeyReturns
fake.recordInvocation("GetPrivateDataByPartialCompositeKey", []interface{}{arg1, arg2, arg3Copy}) fake.recordInvocation("GetPrivateDataByPartialCompositeKey", []interface{}{arg1, arg2, arg3Copy})
fake.getPrivateDataByPartialCompositeKeyMutex.Unlock() fake.getPrivateDataByPartialCompositeKeyMutex.Unlock()
if fake.GetPrivateDataByPartialCompositeKeyStub != nil { if stub != nil {
return fake.GetPrivateDataByPartialCompositeKeyStub(arg1, arg2, arg3) return stub(arg1, arg2, arg3)
} }
if specificReturn { if specificReturn {
return ret.result1, ret.result2 return ret.result1, ret.result2
} }
fakeReturns := fake.getPrivateDataByPartialCompositeKeyReturns
return fakeReturns.result1, fakeReturns.result2 return fakeReturns.result1, fakeReturns.result2
} }
@ -1265,15 +1290,16 @@ func (fake *ChaincodeStub) GetPrivateDataByRange(arg1 string, arg2 string, arg3
arg2 string arg2 string
arg3 string arg3 string
}{arg1, arg2, arg3}) }{arg1, arg2, arg3})
stub := fake.GetPrivateDataByRangeStub
fakeReturns := fake.getPrivateDataByRangeReturns
fake.recordInvocation("GetPrivateDataByRange", []interface{}{arg1, arg2, arg3}) fake.recordInvocation("GetPrivateDataByRange", []interface{}{arg1, arg2, arg3})
fake.getPrivateDataByRangeMutex.Unlock() fake.getPrivateDataByRangeMutex.Unlock()
if fake.GetPrivateDataByRangeStub != nil { if stub != nil {
return fake.GetPrivateDataByRangeStub(arg1, arg2, arg3) return stub(arg1, arg2, arg3)
} }
if specificReturn { if specificReturn {
return ret.result1, ret.result2 return ret.result1, ret.result2
} }
fakeReturns := fake.getPrivateDataByRangeReturns
return fakeReturns.result1, fakeReturns.result2 return fakeReturns.result1, fakeReturns.result2
} }
@ -1329,15 +1355,16 @@ func (fake *ChaincodeStub) GetPrivateDataHash(arg1 string, arg2 string) ([]byte,
arg1 string arg1 string
arg2 string arg2 string
}{arg1, arg2}) }{arg1, arg2})
stub := fake.GetPrivateDataHashStub
fakeReturns := fake.getPrivateDataHashReturns
fake.recordInvocation("GetPrivateDataHash", []interface{}{arg1, arg2}) fake.recordInvocation("GetPrivateDataHash", []interface{}{arg1, arg2})
fake.getPrivateDataHashMutex.Unlock() fake.getPrivateDataHashMutex.Unlock()
if fake.GetPrivateDataHashStub != nil { if stub != nil {
return fake.GetPrivateDataHashStub(arg1, arg2) return stub(arg1, arg2)
} }
if specificReturn { if specificReturn {
return ret.result1, ret.result2 return ret.result1, ret.result2
} }
fakeReturns := fake.getPrivateDataHashReturns
return fakeReturns.result1, fakeReturns.result2 return fakeReturns.result1, fakeReturns.result2
} }
@ -1393,15 +1420,16 @@ func (fake *ChaincodeStub) GetPrivateDataQueryResult(arg1 string, arg2 string) (
arg1 string arg1 string
arg2 string arg2 string
}{arg1, arg2}) }{arg1, arg2})
stub := fake.GetPrivateDataQueryResultStub
fakeReturns := fake.getPrivateDataQueryResultReturns
fake.recordInvocation("GetPrivateDataQueryResult", []interface{}{arg1, arg2}) fake.recordInvocation("GetPrivateDataQueryResult", []interface{}{arg1, arg2})
fake.getPrivateDataQueryResultMutex.Unlock() fake.getPrivateDataQueryResultMutex.Unlock()
if fake.GetPrivateDataQueryResultStub != nil { if stub != nil {
return fake.GetPrivateDataQueryResultStub(arg1, arg2) return stub(arg1, arg2)
} }
if specificReturn { if specificReturn {
return ret.result1, ret.result2 return ret.result1, ret.result2
} }
fakeReturns := fake.getPrivateDataQueryResultReturns
return fakeReturns.result1, fakeReturns.result2 return fakeReturns.result1, fakeReturns.result2
} }
@ -1457,15 +1485,16 @@ func (fake *ChaincodeStub) GetPrivateDataValidationParameter(arg1 string, arg2 s
arg1 string arg1 string
arg2 string arg2 string
}{arg1, arg2}) }{arg1, arg2})
stub := fake.GetPrivateDataValidationParameterStub
fakeReturns := fake.getPrivateDataValidationParameterReturns
fake.recordInvocation("GetPrivateDataValidationParameter", []interface{}{arg1, arg2}) fake.recordInvocation("GetPrivateDataValidationParameter", []interface{}{arg1, arg2})
fake.getPrivateDataValidationParameterMutex.Unlock() fake.getPrivateDataValidationParameterMutex.Unlock()
if fake.GetPrivateDataValidationParameterStub != nil { if stub != nil {
return fake.GetPrivateDataValidationParameterStub(arg1, arg2) return stub(arg1, arg2)
} }
if specificReturn { if specificReturn {
return ret.result1, ret.result2 return ret.result1, ret.result2
} }
fakeReturns := fake.getPrivateDataValidationParameterReturns
return fakeReturns.result1, fakeReturns.result2 return fakeReturns.result1, fakeReturns.result2
} }
@ -1520,15 +1549,16 @@ func (fake *ChaincodeStub) GetQueryResult(arg1 string) (shim.StateQueryIteratorI
fake.getQueryResultArgsForCall = append(fake.getQueryResultArgsForCall, struct { fake.getQueryResultArgsForCall = append(fake.getQueryResultArgsForCall, struct {
arg1 string arg1 string
}{arg1}) }{arg1})
stub := fake.GetQueryResultStub
fakeReturns := fake.getQueryResultReturns
fake.recordInvocation("GetQueryResult", []interface{}{arg1}) fake.recordInvocation("GetQueryResult", []interface{}{arg1})
fake.getQueryResultMutex.Unlock() fake.getQueryResultMutex.Unlock()
if fake.GetQueryResultStub != nil { if stub != nil {
return fake.GetQueryResultStub(arg1) return stub(arg1)
} }
if specificReturn { if specificReturn {
return ret.result1, ret.result2 return ret.result1, ret.result2
} }
fakeReturns := fake.getQueryResultReturns
return fakeReturns.result1, fakeReturns.result2 return fakeReturns.result1, fakeReturns.result2
} }
@ -1585,15 +1615,16 @@ func (fake *ChaincodeStub) GetQueryResultWithPagination(arg1 string, arg2 int32,
arg2 int32 arg2 int32
arg3 string arg3 string
}{arg1, arg2, arg3}) }{arg1, arg2, arg3})
stub := fake.GetQueryResultWithPaginationStub
fakeReturns := fake.getQueryResultWithPaginationReturns
fake.recordInvocation("GetQueryResultWithPagination", []interface{}{arg1, arg2, arg3}) fake.recordInvocation("GetQueryResultWithPagination", []interface{}{arg1, arg2, arg3})
fake.getQueryResultWithPaginationMutex.Unlock() fake.getQueryResultWithPaginationMutex.Unlock()
if fake.GetQueryResultWithPaginationStub != nil { if stub != nil {
return fake.GetQueryResultWithPaginationStub(arg1, arg2, arg3) return stub(arg1, arg2, arg3)
} }
if specificReturn { if specificReturn {
return ret.result1, ret.result2, ret.result3 return ret.result1, ret.result2, ret.result3
} }
fakeReturns := fake.getQueryResultWithPaginationReturns
return fakeReturns.result1, fakeReturns.result2, fakeReturns.result3 return fakeReturns.result1, fakeReturns.result2, fakeReturns.result3
} }
@ -1650,15 +1681,16 @@ func (fake *ChaincodeStub) GetSignedProposal() (*peer.SignedProposal, error) {
ret, specificReturn := fake.getSignedProposalReturnsOnCall[len(fake.getSignedProposalArgsForCall)] ret, specificReturn := fake.getSignedProposalReturnsOnCall[len(fake.getSignedProposalArgsForCall)]
fake.getSignedProposalArgsForCall = append(fake.getSignedProposalArgsForCall, struct { fake.getSignedProposalArgsForCall = append(fake.getSignedProposalArgsForCall, struct {
}{}) }{})
stub := fake.GetSignedProposalStub
fakeReturns := fake.getSignedProposalReturns
fake.recordInvocation("GetSignedProposal", []interface{}{}) fake.recordInvocation("GetSignedProposal", []interface{}{})
fake.getSignedProposalMutex.Unlock() fake.getSignedProposalMutex.Unlock()
if fake.GetSignedProposalStub != nil { if stub != nil {
return fake.GetSignedProposalStub() return stub()
} }
if specificReturn { if specificReturn {
return ret.result1, ret.result2 return ret.result1, ret.result2
} }
fakeReturns := fake.getSignedProposalReturns
return fakeReturns.result1, fakeReturns.result2 return fakeReturns.result1, fakeReturns.result2
} }
@ -1706,15 +1738,16 @@ func (fake *ChaincodeStub) GetState(arg1 string) ([]byte, error) {
fake.getStateArgsForCall = append(fake.getStateArgsForCall, struct { fake.getStateArgsForCall = append(fake.getStateArgsForCall, struct {
arg1 string arg1 string
}{arg1}) }{arg1})
stub := fake.GetStateStub
fakeReturns := fake.getStateReturns
fake.recordInvocation("GetState", []interface{}{arg1}) fake.recordInvocation("GetState", []interface{}{arg1})
fake.getStateMutex.Unlock() fake.getStateMutex.Unlock()
if fake.GetStateStub != nil { if stub != nil {
return fake.GetStateStub(arg1) return stub(arg1)
} }
if specificReturn { if specificReturn {
return ret.result1, ret.result2 return ret.result1, ret.result2
} }
fakeReturns := fake.getStateReturns
return fakeReturns.result1, fakeReturns.result2 return fakeReturns.result1, fakeReturns.result2
} }
@ -1775,15 +1808,16 @@ func (fake *ChaincodeStub) GetStateByPartialCompositeKey(arg1 string, arg2 []str
arg1 string arg1 string
arg2 []string arg2 []string
}{arg1, arg2Copy}) }{arg1, arg2Copy})
stub := fake.GetStateByPartialCompositeKeyStub
fakeReturns := fake.getStateByPartialCompositeKeyReturns
fake.recordInvocation("GetStateByPartialCompositeKey", []interface{}{arg1, arg2Copy}) fake.recordInvocation("GetStateByPartialCompositeKey", []interface{}{arg1, arg2Copy})
fake.getStateByPartialCompositeKeyMutex.Unlock() fake.getStateByPartialCompositeKeyMutex.Unlock()
if fake.GetStateByPartialCompositeKeyStub != nil { if stub != nil {
return fake.GetStateByPartialCompositeKeyStub(arg1, arg2) return stub(arg1, arg2)
} }
if specificReturn { if specificReturn {
return ret.result1, ret.result2 return ret.result1, ret.result2
} }
fakeReturns := fake.getStateByPartialCompositeKeyReturns
return fakeReturns.result1, fakeReturns.result2 return fakeReturns.result1, fakeReturns.result2
} }
@ -1846,15 +1880,16 @@ func (fake *ChaincodeStub) GetStateByPartialCompositeKeyWithPagination(arg1 stri
arg3 int32 arg3 int32
arg4 string arg4 string
}{arg1, arg2Copy, arg3, arg4}) }{arg1, arg2Copy, arg3, arg4})
stub := fake.GetStateByPartialCompositeKeyWithPaginationStub
fakeReturns := fake.getStateByPartialCompositeKeyWithPaginationReturns
fake.recordInvocation("GetStateByPartialCompositeKeyWithPagination", []interface{}{arg1, arg2Copy, arg3, arg4}) fake.recordInvocation("GetStateByPartialCompositeKeyWithPagination", []interface{}{arg1, arg2Copy, arg3, arg4})
fake.getStateByPartialCompositeKeyWithPaginationMutex.Unlock() fake.getStateByPartialCompositeKeyWithPaginationMutex.Unlock()
if fake.GetStateByPartialCompositeKeyWithPaginationStub != nil { if stub != nil {
return fake.GetStateByPartialCompositeKeyWithPaginationStub(arg1, arg2, arg3, arg4) return stub(arg1, arg2, arg3, arg4)
} }
if specificReturn { if specificReturn {
return ret.result1, ret.result2, ret.result3 return ret.result1, ret.result2, ret.result3
} }
fakeReturns := fake.getStateByPartialCompositeKeyWithPaginationReturns
return fakeReturns.result1, fakeReturns.result2, fakeReturns.result3 return fakeReturns.result1, fakeReturns.result2, fakeReturns.result3
} }
@ -1913,15 +1948,16 @@ func (fake *ChaincodeStub) GetStateByRange(arg1 string, arg2 string) (shim.State
arg1 string arg1 string
arg2 string arg2 string
}{arg1, arg2}) }{arg1, arg2})
stub := fake.GetStateByRangeStub
fakeReturns := fake.getStateByRangeReturns
fake.recordInvocation("GetStateByRange", []interface{}{arg1, arg2}) fake.recordInvocation("GetStateByRange", []interface{}{arg1, arg2})
fake.getStateByRangeMutex.Unlock() fake.getStateByRangeMutex.Unlock()
if fake.GetStateByRangeStub != nil { if stub != nil {
return fake.GetStateByRangeStub(arg1, arg2) return stub(arg1, arg2)
} }
if specificReturn { if specificReturn {
return ret.result1, ret.result2 return ret.result1, ret.result2
} }
fakeReturns := fake.getStateByRangeReturns
return fakeReturns.result1, fakeReturns.result2 return fakeReturns.result1, fakeReturns.result2
} }
@ -1979,15 +2015,16 @@ func (fake *ChaincodeStub) GetStateByRangeWithPagination(arg1 string, arg2 strin
arg3 int32 arg3 int32
arg4 string arg4 string
}{arg1, arg2, arg3, arg4}) }{arg1, arg2, arg3, arg4})
stub := fake.GetStateByRangeWithPaginationStub
fakeReturns := fake.getStateByRangeWithPaginationReturns
fake.recordInvocation("GetStateByRangeWithPagination", []interface{}{arg1, arg2, arg3, arg4}) fake.recordInvocation("GetStateByRangeWithPagination", []interface{}{arg1, arg2, arg3, arg4})
fake.getStateByRangeWithPaginationMutex.Unlock() fake.getStateByRangeWithPaginationMutex.Unlock()
if fake.GetStateByRangeWithPaginationStub != nil { if stub != nil {
return fake.GetStateByRangeWithPaginationStub(arg1, arg2, arg3, arg4) return stub(arg1, arg2, arg3, arg4)
} }
if specificReturn { if specificReturn {
return ret.result1, ret.result2, ret.result3 return ret.result1, ret.result2, ret.result3
} }
fakeReturns := fake.getStateByRangeWithPaginationReturns
return fakeReturns.result1, fakeReturns.result2, fakeReturns.result3 return fakeReturns.result1, fakeReturns.result2, fakeReturns.result3
} }
@ -2045,15 +2082,16 @@ func (fake *ChaincodeStub) GetStateValidationParameter(arg1 string) ([]byte, err
fake.getStateValidationParameterArgsForCall = append(fake.getStateValidationParameterArgsForCall, struct { fake.getStateValidationParameterArgsForCall = append(fake.getStateValidationParameterArgsForCall, struct {
arg1 string arg1 string
}{arg1}) }{arg1})
stub := fake.GetStateValidationParameterStub
fakeReturns := fake.getStateValidationParameterReturns
fake.recordInvocation("GetStateValidationParameter", []interface{}{arg1}) fake.recordInvocation("GetStateValidationParameter", []interface{}{arg1})
fake.getStateValidationParameterMutex.Unlock() fake.getStateValidationParameterMutex.Unlock()
if fake.GetStateValidationParameterStub != nil { if stub != nil {
return fake.GetStateValidationParameterStub(arg1) return stub(arg1)
} }
if specificReturn { if specificReturn {
return ret.result1, ret.result2 return ret.result1, ret.result2
} }
fakeReturns := fake.getStateValidationParameterReturns
return fakeReturns.result1, fakeReturns.result2 return fakeReturns.result1, fakeReturns.result2
} }
@ -2107,15 +2145,16 @@ func (fake *ChaincodeStub) GetStringArgs() []string {
ret, specificReturn := fake.getStringArgsReturnsOnCall[len(fake.getStringArgsArgsForCall)] ret, specificReturn := fake.getStringArgsReturnsOnCall[len(fake.getStringArgsArgsForCall)]
fake.getStringArgsArgsForCall = append(fake.getStringArgsArgsForCall, struct { fake.getStringArgsArgsForCall = append(fake.getStringArgsArgsForCall, struct {
}{}) }{})
stub := fake.GetStringArgsStub
fakeReturns := fake.getStringArgsReturns
fake.recordInvocation("GetStringArgs", []interface{}{}) fake.recordInvocation("GetStringArgs", []interface{}{})
fake.getStringArgsMutex.Unlock() fake.getStringArgsMutex.Unlock()
if fake.GetStringArgsStub != nil { if stub != nil {
return fake.GetStringArgsStub() return stub()
} }
if specificReturn { if specificReturn {
return ret.result1 return ret.result1
} }
fakeReturns := fake.getStringArgsReturns
return fakeReturns.result1 return fakeReturns.result1
} }
@ -2159,15 +2198,16 @@ func (fake *ChaincodeStub) GetTransient() (map[string][]byte, error) {
ret, specificReturn := fake.getTransientReturnsOnCall[len(fake.getTransientArgsForCall)] ret, specificReturn := fake.getTransientReturnsOnCall[len(fake.getTransientArgsForCall)]
fake.getTransientArgsForCall = append(fake.getTransientArgsForCall, struct { fake.getTransientArgsForCall = append(fake.getTransientArgsForCall, struct {
}{}) }{})
stub := fake.GetTransientStub
fakeReturns := fake.getTransientReturns
fake.recordInvocation("GetTransient", []interface{}{}) fake.recordInvocation("GetTransient", []interface{}{})
fake.getTransientMutex.Unlock() fake.getTransientMutex.Unlock()
if fake.GetTransientStub != nil { if stub != nil {
return fake.GetTransientStub() return stub()
} }
if specificReturn { if specificReturn {
return ret.result1, ret.result2 return ret.result1, ret.result2
} }
fakeReturns := fake.getTransientReturns
return fakeReturns.result1, fakeReturns.result2 return fakeReturns.result1, fakeReturns.result2
} }
@ -2214,15 +2254,16 @@ func (fake *ChaincodeStub) GetTxID() string {
ret, specificReturn := fake.getTxIDReturnsOnCall[len(fake.getTxIDArgsForCall)] ret, specificReturn := fake.getTxIDReturnsOnCall[len(fake.getTxIDArgsForCall)]
fake.getTxIDArgsForCall = append(fake.getTxIDArgsForCall, struct { fake.getTxIDArgsForCall = append(fake.getTxIDArgsForCall, struct {
}{}) }{})
stub := fake.GetTxIDStub
fakeReturns := fake.getTxIDReturns
fake.recordInvocation("GetTxID", []interface{}{}) fake.recordInvocation("GetTxID", []interface{}{})
fake.getTxIDMutex.Unlock() fake.getTxIDMutex.Unlock()
if fake.GetTxIDStub != nil { if stub != nil {
return fake.GetTxIDStub() return stub()
} }
if specificReturn { if specificReturn {
return ret.result1 return ret.result1
} }
fakeReturns := fake.getTxIDReturns
return fakeReturns.result1 return fakeReturns.result1
} }
@ -2261,20 +2302,21 @@ func (fake *ChaincodeStub) GetTxIDReturnsOnCall(i int, result1 string) {
}{result1} }{result1}
} }
func (fake *ChaincodeStub) GetTxTimestamp() (*timestamp.Timestamp, error) { func (fake *ChaincodeStub) GetTxTimestamp() (*timestamppb.Timestamp, error) {
fake.getTxTimestampMutex.Lock() fake.getTxTimestampMutex.Lock()
ret, specificReturn := fake.getTxTimestampReturnsOnCall[len(fake.getTxTimestampArgsForCall)] ret, specificReturn := fake.getTxTimestampReturnsOnCall[len(fake.getTxTimestampArgsForCall)]
fake.getTxTimestampArgsForCall = append(fake.getTxTimestampArgsForCall, struct { fake.getTxTimestampArgsForCall = append(fake.getTxTimestampArgsForCall, struct {
}{}) }{})
stub := fake.GetTxTimestampStub
fakeReturns := fake.getTxTimestampReturns
fake.recordInvocation("GetTxTimestamp", []interface{}{}) fake.recordInvocation("GetTxTimestamp", []interface{}{})
fake.getTxTimestampMutex.Unlock() fake.getTxTimestampMutex.Unlock()
if fake.GetTxTimestampStub != nil { if stub != nil {
return fake.GetTxTimestampStub() return stub()
} }
if specificReturn { if specificReturn {
return ret.result1, ret.result2 return ret.result1, ret.result2
} }
fakeReturns := fake.getTxTimestampReturns
return fakeReturns.result1, fakeReturns.result2 return fakeReturns.result1, fakeReturns.result2
} }
@ -2284,39 +2326,39 @@ func (fake *ChaincodeStub) GetTxTimestampCallCount() int {
return len(fake.getTxTimestampArgsForCall) return len(fake.getTxTimestampArgsForCall)
} }
func (fake *ChaincodeStub) GetTxTimestampCalls(stub func() (*timestamp.Timestamp, error)) { func (fake *ChaincodeStub) GetTxTimestampCalls(stub func() (*timestamppb.Timestamp, error)) {
fake.getTxTimestampMutex.Lock() fake.getTxTimestampMutex.Lock()
defer fake.getTxTimestampMutex.Unlock() defer fake.getTxTimestampMutex.Unlock()
fake.GetTxTimestampStub = stub fake.GetTxTimestampStub = stub
} }
func (fake *ChaincodeStub) GetTxTimestampReturns(result1 *timestamp.Timestamp, result2 error) { func (fake *ChaincodeStub) GetTxTimestampReturns(result1 *timestamppb.Timestamp, result2 error) {
fake.getTxTimestampMutex.Lock() fake.getTxTimestampMutex.Lock()
defer fake.getTxTimestampMutex.Unlock() defer fake.getTxTimestampMutex.Unlock()
fake.GetTxTimestampStub = nil fake.GetTxTimestampStub = nil
fake.getTxTimestampReturns = struct { fake.getTxTimestampReturns = struct {
result1 *timestamp.Timestamp result1 *timestamppb.Timestamp
result2 error result2 error
}{result1, result2} }{result1, result2}
} }
func (fake *ChaincodeStub) GetTxTimestampReturnsOnCall(i int, result1 *timestamp.Timestamp, result2 error) { func (fake *ChaincodeStub) GetTxTimestampReturnsOnCall(i int, result1 *timestamppb.Timestamp, result2 error) {
fake.getTxTimestampMutex.Lock() fake.getTxTimestampMutex.Lock()
defer fake.getTxTimestampMutex.Unlock() defer fake.getTxTimestampMutex.Unlock()
fake.GetTxTimestampStub = nil fake.GetTxTimestampStub = nil
if fake.getTxTimestampReturnsOnCall == nil { if fake.getTxTimestampReturnsOnCall == nil {
fake.getTxTimestampReturnsOnCall = make(map[int]struct { fake.getTxTimestampReturnsOnCall = make(map[int]struct {
result1 *timestamp.Timestamp result1 *timestamppb.Timestamp
result2 error result2 error
}) })
} }
fake.getTxTimestampReturnsOnCall[i] = struct { fake.getTxTimestampReturnsOnCall[i] = struct {
result1 *timestamp.Timestamp result1 *timestamppb.Timestamp
result2 error result2 error
}{result1, result2} }{result1, result2}
} }
func (fake *ChaincodeStub) InvokeChaincode(arg1 string, arg2 [][]byte, arg3 string) peer.Response { func (fake *ChaincodeStub) InvokeChaincode(arg1 string, arg2 [][]byte, arg3 string) *peer.Response {
var arg2Copy [][]byte var arg2Copy [][]byte
if arg2 != nil { if arg2 != nil {
arg2Copy = make([][]byte, len(arg2)) arg2Copy = make([][]byte, len(arg2))
@ -2329,15 +2371,16 @@ func (fake *ChaincodeStub) InvokeChaincode(arg1 string, arg2 [][]byte, arg3 stri
arg2 [][]byte arg2 [][]byte
arg3 string arg3 string
}{arg1, arg2Copy, arg3}) }{arg1, arg2Copy, arg3})
stub := fake.InvokeChaincodeStub
fakeReturns := fake.invokeChaincodeReturns
fake.recordInvocation("InvokeChaincode", []interface{}{arg1, arg2Copy, arg3}) fake.recordInvocation("InvokeChaincode", []interface{}{arg1, arg2Copy, arg3})
fake.invokeChaincodeMutex.Unlock() fake.invokeChaincodeMutex.Unlock()
if fake.InvokeChaincodeStub != nil { if stub != nil {
return fake.InvokeChaincodeStub(arg1, arg2, arg3) return stub(arg1, arg2, arg3)
} }
if specificReturn { if specificReturn {
return ret.result1 return ret.result1
} }
fakeReturns := fake.invokeChaincodeReturns
return fakeReturns.result1 return fakeReturns.result1
} }
@ -2347,7 +2390,7 @@ func (fake *ChaincodeStub) InvokeChaincodeCallCount() int {
return len(fake.invokeChaincodeArgsForCall) return len(fake.invokeChaincodeArgsForCall)
} }
func (fake *ChaincodeStub) InvokeChaincodeCalls(stub func(string, [][]byte, string) peer.Response) { func (fake *ChaincodeStub) InvokeChaincodeCalls(stub func(string, [][]byte, string) *peer.Response) {
fake.invokeChaincodeMutex.Lock() fake.invokeChaincodeMutex.Lock()
defer fake.invokeChaincodeMutex.Unlock() defer fake.invokeChaincodeMutex.Unlock()
fake.InvokeChaincodeStub = stub fake.InvokeChaincodeStub = stub
@ -2360,26 +2403,88 @@ func (fake *ChaincodeStub) InvokeChaincodeArgsForCall(i int) (string, [][]byte,
return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3 return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
} }
func (fake *ChaincodeStub) InvokeChaincodeReturns(result1 peer.Response) { func (fake *ChaincodeStub) InvokeChaincodeReturns(result1 *peer.Response) {
fake.invokeChaincodeMutex.Lock() fake.invokeChaincodeMutex.Lock()
defer fake.invokeChaincodeMutex.Unlock() defer fake.invokeChaincodeMutex.Unlock()
fake.InvokeChaincodeStub = nil fake.InvokeChaincodeStub = nil
fake.invokeChaincodeReturns = struct { fake.invokeChaincodeReturns = struct {
result1 peer.Response result1 *peer.Response
}{result1} }{result1}
} }
func (fake *ChaincodeStub) InvokeChaincodeReturnsOnCall(i int, result1 peer.Response) { func (fake *ChaincodeStub) InvokeChaincodeReturnsOnCall(i int, result1 *peer.Response) {
fake.invokeChaincodeMutex.Lock() fake.invokeChaincodeMutex.Lock()
defer fake.invokeChaincodeMutex.Unlock() defer fake.invokeChaincodeMutex.Unlock()
fake.InvokeChaincodeStub = nil fake.InvokeChaincodeStub = nil
if fake.invokeChaincodeReturnsOnCall == nil { if fake.invokeChaincodeReturnsOnCall == nil {
fake.invokeChaincodeReturnsOnCall = make(map[int]struct { fake.invokeChaincodeReturnsOnCall = make(map[int]struct {
result1 peer.Response result1 *peer.Response
}) })
} }
fake.invokeChaincodeReturnsOnCall[i] = struct { fake.invokeChaincodeReturnsOnCall[i] = struct {
result1 peer.Response result1 *peer.Response
}{result1}
}
func (fake *ChaincodeStub) PurgePrivateData(arg1 string, arg2 string) error {
fake.purgePrivateDataMutex.Lock()
ret, specificReturn := fake.purgePrivateDataReturnsOnCall[len(fake.purgePrivateDataArgsForCall)]
fake.purgePrivateDataArgsForCall = append(fake.purgePrivateDataArgsForCall, struct {
arg1 string
arg2 string
}{arg1, arg2})
stub := fake.PurgePrivateDataStub
fakeReturns := fake.purgePrivateDataReturns
fake.recordInvocation("PurgePrivateData", []interface{}{arg1, arg2})
fake.purgePrivateDataMutex.Unlock()
if stub != nil {
return stub(arg1, arg2)
}
if specificReturn {
return ret.result1
}
return fakeReturns.result1
}
func (fake *ChaincodeStub) PurgePrivateDataCallCount() int {
fake.purgePrivateDataMutex.RLock()
defer fake.purgePrivateDataMutex.RUnlock()
return len(fake.purgePrivateDataArgsForCall)
}
func (fake *ChaincodeStub) PurgePrivateDataCalls(stub func(string, string) error) {
fake.purgePrivateDataMutex.Lock()
defer fake.purgePrivateDataMutex.Unlock()
fake.PurgePrivateDataStub = stub
}
func (fake *ChaincodeStub) PurgePrivateDataArgsForCall(i int) (string, string) {
fake.purgePrivateDataMutex.RLock()
defer fake.purgePrivateDataMutex.RUnlock()
argsForCall := fake.purgePrivateDataArgsForCall[i]
return argsForCall.arg1, argsForCall.arg2
}
func (fake *ChaincodeStub) PurgePrivateDataReturns(result1 error) {
fake.purgePrivateDataMutex.Lock()
defer fake.purgePrivateDataMutex.Unlock()
fake.PurgePrivateDataStub = nil
fake.purgePrivateDataReturns = struct {
result1 error
}{result1}
}
func (fake *ChaincodeStub) PurgePrivateDataReturnsOnCall(i int, result1 error) {
fake.purgePrivateDataMutex.Lock()
defer fake.purgePrivateDataMutex.Unlock()
fake.PurgePrivateDataStub = nil
if fake.purgePrivateDataReturnsOnCall == nil {
fake.purgePrivateDataReturnsOnCall = make(map[int]struct {
result1 error
})
}
fake.purgePrivateDataReturnsOnCall[i] = struct {
result1 error
}{result1} }{result1}
} }
@ -2396,15 +2501,16 @@ func (fake *ChaincodeStub) PutPrivateData(arg1 string, arg2 string, arg3 []byte)
arg2 string arg2 string
arg3 []byte arg3 []byte
}{arg1, arg2, arg3Copy}) }{arg1, arg2, arg3Copy})
stub := fake.PutPrivateDataStub
fakeReturns := fake.putPrivateDataReturns
fake.recordInvocation("PutPrivateData", []interface{}{arg1, arg2, arg3Copy}) fake.recordInvocation("PutPrivateData", []interface{}{arg1, arg2, arg3Copy})
fake.putPrivateDataMutex.Unlock() fake.putPrivateDataMutex.Unlock()
if fake.PutPrivateDataStub != nil { if stub != nil {
return fake.PutPrivateDataStub(arg1, arg2, arg3) return stub(arg1, arg2, arg3)
} }
if specificReturn { if specificReturn {
return ret.result1 return ret.result1
} }
fakeReturns := fake.putPrivateDataReturns
return fakeReturns.result1 return fakeReturns.result1
} }
@ -2462,15 +2568,16 @@ func (fake *ChaincodeStub) PutState(arg1 string, arg2 []byte) error {
arg1 string arg1 string
arg2 []byte arg2 []byte
}{arg1, arg2Copy}) }{arg1, arg2Copy})
stub := fake.PutStateStub
fakeReturns := fake.putStateReturns
fake.recordInvocation("PutState", []interface{}{arg1, arg2Copy}) fake.recordInvocation("PutState", []interface{}{arg1, arg2Copy})
fake.putStateMutex.Unlock() fake.putStateMutex.Unlock()
if fake.PutStateStub != nil { if stub != nil {
return fake.PutStateStub(arg1, arg2) return stub(arg1, arg2)
} }
if specificReturn { if specificReturn {
return ret.result1 return ret.result1
} }
fakeReturns := fake.putStateReturns
return fakeReturns.result1 return fakeReturns.result1
} }
@ -2528,15 +2635,16 @@ func (fake *ChaincodeStub) SetEvent(arg1 string, arg2 []byte) error {
arg1 string arg1 string
arg2 []byte arg2 []byte
}{arg1, arg2Copy}) }{arg1, arg2Copy})
stub := fake.SetEventStub
fakeReturns := fake.setEventReturns
fake.recordInvocation("SetEvent", []interface{}{arg1, arg2Copy}) fake.recordInvocation("SetEvent", []interface{}{arg1, arg2Copy})
fake.setEventMutex.Unlock() fake.setEventMutex.Unlock()
if fake.SetEventStub != nil { if stub != nil {
return fake.SetEventStub(arg1, arg2) return stub(arg1, arg2)
} }
if specificReturn { if specificReturn {
return ret.result1 return ret.result1
} }
fakeReturns := fake.setEventReturns
return fakeReturns.result1 return fakeReturns.result1
} }
@ -2595,15 +2703,16 @@ func (fake *ChaincodeStub) SetPrivateDataValidationParameter(arg1 string, arg2 s
arg2 string arg2 string
arg3 []byte arg3 []byte
}{arg1, arg2, arg3Copy}) }{arg1, arg2, arg3Copy})
stub := fake.SetPrivateDataValidationParameterStub
fakeReturns := fake.setPrivateDataValidationParameterReturns
fake.recordInvocation("SetPrivateDataValidationParameter", []interface{}{arg1, arg2, arg3Copy}) fake.recordInvocation("SetPrivateDataValidationParameter", []interface{}{arg1, arg2, arg3Copy})
fake.setPrivateDataValidationParameterMutex.Unlock() fake.setPrivateDataValidationParameterMutex.Unlock()
if fake.SetPrivateDataValidationParameterStub != nil { if stub != nil {
return fake.SetPrivateDataValidationParameterStub(arg1, arg2, arg3) return stub(arg1, arg2, arg3)
} }
if specificReturn { if specificReturn {
return ret.result1 return ret.result1
} }
fakeReturns := fake.setPrivateDataValidationParameterReturns
return fakeReturns.result1 return fakeReturns.result1
} }
@ -2661,15 +2770,16 @@ func (fake *ChaincodeStub) SetStateValidationParameter(arg1 string, arg2 []byte)
arg1 string arg1 string
arg2 []byte arg2 []byte
}{arg1, arg2Copy}) }{arg1, arg2Copy})
stub := fake.SetStateValidationParameterStub
fakeReturns := fake.setStateValidationParameterReturns
fake.recordInvocation("SetStateValidationParameter", []interface{}{arg1, arg2Copy}) fake.recordInvocation("SetStateValidationParameter", []interface{}{arg1, arg2Copy})
fake.setStateValidationParameterMutex.Unlock() fake.setStateValidationParameterMutex.Unlock()
if fake.SetStateValidationParameterStub != nil { if stub != nil {
return fake.SetStateValidationParameterStub(arg1, arg2) return stub(arg1, arg2)
} }
if specificReturn { if specificReturn {
return ret.result1 return ret.result1
} }
fakeReturns := fake.setStateValidationParameterReturns
return fakeReturns.result1 return fakeReturns.result1
} }
@ -2721,15 +2831,16 @@ func (fake *ChaincodeStub) SplitCompositeKey(arg1 string) (string, []string, err
fake.splitCompositeKeyArgsForCall = append(fake.splitCompositeKeyArgsForCall, struct { fake.splitCompositeKeyArgsForCall = append(fake.splitCompositeKeyArgsForCall, struct {
arg1 string arg1 string
}{arg1}) }{arg1})
stub := fake.SplitCompositeKeyStub
fakeReturns := fake.splitCompositeKeyReturns
fake.recordInvocation("SplitCompositeKey", []interface{}{arg1}) fake.recordInvocation("SplitCompositeKey", []interface{}{arg1})
fake.splitCompositeKeyMutex.Unlock() fake.splitCompositeKeyMutex.Unlock()
if fake.SplitCompositeKeyStub != nil { if stub != nil {
return fake.SplitCompositeKeyStub(arg1) return stub(arg1)
} }
if specificReturn { if specificReturn {
return ret.result1, ret.result2, ret.result3 return ret.result1, ret.result2, ret.result3
} }
fakeReturns := fake.splitCompositeKeyReturns
return fakeReturns.result1, fakeReturns.result2, fakeReturns.result3 return fakeReturns.result1, fakeReturns.result2, fakeReturns.result3
} }
@ -2846,6 +2957,8 @@ func (fake *ChaincodeStub) Invocations() map[string][][]interface{} {
defer fake.getTxTimestampMutex.RUnlock() defer fake.getTxTimestampMutex.RUnlock()
fake.invokeChaincodeMutex.RLock() fake.invokeChaincodeMutex.RLock()
defer fake.invokeChaincodeMutex.RUnlock() defer fake.invokeChaincodeMutex.RUnlock()
fake.purgePrivateDataMutex.RLock()
defer fake.purgePrivateDataMutex.RUnlock()
fake.putPrivateDataMutex.RLock() fake.putPrivateDataMutex.RLock()
defer fake.putPrivateDataMutex.RUnlock() defer fake.putPrivateDataMutex.RUnlock()
fake.putStateMutex.RLock() fake.putStateMutex.RLock()

View file

@ -4,7 +4,7 @@ package mocks
import ( import (
"sync" "sync"
"github.com/hyperledger/fabric-protos-go/ledger/queryresult" "github.com/hyperledger/fabric-protos-go-apiv2/ledger/queryresult"
) )
type StateQueryIterator struct { type StateQueryIterator struct {
@ -49,15 +49,16 @@ func (fake *StateQueryIterator) Close() error {
ret, specificReturn := fake.closeReturnsOnCall[len(fake.closeArgsForCall)] ret, specificReturn := fake.closeReturnsOnCall[len(fake.closeArgsForCall)]
fake.closeArgsForCall = append(fake.closeArgsForCall, struct { fake.closeArgsForCall = append(fake.closeArgsForCall, struct {
}{}) }{})
stub := fake.CloseStub
fakeReturns := fake.closeReturns
fake.recordInvocation("Close", []interface{}{}) fake.recordInvocation("Close", []interface{}{})
fake.closeMutex.Unlock() fake.closeMutex.Unlock()
if fake.CloseStub != nil { if stub != nil {
return fake.CloseStub() return stub()
} }
if specificReturn { if specificReturn {
return ret.result1 return ret.result1
} }
fakeReturns := fake.closeReturns
return fakeReturns.result1 return fakeReturns.result1
} }
@ -101,15 +102,16 @@ func (fake *StateQueryIterator) HasNext() bool {
ret, specificReturn := fake.hasNextReturnsOnCall[len(fake.hasNextArgsForCall)] ret, specificReturn := fake.hasNextReturnsOnCall[len(fake.hasNextArgsForCall)]
fake.hasNextArgsForCall = append(fake.hasNextArgsForCall, struct { fake.hasNextArgsForCall = append(fake.hasNextArgsForCall, struct {
}{}) }{})
stub := fake.HasNextStub
fakeReturns := fake.hasNextReturns
fake.recordInvocation("HasNext", []interface{}{}) fake.recordInvocation("HasNext", []interface{}{})
fake.hasNextMutex.Unlock() fake.hasNextMutex.Unlock()
if fake.HasNextStub != nil { if stub != nil {
return fake.HasNextStub() return stub()
} }
if specificReturn { if specificReturn {
return ret.result1 return ret.result1
} }
fakeReturns := fake.hasNextReturns
return fakeReturns.result1 return fakeReturns.result1
} }
@ -153,15 +155,16 @@ func (fake *StateQueryIterator) Next() (*queryresult.KV, error) {
ret, specificReturn := fake.nextReturnsOnCall[len(fake.nextArgsForCall)] ret, specificReturn := fake.nextReturnsOnCall[len(fake.nextArgsForCall)]
fake.nextArgsForCall = append(fake.nextArgsForCall, struct { fake.nextArgsForCall = append(fake.nextArgsForCall, struct {
}{}) }{})
stub := fake.NextStub
fakeReturns := fake.nextReturns
fake.recordInvocation("Next", []interface{}{}) fake.recordInvocation("Next", []interface{}{})
fake.nextMutex.Unlock() fake.nextMutex.Unlock()
if fake.NextStub != nil { if stub != nil {
return fake.NextStub() return stub()
} }
if specificReturn { if specificReturn {
return ret.result1, ret.result2 return ret.result1, ret.result2
} }
fakeReturns := fake.nextReturns
return fakeReturns.result1, fakeReturns.result2 return fakeReturns.result1, fakeReturns.result2
} }

View file

@ -4,8 +4,8 @@ package mocks
import ( import (
"sync" "sync"
"github.com/hyperledger/fabric-chaincode-go/pkg/cid" "github.com/hyperledger/fabric-chaincode-go/v2/pkg/cid"
"github.com/hyperledger/fabric-chaincode-go/shim" "github.com/hyperledger/fabric-chaincode-go/v2/shim"
) )
type TransactionContext struct { type TransactionContext struct {
@ -38,15 +38,16 @@ func (fake *TransactionContext) GetClientIdentity() cid.ClientIdentity {
ret, specificReturn := fake.getClientIdentityReturnsOnCall[len(fake.getClientIdentityArgsForCall)] ret, specificReturn := fake.getClientIdentityReturnsOnCall[len(fake.getClientIdentityArgsForCall)]
fake.getClientIdentityArgsForCall = append(fake.getClientIdentityArgsForCall, struct { fake.getClientIdentityArgsForCall = append(fake.getClientIdentityArgsForCall, struct {
}{}) }{})
stub := fake.GetClientIdentityStub
fakeReturns := fake.getClientIdentityReturns
fake.recordInvocation("GetClientIdentity", []interface{}{}) fake.recordInvocation("GetClientIdentity", []interface{}{})
fake.getClientIdentityMutex.Unlock() fake.getClientIdentityMutex.Unlock()
if fake.GetClientIdentityStub != nil { if stub != nil {
return fake.GetClientIdentityStub() return stub()
} }
if specificReturn { if specificReturn {
return ret.result1 return ret.result1
} }
fakeReturns := fake.getClientIdentityReturns
return fakeReturns.result1 return fakeReturns.result1
} }
@ -90,15 +91,16 @@ func (fake *TransactionContext) GetStub() shim.ChaincodeStubInterface {
ret, specificReturn := fake.getStubReturnsOnCall[len(fake.getStubArgsForCall)] ret, specificReturn := fake.getStubReturnsOnCall[len(fake.getStubArgsForCall)]
fake.getStubArgsForCall = append(fake.getStubArgsForCall, struct { fake.getStubArgsForCall = append(fake.getStubArgsForCall, struct {
}{}) }{})
stub := fake.GetStubStub
fakeReturns := fake.getStubReturns
fake.recordInvocation("GetStub", []interface{}{}) fake.recordInvocation("GetStub", []interface{}{})
fake.getStubMutex.Unlock() fake.getStubMutex.Unlock()
if fake.GetStubStub != nil { if stub != nil {
return fake.GetStubStub() return stub()
} }
if specificReturn { if specificReturn {
return ret.result1 return ret.result1
} }
fakeReturns := fake.getStubReturns
return fakeReturns.result1 return fakeReturns.result1
} }

View file

@ -4,7 +4,7 @@ import (
"encoding/json" "encoding/json"
"fmt" "fmt"
"github.com/hyperledger/fabric-contract-api-go/contractapi" "github.com/hyperledger/fabric-contract-api-go/v2/contractapi"
) )
// SmartContract provides functions for managing an Asset // SmartContract provides functions for managing an Asset
@ -13,12 +13,14 @@ type SmartContract struct {
} }
// Asset describes basic details of what makes up a simple asset // Asset describes basic details of what makes up a simple asset
// Insert struct field in alphabetic order => to achieve determinism across languages
// golang keeps the order when marshal to json but doesn't order automatically
type Asset struct { type Asset struct {
AppraisedValue int `json:"AppraisedValue"`
Color string `json:"Color"`
ID string `json:"ID"` ID string `json:"ID"`
Color string `json:"color"` Owner string `json:"Owner"`
Size int `json:"size"` Size int `json:"Size"`
Owner string `json:"owner"`
AppraisedValue int `json:"appraisedValue"`
} }
// InitLedger adds a base set of assets to the ledger // InitLedger adds a base set of assets to the ledger
@ -140,20 +142,27 @@ func (s *SmartContract) AssetExists(ctx contractapi.TransactionContextInterface,
return assetJSON != nil, nil return assetJSON != nil, nil
} }
// TransferAsset updates the owner field of asset with given id in world state. // TransferAsset updates the owner field of asset with given id in world state, and returns the old owner.
func (s *SmartContract) TransferAsset(ctx contractapi.TransactionContextInterface, id string, newOwner string) error { func (s *SmartContract) TransferAsset(ctx contractapi.TransactionContextInterface, id string, newOwner string) (string, error) {
asset, err := s.ReadAsset(ctx, id) asset, err := s.ReadAsset(ctx, id)
if err != nil { if err != nil {
return err return "", err
} }
oldOwner := asset.Owner
asset.Owner = newOwner asset.Owner = newOwner
assetJSON, err := json.Marshal(asset) assetJSON, err := json.Marshal(asset)
if err != nil { if err != nil {
return err return "", err
} }
return ctx.GetStub().PutState(id, assetJSON) err = ctx.GetStub().PutState(id, assetJSON)
if err != nil {
return "", err
}
return oldOwner, nil
} }
// GetAllAssets returns all assets found in world state // GetAllAssets returns all assets found in world state

View file

@ -5,9 +5,9 @@ import (
"fmt" "fmt"
"testing" "testing"
"github.com/hyperledger/fabric-chaincode-go/shim" "github.com/hyperledger/fabric-chaincode-go/v2/shim"
"github.com/hyperledger/fabric-contract-api-go/contractapi" "github.com/hyperledger/fabric-contract-api-go/v2/contractapi"
"github.com/hyperledger/fabric-protos-go/ledger/queryresult" "github.com/hyperledger/fabric-protos-go-apiv2/ledger/queryresult"
"github.com/hyperledger/fabric-samples/asset-transfer-basic/chaincode-go/chaincode" "github.com/hyperledger/fabric-samples/asset-transfer-basic/chaincode-go/chaincode"
"github.com/hyperledger/fabric-samples/asset-transfer-basic/chaincode-go/chaincode/mocks" "github.com/hyperledger/fabric-samples/asset-transfer-basic/chaincode-go/chaincode/mocks"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
@ -143,11 +143,11 @@ func TestTransferAsset(t *testing.T) {
chaincodeStub.GetStateReturns(bytes, nil) chaincodeStub.GetStateReturns(bytes, nil)
assetTransfer := chaincode.SmartContract{} assetTransfer := chaincode.SmartContract{}
err = assetTransfer.TransferAsset(transactionContext, "", "") _, err = assetTransfer.TransferAsset(transactionContext, "", "")
require.NoError(t, err) require.NoError(t, err)
chaincodeStub.GetStateReturns(nil, fmt.Errorf("unable to retrieve asset")) chaincodeStub.GetStateReturns(nil, fmt.Errorf("unable to retrieve asset"))
err = assetTransfer.TransferAsset(transactionContext, "", "") _, err = assetTransfer.TransferAsset(transactionContext, "", "")
require.EqualError(t, err, "failed to read from world state: unable to retrieve asset") require.EqualError(t, err, "failed to read from world state: unable to retrieve asset")
} }

View file

@ -1,11 +1,31 @@
module github.com/hyperledger/fabric-samples/asset-transfer-basic/chaincode-go module github.com/hyperledger/fabric-samples/asset-transfer-basic/chaincode-go
go 1.14 go 1.23.0
require ( require (
github.com/golang/protobuf v1.3.2 github.com/hyperledger/fabric-chaincode-go/v2 v2.0.0
github.com/hyperledger/fabric-chaincode-go v0.0.0-20200424173110-d7076418f212 github.com/hyperledger/fabric-contract-api-go/v2 v2.2.0
github.com/hyperledger/fabric-contract-api-go v1.1.0 github.com/hyperledger/fabric-protos-go-apiv2 v0.3.4
github.com/hyperledger/fabric-protos-go v0.0.0-20200424173316-dd554ba3746e github.com/stretchr/testify v1.10.0
github.com/stretchr/testify v1.5.1 google.golang.org/protobuf v1.36.4
)
require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/go-openapi/jsonpointer v0.21.0 // indirect
github.com/go-openapi/jsonreference v0.21.0 // indirect
github.com/go-openapi/spec v0.21.0 // indirect
github.com/go-openapi/swag v0.23.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
github.com/xeipuuv/gojsonschema v1.2.0 // indirect
golang.org/x/net v0.38.0 // indirect
golang.org/x/sys v0.31.0 // indirect
golang.org/x/text v0.23.0 // indirect
google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // indirect
google.golang.org/grpc v1.71.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
) )

View file

@ -1,146 +1,81 @@
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/DATA-DOG/go-txdb v0.1.3/go.mod h1:DhAhxMXZpUJVGnT+p9IbzJoRKvlArO2pkHjnGX7o0n0=
github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI=
github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M=
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=
github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk=
github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE=
github.com/cucumber/godog v0.8.0/go.mod h1:Cp3tEV1LRAyH/RuCThcxHS/+9ORZ+FMzPva2AZ5Ki+A=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-openapi/jsonpointer v0.19.3 h1:gihV7YNZK1iK6Tgwwsxo2rJbD1GTbdm72325Bq8FI3w= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
github.com/go-openapi/jsonreference v0.19.2 h1:o20suLFB4Ri0tuzpWtyHlh7E7HnkqTNLq6aR6WVNS1w= github.com/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1rr/O9oNQ=
github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= github.com/go-openapi/jsonpointer v0.21.0/go.mod h1:IUyH9l/+uyhIYQ/PXVA41Rexl+kOkAPDdXEYns6fzUY=
github.com/go-openapi/spec v0.19.4 h1:ixzUSnHTd6hCemgtAJgluaTSGYpLNpJY4mA2DIkdOAo= github.com/go-openapi/jsonreference v0.21.0 h1:Rs+Y7hSXT83Jacb7kFyjn4ijOuVGSvOdF2+tg1TRrwQ=
github.com/go-openapi/spec v0.19.4/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo= github.com/go-openapi/jsonreference v0.21.0/go.mod h1:LmZmgsrTkVg9LG4EaHeY8cBDslNPMo06cago5JNLkm4=
github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/spec v0.21.0 h1:LTVzPc3p/RzRnkQqLRndbAzjY0d0BCL72A6j3CdL9ZY=
github.com/go-openapi/swag v0.19.5 h1:lTz6Ys4CmqqCQmZPBlbQENR1/GucA2bzYTE12Pw4tFY= github.com/go-openapi/spec v0.21.0/go.mod h1:78u6VdPw81XU44qEWGhtr982gJ5BWg2c0I5XwVMotYk=
github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+GrE=
github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ=
github.com/gobuffalo/envy v1.7.0 h1:GlXgaiBkmrYMHco6t4j7SacKO4XUjvh5pwXh0f4uxXU= github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
github.com/gobuffalo/envy v1.7.0/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
github.com/gobuffalo/logger v1.0.0/go.mod h1:2zbswyIUa45I+c+FLXuWl9zSWEiVuthsk8ze5s8JvPs= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/gobuffalo/packd v0.3.0 h1:eMwymTkA1uXsqxS0Tpoop3Lc0u3kTfiMBE6nKtQU4g4= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/gobuffalo/packd v0.3.0/go.mod h1:zC7QkmNkYVGKPw4tHpBQ+ml7W/3tIebgeo1b36chA3Q= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/gobuffalo/packr v1.30.1 h1:hu1fuVR3fXEZR7rXNW3h8rqSML8EVAf6KNm0NKO/wKg= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/gobuffalo/packr v1.30.1/go.mod h1:ljMyFO2EcrnzsHsN99cvbq055Y9OhRrIaviy289eRuk= github.com/hyperledger/fabric-chaincode-go/v2 v2.0.0 h1:IhkHfrl5X/fVnmB6pWeCYCdIJRi9bxj+WTnVN8DtW3c=
github.com/gobuffalo/packr/v2 v2.5.1/go.mod h1:8f9c96ITobJlPzI44jj+4tHnEKNt0xXWSVlXRN9X1Iw= github.com/hyperledger/fabric-chaincode-go/v2 v2.0.0/go.mod h1:PHHaFffjw7p7n9bmCfcm7RqDqYdivNEsJdiNIKZo5Lk=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= github.com/hyperledger/fabric-contract-api-go/v2 v2.2.0 h1:rmUoBmciB0GL/miqcbJmJbgp5QTWoJUrZo+CNxrNLF4=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/hyperledger/fabric-contract-api-go/v2 v2.2.0/go.mod h1:FeWeO/jwGjiME7ak3GufqKIcwkejtzrDG4QxbfKydWs=
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/hyperledger/fabric-protos-go-apiv2 v0.3.4 h1:YJrd+gMaeY0/vsN0aS0QkEKTivGoUnSRIXxGJ7KI+Pc=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/hyperledger/fabric-protos-go-apiv2 v0.3.4/go.mod h1:bau/6AJhvEcu9GKKYHlDXAxXKzYNfhP6xu2GXuxEcFk=
github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/hyperledger/fabric-chaincode-go v0.0.0-20200424173110-d7076418f212 h1:1i4lnpV8BDgKOLi1hgElfBqdHXjXieSuj8629mwBZ8o= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/hyperledger/fabric-chaincode-go v0.0.0-20200424173110-d7076418f212/go.mod h1:N7H3sA7Tx4k/YzFq7U0EPdqJtqvM4Kild0JoCc7C0Dc= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/hyperledger/fabric-contract-api-go v1.1.0 h1:K9uucl/6eX3NF0/b+CGIiO1IPm1VYQxBkpnVGJur2S4= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=
github.com/hyperledger/fabric-contract-api-go v1.1.0/go.mod h1:nHWt0B45fK53owcFpLtAe8DH0Q5P068mnzkNXMPSL7E= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
github.com/hyperledger/fabric-protos-go v0.0.0-20190919234611-2a87503ac7c9/go.mod h1:xVYTjK4DtZRBxZ2D9aE4y6AbLaPwue2o/criQyQbVD0=
github.com/hyperledger/fabric-protos-go v0.0.0-20200424173316-dd554ba3746e h1:9PS5iezHk/j7XriSlNuSQILyCOfcZ9wZ3/PiucmSE8E=
github.com/hyperledger/fabric-protos-go v0.0.0-20200424173316-dd554ba3746e/go.mod h1:xVYTjK4DtZRBxZ2D9aE4y6AbLaPwue2o/criQyQbVD0=
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc=
github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg=
github.com/karrick/godirwalk v1.10.12/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs=
github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA=
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e h1:hB2xlXdHp/pmPZq0y3QnmWAArdw9PqbmotexnWx/FU8=
github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8=
github.com/rogpeppe/go-internal v1.3.0 h1:RR9dF3JtopPvtkroDZuVD7qquD0bnHlKSqaQhgwt8yk= github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g=
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ=
github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU=
github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo=
github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY=
github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4= github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0=
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f h1:J9EGpcZtP0E/raorCMxlFGSTBrsSlaDGf3jU/qvAE2c=
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb h1:zGWFAtiMcyryUHoUjUJX0/lt1H2+i2Ka2n+D3DImSNo=
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHovont7NscjpAxXsDA8S8BMYve8Y5+7cuRE7R0= github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHovont7NscjpAxXsDA8S8BMYve8Y5+7cuRE7R0=
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ=
github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74= github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74=
github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y=
github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA=
golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= go.opentelemetry.io/otel v1.34.0 h1:zRLXxLCgL1WyKsPVrgbSdMN4c0FMkDAskSTQP+0hdUY=
golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= go.opentelemetry.io/otel v1.34.0/go.mod h1:OWFPOQ+h4G8xpyjgqo4SxJYdDQ/qmRH+wivy7zzx9oI=
golang.org/x/crypto v0.0.0-20190621222207-cc06ce4a13d4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= go.opentelemetry.io/otel/metric v1.34.0 h1:+eTR3U0MyfWjRDhmFMxe2SsW64QrZ84AOhvqS7Y+PoQ=
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= go.opentelemetry.io/otel/metric v1.34.0/go.mod h1:CEDrp0fy2D0MvkXE+dPV7cMi8tWZwX3dmaIhwPOaqHE=
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= go.opentelemetry.io/otel/sdk v1.34.0 h1:95zS4k/2GOy069d321O8jWgYsW3MzVV+KuSPKp7Wr1A=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= go.opentelemetry.io/otel/sdk v1.34.0/go.mod h1:0e/pNiaMAqaykJGKbi+tSjWfNNHMTxoC9qANsCzbyxU=
golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= go.opentelemetry.io/otel/sdk/metric v1.34.0 h1:5CeK9ujjbFVL5c1PhLuStg1wxA7vQv7ce1EK0Gyvahk=
golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= go.opentelemetry.io/otel/sdk/metric v1.34.0/go.mod h1:jQ/r8Ze28zRKoNRdkjCZxfs6YvBTG1+YIqyFVFYec5w=
golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297 h1:k7pJ2yAPLPgbskkFdhRCsA77k2fySZ1zf2zCjvQCiIM= go.opentelemetry.io/otel/trace v1.34.0 h1:+ouXS2V8Rd4hp4580a8q23bg0azF2nI8cqLYnC8mh/k=
golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= go.opentelemetry.io/otel/trace v1.34.0/go.mod h1:Svm7lSjQD7kG7KJ/MUHPVXSDGz2OX4h0M2jHBhmSfRE=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/net v0.38.0 h1:vRMAPTMaeGqVhG5QyLJHqNDwecKTomGeqbnfZyKlBI8=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/net v0.38.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8=
golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.23.0 h1:D71I7dUrlY+VX0gQShAThNGHFxZ13dGLBHQLVl1mJlY=
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4=
golang.org/x/sys v0.0.0-20190515120540-06a5c4944438/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 h1:KpwkzHKEF7B9Zxg18WzOa7djJ+Ha5DzthMyZYQfEn2A=
golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1/go.mod h1:nKE/iIaLqn2bQwXBg8f1g2Ylh6r5MN5CmZvuzZCgsCU=
golang.org/x/sys v0.0.0-20190710143415-6ec70d6a5542 h1:6ZQFf1D2YYDDI7eSwW8adlkkavTB9sw5I24FVtEvNUQ= google.golang.org/grpc v1.71.0 h1:kF77BGdPTQ4/JZWMlb9VpJ5pa25aqvVqogsxNHHdeBg=
golang.org/x/sys v0.0.0-20190710143415-6ec70d6a5542/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= google.golang.org/grpc v1.71.0/go.mod h1:H0GRtasmQOh9LkFoCPDu3ZrwUtD1YGE+b2vYBYd/8Ec=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= google.golang.org/protobuf v1.36.4 h1:6A3ZDJHn/eNqc1i+IdefRzy/9PokBTPvcqMySR7NNIM=
golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= google.golang.org/protobuf v1.36.4/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20190624180213-70d37148ca0c/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
google.golang.org/genproto v0.0.0-20180831171423-11092d34479b h1:lohp5blsw53GBXtLyLNaTXPXS9pJ1tiTw61ZHUoE9Qw=
google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
google.golang.org/grpc v1.23.0 h1:AzbTB6ux+okLTzP8Ru1Xs41C303zdcfEht7MQnYJt5A=
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10=
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=

View file

@ -0,0 +1,2 @@
.idea/
.gradle/

View file

@ -0,0 +1,31 @@
# the first stage
FROM gradle:9-jdk25 AS gradle_build
# copy the build.gradle and src code to the container
COPY src/ src/
COPY build.gradle ./
# Build and package our code
RUN gradle --no-daemon build shadowJar -x checkstyleMain -x checkstyleTest
# the second stage of our build just needs the compiled files
FROM eclipse-temurin:25-jre
ARG CC_SERVER_PORT=9999
# Setup tini to work better handle signals
ENV TINI_VERSION=v0.19.0
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
RUN chmod +x /tini
RUN addgroup --system javauser && useradd -g javauser javauser
# copy only the artifacts we need from the first stage and discard the rest
COPY --chown=javauser:javauser --from=gradle_build /home/gradle/build/libs/chaincode.jar /chaincode.jar
COPY --chown=javauser:javauser docker/docker-entrypoint.sh /docker-entrypoint.sh
ENV PORT=$CC_SERVER_PORT
EXPOSE $CC_SERVER_PORT
USER javauser
ENTRYPOINT [ "/tini", "--", "/docker-entrypoint.sh" ]

View file

@ -0,0 +1,10 @@
## Basic Asset Transfer
This sample implements the basic asset transfer scenario, illustrating the use of the Java Contract SDKs to provide a
smart contract as a service.
To run this chaincode contract locally on a development network, see:
- [Debugging chaincode as a service](../../test-network-k8s/docs/CHAINCODE_AS_A_SERVICE.md) (Kube test network)
- [End-to-end with the test-network](../../test-network/CHAINCODE_AS_A_SERVICE_TUTORIAL.md#end-to-end-with-the-the-test-network) (Docker compose)

View file

@ -3,6 +3,7 @@
*/ */
plugins { plugins {
id 'com.gradleup.shadow' version '9.2.2'
id 'application' id 'application'
id 'checkstyle' id 'checkstyle'
id 'jacoco' id 'jacoco'
@ -12,25 +13,27 @@ group 'org.hyperledger.fabric.samples'
version '1.0-SNAPSHOT' version '1.0-SNAPSHOT'
dependencies { dependencies {
implementation 'org.hyperledger.fabric-chaincode-java:fabric-chaincode-shim:2.5.+'
compileOnly 'org.hyperledger.fabric-chaincode-java:fabric-chaincode-shim:2.+' implementation 'org.json:json:+'
implementation 'com.owlike:genson:1.5' implementation 'com.owlike:genson:1.6'
testImplementation 'org.hyperledger.fabric-chaincode-java:fabric-chaincode-shim:2.+' testImplementation platform('org.junit:junit-bom:5.14.0')
testImplementation 'org.junit.jupiter:junit-jupiter:5.4.2' testImplementation 'org.junit.jupiter:junit-jupiter'
testImplementation 'org.assertj:assertj-core:3.11.1' testImplementation 'org.assertj:assertj-core:3.27.6'
testImplementation 'org.mockito:mockito-core:2.+' testImplementation 'org.mockito:mockito-core:5.20.0'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
} }
repositories { repositories {
maven { mavenCentral()
url "https://hyperledger.jfrog.io/hyperledger/fabric-maven"
}
jcenter()
maven { maven {
url 'https://jitpack.io' url 'https://jitpack.io'
} }
} }
compileJava {
options.release = 11
}
application { application {
mainClass = 'org.hyperledger.fabric.contract.ContractRouter' mainClass = 'org.hyperledger.fabric.contract.ContractRouter'
} }
@ -71,5 +74,18 @@ test {
} }
} }
shadowJar {
archiveBaseName = 'chaincode'
archiveVersion = ''
archiveClassifier = ''
duplicatesStrategy = DuplicatesStrategy.INCLUDE
mergeServiceFiles()
manifest {
attributes 'Main-Class': 'org.hyperledger.fabric.contract.ContractRouter'
}
}
check.dependsOn jacocoTestCoverageVerification check.dependsOn jacocoTestCoverageVerification
installDist.dependsOn check installDist.dependsOn check

Some files were not shown because too many files have changed in this diff Show more