From 6c8b5c722dc01004d251552b7e037c458030a90c Mon Sep 17 00:00:00 2001 From: "Mark S. Lewis" Date: Fri, 7 Jun 2024 17:52:09 +0100 Subject: [PATCH] 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 --- .github/workflows/test-network-gateway.yaml | 39 -- .github/workflows/test-network-hsm.yaml | 7 +- .../application-go/.gitignore | 4 - .../application-go/assetTransfer.go | 169 ------ asset-transfer-basic/application-go/go.mod | 49 -- asset-transfer-basic/application-go/go.sum | 234 -------- .../application-java/.gitattributes | 6 - .../application-java/build.gradle | 42 -- .../gradle/wrapper/gradle-wrapper.jar | Bin 63721 -> 0 bytes .../gradle/wrapper/gradle-wrapper.properties | 7 - asset-transfer-basic/application-java/gradlew | 249 -------- .../application-java/gradlew.bat | 92 --- .../application-java/settings.gradle | 10 - .../src/main/java/application/java/App.java | 120 ---- .../java/application/java/EnrollAdmin.java | 59 -- .../java/application/java/RegisterUser.java | 107 ---- .../src/main/resources/log4j.properties | 19 - .../application-javascript/.eslintignore | 5 - .../application-javascript/.eslintrc.js | 36 -- .../application-javascript/.gitignore | 14 - .../application-javascript/app.js | 183 ------ .../application-javascript/package.json | 23 - .../application-typescript-hsm/.gitignore | 15 - .../application-typescript-hsm/README.md | 263 --------- .../application-typescript-hsm/package.json | 51 -- .../application-typescript-hsm/softhsm2.conf | 5 - .../application-typescript-hsm/src/app.ts | 286 --------- .../src/utils/AppUtil.ts | 56 -- .../src/utils/CAUtil.ts | 94 --- .../application-typescript-hsm/tsconfig.json | 18 - .../application-typescript-hsm/tslint.json | 24 - .../application-typescript/.gitignore | 15 - .../application-typescript/package.json | 51 -- .../application-typescript/src/app.ts | 172 ------ .../src/utils/AppUtil.ts | 76 --- .../src/utils/CAUtil.ts | 104 ---- .../application-typescript/tsconfig.json | 15 - .../application-typescript/tslint.json | 23 - .../chaincode-external/README.md | 8 +- .../application-javascript/.eslintignore | 5 - .../application-javascript/.eslintrc.js | 37 -- .../application-javascript/.gitignore | 14 - .../application-javascript/app.js | 545 ------------------ .../application-javascript/package.json | 22 - asset-transfer-private-data/README.md | 6 - .../application-javascript/.eslintignore | 5 - .../application-javascript/.eslintrc.js | 37 -- .../application-javascript/.gitignore | 16 - .../application-javascript/app.js | 358 ------------ .../application-javascript/package.json | 45 -- asset-transfer-secured-agreement/README.md | 4 - .../application-javascript/.eslintignore | 5 - .../application-javascript/.eslintrc.js | 37 -- .../application-javascript/.gitignore | 14 - .../application-javascript/app.js | 544 ----------------- .../application-javascript/package.json | 22 - ci/scripts/run-test-network-basic.sh | 44 +- ci/scripts/run-test-network-events.sh | 19 +- ci/scripts/run-test-network-gateway.sh | 76 --- ci/scripts/run-test-network-hsm.sh | 23 +- ci/scripts/run-test-network-private.sh | 17 +- ci/scripts/run-test-network-secured.sh | 18 +- hardware-security-module/README.md | 2 +- .../application-typescript/package.json | 2 +- .../scripts/generate-hsm-user.sh | 69 ++- .../.eslintrc.yaml | 10 - .../legacy-application-javascript/.gitignore | 5 - .../legacy-application-javascript/README.md | 328 ----------- .../addAssets.js | 118 ---- .../blockEventListener.js | 179 ------ .../blockProcessing.js | 217 ------- .../legacy-application-javascript/config.json | 7 - .../couchdbutil.js | 111 ---- .../deleteAsset.js | 69 --- .../enrollAdmin.js | 55 -- .../network-clean.sh | 20 - .../package.json | 45 -- .../registerUser.js | 75 --- .../startFabric.sh | 36 -- .../transferAsset.js | 69 --- 80 files changed, 83 insertions(+), 5997 deletions(-) delete mode 100644 .github/workflows/test-network-gateway.yaml delete mode 100755 asset-transfer-basic/application-go/.gitignore delete mode 100644 asset-transfer-basic/application-go/assetTransfer.go delete mode 100644 asset-transfer-basic/application-go/go.mod delete mode 100644 asset-transfer-basic/application-go/go.sum delete mode 100644 asset-transfer-basic/application-java/.gitattributes delete mode 100644 asset-transfer-basic/application-java/build.gradle delete mode 100644 asset-transfer-basic/application-java/gradle/wrapper/gradle-wrapper.jar delete mode 100644 asset-transfer-basic/application-java/gradle/wrapper/gradle-wrapper.properties delete mode 100755 asset-transfer-basic/application-java/gradlew delete mode 100644 asset-transfer-basic/application-java/gradlew.bat delete mode 100644 asset-transfer-basic/application-java/settings.gradle delete mode 100644 asset-transfer-basic/application-java/src/main/java/application/java/App.java delete mode 100644 asset-transfer-basic/application-java/src/main/java/application/java/EnrollAdmin.java delete mode 100644 asset-transfer-basic/application-java/src/main/java/application/java/RegisterUser.java delete mode 100644 asset-transfer-basic/application-java/src/main/resources/log4j.properties delete mode 100644 asset-transfer-basic/application-javascript/.eslintignore delete mode 100644 asset-transfer-basic/application-javascript/.eslintrc.js delete mode 100644 asset-transfer-basic/application-javascript/.gitignore delete mode 100644 asset-transfer-basic/application-javascript/app.js delete mode 100644 asset-transfer-basic/application-javascript/package.json delete mode 100644 asset-transfer-basic/application-typescript-hsm/.gitignore delete mode 100644 asset-transfer-basic/application-typescript-hsm/README.md delete mode 100644 asset-transfer-basic/application-typescript-hsm/package.json delete mode 100644 asset-transfer-basic/application-typescript-hsm/softhsm2.conf delete mode 100644 asset-transfer-basic/application-typescript-hsm/src/app.ts delete mode 100644 asset-transfer-basic/application-typescript-hsm/src/utils/AppUtil.ts delete mode 100644 asset-transfer-basic/application-typescript-hsm/src/utils/CAUtil.ts delete mode 100644 asset-transfer-basic/application-typescript-hsm/tsconfig.json delete mode 100644 asset-transfer-basic/application-typescript-hsm/tslint.json delete mode 100644 asset-transfer-basic/application-typescript/.gitignore delete mode 100644 asset-transfer-basic/application-typescript/package.json delete mode 100644 asset-transfer-basic/application-typescript/src/app.ts delete mode 100644 asset-transfer-basic/application-typescript/src/utils/AppUtil.ts delete mode 100644 asset-transfer-basic/application-typescript/src/utils/CAUtil.ts delete mode 100644 asset-transfer-basic/application-typescript/tsconfig.json delete mode 100644 asset-transfer-basic/application-typescript/tslint.json delete mode 100644 asset-transfer-events/application-javascript/.eslintignore delete mode 100644 asset-transfer-events/application-javascript/.eslintrc.js delete mode 100644 asset-transfer-events/application-javascript/.gitignore delete mode 100644 asset-transfer-events/application-javascript/app.js delete mode 100644 asset-transfer-events/application-javascript/package.json delete mode 100644 asset-transfer-private-data/application-javascript/.eslintignore delete mode 100644 asset-transfer-private-data/application-javascript/.eslintrc.js delete mode 100644 asset-transfer-private-data/application-javascript/.gitignore delete mode 100644 asset-transfer-private-data/application-javascript/app.js delete mode 100644 asset-transfer-private-data/application-javascript/package.json delete mode 100644 asset-transfer-secured-agreement/application-javascript/.eslintignore delete mode 100644 asset-transfer-secured-agreement/application-javascript/.eslintrc.js delete mode 100644 asset-transfer-secured-agreement/application-javascript/.gitignore delete mode 100644 asset-transfer-secured-agreement/application-javascript/app.js delete mode 100644 asset-transfer-secured-agreement/application-javascript/package.json delete mode 100755 ci/scripts/run-test-network-gateway.sh delete mode 100644 off_chain_data/legacy-application-javascript/.eslintrc.yaml delete mode 100644 off_chain_data/legacy-application-javascript/.gitignore delete mode 100644 off_chain_data/legacy-application-javascript/README.md delete mode 100644 off_chain_data/legacy-application-javascript/addAssets.js delete mode 100644 off_chain_data/legacy-application-javascript/blockEventListener.js delete mode 100644 off_chain_data/legacy-application-javascript/blockProcessing.js delete mode 100644 off_chain_data/legacy-application-javascript/config.json delete mode 100644 off_chain_data/legacy-application-javascript/couchdbutil.js delete mode 100644 off_chain_data/legacy-application-javascript/deleteAsset.js delete mode 100644 off_chain_data/legacy-application-javascript/enrollAdmin.js delete mode 100755 off_chain_data/legacy-application-javascript/network-clean.sh delete mode 100644 off_chain_data/legacy-application-javascript/package.json delete mode 100644 off_chain_data/legacy-application-javascript/registerUser.js delete mode 100755 off_chain_data/legacy-application-javascript/startFabric.sh delete mode 100644 off_chain_data/legacy-application-javascript/transferAsset.js diff --git a/.github/workflows/test-network-gateway.yaml b/.github/workflows/test-network-gateway.yaml deleted file mode 100644 index 47ec8a0a15..0000000000 --- a/.github/workflows/test-network-gateway.yaml +++ /dev/null @@ -1,39 +0,0 @@ -# -# SPDX-License-Identifier: Apache-2.0 -# -name: Test Network Gateway 🖥️ -run-name: ${{ github.actor }} is running the Test Network Gateway 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: - gateway: - runs-on: ${{ github.repository == 'hyperledger/fabric-samples' && 'fabric-ubuntu-20.04' || 'ubuntu-20.04' }} - strategy: - matrix: - chaincode-language: - - go - - javascript - - typescript - - java - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Set up the test network runtime - uses: ./.github/actions/test-network-setup - - - name: Run Test - working-directory: test-network - env: - CHAINCODE_LANGUAGE: ${{ matrix.chaincode-language }} - run: ../ci/scripts/run-test-network-gateway.sh diff --git a/.github/workflows/test-network-hsm.yaml b/.github/workflows/test-network-hsm.yaml index 0128368d0a..d904b82493 100644 --- a/.github/workflows/test-network-hsm.yaml +++ b/.github/workflows/test-network-hsm.yaml @@ -36,13 +36,16 @@ jobs: run: sudo apt install -y softhsm2 - name: Set up SoftHSM + env: + TMPDIR: ${{ runner.temp }} + SOFTHSM2_CONF: ${{ github.workspace }}/softhsm2.conf run: | - echo directories.tokendir = /tmp > $HOME/softhsm2.conf - export SOFTHSM2_CONF=$HOME/softhsm2.conf + 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 diff --git a/asset-transfer-basic/application-go/.gitignore b/asset-transfer-basic/application-go/.gitignore deleted file mode 100755 index e9fec12f6e..0000000000 --- a/asset-transfer-basic/application-go/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -wallet -!wallet/.gitkeep - -keystore diff --git a/asset-transfer-basic/application-go/assetTransfer.go b/asset-transfer-basic/application-go/assetTransfer.go deleted file mode 100644 index 2b0b98c749..0000000000 --- a/asset-transfer-basic/application-go/assetTransfer.go +++ /dev/null @@ -1,169 +0,0 @@ -/* -Copyright 2020 IBM All Rights Reserved. - -SPDX-License-Identifier: Apache-2.0 -*/ - -package main - -import ( - "fmt" - "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 environment variable: %v", err) - } - - walletPath := "wallet" - // remove any existing wallet from prior runs - os.RemoveAll(walletPath) - wallet, err := gateway.NewFileSystemWallet(walletPath) - 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() - - channelName := "mychannel" - if cname := os.Getenv("CHANNEL_NAME"); cname != "" { - channelName = cname - } - - log.Println("--> Connecting to channel", channelName) - network, err := gw.GetNetwork(channelName) - if err != nil { - log.Fatalf("Failed to get network: %v", err) - } - - chaincodeName := "basic" - if ccname := os.Getenv("CHAINCODE_NAME"); ccname != "" { - chaincodeName = ccname - } - - log.Println("--> Using chaincode", chaincodeName) - contract := network.GetContract(chaincodeName) - - 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", "asset113", "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", "asset113") - 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 := os.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 := os.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 := os.ReadFile(filepath.Clean(keyPath)) - if err != nil { - return err - } - - identity := gateway.NewX509Identity("Org1MSP", string(cert), string(key)) - - return wallet.Put("appUser", identity) -} diff --git a/asset-transfer-basic/application-go/go.mod b/asset-transfer-basic/application-go/go.mod deleted file mode 100644 index c859f52288..0000000000 --- a/asset-transfer-basic/application-go/go.mod +++ /dev/null @@ -1,49 +0,0 @@ -module asset-transfer-basic - -go 1.18 - -require github.com/hyperledger/fabric-sdk-go v1.0.0 - -require ( - github.com/Knetic/govaluate v3.0.0+incompatible // indirect - github.com/beorn7/perks v1.0.1 // indirect - github.com/cloudflare/cfssl v1.4.1 // indirect - github.com/davecgh/go-spew v1.1.1 // indirect - github.com/fsnotify/fsnotify v1.4.7 // indirect - github.com/go-kit/kit v0.8.0 // indirect - github.com/go-logfmt/logfmt v0.4.0 // indirect - github.com/golang/mock v1.4.3 // indirect - github.com/golang/protobuf v1.3.3 // indirect - github.com/google/certificate-transparency-go v1.0.21 // indirect - github.com/hashicorp/hcl v1.0.0 // indirect - github.com/hyperledger/fabric-config v0.0.5 // indirect - github.com/hyperledger/fabric-lib-go v1.0.0 // indirect - github.com/hyperledger/fabric-protos-go v0.0.0-20200707132912-fee30f3ccd23 // indirect - github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515 // indirect - github.com/magiconair/properties v1.8.1 // indirect - github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect - github.com/mitchellh/mapstructure v1.3.2 // indirect - github.com/pelletier/go-toml v1.8.0 // indirect - github.com/pkg/errors v0.8.1 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.1.0 // indirect - github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4 // indirect - github.com/prometheus/common v0.6.0 // indirect - github.com/prometheus/procfs v0.0.3 // indirect - github.com/spf13/afero v1.3.1 // indirect - github.com/spf13/cast v1.3.1 // indirect - github.com/spf13/jwalterweatherman v1.1.0 // indirect - github.com/spf13/pflag v1.0.5 // indirect - github.com/spf13/viper v1.1.1 // indirect - github.com/stretchr/testify v1.5.1 // indirect - github.com/weppos/publicsuffix-go v0.5.0 // indirect - github.com/zmap/zcrypto v0.0.0-20190729165852-9051775e6a2e // indirect - github.com/zmap/zlint v0.0.0-20190806154020-fd021b4cfbeb // indirect - golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d // indirect - golang.org/x/net v0.0.0-20190613194153-d28f0bde5980 // indirect - golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3 // indirect - golang.org/x/text v0.3.2 // indirect - google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55 // indirect - google.golang.org/grpc v1.29.1 // indirect - gopkg.in/yaml.v2 v2.3.0 // indirect -) diff --git a/asset-transfer-basic/application-go/go.sum b/asset-transfer-basic/application-go/go.sum deleted file mode 100644 index 26bb2eb66f..0000000000 --- a/asset-transfer-basic/application-go/go.sum +++ /dev/null @@ -1,234 +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 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= -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 h1:6+hBz+qvs0JOrrNhhmR7lFxo5sINxBCGXrdtl/UvroE= -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/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 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 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk= -github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -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.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/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 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 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY= -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 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-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 h1:NRu0iNbHV6u4nd9jgYghAdA1Ll4g0Sri4hwMEGiTbyg= -github.com/hyperledger/fabric-sdk-go v1.0.0/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 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= -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 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= -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.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 v1.0.3/go.mod h1:XsNlhZGX73bx86s2hdc/FuaLm2CPZJemRLMA+WTFxgs= -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.9.0 h1:R1uwffexN6Pr340GtYRIdZmAiN4J+iw6WG4wog1DUXg= -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.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.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/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.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-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.3.1 h1:GPTpEAuNr98px18yNQ66JllNil98wfRZ/5Ukny8FeQA= -github.com/spf13/afero v1.3.1/go.mod h1:5KUK8ByomD5Ti5Artl0RtHeI5pTF7MIDuXL3yY520V4= -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 v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= -github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= -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.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/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/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/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-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/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/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 h1:9zdDQZ7Thm29KFXgAX/+yaf3eVbP7djjWp/dXAppNCc= -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-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/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 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= -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/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= diff --git a/asset-transfer-basic/application-java/.gitattributes b/asset-transfer-basic/application-java/.gitattributes deleted file mode 100644 index 00a51aff5e..0000000000 --- a/asset-transfer-basic/application-java/.gitattributes +++ /dev/null @@ -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 - diff --git a/asset-transfer-basic/application-java/build.gradle b/asset-transfer-basic/application-java/build.gradle deleted file mode 100644 index a204249d8b..0000000000 --- a/asset-transfer-basic/application-java/build.gradle +++ /dev/null @@ -1,42 +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 { - // You can declare any Maven/Ivy/file repository here. - mavenCentral() -} - -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 -} \ No newline at end of file diff --git a/asset-transfer-basic/application-java/gradle/wrapper/gradle-wrapper.jar b/asset-transfer-basic/application-java/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index 7f93135c49b765f8051ef9d0a6055ff8e46073d8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 63721 zcmb5Wb9gP!wgnp7wrv|bwr$&XvSZt}Z6`anZSUAlc9NHKf9JdJ;NJVr`=eI(_pMp0 zy1VAAG3FfAOI`{X1O)&90s;U4K;XLp008~hCjbEC_fbYfS%6kTR+JtXK>nW$ZR+`W ze|#J8f4A@M|F5BpfUJb5h>|j$jOe}0oE!`Zf6fM>CR?!y@zU(cL8NsKk`a z6tx5mAkdjD;J=LcJ;;Aw8p!v#ouk>mUDZF@ zK>yvw%+bKu+T{Nk@LZ;zkYy0HBKw06_IWcMHo*0HKpTsEFZhn5qCHH9j z)|XpN&{`!0a>Vl+PmdQc)Yg4A(AG-z!+@Q#eHr&g<9D?7E)_aEB?s_rx>UE9TUq|? z;(ggJt>9l?C|zoO@5)tu?EV0x_7T17q4fF-q3{yZ^ipUbKcRZ4Qftd!xO(#UGhb2y>?*@{xq%`(-`2T^vc=#< zx!+@4pRdk&*1ht2OWk^Z5IAQ0YTAXLkL{(D*$gENaD)7A%^XXrCchN&z2x+*>o2FwPFjWpeaL=!tzv#JOW#( z$B)Nel<+$bkH1KZv3&-}=SiG~w2sbDbAWarg%5>YbC|}*d9hBjBkR(@tyM0T)FO$# zPtRXukGPnOd)~z=?avu+4Co@wF}1T)-uh5jI<1$HLtyDrVak{gw`mcH@Q-@wg{v^c zRzu}hMKFHV<8w}o*yg6p@Sq%=gkd~;`_VGTS?L@yVu`xuGy+dH6YOwcP6ZE`_0rK% zAx5!FjDuss`FQ3eF|mhrWkjux(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5|Tc|D8fN zJORAg=_vsy{ak|o);@)Yh8Lkcg@$FG3k@ep36BRa^>~UmnRPziS>Z=`Jb2x*Q#`%A zU*i3&Vg?TluO@X0O;r2Jl6LKLUOVhSqg1*qOt^|8*c7 zo(298@+r$k_wQNGHv{|$tW(T8L+4_`FQ{kEW5Jgg{yf7ey4ss_(SNKfz(N9lx&a;< je(UuV8hP?p&}TPdm1I$XmG#(RzlD&B2izSj9sl%y5~4qc diff --git a/asset-transfer-basic/application-java/gradle/wrapper/gradle-wrapper.properties b/asset-transfer-basic/application-java/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index a80b22ce5c..0000000000 --- a/asset-transfer-basic/application-java/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,7 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip -networkTimeout=10000 -validateDistributionUrl=true -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists diff --git a/asset-transfer-basic/application-java/gradlew b/asset-transfer-basic/application-java/gradlew deleted file mode 100755 index 0adc8e1a53..0000000000 --- a/asset-transfer-basic/application-java/gradlew +++ /dev/null @@ -1,249 +0,0 @@ -#!/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. -# - -############################################################################## -# -# 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/subprojects/plugins/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 "${APP_HOME:-./}" > /dev/null && pwd -P ) || 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=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=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, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. - -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" "$@" diff --git a/asset-transfer-basic/application-java/gradlew.bat b/asset-transfer-basic/application-java/gradlew.bat deleted file mode 100644 index 93e3f59f13..0000000000 --- a/asset-transfer-basic/application-java/gradlew.bat +++ /dev/null @@ -1,92 +0,0 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@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 obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@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 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem - -@if "%DEBUG%"=="" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -@rem This is normally unused -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* - -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/asset-transfer-basic/application-java/settings.gradle b/asset-transfer-basic/application-java/settings.gradle deleted file mode 100644 index 5423bc7de3..0000000000 --- a/asset-transfer-basic/application-java/settings.gradle +++ /dev/null @@ -1,10 +0,0 @@ -/* - * This file was generated by the Gradle 'init' task. - * - * The settings file is used to specify which projects to include in your build. - * - * Detailed information about configuring a multi-project build in Gradle can be found - * in the user manual at https://docs.gradle.org/6.5/userguide/multi_project_builds.html - */ - -rootProject.name = 'application-java' diff --git a/asset-transfer-basic/application-java/src/main/java/application/java/App.java b/asset-transfer-basic/application-java/src/main/java/application/java/App.java deleted file mode 100644 index 7278b25f83..0000000000 --- a/asset-transfer-basic/application-java/src/main/java/application/java/App.java +++ /dev/null @@ -1,120 +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 { - - private static final String CHANNEL_NAME = System.getenv().getOrDefault("CHANNEL_NAME", "mychannel"); - private static final String CHAINCODE_NAME = System.getenv().getOrDefault("CHAINCODE_NAME", "basic"); - - 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, "javaAppUser").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(CHANNEL_NAME); - Contract contract = network.getContract(CHAINCODE_NAME); - - 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 asset213"); - // CreateAsset creates an asset with ID asset213, color yellow, owner Tom, size 5 and appraisedValue of 1300 - contract.submitTransaction("CreateAsset", "asset213", "yellow", "5", "Tom", "1300"); - - System.out.println("\n"); - System.out.println("Evaluate Transaction: ReadAsset asset213"); - // ReadAsset returns an asset with given assetID - result = contract.evaluateTransaction("ReadAsset", "asset213"); - 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); - System.exit(1); - } - - } -} diff --git a/asset-transfer-basic/application-java/src/main/java/application/java/EnrollAdmin.java b/asset-transfer-basic/application-java/src/main/java/application/java/EnrollAdmin.java deleted file mode 100644 index 98f65e9017..0000000000 --- a/asset-transfer-basic/application-java/src/main/java/application/java/EnrollAdmin.java +++ /dev/null @@ -1,59 +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 java.io.File; -import org.apache.commons.io.FileUtils; - -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); - - // Delete wallet if it exists from prior runs - FileUtils.deleteDirectory(new File("wallet")); - - // 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"); - } -} diff --git a/asset-transfer-basic/application-java/src/main/java/application/java/RegisterUser.java b/asset-transfer-basic/application-java/src/main/java/application/java/RegisterUser.java deleted file mode 100644 index cf3a411a91..0000000000 --- a/asset-transfer-basic/application-java/src/main/java/application/java/RegisterUser.java +++ /dev/null @@ -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("javaAppUser") != null) { - System.out.println("An identity for the user \"javaAppUser\" 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 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("javaAppUser"); - registrationRequest.setAffiliation("org1.department1"); - registrationRequest.setEnrollmentID("javaAppUser"); - String enrollmentSecret = caClient.register(registrationRequest, admin); - Enrollment enrollment = caClient.enroll("javaAppUser", enrollmentSecret); - Identity user = Identities.newX509Identity("Org1MSP", enrollment); - wallet.put("javaAppUser", user); - System.out.println("Successfully enrolled user \"javaAppUser\" and imported it into the wallet"); - } - -} diff --git a/asset-transfer-basic/application-java/src/main/resources/log4j.properties b/asset-transfer-basic/application-java/src/main/resources/log4j.properties deleted file mode 100644 index f1f841feb4..0000000000 --- a/asset-transfer-basic/application-java/src/main/resources/log4j.properties +++ /dev/null @@ -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 diff --git a/asset-transfer-basic/application-javascript/.eslintignore b/asset-transfer-basic/application-javascript/.eslintignore deleted file mode 100644 index 1595847010..0000000000 --- a/asset-transfer-basic/application-javascript/.eslintignore +++ /dev/null @@ -1,5 +0,0 @@ -# -# SPDX-License-Identifier: Apache-2.0 -# - -coverage diff --git a/asset-transfer-basic/application-javascript/.eslintrc.js b/asset-transfer-basic/application-javascript/.eslintrc.js deleted file mode 100644 index 6fa636ba89..0000000000 --- a/asset-transfer-basic/application-javascript/.eslintrc.js +++ /dev/null @@ -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'] - } -}; diff --git a/asset-transfer-basic/application-javascript/.gitignore b/asset-transfer-basic/application-javascript/.gitignore deleted file mode 100644 index 21b287f72d..0000000000 --- a/asset-transfer-basic/application-javascript/.gitignore +++ /dev/null @@ -1,14 +0,0 @@ -# -# SPDX-License-Identifier: Apache-2.0 -# - -# Coverage directory used by tools like istanbul -coverage - -# Dependency directories -node_modules/ -jspm_packages/ -package-lock.json - -wallet -!wallet/.gitkeep diff --git a/asset-transfer-basic/application-javascript/app.js b/asset-transfer-basic/application-javascript/app.js deleted file mode 100644 index b27a5c2c19..0000000000 --- a/asset-transfer-basic/application-javascript/app.js +++ /dev/null @@ -1,183 +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 = process.env.CHANNEL_NAME || 'mychannel'; -const chaincodeName = process.env.CHAINCODE_NAME || 'basic'; - -const mspOrg1 = 'Org1MSP'; -const walletPath = path.join(__dirname, 'wallet'); -const org1UserId = 'javascriptAppUser'; - -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', 'asset313', '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', 'asset313'); - 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}`); - process.exit(1); - } -} - - -main(); diff --git a/asset-transfer-basic/application-javascript/package.json b/asset-transfer-basic/application-javascript/package.json deleted file mode 100644 index a5f5f35a19..0000000000 --- a/asset-transfer-basic/application-javascript/package.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name": "asset-transfer-basic", - "version": "1.0.0", - "description": "Asset-transfer-basic application implemented in JavaScript", - "engines": { - "node": ">=14.14", - "npm": ">=6" - }, - "scripts": { - "lint": "eslint *.js", - "pretest": "npm run lint" - }, - "engineStrict": true, - "author": "Hyperledger", - "license": "Apache-2.0", - "dependencies": { - "fabric-ca-client": "^2.2.19", - "fabric-network": "^2.2.19" - }, - "devDependencies": { - "eslint": "^7.32.0" - } -} diff --git a/asset-transfer-basic/application-typescript-hsm/.gitignore b/asset-transfer-basic/application-typescript-hsm/.gitignore deleted file mode 100644 index 48285d12a9..0000000000 --- a/asset-transfer-basic/application-typescript-hsm/.gitignore +++ /dev/null @@ -1,15 +0,0 @@ -# -# SPDX-License-Identifier: Apache-2.0 -# - - -# Coverage directory used by tools like istanbul -coverage - -# Dependency directories -node_modules/ -jspm_packages/ - -# Compiled TypeScript files -dist - diff --git a/asset-transfer-basic/application-typescript-hsm/README.md b/asset-transfer-basic/application-typescript-hsm/README.md deleted file mode 100644 index 8b87a82c29..0000000000 --- a/asset-transfer-basic/application-typescript-hsm/README.md +++ /dev/null @@ -1,263 +0,0 @@ -# Asset Transfer Basic typescript HSM sample - -This sample takes the Asset Transfer basic example and re-works it to focus on how -you would use a Hardware Security Modules within your node client application. - -## About the Sample - -This typescript sample application is able to use any of the asset transfer basic -chaincode samples. It will show how to register users with a Fabric CA and enroll users which will store keys in an HSM (In this case the sample uses SoftHSM which is an HSM implementation that should be used for development and testing purposes only). It also demonstrates setting up a wallet that will store identities that can then be used to transact on the fabric network which are HSM managed. - -## C Compilers - -In order for the client application to run successfully you must ensure you have C compilers and Python 3 (Note that Python 2 may still work however Python 2 is out of support and could stop working in the future) installed otherwise the node dependency `pkcs11js` will not be built and the application will fail. The failure will look like - -``` -Loaded the network configuration located at /home/dave/temp/fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/connection-org1.json -******** FAILED to run the application: Error: Cannot find module 'pkcs11js' -Require stack: -- /home/dave/temp/fabric-samples/asset-transfer-basic/application-typescript-hsm/node_modules/fabric-common/lib/impl/bccsp_pkcs11.js -- /home/dave/temp/fabric-samples/asset-transfer-basic/application-typescript-hsm/node_modules/fabric-common/lib/Utils.js -- /home/dave/temp/fabric-samples/asset-transfer-basic/application-typescript-hsm/node_modules/fabric-common/index.js -- /home/dave/temp/fabric-samples/asset-transfer-basic/application-typescript-hsm/node_modules/fabric-ca-client/lib/FabricCAServices.js -- /home/dave/temp/fabric-samples/asset-transfer-basic/application-typescript-hsm/node_modules/fabric-ca-client/index.js -- /home/dave/temp/fabric-samples/asset-transfer-basic/application-typescript-hsm/dist/app.js -``` - -how to install the required C Compilers and Python will depend on your operating system and version. - -## Configuring and running a Hardware Security Module - -This sample sets the hsmOptions for the wallet as follows - -```javascript -const softHSMOptions: HsmOptions = { - lib: await findSoftHSMPKCS11Lib(), - pin: process.env.PKCS11_PIN || '98765432', - label: process.env.PKCS11_LABEL || 'ForFabric', -}; -``` - -which is specific to using SoftHSM which has been initialised with a token labelled `ForFabric` -and a user pin of `98765432`, however you can override these values to use your own HSM by either -editting the application or use these environment variables to pass in the values: - -* PKCS11_LIB - path to the your specific HSM Library -* PKCS11_PIN - your HSM pin -* PKCS11_LABEL - your HSM label - -Alternatively you could install SoftHSM to try out the application as described in the next sections - -### Install SoftHSM - -In order to run the application in the absence of a real HSM, a software -emulator of the PKCS#11 interface is required. -For more information please refer to [SoftHSM](https://www.opendnssec.org/softhsm/). - -SoftHSM can either be installed using the package manager for your host system: - -* Ubuntu: `sudo apt install softhsm2` -* macOS: `brew install softhsm` -* Windows: **unsupported** - -Or compiled and installed from source: - -1. install openssl 1.0.0+ or botan 1.10.0+ -2. download the source code from -3. `tar -xvf softhsm-2.5.0.tar.gz` -4. `cd softhsm-2.5.0` -5. `./configure --disable-gost` (would require additional libraries, turn it off unless you need 'gost' algorithm support for the Russian market) -6. `make` -7. `sudo make install` - -### Specify the SoftHSM configuration file - -A configuration file for SoftHSM is provided in this sample directory. This file -uses /tmp as the location for SoftHSM to store it's data which means (depending on -your operating system configuration) the data could be deleted at some point, for example -when you reboot your system. If this data is lost then you will have to delete the wallet -created. An alternative is to change this file to store SoftHSM data in a permanent location -on your file system. -To use this configuration file you need to export an environment variable to point to it -for example, if you are in the application directory then you can use the following command - -```bash -export SOFTHSM2_CONF=$PWD/softhsm2.conf -``` - -Ensure you have this set when initializing the token as well as running the application - -### Initialize a token to store keys in SoftHSM - -If you have not initialized a token previously (or it has been deleted) then you will need to perform this one time operation - -```bash -softhsm2-util --init-token --slot 0 --label "ForFabric" --pin 98765432 --so-pin 1234 -``` - -The Security Officer PIN, specified with the `--so-pin` flag, can be used to re-initialize the token, -and the user PIN (see below), specified with the `--pin` flag, is used by applications to access the token for -generating and retrieving keys. - -## Running the sample - -Use the Fabric test network utility (`network.sh`) to start a Fabric network and deploy one -one of the sample chaincodes. - -Follow these step in order. -- Start the test network with a Certificate Authority and create a channel, so assuming you are in the ensuring you are in the `application-typescript-hsm` directory - -``` -cd ../../test-network -./network.sh down -./network.sh up createChannel -c mychannel -ca -``` - -- Deploy the chaincode (smart contract) - -``` -# to deploy the javascript version -./network.sh deployCC -ccs 1 -ccv 1 -ccep "OR('Org1MSP.peer','Org2MSP.peer')" -ccl javascript -ccp ./../asset-transfer-basic/chaincode-javascript/ -ccn basic -``` - -- Run the application - -``` -cd ../asset-transfer-basic/application-typescript-hsm -npm install -npm run build -node dist/app.js -``` - -### Expected successful execution - -If the sample runs successfully then it will output several messages showing the various actions and finally display the message - -``` -*** The sample ran successfully *** -``` - -One the first run of the sample, a CA admin id from Org1 will be enrolled from the CA. The certificate for this admin will be stored in the application wallet but the private key will have been stored in the HSM, it will not be in the application wallet. A User in Org1 will be registered in the the Org1 CA and then enrolled. Again only it's certificate will be stored in the application wallet. -All signing of transactions done by the application (driven by the node sdk) will actually be done by the HSM rather than within the node sdk as the private key will never be directly available outside of the HSM. - -This sample can be run multiple times even while the same network remains up. As the certificates are already in the application wallet it will not have to enroll a CA admin or register and enroll a user. - -### Possible issues you could encounter running the sample - -If you see this error: - -``` -******** FAILED to run the application: Pkcs11Error: CKR_GENERAL_ERROR -``` -Make sure you have exported SOFTHSM2_CONF correctly and it points to a valid SoftHSM configuration file that references -a directory containing a initialised SoftHSM token - - -If you see this error: - -``` -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 -``` - -Then the current certificates in your wallet are not valid for the network you are trying to interact with. This would happen if you had -shutdown the fabric network using `network.sh down` and created a new network because this causes all the root certificates to be recreated -To address this problem, you can delete the `wallet` directory in the `dist` folder (`fabric-samples/asset-transfer-basic/application-typescript-hsm/dist/wallet`) of this sample to create new certificates. Because new keypairs are generated these will be stored in SoftHSM and the existing old ones will not be referenced - -If you see this error - -``` -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 -``` - -Then the most likely cause is you have deleted your wallet. You would need to either -- stop and create a new fabric network using the `network.sh down` and then following the above instructions to start a new fabric network (but you should not re-initialize the softhsm token) -- or change the application such that it registers a new user instead of `appUser`. This is because be default a registered user can only be enrolled once (using the userid and it's secret) - -If you see this error - -``` -******** FAILED to run the application: Error: _pkcs11OpenSession[336]: PKCS11 label ForFabric cannot be found in the slot list -``` - -Then the SoftHSM token directory has been deleted (could be due to the /tmp file being cleaned up if you use the sample softhsm2.conf file provided). -You will either need to -- delete your existing wallet, bring down the network as described in `Clean up` section and recreate the network including re-initializing the softhsm token -- or you could just re-initialise the softhsm token but you will need to change the application so that it registers a new user instead of `appUser` - -If you see this error (note the number following `SKI` will not be the same) - -``` -******** FAILED to run the application: Error: _pkcs11SkiToHandle[572]: no key with SKI 27f3557183cd5f26384ab69968ba74944c94c0e24f681c4fadd6502886891da0 found -``` - -Then the certificates in your wallet do not have corresponding keys in SoftHSM. You can should bring down the network and delete your current wallet (as described in `Clean up` section) and create the network again - - -If you see either of these errors when the application ends - -``` -free(): double free detected in tcache 2 -Aborted -``` - -or - -``` -node[61480]: ../src/node_http2.cc:521:void node::http2::Http2Session::CheckAllocatedSize(size_t) const: Assertion `(current_nghttp2_memory_) >= (previous_size)' failed. - 1: 0xa1a640 node::Abort() [node] - 2: 0xa1a6be [node] - 3: 0xa55e2a node::mem::NgLibMemoryManager::ReallocImpl(void*, unsigned long, void*) [node] - 4: 0xa55ed3 node::mem::NgLibMemoryManager::FreeImpl(void*, void*) [node] - 5: 0x18b0388 nghttp2_session_close_stream [node] - 6: 0x18b76ea nghttp2_session_mem_recv [node] - 7: 0xa54937 node::http2::Http2Session::ConsumeHTTP2Data() [node] - 8: 0xa54d5e node::http2::Http2Session::OnStreamRead(long, uv_buf_t const&) [node] - 9: 0xb6a651 node::TLSWrap::ClearOut() [node] -10: 0xb6bcdb node::TLSWrap::OnStreamRead(long, uv_buf_t const&) [node] -11: 0xaf54b1 [node] -12: 0x137fed9 [node] -13: 0x1380500 [node] -14: 0x1386de5 [node] -15: 0x137458f uv_run [node] -16: 0xa5d7a6 node::NodeMainInstance::Run() [node] -17: 0x9eab6c node::Start(int, char**) [node] -18: 0x7fd7612180b3 __libc_start_main [/lib/x86_64-linux-gnu/libc.so.6] -19: 0x981fe5 [node] -Aborted (core dumped) -``` - -then this is due to a bug in `node`. May sure you are using the latest supported version of node, however at the time of writing (node 14.17.1 & node 12.22.1) a fix had not been released by node.js - -### Enabling Node SDK logging - -To see the SDK workings, try setting the logging to show on the console before running -``` -export HFC_LOGGING='{"debug":"console"}' -``` -or log to a file -``` -export HFC_LOGGING='{"debug":"./debug.log"}' -``` - -## Clean up - -When you are finished, you can bring down the test network. -The command will remove all the nodes of the test network, and delete any -ledger data that you created: - -```bash -cd ../../test-network -./network.sh down -``` -Be sure to delete the wallet directory create by the application. -The stored identities will no longer be valid when restarting the network. -For example if you are in the application-typescript-hsm directory - -```bash -rm -fr dist/wallet -``` - -## Suggestions -When typescript node applications log problems or terminate with a stack trace you normally would have to look at the compiled .js code to find the code that was executed in the stack trace. It would be easier if you could find the corresponding lines in the typescript source file. One solution to this problem can be found here https://github.com/evanw/node-source-map-support which will convert stack trace output to corresponding typescript file lines using the generated source maps. \ No newline at end of file diff --git a/asset-transfer-basic/application-typescript-hsm/package.json b/asset-transfer-basic/application-typescript-hsm/package.json deleted file mode 100644 index cd7606489c..0000000000 --- a/asset-transfer-basic/application-typescript-hsm/package.json +++ /dev/null @@ -1,51 +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.19", - "fabric-network": "^2.2.19" - }, - "devDependencies": { - "@types/node": "^12.20.55", - "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 - } -} diff --git a/asset-transfer-basic/application-typescript-hsm/softhsm2.conf b/asset-transfer-basic/application-typescript-hsm/softhsm2.conf deleted file mode 100644 index 86687cf7d8..0000000000 --- a/asset-transfer-basic/application-typescript-hsm/softhsm2.conf +++ /dev/null @@ -1,5 +0,0 @@ -directories.tokendir = /tmp/ -objectstore.backend = file - -# ERROR, WARNING, INFO, DEBUG -log.level = INFO \ No newline at end of file diff --git a/asset-transfer-basic/application-typescript-hsm/src/app.ts b/asset-transfer-basic/application-typescript-hsm/src/app.ts deleted file mode 100644 index 0f3baa3ab8..0000000000 --- a/asset-transfer-basic/application-typescript-hsm/src/app.ts +++ /dev/null @@ -1,286 +0,0 @@ -/* - * Copyright IBM Corp. All Rights Reserved. - * - * SPDX-License-Identifier: Apache-2.0 - */ -import * as FabricCAServices from 'fabric-ca-client'; -import { Contract, Gateway, GatewayOptions, HsmOptions, HsmX509Provider, Wallets } from 'fabric-network'; -import * as fs from 'fs'; -import * as path from 'path'; -import { buildCCPOrg1, prettyJSONString } from './utils//AppUtil'; -import { enrollUserToWallet, registerUser, UserToEnroll, UserToRegister } from './utils/CAUtil'; - -const walletPath = path.join(__dirname, 'wallet'); - -// define information about the channel and chaincode that will be driven by this application -const channelName = envOrDefault('CHANNEL_NAME', 'mychannel'); -const chaincodeName = envOrDefault('CHAINCODE_NAME', 'default-basic'); - - -// define the CA Registrar -const mspOrg1 = 'Org1MSP'; -const org1CAAdminUserId = 'admin'; -const org1CAAdminSecret = 'adminpw'; - -// define the user in org1 to use -const org1UserId = 'appUser'; -const org1Secret = 'appUserSecret'; -const org1Affiliation = 'org1.department1'; - -type Request = 'submit' | 'evaluate'; - -interface TransactionToSendFormat { - request: Request; - txName: string; - txArgs: string[]; - description?: string; -} - -// The set of transactions to be invoked -const transactionsToSend: TransactionToSendFormat[] = [ - { - request: 'submit', - txName: 'InitLedger', - txArgs: [], - description: '\n--> Submit Transaction: InitLedger, function creates the initial set of assets on the ledger', - }, - { - request: 'evaluate', - txName: 'GetAllAssets', - txArgs: [], - description: '\n--> Evaluate Transaction: GetAllAssets, function returns all the current assets on the ledger', - }, - { - request: 'submit', - txName: 'CreateAsset', - txArgs: ['asset513', 'yellow', '5', 'Tom', '1300'], - description: '\n--> Submit Transaction: CreateAsset, creates new asset with ID, color, owner, size, and appraisedValue arguments', - }, - { - request: 'evaluate', - txName: 'ReadAsset', - txArgs: ['asset513'], - description: '\n--> Evaluate Transaction: ReadAsset, function returns an asset with a given assetID', - }, - { - request: 'evaluate', - txName: 'AssetExists', - txArgs: ['asset1'], - description: '\n--> Evaluate Transaction: AssetExists, function returns "true" if an asset with given assetID exist', - }, - { - request: 'submit', - txName: 'UpdateAsset', - txArgs: ['asset1', 'blue', '5', 'Tomoko', '350'], - description: '\n--> Submit Transaction: UpdateAsset asset1, change the appraisedValue to 350', - }, - { - request: 'evaluate', - txName: 'ReadAsset', - txArgs: ['asset1'], - description: '\n--> Evaluate Transaction: ReadAsset, function returns "asset1" attributes', - }, - { - request: 'submit', - txName: 'UpdateAsset', - txArgs: ['asset70', 'blue', '5', 'Tomoko', '300'], - description: '\n--> Submit Transaction: UpdateAsset asset70, asset70 does not exist and should return an error', - }, - { - request: 'submit', - txName: 'TransferAsset', - txArgs: ['asset1', 'Tom'], - description: '\n--> Submit Transaction: TransferAsset asset1, transfer to new owner of Tom', - }, - { - request: 'evaluate', - txName: 'ReadAsset', - txArgs: ['asset1'], - description: '\n--> Evaluate Transaction: ReadAsset, function returns "asset1" attributes', - }, -]; - -/** - * 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(); - - // softhsm pkcs11 options to use - const softHSMOptions: HsmOptions = { - lib: await findSoftHSMPKCS11Lib(), - pin: process.env.PKCS11_PIN || '98765432', - label: process.env.PKCS11_LABEL || 'ForFabric', - }; - - // setup the wallet to hold the credentials used by this application - // Here we add the HSM provider to the provider registry of the wallet - const wallet = await Wallets.newFileSystemWallet(walletPath); - const hsmProvider = new HsmX509Provider(softHSMOptions); - wallet.getProviderRegistry().addProvider(hsmProvider); - - // build an instance of the fabric ca services client based on - // the information in the network configuration - const caInfo = ccp.certificateAuthorities['ca.org1.example.com']; // lookup CA details from config - const caTLSCACerts = caInfo.tlsCACerts.pem; - - // Here we make sure we pass in an HSM enabled cryptosuite to this CA instance - const hsmCAClient = new FabricCAServices(caInfo.url, { trustedRoots: caTLSCACerts, verify: false }, caInfo.caName, hsmProvider.getCryptoSuite()); - console.log(`Built a CA Client named ${caInfo.caName}`); - - // enroll the CA admin into the wallet if it doesn't already exist in the wallet - if (!await wallet.get(org1CAAdminUserId)) { - await enrollUserToWallet({ - caClient: hsmCAClient, - wallet, - orgMspId: mspOrg1, - userId: org1CAAdminUserId, - userIdSecret: org1CAAdminSecret, - } as UserToEnroll); - } - - // if we don't have the required user in the wallet then - // register this user to the CA (if it's not already registered) - // then enroll that user into the wallet - if (!await wallet.get(org1UserId)) { - await registerUser({ - caClient: hsmCAClient, - adminId: org1CAAdminUserId, - wallet, - orgMspId: mspOrg1, - userId: org1UserId, - userIdSecret: org1Secret, - affiliation: org1Affiliation, - } as UserToRegister); - - // By default you can only enroll a user once, after that you would have to re-enroll using the current - // certificate rather than using the secret. - await enrollUserToWallet({ - caClient: hsmCAClient, - wallet, - orgMspId: mspOrg1, - userId: org1UserId, - userIdSecret: org1Secret, - } as UserToEnroll); - } - - // Create a new gateway instance for interacting with the fabric network bound to our user - // This sample expects a locally deployed fabric network (ie running on the same machine in docker containers) - // therefore we set asLocalhost to true - 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); - - // loop around all transactions to send, each one will be sent sequentially - // through the same gateway/network/contract as subsequent transations expect the - // previous submits to have been committed - // Note however that a gateway/network/contract can support concurrent submitted - // transactions. - for (const transactionToSend of transactionsToSend) { - await interactWithFabric(contract, transactionToSend); - } - - console.log('*** The sample ran successfully ***'); - } 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}`); - } -} - -/** - * Determine the location of the SoftHSM PKCS11 Library - * @returns the location of the SoftHSM PKCS11 Library or 'NOT FOUND' if not found - */ -async function findSoftHSMPKCS11Lib() { - const commonSoftHSMPathNames = [ - '/usr/lib/softhsm/libsofthsm2.so', - '/usr/lib/x86_64-linux-gnu/softhsm/libsofthsm2.so', - '/usr/local/lib/softhsm/libsofthsm2.so', - '/usr/lib/libacsp-pkcs11.so', - ]; - - let pkcsLibPath = 'NOT FOUND'; - if (typeof process.env.PKCS11_LIB === 'string' && process.env.PKCS11_LIB !== '') { - pkcsLibPath = process.env.PKCS11_LIB; - } else { - - // Check common locations for PKCS library - - for (const pathnameToTry of commonSoftHSMPathNames) { - if (fs.existsSync(pathnameToTry)) { - pkcsLibPath = pathnameToTry; - break; - } - } - } - - return pkcsLibPath; -} - -/** - * Interact with the Fabric Network via the Contact with the required transaction to perform. - * @param contract The contract to send the transaction to - * @param transactionToPerform the transaction to perform - */ -async function interactWithFabric(contract: Contract, transactionToPerform: TransactionToSendFormat): Promise { - console.log(transactionToPerform.description); - try { - switch (transactionToPerform.request) { - case 'submit': { - await contract.submitTransaction(transactionToPerform.txName, ...transactionToPerform.txArgs); - console.log('*** Result: committed'); - break; - } - - case 'evaluate': { - const result = await contract.evaluateTransaction(transactionToPerform.txName, ...transactionToPerform.txArgs); - console.log(`*** Result: ${prettyJSONString(result.toString())}`); - } - } - } catch (error) { - console.log(`*** Successfully caught the error: \n ${error}`); - // In reality applications should check the returned error to decide whether the transaction needs to be retried (ie go through - // endorsement again) for example an MVCC_READ_CONFLICT error, resubmitted to the orderer for example a timeout because it was - // never committed (for example due to networking issues the transaction never gets included in a block), or whether it should - // be reported back, for example they tried to perform an invalid application action. - } -} - -/** - * 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; -} - -// execute the main function -main(); diff --git a/asset-transfer-basic/application-typescript-hsm/src/utils/AppUtil.ts b/asset-transfer-basic/application-typescript-hsm/src/utils/AppUtil.ts deleted file mode 100644 index 685acce56d..0000000000 --- a/asset-transfer-basic/application-typescript-hsm/src/utils/AppUtil.ts +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright IBM Corp. All Rights Reserved. - * - * SPDX-License-Identifier: Apache-2.0 - */ - -import * as fs from 'fs'; -import * as path from 'path'; - -const buildCCPOrg1 = (): Record => { - // 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 => { - // 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 prettyJSONString = (inputString: string): string => { - if (inputString) { - return JSON.stringify(JSON.parse(inputString), null, 2); - } else { - return inputString; - } -}; - -export { - buildCCPOrg1, - buildCCPOrg2, - prettyJSONString, -}; diff --git a/asset-transfer-basic/application-typescript-hsm/src/utils/CAUtil.ts b/asset-transfer-basic/application-typescript-hsm/src/utils/CAUtil.ts deleted file mode 100644 index 00944d2260..0000000000 --- a/asset-transfer-basic/application-typescript-hsm/src/utils/CAUtil.ts +++ /dev/null @@ -1,94 +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'; - -export interface UserToEnroll { - caClient: FabricCAServices; - wallet: Wallet; - orgMspId: string; - userId: string; - userIdSecret: string; -} - -/** - * enroll a registered CA user and store the credentials in the wallet - * @param userToEnroll details about the user and the wallet to use - */ -export const enrollUserToWallet = async (userToEnroll: UserToEnroll): Promise => { - try { - - // check that the identity isn't already in the wallet - const identity = await userToEnroll.wallet.get(userToEnroll.userId); - if (identity) { - console.log(`Identity ${userToEnroll.userId} already exists in the wallet`); - return; - } - - // Enroll the user - const enrollment = await userToEnroll.caClient.enroll({ enrollmentID: userToEnroll.userId, enrollmentSecret: userToEnroll.userIdSecret }); - - // store the user - const hsmIdentity = { - credentials: { - certificate: enrollment.certificate, - }, - mspId: userToEnroll.orgMspId, - type: 'HSM-X.509', - }; - await userToEnroll.wallet.put(userToEnroll.userId, hsmIdentity); - console.log(`Successfully enrolled user ${userToEnroll.userId} and imported it into the wallet`); - } catch (error) { - console.error(`Failed to enroll user ${userToEnroll.userId}: ${error}`); - } -}; - -export interface UserToRegister { - caClient: FabricCAServices; - wallet: Wallet; - orgMspId: string; - adminId: string; - userId: string; - userIdSecret: string; - affiliation: string; -} - -export const registerUser = async (userToRegister: UserToRegister): Promise => { - try { - - // Must use a CA admin (registrar) to register a new user - const adminIdentity = await userToRegister.wallet.get(userToRegister.adminId); - 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 = userToRegister.wallet.getProviderRegistry().getProvider(adminIdentity.type); - const adminUser = await provider.getUserContext(adminIdentity, userToRegister.adminId); - - // Register the user - // if affiliation is specified by client, the affiliation value must be configured in CA - await userToRegister.caClient.register({ - affiliation: userToRegister.affiliation, - enrollmentID: userToRegister.userId, - enrollmentSecret: userToRegister.userIdSecret, - role: 'client', - }, adminUser); - console.log(`Successfully registered ${userToRegister.userId}.`); - return; - - } catch (error) { - // check to see if it's an already registered error, if it is, then we can ignore it - // otherwise we rethrow the error - if (error.errors[0].code !== 74) { - console.error(`Failed to register user : ${error}`); - throw error; - } - } -}; diff --git a/asset-transfer-basic/application-typescript-hsm/tsconfig.json b/asset-transfer-basic/application-typescript-hsm/tsconfig.json deleted file mode 100644 index 590edcb3c7..0000000000 --- a/asset-transfer-basic/application-typescript-hsm/tsconfig.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "compilerOptions": { - "outDir": "dist", - "target": "es2017", - "moduleResolution": "node", - "module": "commonjs", - "declaration": true, - "sourceMap": true, - "noImplicitAny": true, - "strict": true - }, - "include": [ - "./src/**/*" - ], - "exclude": [ - "./src/**/*.spec.ts" - ] -} diff --git a/asset-transfer-basic/application-typescript-hsm/tslint.json b/asset-transfer-basic/application-typescript-hsm/tslint.json deleted file mode 100644 index 3612c23a09..0000000000 --- a/asset-transfer-basic/application-typescript-hsm/tslint.json +++ /dev/null @@ -1,24 +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, - "interface-name":false - }, - "rulesDirectory": [] -} diff --git a/asset-transfer-basic/application-typescript/.gitignore b/asset-transfer-basic/application-typescript/.gitignore deleted file mode 100644 index 48285d12a9..0000000000 --- a/asset-transfer-basic/application-typescript/.gitignore +++ /dev/null @@ -1,15 +0,0 @@ -# -# SPDX-License-Identifier: Apache-2.0 -# - - -# Coverage directory used by tools like istanbul -coverage - -# Dependency directories -node_modules/ -jspm_packages/ - -# Compiled TypeScript files -dist - diff --git a/asset-transfer-basic/application-typescript/package.json b/asset-transfer-basic/application-typescript/package.json deleted file mode 100644 index ca8f7b38a3..0000000000 --- a/asset-transfer-basic/application-typescript/package.json +++ /dev/null @@ -1,51 +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": ">=14.14" - }, - "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.19", - "fabric-network": "^2.2.19" - }, - "devDependencies": { - "@tsconfig/node14": "^14.1.0", - "@types/node": "^14.17.32", - "tslint": "^5.11.0", - "typescript": "~4.9.4" - }, - "nyc": { - "extension": [ - ".ts", - ".tsx" - ], - "exclude": [ - "coverage/**", - "dist/**" - ], - "reporter": [ - "text-summary", - "html" - ], - "all": true, - "check-coverage": true, - "statements": 100, - "branches": 100, - "functions": 100, - "lines": 100 - } -} diff --git a/asset-transfer-basic/application-typescript/src/app.ts b/asset-transfer-basic/application-typescript/src/app.ts deleted file mode 100644 index 08758e06f3..0000000000 --- a/asset-transfer-basic/application-typescript/src/app.ts +++ /dev/null @@ -1,172 +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 = process.env.CHANNEL_NAME || 'mychannel'; -const chaincodeName = process.env.CHAINCODE_NAME || 'basic'; - -const mspOrg1 = 'Org1MSP'; -const walletPath = path.join(__dirname, 'wallet'); -const org1UserId = 'typescriptAppUser'; - -// 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', 'asset413', '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', 'asset413'); - 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}`); - process.exit(1); - } -} - -main(); diff --git a/asset-transfer-basic/application-typescript/src/utils/AppUtil.ts b/asset-transfer-basic/application-typescript/src/utils/AppUtil.ts deleted file mode 100644 index d72ec0f9b5..0000000000 --- a/asset-transfer-basic/application-typescript/src/utils/AppUtil.ts +++ /dev/null @@ -1,76 +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 => { - // 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 => { - // 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 => { - // Create a new wallet : Note that wallet is for managing identities. - let wallet: Wallet; - if (walletPath) { - - // remove any pre-existing wallet from prior runs - fs.rmSync(walletPath, { recursive: true, force: true }); - - 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, -}; diff --git a/asset-transfer-basic/application-typescript/src/utils/CAUtil.ts b/asset-transfer-basic/application-typescript/src/utils/CAUtil.ts deleted file mode 100644 index 7e792119eb..0000000000 --- a/asset-transfer-basic/application-typescript/src/utils/CAUtil.ts +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright IBM Corp. All Rights Reserved. - * - * SPDX-License-Identifier: Apache-2.0 - */ - -import FabricCAServices from 'fabric-ca-client'; -import { Wallet } from 'fabric-network'; - -const adminUserId = 'admin'; -const adminUserPasswd = 'adminpw'; - -/** - * - * @param {*} ccp - */ -const buildCAClient = (ccp: Record, 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 => { - 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 => { - 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, -}; diff --git a/asset-transfer-basic/application-typescript/tsconfig.json b/asset-transfer-basic/application-typescript/tsconfig.json deleted file mode 100644 index ba53c81981..0000000000 --- a/asset-transfer-basic/application-typescript/tsconfig.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "$schema": "https://json.schemastore.org/tsconfig", - "extends": "@tsconfig/node14/tsconfig.json", - "compilerOptions": { - "outDir": "dist", - "declaration": true, - "sourceMap": true, - }, - "include": [ - "./src/**/*" - ], - "exclude": [ - "./src/**/*.spec.ts" - ] -} diff --git a/asset-transfer-basic/application-typescript/tslint.json b/asset-transfer-basic/application-typescript/tslint.json deleted file mode 100644 index a52c3ee2ed..0000000000 --- a/asset-transfer-basic/application-typescript/tslint.json +++ /dev/null @@ -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": [] -} diff --git a/asset-transfer-basic/chaincode-external/README.md b/asset-transfer-basic/chaincode-external/README.md index a5188efcb9..64894ac58b 100755 --- a/asset-transfer-basic/chaincode-external/README.md +++ b/asset-transfer-basic/chaincode-external/README.md @@ -159,16 +159,14 @@ Now that we have started the chaincode service and deployed it to the channel, w ## Using the Asset-Transfer-Basic external chaincode -Open yet another terminal and navigate to the `fabric-samples/asset-transfer-basic/application-javascript` directory: +Open yet another terminal and navigate to the `fabric-samples/asset-transfer-basic/application-gateway-go` directory: ``` -cd fabric-samples/asset-transfer-basic/application-javascript +cd fabric-samples/asset-transfer-basic/application-gateway-go ``` Run the following commands to use the node application in this directory to test the external smart contract: ``` -rm -rf wallet # in case you ran this before -npm install -node app.js +go run . ``` If all goes well, the program should run exactly the same as described in the "Writing Your First Application" tutorial. diff --git a/asset-transfer-events/application-javascript/.eslintignore b/asset-transfer-events/application-javascript/.eslintignore deleted file mode 100644 index 1595847010..0000000000 --- a/asset-transfer-events/application-javascript/.eslintignore +++ /dev/null @@ -1,5 +0,0 @@ -# -# SPDX-License-Identifier: Apache-2.0 -# - -coverage diff --git a/asset-transfer-events/application-javascript/.eslintrc.js b/asset-transfer-events/application-javascript/.eslintrc.js deleted file mode 100644 index ae0bf212d4..0000000000 --- a/asset-transfer-events/application-javascript/.eslintrc.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - */ -'use strict'; - -module.exports = { - env: { - node: true, - mocha: true, - es6: 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', - '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'] - } -}; diff --git a/asset-transfer-events/application-javascript/.gitignore b/asset-transfer-events/application-javascript/.gitignore deleted file mode 100644 index 21b287f72d..0000000000 --- a/asset-transfer-events/application-javascript/.gitignore +++ /dev/null @@ -1,14 +0,0 @@ -# -# SPDX-License-Identifier: Apache-2.0 -# - -# Coverage directory used by tools like istanbul -coverage - -# Dependency directories -node_modules/ -jspm_packages/ -package-lock.json - -wallet -!wallet/.gitkeep diff --git a/asset-transfer-events/application-javascript/app.js b/asset-transfer-events/application-javascript/app.js deleted file mode 100644 index 10e4f36796..0000000000 --- a/asset-transfer-events/application-javascript/app.js +++ /dev/null @@ -1,545 +0,0 @@ -/* - * Copyright IBM Corp. All Rights Reserved. - * - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict'; - -/** - * Application that shows events when creating and updating an asset - * -- How to register a contract listener for chaincode events - * -- How to get the chaincode event name and value from the chaincode event - * -- How to retrieve the transaction and block information from the chaincode event - * -- How to register a block listener for full block events - * -- How to retrieve the transaction and block information from the full block event - * -- How to register to recieve private data associated with transactions when - * registering a block listener - * -- How to retreive the private data from the full block event - * -- The listener will be notified of an event at anytime. Notice that events will - * be posted by the listener after the application activity causing the ledger change - * and during other application activity unrelated to the event - * -- How to connect to a Gateway that will not use events when submitting transactions. - * This may be useful when the application does not want to wait for the peer to commit - * blocks and notify the application. - * - * To see the SDK workings, try setting the logging to be displayed on the console - * before executing this application. - * export HFC_LOGGING='{"debug":"console"}' - * See the following on how the SDK is working with the Peer's Event Services - * https://hyperledger-fabric.readthedocs.io/en/latest/peer_event_services.html - * - * See the following for more details on using the Node SDK - * https://hyperledger.github.io/fabric-sdk-node/release-2.2/module-fabric-network.html - */ - -// pre-requisites: -// - fabric-sample two organization test-network setup with two peers, ordering service, -// and 2 certificate authorities -// ===> from directory test-network -// ./network.sh up createChannel -ca -// -// - Use the asset-transfer-events/chaincode-javascript chaincode deployed on -// the channel "mychannel". 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 test-network -// ./network.sh deployCC -ccn events -ccp ../asset-transfer-events/chaincode-javascript/ -ccl javascript -ccep "OR('Org1MSP.peer','Org2MSP.peer')" -// -// - Be sure that node.js is installed -// ===> from directory asset-transfer-events/application-javascript -// node -v -// - npm installed code dependencies -// ===> from directory asset-transfer-events/application-javascript -// npm install -// - to run this test application -// ===> from directory asset-transfer-events/application-javascript -// node app.js - -// NOTE: If you see an error like these: -/* - - Error in setup: Error: DiscoveryService: mychannel error: access denied - - OR - - Failed to register user : Error: fabric-ca request register failed with errors [[ { code: 20, message: 'Authentication failure' } ]] - - */ -// Delete the /fabric-samples/asset-transfer-sbe/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. -// - -// use this to set logging, must be set before the require('fabric-network'); -process.env.HFC_LOGGING = '{"debug": "./debug.log"}'; - -const { Gateway, Wallets } = require('fabric-network'); -const EventStrategies = require('fabric-network/lib/impl/event/defaulteventhandlerstrategies'); -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 = 'events'; - -const org1 = 'Org1MSP'; -const Org1UserId = 'appUser1'; - -const RED = '\x1b[31m\n'; -const GREEN = '\x1b[32m\n'; -const BLUE = '\x1b[34m'; -const RESET = '\x1b[0m'; - -/** - * Perform a sleep -- asynchronous wait - * @param ms the time in milliseconds to sleep for - */ -function sleep(ms) { - return new Promise((resolve) => setTimeout(resolve, ms)); -} - -async function initGatewayForOrg1(useCommitEvents) { - console.log(`${GREEN}--> Fabric client user & Gateway init: Using Org1 identity to Org1 Peer${RESET}`); - // build an in memory object with the network configuration (also known as a connection profile) - const ccpOrg1 = buildCCPOrg1(); - - // build an instance of the fabric ca services client based on - // the information in the network configuration - const caOrg1Client = buildCAClient(FabricCAServices, ccpOrg1, 'ca.org1.example.com'); - - // setup the wallet to cache the credentials of the application user, on the app server locally - const walletPathOrg1 = path.join(__dirname, 'wallet', 'org1'); - const walletOrg1 = await buildWallet(Wallets, walletPathOrg1); - - // in a real application this would be done on an administrative flow, and only once - // stores admin identity in local wallet, if needed - await enrollAdmin(caOrg1Client, walletOrg1, org1); - // register & enroll application user with CA, which is used as client identify to make chaincode calls - // and stores app user identity in local wallet - // 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(caOrg1Client, walletOrg1, org1, Org1UserId, 'org1.department1'); - - try { - // Create a new gateway for connecting to Org's peer node. - const gatewayOrg1 = new Gateway(); - - if (useCommitEvents) { - await gatewayOrg1.connect(ccpOrg1, { - wallet: walletOrg1, - identity: Org1UserId, - discovery: { enabled: true, asLocalhost: true } - }); - } else { - await gatewayOrg1.connect(ccpOrg1, { - wallet: walletOrg1, - identity: Org1UserId, - discovery: { enabled: true, asLocalhost: true }, - eventHandlerOptions: EventStrategies.NONE - }); - } - - - return gatewayOrg1; - } catch (error) { - console.error(`Error in connecting to gateway for Org1: ${error}`); - process.exit(1); - } -} - -function checkAsset(org, resultBuffer, color, size, owner, appraisedValue, price) { - console.log(`${GREEN}<-- Query results from ${org}${RESET}`); - - let asset; - if (resultBuffer) { - asset = JSON.parse(resultBuffer.toString('utf8')); - } else { - console.log(`${RED}*** Failed to read asset${RESET}`); - } - console.log(`*** verify asset ${asset.ID}`); - - if (asset) { - if (asset.Color === color) { - console.log(`*** asset ${asset.ID} has color ${asset.Color}`); - } else { - console.log(`${RED}*** asset ${asset.ID} has color of ${asset.Color}${RESET}`); - } - if (asset.Size === size) { - console.log(`*** asset ${asset.ID} has size ${asset.Size}`); - } else { - console.log(`${RED}*** Failed size check from ${org} - asset ${asset.ID} has size of ${asset.Size}${RESET}`); - } - if (asset.Owner === owner) { - console.log(`*** asset ${asset.ID} owned by ${asset.Owner}`); - } else { - console.log(`${RED}*** Failed owner check from ${org} - asset ${asset.ID} owned by ${asset.Owner}${RESET}`); - } - if (asset.AppraisedValue === appraisedValue) { - console.log(`*** asset ${asset.ID} has appraised value ${asset.AppraisedValue}`); - } else { - console.log(`${RED}*** Failed appraised value check from ${org} - asset ${asset.ID} has appraised value of ${asset.AppraisedValue}${RESET}`); - } - if (price) { - if (asset.asset_properties && asset.asset_properties.Price === price) { - console.log(`*** asset ${asset.ID} has price ${asset.asset_properties.Price}`); - } else { - console.log(`${RED}*** Failed price check from ${org} - asset ${asset.ID} has price of ${asset.asset_properties.Price}${RESET}`); - } - } - } -} - -function showTransactionData(transactionData) { - const creator = transactionData.actions[0].header.creator; - console.log(` - submitted by: ${creator.mspid}-${creator.id_bytes.toString('hex')}`); - for (const endorsement of transactionData.actions[0].payload.action.endorsements) { - console.log(` - endorsed by: ${endorsement.endorser.mspid}-${endorsement.endorser.id_bytes.toString('hex')}`); - } - const chaincode = transactionData.actions[0].payload.chaincode_proposal_payload.input.chaincode_spec; - console.log(` - chaincode:${chaincode.chaincode_id.name}`); - console.log(` - function:${chaincode.input.args[0].toString()}`); - for (let x = 1; x < chaincode.input.args.length; x++) { - console.log(` - arg:${chaincode.input.args[x].toString()}`); - } -} - -async function main() { - console.log(`${BLUE} **** START ****${RESET}`); - try { - let randomNumber = Math.floor(Math.random() * 1000) + 1; - // use a random key so that we can run multiple times - let assetKey = `item-${randomNumber}`; - - /** ******* Fabric client init: Using Org1 identity to Org1 Peer ******* */ - const gateway1Org1 = await initGatewayForOrg1(true); // transaction handling uses commit events - const gateway2Org1 = await initGatewayForOrg1(); - - try { - // - // - - - - - - C H A I N C O D E E V E N T S - // - console.log(`${BLUE} **** CHAINCODE EVENTS ****${RESET}`); - let transaction; - let listener; - const network1Org1 = await gateway1Org1.getNetwork(channelName); - const contract1Org1 = network1Org1.getContract(chaincodeName); - - try { - // first create a listener to be notified of chaincode code events - // coming from the chaincode ID "events" - listener = async (event) => { - // The payload of the chaincode event is the value place there by the - // chaincode. Notice it is a byte data and the application will have - // to know how to deserialize. - // In this case we know that the chaincode will always place the asset - // being worked with as the payload for all events produced. - const asset = JSON.parse(event.payload.toString()); - console.log(`${GREEN}<-- Contract Event Received: ${event.eventName} - ${JSON.stringify(asset)}${RESET}`); - // show the information available with the event - console.log(`*** Event: ${event.eventName}:${asset.ID}`); - // notice how we have access to the transaction information that produced this chaincode event - const eventTransaction = event.getTransactionEvent(); - console.log(`*** transaction: ${eventTransaction.transactionId} status:${eventTransaction.status}`); - showTransactionData(eventTransaction.transactionData); - // notice how we have access to the full block that contains this transaction - const eventBlock = eventTransaction.getBlockEvent(); - console.log(`*** block: ${eventBlock.blockNumber.toString()}`); - }; - // now start the client side event service and register the listener - console.log(`${GREEN}--> Start contract event stream to peer in Org1${RESET}`); - await contract1Org1.addContractListener(listener); - } catch (eventError) { - console.log(`${RED}<-- Failed: Setup contract events - ${eventError}${RESET}`); - } - - try { - // C R E A T E - console.log(`${GREEN}--> Submit Transaction: CreateAsset, ${assetKey} owned by Sam${RESET}`); - transaction = contract1Org1.createTransaction('CreateAsset'); - await transaction.submit(assetKey, 'blue', '10', 'Sam', '100'); - console.log(`${GREEN}<-- Submit CreateAsset Result: committed, asset ${assetKey}${RESET}`); - } catch (createError) { - console.log(`${RED}<-- Submit Failed: CreateAsset - ${createError}${RESET}`); - } - try { - // R E A D - console.log(`${GREEN}--> Evaluate: ReadAsset, - ${assetKey} should be owned by Sam${RESET}`); - const resultBuffer = await contract1Org1.evaluateTransaction('ReadAsset', assetKey); - checkAsset(org1, resultBuffer, 'blue', '10', 'Sam', '100'); - } catch (readError) { - console.log(`${RED}<-- Failed: ReadAsset - ${readError}${RESET}`); - } - - try { - // U P D A T E - console.log(`${GREEN}--> Submit Transaction: UpdateAsset ${assetKey} update appraised value to 200`); - transaction = contract1Org1.createTransaction('UpdateAsset'); - await transaction.submit(assetKey, 'blue', '10', 'Sam', '200'); - console.log(`${GREEN}<-- Submit UpdateAsset Result: committed, asset ${assetKey}${RESET}`); - } catch (updateError) { - console.log(`${RED}<-- Failed: UpdateAsset - ${updateError}${RESET}`); - } - try { - // R E A D - console.log(`${GREEN}--> Evaluate: ReadAsset, - ${assetKey} should now have appraised value of 200${RESET}`); - const resultBuffer = await contract1Org1.evaluateTransaction('ReadAsset', assetKey); - checkAsset(org1, resultBuffer, 'blue', '10', 'Sam', '200'); - } catch (readError) { - console.log(`${RED}<-- Failed: ReadAsset - ${readError}${RESET}`); - } - - try { - // T R A N S F E R - console.log(`${GREEN}--> Submit Transaction: TransferAsset ${assetKey} to Mary`); - transaction = contract1Org1.createTransaction('TransferAsset'); - await transaction.submit(assetKey, 'Mary'); - console.log(`${GREEN}<-- Submit TransferAsset Result: committed, asset ${assetKey}${RESET}`); - } catch (transferError) { - console.log(`${RED}<-- Failed: TransferAsset - ${transferError}${RESET}`); - } - try { - // R E A D - console.log(`${GREEN}--> Evaluate: ReadAsset, - ${assetKey} should now be owned by Mary${RESET}`); - const resultBuffer = await contract1Org1.evaluateTransaction('ReadAsset', assetKey); - checkAsset(org1, resultBuffer, 'blue', '10', 'Mary', '200'); - } catch (readError) { - console.log(`${RED}<-- Failed: ReadAsset - ${readError}${RESET}`); - } - - try { - // D E L E T E - console.log(`${GREEN}--> Submit Transaction: DeleteAsset ${assetKey}`); - transaction = contract1Org1.createTransaction('DeleteAsset'); - await transaction.submit(assetKey); - console.log(`${GREEN}<-- Submit DeleteAsset Result: committed, asset ${assetKey}${RESET}`); - } catch (deleteError) { - console.log(`${RED}<-- Failed: DeleteAsset - ${deleteError}${RESET}`); - if (deleteError.toString().includes('ENDORSEMENT_POLICY_FAILURE')) { - console.log(`${RED}Be sure that chaincode was deployed with the endorsement policy "OR('Org1MSP.peer','Org2MSP.peer')"${RESET}`); - } - } - try { - // R E A D - console.log(`${GREEN}--> Evaluate: ReadAsset, - ${assetKey} should now be deleted${RESET}`); - const resultBuffer = await contract1Org1.evaluateTransaction('ReadAsset', assetKey); - checkAsset(org1, resultBuffer, 'blue', '10', 'Mary', '200'); - console.log(`${RED}<-- Failed: ReadAsset - should not have read this asset${RESET}`); - } catch (readError) { - console.log(`${GREEN}<-- Success: ReadAsset - ${readError}${RESET}`); - } - - // all done with this listener - contract1Org1.removeContractListener(listener); - - // - // - - - - - - B L O C K E V E N T S with P R I V A T E D A T A - // - console.log(`${BLUE} **** BLOCK EVENTS with PRIVATE DATA ****${RESET}`); - const network2Org1 = await gateway2Org1.getNetwork(channelName); - const contract2Org1 = network2Org1.getContract(chaincodeName); - - randomNumber = Math.floor(Math.random() * 1000) + 1; - assetKey = `item-${randomNumber}`; - - let firstBlock = true; // simple indicator to track blocks - - try { - let listener; - - // create a block listener - listener = async (event) => { - if (firstBlock) { - console.log(`${GREEN}<-- Block Event Received - block number: ${event.blockNumber.toString()}` + - '\n### Note:' + - '\n This block event represents the current top block of the ledger.' + - `\n All block events after this one are events that represent new blocks added to the ledger${RESET}`); - firstBlock = false; - } else { - console.log(`${GREEN}<-- Block Event Received - block number: ${event.blockNumber.toString()}${RESET}`); - } - const transEvents = event.getTransactionEvents(); - for (const transEvent of transEvents) { - console.log(`*** transaction event: ${transEvent.transactionId}`); - if (transEvent.privateData) { - for (const namespace of transEvent.privateData.ns_pvt_rwset) { - console.log(` - private data: ${namespace.namespace}`); - for (const collection of namespace.collection_pvt_rwset) { - console.log(` - collection: ${collection.collection_name}`); - if (collection.rwset.reads) { - for (const read of collection.rwset.reads) { - console.log(` - read set - ${BLUE}key:${RESET} ${read.key} ${BLUE}value:${read.value.toString()}`); - } - } - if (collection.rwset.writes) { - for (const write of collection.rwset.writes) { - console.log(` - write set - ${BLUE}key:${RESET}${write.key} ${BLUE}is_delete:${RESET}${write.is_delete} ${BLUE}value:${RESET}${write.value.toString()}`); - } - } - } - } - } - if (transEvent.transactionData) { - showTransactionData(transEvent.transactionData); - } - } - }; - // now start the client side event service and register the listener - console.log(`${GREEN}--> Start private data block event stream to peer in Org1${RESET}`); - await network2Org1.addBlockListener(listener, {type: 'private'}); - } catch (eventError) { - console.log(`${RED}<-- Failed: Setup block events - ${eventError}${RESET}`); - } - - try { - // C R E A T E - console.log(`${GREEN}--> Submit Transaction: CreateAsset, ${assetKey} owned by Sam${RESET}`); - transaction = contract2Org1.createTransaction('CreateAsset'); - - // create the private data with salt and assign to the transaction - const randomNumber = Math.floor(Math.random() * 100) + 1; - const asset_properties = { - object_type: 'asset_properties', - asset_id: assetKey, - Price: '90', - salt: Buffer.from(randomNumber.toString()).toString('hex') - }; - const asset_properties_string = JSON.stringify(asset_properties); - transaction.setTransient({ - asset_properties: Buffer.from(asset_properties_string) - }); - // With the addition of private data to the transaction - // We must only send this to the organization that will be - // saving the private data or we will get an endorsement policy failure - transaction.setEndorsingOrganizations(org1); - // endorse and commit - private data (transient data) will be - // saved to the implicit collection on the peer - await transaction.submit(assetKey, 'blue', '10', 'Sam', '100'); - console.log(`${GREEN}<-- Submit CreateAsset Result: committed, asset ${assetKey}${RESET}`); - } catch (createError) { - console.log(`${RED}<-- Failed: CreateAsset - ${createError}${RESET}`); - } - await sleep(5000); // need to wait for event to be committed - try { - // R E A D - console.log(`${GREEN}--> Evaluate: ReadAsset, - ${assetKey} should be owned by Sam${RESET}`); - const resultBuffer = await contract2Org1.evaluateTransaction('ReadAsset', assetKey); - checkAsset(org1, resultBuffer, 'blue', '10', 'Sam', '100', '90'); - } catch (readError) { - console.log(`${RED}<-- Failed: ReadAsset - ${readError}${RESET}`); - } - - try { - // U P D A T E - console.log(`${GREEN}--> Submit Transaction: UpdateAsset ${assetKey} update appraised value to 200`); - transaction = contract2Org1.createTransaction('UpdateAsset'); - - // update the private data with new salt and assign to the transaction - const randomNumber = Math.floor(Math.random() * 100) + 1; - const asset_properties = { - object_type: 'asset_properties', - asset_id: assetKey, - Price: '90', - salt: Buffer.from(randomNumber.toString()).toString('hex') - }; - const asset_properties_string = JSON.stringify(asset_properties); - transaction.setTransient({ - asset_properties: Buffer.from(asset_properties_string) - }); - transaction.setEndorsingOrganizations(org1); - - await transaction.submit(assetKey, 'blue', '10', 'Sam', '200'); - console.log(`${GREEN}<-- Submit UpdateAsset Result: committed, asset ${assetKey}${RESET}`); - } catch (updateError) { - console.log(`${RED}<-- Failed: UpdateAsset - ${updateError}${RESET}`); - } - await sleep(5000); // need to wait for event to be committed - try { - // R E A D - console.log(`${GREEN}--> Evaluate: ReadAsset, - ${assetKey} should now have appraised value of 200${RESET}`); - const resultBuffer = await contract2Org1.evaluateTransaction('ReadAsset', assetKey); - checkAsset(org1, resultBuffer, 'blue', '10', 'Sam', '200', '90'); - } catch (readError) { - console.log(`${RED}<-- Failed: ReadAsset - ${readError}${RESET}`); - } - - try { - // T R A N S F E R - console.log(`${GREEN}--> Submit Transaction: TransferAsset ${assetKey} to Mary`); - transaction = contract2Org1.createTransaction('TransferAsset'); - - // update the private data with new salt and assign to the transaction - const randomNumber = Math.floor(Math.random() * 100) + 1; - const asset_properties = { - object_type: 'asset_properties', - asset_id: assetKey, - Price: '180', - salt: Buffer.from(randomNumber.toString()).toString('hex') - }; - const asset_properties_string = JSON.stringify(asset_properties); - transaction.setTransient({ - asset_properties: Buffer.from(asset_properties_string) - }); - transaction.setEndorsingOrganizations(org1); - - await transaction.submit(assetKey, 'Mary'); - console.log(`${GREEN}<-- Submit TransferAsset Result: committed, asset ${assetKey}${RESET}`); - } catch (transferError) { - console.log(`${RED}<-- Failed: TransferAsset - ${transferError}${RESET}`); - } - await sleep(5000); // need to wait for event to be committed - try { - // R E A D - console.log(`${GREEN}--> Evaluate: ReadAsset, - ${assetKey} should now be owned by Mary${RESET}`); - const resultBuffer = await contract2Org1.evaluateTransaction('ReadAsset', assetKey); - checkAsset(org1, resultBuffer, 'blue', '10', 'Mary', '200', '180'); - } catch (readError) { - console.log(`${RED}<-- Failed: ReadAsset - ${readError}${RESET}`); - } - - try { - // D E L E T E - console.log(`${GREEN}--> Submit Transaction: DeleteAsset ${assetKey}`); - transaction = contract2Org1.createTransaction('DeleteAsset'); - await transaction.submit(assetKey); - console.log(`${GREEN}<-- Submit DeleteAsset Result: committed, asset ${assetKey}${RESET}`); - } catch (deleteError) { - console.log(`${RED}<-- Failed: DeleteAsset - ${deleteError}${RESET}`); - } - await sleep(5000); // need to wait for event to be committed - try { - // R E A D - console.log(`${GREEN}--> Evaluate: ReadAsset, - ${assetKey} should now be deleted${RESET}`); - const resultBuffer = await contract2Org1.evaluateTransaction('ReadAsset', assetKey); - checkAsset(org1, resultBuffer, 'blue', '10', 'Mary', '200'); - console.log(`${RED}<-- Failed: ReadAsset - should not have read this asset${RESET}`); - } catch (readError) { - console.log(`${GREEN}<-- Success: ReadAsset - ${readError}${RESET}`); - } - - // all done with this listener - network2Org1.removeBlockListener(listener); - - } catch (runError) { - console.error(`Error in transaction: ${runError}`); - if (runError.stack) { - console.error(runError.stack); - } - } - } catch (error) { - console.error(`Error in setup: ${error}`); - if (error.stack) { - console.error(error.stack); - } - process.exit(1); - } - - await sleep(5000); - console.log(`${BLUE} **** END ****${RESET}`); - process.exit(0); -} -main(); diff --git a/asset-transfer-events/application-javascript/package.json b/asset-transfer-events/application-javascript/package.json deleted file mode 100644 index 04d5fa49e9..0000000000 --- a/asset-transfer-events/application-javascript/package.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "asset-transfer-events", - "version": "1.0.0", - "description": "Javascript application that uses chaincode events and block events with private data", - "engines": { - "node": ">=12", - "npm": ">=5" - }, - "engineStrict": true, - "author": "Hyperledger", - "license": "Apache-2.0", - "scripts": { - "lint": "eslint *.js" - }, - "dependencies": { - "fabric-ca-client": "^2.2.19", - "fabric-network": "^2.2.19" - }, - "devDependencies": { - "eslint": "^7.32.0" - } -} diff --git a/asset-transfer-private-data/README.md b/asset-transfer-private-data/README.md index a9613d8c22..8ee1528946 100644 --- a/asset-transfer-private-data/README.md +++ b/asset-transfer-private-data/README.md @@ -60,16 +60,10 @@ Like other samples, the Fabric test network is used to deploy and run this sampl 3. Run the application (from the `asset-transfer-private-data` folder). ``` - # To run the Javascript sample application - cd application-javascript - npm install - node app.js - # To run the Typescript sample application cd application-gateway-typescript npm install npm start - ``` ## Clean up diff --git a/asset-transfer-private-data/application-javascript/.eslintignore b/asset-transfer-private-data/application-javascript/.eslintignore deleted file mode 100644 index 1595847010..0000000000 --- a/asset-transfer-private-data/application-javascript/.eslintignore +++ /dev/null @@ -1,5 +0,0 @@ -# -# SPDX-License-Identifier: Apache-2.0 -# - -coverage diff --git a/asset-transfer-private-data/application-javascript/.eslintrc.js b/asset-transfer-private-data/application-javascript/.eslintrc.js deleted file mode 100644 index 8b83df7355..0000000000 --- a/asset-transfer-private-data/application-javascript/.eslintrc.js +++ /dev/null @@ -1,37 +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', 4], - '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-tabs': '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'] - } -}; diff --git a/asset-transfer-private-data/application-javascript/.gitignore b/asset-transfer-private-data/application-javascript/.gitignore deleted file mode 100644 index b7db091395..0000000000 --- a/asset-transfer-private-data/application-javascript/.gitignore +++ /dev/null @@ -1,16 +0,0 @@ -# -# SPDX-License-Identifier: Apache-2.0 -# - -# Coverage directory used by tools like istanbul -coverage - -# Dependency directories -node_modules/ -jspm_packages/ -package-lock.json - -wallet.org1 -wallet.org2 -!wallet.org1/.gitkeep -!wallet.org2/.gitkeep \ No newline at end of file diff --git a/asset-transfer-private-data/application-javascript/app.js b/asset-transfer-private-data/application-javascript/app.js deleted file mode 100644 index 36c03f5845..0000000000 --- a/asset-transfer-private-data/application-javascript/app.js +++ /dev/null @@ -1,358 +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, buildCCPOrg2, buildWallet } = require('../../test-application/javascript/AppUtil.js'); - -const myChannel = 'mychannel'; -const myChaincodeName = 'private'; - -const memberAssetCollectionName = 'assetCollection'; -const org1PrivateCollectionName = 'Org1MSPPrivateCollection'; -const org2PrivateCollectionName = 'Org2MSPPrivateCollection'; -const mspOrg1 = 'Org1MSP'; -const mspOrg2 = 'Org2MSP'; -const Org1UserId = 'appUser1'; -const Org2UserId = 'appUser2'; - -const RED = '\x1b[31m\n'; -const RESET = '\x1b[0m'; - -function prettyJSONString(inputString) { - if (inputString) { - return JSON.stringify(JSON.parse(inputString), null, 2); - } - else { - return inputString; - } -} - -function doFail(msgString) { - console.error(`${RED}\t${msgString}${RESET}`); - process.exit(1); -} - -function verifyAssetData(org, resultBuffer, expectedId, color, size, ownerUserId, appraisedValue) { - - let asset; - if (resultBuffer) { - asset = JSON.parse(resultBuffer.toString('utf8')); - } else { - doFail('Failed to read asset'); - } - console.log(`*** verify asset data for: ${expectedId}`); - if (!asset) { - doFail('Received empty asset'); - } - if (expectedId !== asset.assetID) { - doFail(`recieved asset ${asset.assetID} , but expected ${expectedId}`); - } - if (asset.color !== color) { - doFail(`asset ${asset.assetID} has color of ${asset.color}, expected value ${color}`); - } - if (asset.size !== size) { - doFail(`Failed size check - asset ${asset.assetID} has size of ${asset.size}, expected value ${size}`); - } - - if (asset.owner.includes(ownerUserId)) { - console.log(`\tasset ${asset.assetID} owner: ${asset.owner}`); - } else { - doFail(`Failed owner check from ${org} - asset ${asset.assetID} owned by ${asset.owner}, expected userId ${ownerUserId}`); - } - if (appraisedValue) { - if (asset.appraisedValue !== appraisedValue) { - doFail(`Failed appraised value check from ${org} - asset ${asset.assetID} has appraised value of ${asset.appraisedValue}, expected value ${appraisedValue}`); - } - } -} - -function verifyAssetPrivateDetails(resultBuffer, expectedId, appraisedValue) { - let assetPD; - if (resultBuffer) { - assetPD = JSON.parse(resultBuffer.toString('utf8')); - } else { - doFail('Failed to read asset private details'); - } - console.log(`*** verify private details: ${expectedId}`); - if (!assetPD) { - doFail('Received empty data'); - } - if (expectedId !== assetPD.assetID) { - doFail(`recieved ${assetPD.assetID} , but expected ${expectedId}`); - } - - if (appraisedValue) { - if (assetPD.appraisedValue !== appraisedValue) { - doFail(`Failed appraised value check - asset ${assetPD.assetID} has appraised value of ${assetPD.appraisedValue}, expected value ${appraisedValue}`); - } - } -} - -async function initContractFromOrg1Identity() { - console.log('\n--> Fabric client user & Gateway init: Using Org1 identity to Org1 Peer'); - // build an in memory object with the network configuration (also known as a connection profile) - const ccpOrg1 = buildCCPOrg1(); - - // build an instance of the fabric ca services client based on - // the information in the network configuration - const caOrg1Client = buildCAClient(FabricCAServices, ccpOrg1, 'ca.org1.example.com'); - - // setup the wallet to cache the credentials of the application user, on the app server locally - const walletPathOrg1 = path.join(__dirname, 'wallet/org1'); - const walletOrg1 = await buildWallet(Wallets, walletPathOrg1); - - // in a real application this would be done on an administrative flow, and only once - // stores admin identity in local wallet, if needed - await enrollAdmin(caOrg1Client, walletOrg1, mspOrg1); - // register & enroll application user with CA, which is used as client identify to make chaincode calls - // and stores app user identity in local wallet - // 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(caOrg1Client, walletOrg1, mspOrg1, Org1UserId, 'org1.department1'); - - try { - // Create a new gateway for connecting to Org's peer node. - const gatewayOrg1 = new Gateway(); - // Connect using Discovery enabled - await gatewayOrg1.connect(ccpOrg1, - { wallet: walletOrg1, identity: Org1UserId, discovery: { enabled: true, asLocalhost: true } }); - - return gatewayOrg1; - } catch (error) { - console.error(`Error in connecting to gateway: ${error}`); - process.exit(1); - } -} - -async function initContractFromOrg2Identity() { - console.log('\n--> Fabric client user & Gateway init: Using Org2 identity to Org2 Peer'); - const ccpOrg2 = buildCCPOrg2(); - const caOrg2Client = buildCAClient(FabricCAServices, ccpOrg2, 'ca.org2.example.com'); - - const walletPathOrg2 = path.join(__dirname, 'wallet/org2'); - const walletOrg2 = await buildWallet(Wallets, walletPathOrg2); - - await enrollAdmin(caOrg2Client, walletOrg2, mspOrg2); - await registerAndEnrollUser(caOrg2Client, walletOrg2, mspOrg2, Org2UserId, 'org2.department1'); - - try { - // Create a new gateway for connecting to Org's peer node. - const gatewayOrg2 = new Gateway(); - await gatewayOrg2.connect(ccpOrg2, - { wallet: walletOrg2, identity: Org2UserId, discovery: { enabled: true, asLocalhost: true } }); - - return gatewayOrg2; - } catch (error) { - console.error(`Error in connecting to gateway: ${error}`); - process.exit(1); - } -} - -// Main workflow : usecase details at asset-transfer-private-data/chaincode-go/README.md -// This app uses fabric-samples/test-network based setup and the companion chaincode -// For this usecase illustration, we will use both Org1 & Org2 client identity from this same app -// In real world the Org1 & Org2 identity will be used in different apps to achieve asset transfer. -async function main() { - try { - - /** ******* Fabric client init: Using Org1 identity to Org1 Peer ********** */ - const gatewayOrg1 = await initContractFromOrg1Identity(); - const networkOrg1 = await gatewayOrg1.getNetwork(myChannel); - const contractOrg1 = networkOrg1.getContract(myChaincodeName); - // Since this sample chaincode uses, Private Data Collection level endorsement policy, addDiscoveryInterest - // scopes the discovery service further to use the endorsement policies of collections, if any - contractOrg1.addDiscoveryInterest({ name: myChaincodeName, collectionNames: [memberAssetCollectionName, org1PrivateCollectionName] }); - - /** ~~~~~~~ Fabric client init: Using Org2 identity to Org2 Peer ~~~~~~~ */ - const gatewayOrg2 = await initContractFromOrg2Identity(); - const networkOrg2 = await gatewayOrg2.getNetwork(myChannel); - const contractOrg2 = networkOrg2.getContract(myChaincodeName); - contractOrg2.addDiscoveryInterest({ name: myChaincodeName, collectionNames: [memberAssetCollectionName, org2PrivateCollectionName] }); - try { - // Sample transactions are listed below - // Add few sample Assets & transfers one of the asset from Org1 to Org2 as the new owner - let randomNumber = Math.floor(Math.random() * 1000) + 1; - // use a random key so that we can run multiple times - let assetID1 = `asset${randomNumber}`; - let assetID2 = `asset${randomNumber + 1}`; - const assetType = 'ValuableAsset'; - let result; - let asset1Data = { objectType: assetType, assetID: assetID1, color: 'green', size: 20, appraisedValue: 100 }; - let asset2Data = { objectType: assetType, assetID: assetID2, color: 'blue', size: 35, appraisedValue: 727 }; - - console.log('\n**************** As Org1 Client ****************'); - console.log('Adding Assets to work with:\n--> Submit Transaction: CreateAsset ' + assetID1); - let statefulTxn = contractOrg1.createTransaction('CreateAsset'); - // if you need to customize endorsement to specific set of Orgs, use setEndorsingOrganizations - // statefulTxn.setEndorsingOrganizations(mspOrg1); - let tmapData = Buffer.from(JSON.stringify(asset1Data)); - statefulTxn.setTransient({ - asset_properties: tmapData - }); - result = await statefulTxn.submit(); - - // Add asset2 - console.log('\n--> Submit Transaction: CreateAsset ' + assetID2); - statefulTxn = contractOrg1.createTransaction('CreateAsset'); - tmapData = Buffer.from(JSON.stringify(asset2Data)); - statefulTxn.setTransient({ - asset_properties: tmapData - }); - result = await statefulTxn.submit(); - - - console.log('\n--> Evaluate Transaction: GetAssetByRange asset0-asset9'); - // GetAssetByRange returns assets on the ledger with ID in the range of startKey (inclusive) and endKey (exclusive) - result = await contractOrg1.evaluateTransaction('GetAssetByRange', 'asset0', 'asset9'); - console.log(`<-- result: ${prettyJSONString(result.toString())}`); - if (!result || result.length === 0) { - doFail('recieved empty query list for GetAssetByRange'); - } - console.log('\n--> Evaluate Transaction: ReadAssetPrivateDetails from ' + org1PrivateCollectionName); - // ReadAssetPrivateDetails reads data from Org's private collection. Args: collectionName, assetID - result = await contractOrg1.evaluateTransaction('ReadAssetPrivateDetails', org1PrivateCollectionName, assetID1); - console.log(`<-- result: ${prettyJSONString(result.toString())}`); - verifyAssetPrivateDetails(result, assetID1, 100); - - // Attempt Transfer the asset to Org2 , without Org2 adding AgreeToTransfer // - // Transaction should return an error: "failed transfer verification ..." - let buyerDetails = { assetID: assetID1, buyerMSP: mspOrg2 }; - try { - console.log('\n--> Attempt Submit Transaction: TransferAsset ' + assetID1); - statefulTxn = contractOrg1.createTransaction('TransferAsset'); - tmapData = Buffer.from(JSON.stringify(buyerDetails)); - statefulTxn.setTransient({ - asset_owner: tmapData - }); - result = await statefulTxn.submit(); - console.log('******** FAILED: above operation expected to return an error'); - } catch (error) { - console.log(` Successfully caught the error: \n ${error}`); - } - console.log('\n~~~~~~~~~~~~~~~~ As Org2 Client ~~~~~~~~~~~~~~~~'); - console.log('\n--> Evaluate Transaction: ReadAsset ' + assetID1); - result = await contractOrg2.evaluateTransaction('ReadAsset', assetID1); - console.log(`<-- result: ${prettyJSONString(result.toString())}`); - verifyAssetData(mspOrg2, result, assetID1, 'green', 20, Org1UserId); - - - // Org2 cannot ReadAssetPrivateDetails from Org1's private collection due to Collection policy - // Will fail: await contractOrg2.evaluateTransaction('ReadAssetPrivateDetails', org1PrivateCollectionName, assetID1); - - // Buyer from Org2 agrees to buy the asset assetID1 // - // To purchase the asset, the buyer needs to agree to the same value as the asset owner - let dataForAgreement = { assetID: assetID1, appraisedValue: 100 }; - console.log('\n--> Submit Transaction: AgreeToTransfer payload ' + JSON.stringify(dataForAgreement)); - statefulTxn = contractOrg2.createTransaction('AgreeToTransfer'); - tmapData = Buffer.from(JSON.stringify(dataForAgreement)); - statefulTxn.setTransient({ - asset_value: tmapData - }); - result = await statefulTxn.submit(); - - //Buyer can withdraw the Agreement, using DeleteTranferAgreement - /*statefulTxn = contractOrg2.createTransaction('DeleteTranferAgreement'); - statefulTxn.setEndorsingOrganizations(mspOrg2); - let dataForDeleteAgreement = { assetID: assetID1 }; - tmapData = Buffer.from(JSON.stringify(dataForDeleteAgreement)); - statefulTxn.setTransient({ - agreement_delete: tmapData - }); - result = await statefulTxn.submit();*/ - - console.log('\n**************** As Org1 Client ****************'); - // All members can send txn ReadTransferAgreement, set by Org2 above - console.log('\n--> Evaluate Transaction: ReadTransferAgreement ' + assetID1); - result = await contractOrg1.evaluateTransaction('ReadTransferAgreement', assetID1); - console.log(`<-- result: ${prettyJSONString(result.toString())}`); - - // Transfer the asset to Org2 // - // To transfer the asset, the owner needs to pass the MSP ID of new asset owner, and initiate the transfer - console.log('\n--> Submit Transaction: TransferAsset ' + assetID1); - - statefulTxn = contractOrg1.createTransaction('TransferAsset'); - tmapData = Buffer.from(JSON.stringify(buyerDetails)); - statefulTxn.setTransient({ - asset_owner: tmapData - }); - result = await statefulTxn.submit(); - - // Again ReadAsset : results will show that the buyer identity now owns the asset: - console.log('\n--> Evaluate Transaction: ReadAsset ' + assetID1); - result = await contractOrg1.evaluateTransaction('ReadAsset', assetID1); - console.log(`<-- result: ${prettyJSONString(result.toString())}`); - verifyAssetData(mspOrg1, result, assetID1, 'green', 20, Org2UserId); - - // Confirm that transfer removed the private details from the Org1 collection: - console.log('\n--> Evaluate Transaction: ReadAssetPrivateDetails'); - // ReadAssetPrivateDetails reads data from Org's private collection: Should return empty - result = await contractOrg1.evaluateTransaction('ReadAssetPrivateDetails', org1PrivateCollectionName, assetID1); - console.log(`<-- result: ${prettyJSONString(result.toString())}`); - if (result && result.length > 0) { - doFail('Expected empty data from ReadAssetPrivateDetails'); - } - console.log('\n--> Evaluate Transaction: ReadAsset ' + assetID2); - result = await contractOrg1.evaluateTransaction('ReadAsset', assetID2); - console.log(`<-- result: ${prettyJSONString(result.toString())}`); - verifyAssetData(mspOrg1, result, assetID2, 'blue', 35, Org1UserId); - - console.log('\n********* Demo deleting asset **************'); - let dataForDelete = { assetID: assetID2 }; - try { - // Non-owner Org2 should not be able to DeleteAsset. Expect an error from DeleteAsset - console.log('--> Attempt Transaction: as Org2 DeleteAsset ' + assetID2); - statefulTxn = contractOrg2.createTransaction('DeleteAsset'); - tmapData = Buffer.from(JSON.stringify(dataForDelete)); - statefulTxn.setTransient({ - asset_delete: tmapData - }); - result = await statefulTxn.submit(); - console.log('******** FAILED : expected to return an error'); - } catch (error) { - console.log(` Successfully caught the error: \n ${error}`); - } - // Delete Asset2 as Org1 - console.log('--> Submit Transaction: as Org1 DeleteAsset ' + assetID2); - statefulTxn = contractOrg1.createTransaction('DeleteAsset'); - tmapData = Buffer.from(JSON.stringify(dataForDelete)); - statefulTxn.setTransient({ - asset_delete: tmapData - }); - result = await statefulTxn.submit(); - - console.log('\n--> Evaluate Transaction: ReadAsset ' + assetID2); - result = await contractOrg1.evaluateTransaction('ReadAsset', assetID2); - console.log(`<-- result: ${prettyJSONString(result.toString())}`); - if (result && result.length > 0) { - doFail('Expected empty read, after asset is deleted'); - } - - console.log('\n~~~~~~~~~~~~~~~~ As Org2 Client ~~~~~~~~~~~~~~~~'); - // Org2 can ReadAssetPrivateDetails: Org2 is owner, and private details exist in new owner's Collection - console.log('\n--> Evaluate Transaction as Org2: ReadAssetPrivateDetails ' + assetID1 + ' from ' + org2PrivateCollectionName); - result = await contractOrg2.evaluateTransaction('ReadAssetPrivateDetails', org2PrivateCollectionName, assetID1); - console.log(`<-- result: ${prettyJSONString(result.toString())}`); - verifyAssetPrivateDetails(result, assetID1, 100); - } finally { - // Disconnect from the gateway peer when all work for this client identity is complete - gatewayOrg1.disconnect(); - gatewayOrg2.disconnect(); - } - } catch (error) { - console.error(`Error in transaction: ${error}`); - if (error.stack) { - console.error(error.stack); - } - process.exit(1); - } -} - -main(); diff --git a/asset-transfer-private-data/application-javascript/package.json b/asset-transfer-private-data/application-javascript/package.json deleted file mode 100644 index 355adb3f0f..0000000000 --- a/asset-transfer-private-data/application-javascript/package.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "name": "asset-transfer-private-data", - "version": "1.0.0", - "description": "asset-transfer-private-data application implemented in JavaScript", - "engines": { - "node": ">=12", - "npm": ">=5" - }, - "scripts": { - "lint": "eslint .", - "pretest": "npm run lint", - "test": "nyc mocha --recursive" - }, - "engineStrict": true, - "author": "Hyperledger", - "license": "Apache-2.0", - "dependencies": { - "fabric-ca-client": "^2.2.19", - "fabric-network": "^2.2.19" - }, - "devDependencies": { - "chai": "^4.2.0", - "eslint": "^5.9.0", - "mocha": "^5.2.0", - "nyc": "^14.1.1", - "sinon": "^7.1.1", - "sinon-chai": "^3.3.0" - }, - "nyc": { - "exclude": [ - "coverage/**", - "test/**" - ], - "reporter": [ - "text-summary", - "html" - ], - "all": true, - "check-coverage": true, - "statements": 100, - "branches": 100, - "functions": 100, - "lines": 100 - } -} diff --git a/asset-transfer-secured-agreement/README.md b/asset-transfer-secured-agreement/README.md index 2cf2acfacb..83e4c2fc6f 100644 --- a/asset-transfer-secured-agreement/README.md +++ b/asset-transfer-secured-agreement/README.md @@ -50,10 +50,6 @@ Like other samples, the Fabric test network is used to deploy and run this sampl cd application-gateway-typescript npm install npm start - - # To run the Javascript sample application - cd application-javascript - node app.js ``` ## Clean up diff --git a/asset-transfer-secured-agreement/application-javascript/.eslintignore b/asset-transfer-secured-agreement/application-javascript/.eslintignore deleted file mode 100644 index 1595847010..0000000000 --- a/asset-transfer-secured-agreement/application-javascript/.eslintignore +++ /dev/null @@ -1,5 +0,0 @@ -# -# SPDX-License-Identifier: Apache-2.0 -# - -coverage diff --git a/asset-transfer-secured-agreement/application-javascript/.eslintrc.js b/asset-transfer-secured-agreement/application-javascript/.eslintrc.js deleted file mode 100644 index 072edaf65a..0000000000 --- a/asset-transfer-secured-agreement/application-javascript/.eslintrc.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - */ -'use strict'; - -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'] - } -}; diff --git a/asset-transfer-secured-agreement/application-javascript/.gitignore b/asset-transfer-secured-agreement/application-javascript/.gitignore deleted file mode 100644 index 21b287f72d..0000000000 --- a/asset-transfer-secured-agreement/application-javascript/.gitignore +++ /dev/null @@ -1,14 +0,0 @@ -# -# SPDX-License-Identifier: Apache-2.0 -# - -# Coverage directory used by tools like istanbul -coverage - -# Dependency directories -node_modules/ -jspm_packages/ -package-lock.json - -wallet -!wallet/.gitkeep diff --git a/asset-transfer-secured-agreement/application-javascript/app.js b/asset-transfer-secured-agreement/application-javascript/app.js deleted file mode 100644 index b8a0958227..0000000000 --- a/asset-transfer-secured-agreement/application-javascript/app.js +++ /dev/null @@ -1,544 +0,0 @@ -/* - * Copyright IBM Corp. All Rights Reserved. - * - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict'; - -/** - * Application 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 - * -- How to submit a transaction - * -- How to query - * -- How to limit the organizations involved in a transaction - * - * To see the SDK workings, try setting the logging to show on the console before running - * export HFC_LOGGING='{"debug":"console"}' - */ - -// 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 the asset-transfer-secured-agreement/chaincode-go chaincode deployed on -// the channel "mychannel". The following deploy command will package, install, -// approve, and commit the golang chaincode, all the actions it takes -// to deploy a chaincode to a channel with the endorsement and private collection -// settings. -// ===> from directory /fabric-samples/test-network -// ./network.sh deployCC -ccn secured -ccp ../asset-transfer-secured-agreement/chaincode-go/ -ccl go -ccep "OR('Org1MSP.peer','Org2MSP.peer')" -// -// - Be sure that node.js is installed -// ===> from directory /fabric-samples/asset-transfer-secured-agreement/application-javascript -// node -v -// - npm installed code dependencies -// ===> from directory /fabric-samples/asset-transfer-secured-agreement/application-javascript -// npm install -// - to run this test application -// ===> from directory /fabric-samples/asset-transfer-secured-agreement/application-javascript -// node app.js - -// NOTE: If you see an error like these: -/* - - Error in setup: Error: DiscoveryService: mychannel error: access denied - - OR - - Failed to register user : Error: fabric-ca request register failed with errors [[ { code: 20, message: 'Authentication failure' } ]] - - */ -// Delete the /fabric-samples/asset-transfer-secured-agreement/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. -// - -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, buildCCPOrg2, buildWallet } = require('../../test-application/javascript/AppUtil.js'); - -const channelName = 'mychannel'; -const chaincodeName = 'secured'; - -const org1 = 'Org1MSP'; -const org2 = 'Org2MSP'; -const Org1UserId = 'appUser1'; -const Org2UserId = 'appUser2'; - -const RED = '\x1b[31m\n'; -const GREEN = '\x1b[32m\n'; -const RESET = '\x1b[0m'; - -async function initGatewayForOrg1() { - console.log(`${GREEN}--> Fabric client user & Gateway init: Using Org1 identity to Org1 Peer${RESET}`); - // build an in memory object with the network configuration (also known as a connection profile) - const ccpOrg1 = buildCCPOrg1(); - - // build an instance of the fabric ca services client based on - // the information in the network configuration - const caOrg1Client = buildCAClient(FabricCAServices, ccpOrg1, 'ca.org1.example.com'); - - // setup the wallet to cache the credentials of the application user, on the app server locally - const walletPathOrg1 = path.join(__dirname, 'wallet', 'org1'); - const walletOrg1 = await buildWallet(Wallets, walletPathOrg1); - - // in a real application this would be done on an administrative flow, and only once - // stores admin identity in local wallet, if needed - await enrollAdmin(caOrg1Client, walletOrg1, org1); - // register & enroll application user with CA, which is used as client identify to make chaincode calls - // and stores app user identity in local wallet - // 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(caOrg1Client, walletOrg1, org1, Org1UserId, 'org1.department1'); - - try { - // Create a new gateway for connecting to Org's peer node. - const gatewayOrg1 = new Gateway(); - //connect using Discovery enabled - await gatewayOrg1.connect(ccpOrg1, - { wallet: walletOrg1, identity: Org1UserId, discovery: { enabled: true, asLocalhost: true } }); - - return gatewayOrg1; - } catch (error) { - console.error(`Error in connecting to gateway for Org1: ${error}`); - process.exit(1); - } -} - -async function initGatewayForOrg2() { - console.log(`${GREEN}--> Fabric client user & Gateway init: Using Org2 identity to Org2 Peer${RESET}`); - const ccpOrg2 = buildCCPOrg2(); - const caOrg2Client = buildCAClient(FabricCAServices, ccpOrg2, 'ca.org2.example.com'); - - const walletPathOrg2 = path.join(__dirname, 'wallet', 'org2'); - const walletOrg2 = await buildWallet(Wallets, walletPathOrg2); - - await enrollAdmin(caOrg2Client, walletOrg2, org2); - await registerAndEnrollUser(caOrg2Client, walletOrg2, org2, Org2UserId, 'org2.department1'); - - try { - // Create a new gateway for connecting to Org's peer node. - const gatewayOrg2 = new Gateway(); - await gatewayOrg2.connect(ccpOrg2, - { wallet: walletOrg2, identity: Org2UserId, discovery: { enabled: true, asLocalhost: true } }); - - return gatewayOrg2; - } catch (error) { - console.error(`Error in connecting to gateway for Org2: ${error}`); - process.exit(1); - } -} - -async function readPrivateAsset(assetKey, org, contract) { - console.log(`${GREEN}--> Evaluate Transaction: GetAssetPrivateProperties, - ${assetKey} from organization ${org}${RESET}`); - try { - const resultBuffer = await contract.evaluateTransaction('GetAssetPrivateProperties', assetKey); - const asset = JSON.parse(resultBuffer.toString('utf8')); - console.log(`*** Result: GetAssetPrivateProperties, ${JSON.stringify(asset)}`); - - } catch (evalError) { - console.log(`*** Failed evaluateTransaction readPrivateAsset: ${evalError}`); - } -} - -async function readBidPrice(assetKey, org, contract) { - console.log(`${GREEN}--> Evaluate Transaction: GetAssetBidPrice, - ${assetKey} from organization ${org}${RESET}`); - try { - const resultBuffer = await contract.evaluateTransaction('GetAssetBidPrice', assetKey); - const asset = JSON.parse(resultBuffer.toString('utf8')); - console.log(`*** Result: GetAssetBidPrice, ${JSON.stringify(asset)}`); - - } catch (evalError) { - console.log(`*** Failed evaluateTransaction GetAssetBidPrice: ${evalError}`); - } -} - -async function readSalePrice(assetKey, org, contract) { - console.log(`${GREEN}--> Evaluate Transaction: GetAssetSalesPrice, - ${assetKey} from organization ${org}${RESET}`); - try { - const resultBuffer = await contract.evaluateTransaction('GetAssetSalesPrice', assetKey); - const asset = JSON.parse(resultBuffer.toString('utf8')); - console.log(`*** Result: GetAssetSalesPrice, ${JSON.stringify(asset)}`); - - } catch (evalError) { - console.log(`*** Failed evaluateTransaction GetAssetSalesPrice: ${evalError}`); - } -} - -function checkAsset(org, resultBuffer, ownerOrg) { - let asset; - if (resultBuffer) { - asset = JSON.parse(resultBuffer.toString('utf8')); - } - - if (asset) { - if (asset.ownerOrg === ownerOrg) { - console.log(`*** Result from ${org} - asset ${asset.assetID} owned by ${asset.ownerOrg} DESC:${asset.publicDescription}`); - } else { - console.log(`${RED}*** Failed owner check from ${org} - asset ${asset.assetID} owned by ${asset.ownerOrg} DESC:${asset.publicDescription}${RESET}`); - } - } -} - -// This is not a real function for an application, this simulates when two applications are running -// from different organizations and what they would see if they were to both query the asset -async function readAssetByBothOrgs(assetKey, ownerOrg, contractOrg1, contractOrg2) { - console.log(`${GREEN}--> Evaluate Transactions: ReadAsset, - ${assetKey} should be owned by ${ownerOrg}${RESET}`); - let resultBuffer; - resultBuffer = await contractOrg1.evaluateTransaction('ReadAsset', assetKey); - checkAsset('Org1', resultBuffer, ownerOrg); - resultBuffer = await contractOrg2.evaluateTransaction('ReadAsset', assetKey); - checkAsset('Org2', resultBuffer, ownerOrg); -} - -// This application uses fabric-samples/test-network based setup and the companion chaincode -// For this illustration, both Org1 & Org2 client identities will be used, however -// notice they are used by two different "gateway"s to simulate two different running -// applications from two different organizations. -async function main() { - console.log(`${GREEN} **** START ****${RESET}`); - try { - const randomNumber = Math.floor(Math.random() * 100) + 1; - let assetKey; - - /** ******* Fabric client init: Using Org1 identity to Org1 Peer ******* */ - const gatewayOrg1 = await initGatewayForOrg1(); - const networkOrg1 = await gatewayOrg1.getNetwork(channelName); - const contractOrg1 = networkOrg1.getContract(chaincodeName); - - /** ******* Fabric client init: Using Org2 identity to Org2 Peer ******* */ - const gatewayOrg2 = await initGatewayForOrg2(); - const networkOrg2 = await gatewayOrg2.getNetwork(channelName); - const contractOrg2 = networkOrg2.getContract(chaincodeName); - - try { - let transaction; - - try { - // Create an asset by organization Org1, this only requires the owning - // organization to endorse. - // With the gateway using discovery, we should limit the organizations used - // to endorse. This only requires knowledge of the Organizations and not - // the actual peers that may be active at any given time. - const asset_properties = { - object_type: 'asset_properties', - color: 'blue', - size: 35, - salt: Buffer.from(randomNumber.toString()).toString('hex') - }; - const asset_properties_string = JSON.stringify(asset_properties); - console.log(`${GREEN}--> Submit Transaction: CreateAsset as Org1 - endorsed by Org1${RESET}`); - console.log(`${asset_properties_string}`); - transaction = contractOrg1.createTransaction('CreateAsset'); - transaction.setEndorsingOrganizations(org1); - transaction.setTransient({ - asset_properties: Buffer.from(asset_properties_string) - }); - assetKey = await transaction.submit( `Asset owned by ${org1} is not for sale`); - console.log(`*** Result: committed, asset ${assetKey} is owned by Org1`); - } catch (createError) { - console.log(`${RED}*** Failed: CreateAsset - ${createError}${RESET}`); - } - - // read the public details by both orgs - await readAssetByBothOrgs(assetKey, org1, contractOrg1, contractOrg2); - // Org1 should be able to read the private data details of this asset - await readPrivateAsset(assetKey, org1, contractOrg1); - // Org2 is not the owner and does not have the private details, this should fail - await readPrivateAsset(assetKey, org2, contractOrg2); - - try { - // This is an update to the public state and requires only the owner to endorse. - console.log(`${GREEN}--> Submit Transaction: ChangePublicDescription ${assetKey}, as Org1 - endorse by Org1${RESET}`); - transaction = contractOrg1.createTransaction('ChangePublicDescription'); - transaction.setEndorsingOrganizations(org1); - await transaction.submit(assetKey, `Asset ${assetKey} owned by ${org1} is for sale`); - console.log(`*** Result: committed, asset ${assetKey} is now for sale by Org1`); - } catch (updateError) { - console.log(`${RED}*** Failed: ChangePublicDescription - ${updateError}${RESET}`); - } - - // read the public details by both orgs - await readAssetByBothOrgs(assetKey, org1, contractOrg1, contractOrg2); - - try { - // This is an update to the public state and requires the owner(Org1) to endorse and - // sent by the owner org client (Org1). - // Since the client is from Org2, which is not the owner, this will fail - console.log(`${GREEN}--> Submit Transaction: ChangePublicDescription ${assetKey}, as Org2 - endorse by Org2${RESET}`); - transaction = contractOrg2.createTransaction('ChangePublicDescription'); - transaction.setEndorsingOrganizations(org2); - await transaction.submit(assetKey, `Asset ${assetKey} owned by ${org2} is NOT for sale`); - console.log(`${RESET}*** Failed: Org2 is not the owner and this should have failed${RESET}`); - } catch (updateError) { - console.log(`*** Success: ChangePublicDescription has failed endorsememnt by Org2 sent by Org2 - ${updateError}`); - } - - try { - // This is an update to the public state and requires the owner(Org1) to endorse and - // sent by the owner org client (Org1). - // Since this is being sent by Org2, which is not the owner, this will fail - console.log(`${GREEN}--> Submit Transaction: ChangePublicDescription ${assetKey}, as Org2 - endorse by Org1${RESET}`); - transaction = contractOrg2.createTransaction('ChangePublicDescription'); - transaction.setEndorsingOrganizations(org1); - await transaction.submit(assetKey, `Asset ${assetKey} owned by ${org2} is NOT for sale`); - console.log(`${RESET}*** Failed: Org2 is not the owner and this should have failed${RESET}`); - } catch (updateError) { - console.log(`*** Success: ChangePublicDescription has failed endorsement by Org1 sent by Org2 - ${updateError}`); - } - - // read the public details by both orgs - await readAssetByBothOrgs(assetKey, org1, contractOrg1, contractOrg2); - - try { - // Agree to a sell by Org1 - const asset_price = { - asset_id: assetKey.toString(), - price: 110, - trade_id: randomNumber.toString() - }; - const asset_price_string = JSON.stringify(asset_price); - console.log(`${GREEN}--> Submit Transaction: AgreeToSell, ${assetKey} as Org1 - endorsed by Org1${RESET}`); - transaction = contractOrg1.createTransaction('AgreeToSell'); - transaction.setEndorsingOrganizations(org1); - transaction.setTransient({ - asset_price: Buffer.from(asset_price_string) - }); - //call agree to sell with desired price - await transaction.submit(assetKey); - console.log(`*** Result: committed, Org1 has agreed to sell asset ${assetKey} for 110`); - } catch (sellError) { - console.log(`${RED}*** Failed: AgreeToSell - ${sellError}${RESET}`); - } - - try { - // check the private information about the asset from Org2 - // Org1 would have to send Org2 these details, so the hash of the - // details may be checked by the chaincode. - const asset_properties = { - object_type: 'asset_properties', - color: 'blue', - size: 35, - salt: Buffer.from(randomNumber.toString()).toString('hex') - }; - const asset_properties_string = JSON.stringify(asset_properties); - console.log(`${GREEN}--> Evalute: VerifyAssetProperties, ${assetKey} as Org2 - endorsed by Org2${RESET}`); - console.log(`${asset_properties_string}`); - transaction = contractOrg2.createTransaction('VerifyAssetProperties'); - transaction.setTransient({ - asset_properties: Buffer.from(asset_properties_string) - }); - const verifyResultBuffer = await transaction.evaluate(assetKey); - if (verifyResultBuffer) { - const verifyResult = Boolean(verifyResultBuffer.toString()); - if (verifyResult) { - console.log(`*** Successfully VerifyAssetProperties, private information about asset ${assetKey} has been verified by Org2`); - } else { - console.log(`*** Failed: VerifyAssetProperties, private information about asset ${assetKey} has not been verified by Org2`); - } - } else { - console.log(`*** Failed: VerifyAssetProperties, private information about asset ${assetKey} has not been verified by Org2`); - } - } catch (verifyError) { - console.log(`${RED}*** Failed: VerifyAssetProperties - ${verifyError}${RESET}`); - } - - try { - // Agree to a buy by Org2 - const asset_price = { - asset_id: assetKey.toString(), - price: 100, - trade_id: randomNumber.toString() - }; - const asset_price_string = JSON.stringify(asset_price); - const asset_properties = { - object_type: 'asset_properties', - color: 'blue', - size: 35, - salt: Buffer.from(randomNumber.toString()).toString('hex') - }; - const asset_properties_string = JSON.stringify(asset_properties); - console.log(`${GREEN}--> Submit Transaction: AgreeToBuy, ${assetKey} as Org2 - endorsed by Org2${RESET}`); - transaction = contractOrg2.createTransaction('AgreeToBuy'); - transaction.setEndorsingOrganizations(org2); - transaction.setTransient({ - asset_price: Buffer.from(asset_price_string), - asset_properties: Buffer.from(asset_properties_string) - }); - await transaction.submit(assetKey); - console.log(`*** Result: committed, Org2 has agreed to buy asset ${assetKey} for 100`); - } catch (buyError) { - console.log(`${RED}*** Failed: AgreeToBuy - ${buyError}${RESET}`); - } - - // read the public details by both orgs - await readAssetByBothOrgs(assetKey, org1, contractOrg1, contractOrg2); - - // Org1 should be able to read the private data details of this asset - await readPrivateAsset(assetKey, org1, contractOrg1); - // Org2 is not the owner and does not have the private details, this should fail - await readPrivateAsset(assetKey, org2, contractOrg2); - - // Org1 should be able to read the sale price of this asset - await readSalePrice(assetKey, org1, contractOrg1); - // Org2 has not set a sale price and this should fail - await readSalePrice(assetKey, org2, contractOrg2); - - // Org1 has not agreed to buy so this should fail - await readBidPrice(assetKey, org1, contractOrg1); - // Org2 should be able to see the price it has agreed - await readBidPrice(assetKey, org2, contractOrg2); - - try { - // Org1 will try to transfer the asset to Org2 - // This will fail due to the sell price and the bid price - // are not the same - const asset_price = { - asset_id: assetKey.toString(), - price: 110, - trade_id: randomNumber.toString() - }; - const asset_price_string = JSON.stringify(asset_price); - - console.log(`${GREEN}--> Submit Transaction: TransferAsset, ${assetKey} as Org1 - endorsed by Org1${RESET}`); - transaction = contractOrg1.createTransaction('TransferAsset'); - transaction.setEndorsingOrganizations(org1); - transaction.setTransient({ - asset_price: Buffer.from(asset_price_string) - }); - await transaction.submit(assetKey, org2); - console.log(`${RED}*** Failed: committed, TransferAsset should have failed for asset ${assetKey}${RESET}`); - } catch (transferError) { - console.log(`*** Success: TransferAsset - ${transferError}`); - } - - try { - // Agree to a sell by Org1 - // Org1, the seller will agree to the bid price of Org2 - const asset_price = { - asset_id: assetKey.toString(), - price: 100, - trade_id: randomNumber.toString() - }; - const asset_price_string = JSON.stringify(asset_price); - console.log(`${GREEN}--> Submit Transaction: AgreeToSell, ${assetKey} as Org1 - endorsed by Org1${RESET}`); - transaction = contractOrg1.createTransaction('AgreeToSell'); - transaction.setEndorsingOrganizations(org1); - transaction.setTransient({ - asset_price: Buffer.from(asset_price_string) - }); - await transaction.submit(assetKey); - console.log(`*** Result: committed, Org1 has agreed to sell asset ${assetKey} for 100`); - } catch (sellError) { - console.log(`${RED}*** Failed: AgreeToSell - ${sellError}${RESET}`); - } - - // read the public details by both orgs - await readAssetByBothOrgs(assetKey, org1, contractOrg1, contractOrg2); - - // Org1 should be able to read the private data details of this asset - await readPrivateAsset(assetKey, org1, contractOrg1); - - // Org1 should be able to read the sale price of this asset - await readSalePrice(assetKey, org1, contractOrg1); - - // Org2 should be able to see the price it has agreed - await readBidPrice(assetKey, org2, contractOrg2); - - try { - // Org2 user will try to transfer the asset to Org2 - // This will fail as the owner is Org1 - const asset_price = { - asset_id: assetKey.toString(), - price: 100, - trade_id: randomNumber.toString() - }; - const asset_price_string = JSON.stringify(asset_price); - - console.log(`${GREEN}--> Submit Transaction: TransferAsset, ${assetKey} as Org2 - endorsed by Org1${RESET}`); - transaction = contractOrg2.createTransaction('TransferAsset'); - transaction.setEndorsingOrganizations(org1, org2); - transaction.setTransient({ - asset_price: Buffer.from(asset_price_string) - }); - await transaction.submit(assetKey, org2); - console.log(`${RED}*** FAILED: committed, TransferAsset - Org2 now owns the asset ${assetKey}${RESET}`); - } catch (transferError) { - console.log(`*** Succeded: TransferAsset - ${transferError}`); - } - - try { - // Org1 will transfer the asset to Org2 - // This will now complete as the sell price and the bid price are the same - const asset_price = { - asset_id: assetKey.toString(), - price: 100, - trade_id: randomNumber.toString() - }; - const asset_price_string = JSON.stringify(asset_price); - - console.log(`${GREEN}--> Submit Transaction: TransferAsset, ${assetKey} as Org1 - endorsed by Org1${RESET}`); - - transaction = contractOrg1.createTransaction('TransferAsset'); - transaction.setEndorsingOrganizations(org1, org2); - transaction.setTransient({ - asset_price: Buffer.from(asset_price_string) - }); - await transaction.submit(assetKey, org2); - console.log(`*** Results: committed, TransferAsset - Org2 now owns the asset ${assetKey}`); - } catch (transferError) { - console.log(`${RED}*** Failed: TransferAsset - ${transferError}${RESET}`); - } - - // read the public details by both orgs - await readAssetByBothOrgs(assetKey, org2, contractOrg1, contractOrg2); - - // Org2 should be able to read the private data details of this asset - await readPrivateAsset(assetKey, org2, contractOrg2); - // Org1 should not be able to read the private data details of this asset - await readPrivateAsset(assetKey, org1, contractOrg1); - - try { - // This is an update to the public state and requires only the owner to endorse. - // Org2 wants to indicate that the items is no longer for sale - console.log(`${GREEN}--> Submit Transaction: ChangePublicDescription ${assetKey}, as Org2 - endorse by Org2${RESET}`); - transaction = contractOrg2.createTransaction('ChangePublicDescription'); - transaction.setEndorsingOrganizations(org2); - await transaction.submit(assetKey, `Asset ${assetKey} owned by ${org2} is NOT for sale`); - console.log('*** Results: committed - Org2 is now the owner and asset is not for sale'); - } catch (updateError) { - console.log(`${RED}*** Failed: ChangePublicDescription has failed by Org2 - ${updateError}${RESET}`); - } - - // read the public details by both orgs - await readAssetByBothOrgs(assetKey, org2, contractOrg1, contractOrg2); - } catch (runError) { - console.error(`Error in transaction: ${runError}`); - if (runError.stack) { - console.error(runError.stack); - } - process.exit(1); - } finally { - // Disconnect from the gateway peer when all work for this client identity is complete - console.log(`${GREEN}--> Close gateways`); - gatewayOrg1.disconnect(); - gatewayOrg2.disconnect(); - } - } catch (error) { - console.error(`Error in setup: ${error}`); - if (error.stack) { - console.error(error.stack); - } - process.exit(1); - } - console.log(`${GREEN} **** END ****${RESET}`); -} -main(); diff --git a/asset-transfer-secured-agreement/application-javascript/package.json b/asset-transfer-secured-agreement/application-javascript/package.json deleted file mode 100644 index 44f47295e6..0000000000 --- a/asset-transfer-secured-agreement/application-javascript/package.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "asset-transfer-secured-agreement", - "version": "1.0.0", - "description": "Javascript application 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", - "engines": { - "node": ">=12", - "npm": ">=5" - }, - "engineStrict": true, - "author": "Hyperledger", - "license": "Apache-2.0", - "scripts": { - "lint": "eslint *.js" - }, - "dependencies": { - "fabric-ca-client": "^2.2.19", - "fabric-network": "^2.2.19" - }, - "devDependencies": { - "eslint": "^7.32.0" - } -} diff --git a/ci/scripts/run-test-network-basic.sh b/ci/scripts/run-test-network-basic.sh index 966bcc8a83..023acaddd9 100755 --- a/ci/scripts/run-test-network-basic.sh +++ b/ci/scripts/run-test-network-basic.sh @@ -38,44 +38,34 @@ set -x createNetwork -# Run Go application -print "Initializing Go application" -export CHAINCODE_NAME=basic_${CHAINCODE_LANGUAGE}_for_go_app +# Run Go gateway application +print "Initializing Go gateway application" +export CHAINCODE_NAME=go_gateway deployChaincode -pushd ../asset-transfer-basic/application-go +pushd ../asset-transfer-basic/application-gateway-go print "Executing AssetTransfer.go" go run . popd -# Run Java application -print "Initializing Java application" -export CHAINCODE_NAME=basic_${CHAINCODE_LANGUAGE}_for_java_app -deployChaincode -pushd ../asset-transfer-basic/application-java -print "Executing Gradle Run" -gradle run -popd -# Run Javascript application -print "Initializing Javascript application" -export CHAINCODE_NAME=basic_${CHAINCODE_LANGUAGE}_for_javascript_app +# Run gateway typescript application +print "Initializing Typescript gateway application" +export CHAINCODE_NAME=typescript_gateway deployChaincode -pushd ../asset-transfer-basic/application-javascript +pushd ../asset-transfer-basic/application-gateway-typescript npm install -print "Executing app.js" -node app.js +print "Start application" +npm start popd -# Run typescript application -print "Initializing Typescript application" -export CHAINCODE_NAME=basic_${CHAINCODE_LANGUAGE}_for_typescript_app + +# Run Java application using gateway +print "Initializing Java application" +export CHAINCODE_NAME=java_gateway deployChaincode -pushd ../asset-transfer-basic/application-typescript -npm install -print "Building app.ts" -npm run build -print "Running the output app" -node dist/app.js +pushd ../asset-transfer-basic/application-gateway-java +print "Executing Gradle Run" +./gradlew run popd diff --git a/ci/scripts/run-test-network-events.sh b/ci/scripts/run-test-network-events.sh index 03242d833a..cf7fb2374e 100755 --- a/ci/scripts/run-test-network-events.sh +++ b/ci/scripts/run-test-network-events.sh @@ -1,3 +1,5 @@ +#!/bin/bash + set -euo pipefail CHAINCODE_LANGUAGE=${CHAINCODE_LANGUAGE:-javascript} @@ -23,27 +25,12 @@ function stopNetwork() { ./network.sh down } -# Run Javascript application -createNetwork -print "Initializing Javascript application" -pushd ../asset-transfer-events/application-javascript -npm install -print "Executing app.js" -node app.js -popd -stopNetwork -print "Remove wallet storage" -rm -R ../asset-transfer-events/application-javascript/wallet - - # Run typescript gateway application createNetwork print "Initializing TypeScript gateway application" pushd ../asset-transfer-events/application-gateway-typescript npm install -print "Build app" -npm run build -print "Executing dist/app.js" +print "Start application" npm start popd stopNetwork diff --git a/ci/scripts/run-test-network-gateway.sh b/ci/scripts/run-test-network-gateway.sh deleted file mode 100755 index 3174816aab..0000000000 --- a/ci/scripts/run-test-network-gateway.sh +++ /dev/null @@ -1,76 +0,0 @@ -#!/bin/bash - -set -euo pipefail - -CHAINCODE_LANGUAGE=${CHAINCODE_LANGUAGE:-go} -CHAINCODE_PATH=${CHAINCODE_PATH:-../asset-transfer-basic} - -function print() { - GREEN='\033[0;32m' - NC='\033[0m' - echo - echo -e "${GREEN}${1}${NC}" -} - -function createNetwork() { - print "Creating 3 Org network" - ./network.sh up createChannel -ca -s couchdb - cd addOrg3 - ./addOrg3.sh up -ca -s couchdb - cd .. -} - -function deployChaincode() { - print "Deploying ${CHAINCODE_NAME} chaincode" - ./network.sh deployCC -ccn "${CHAINCODE_NAME}" -ccp "${CHAINCODE_PATH}/chaincode-${CHAINCODE_LANGUAGE}" -ccv 1 -ccs 1 -ccl "${CHAINCODE_LANGUAGE}" -} - -function stopNetwork() { - print "Stopping network" - ./network.sh down -} - -# print all executed commands to assist with debug in CI environment -set -x - -# Set up one test network to run each test scenario. -# Each test will create an independent scope by installing a new chaincode contract to the channel. -createNetwork - - -# Run Go gateway application -print "Initializing Go gateway application" -export CHAINCODE_NAME=go_gateway -deployChaincode -pushd ../asset-transfer-basic/application-gateway-go -print "Executing AssetTransfer.go" -go run . -popd - - -# Run gateway typescript application -print "Initializing Typescript gateway application" -export CHAINCODE_NAME=typescript_gateway -deployChaincode -pushd ../asset-transfer-basic/application-gateway-typescript -npm install -print "Building app.ts" -npm run build -print "Running the output app" -node dist/app.js -popd - - -# Run Java application using gateway -print "Initializing Java application" -export CHAINCODE_NAME=java_gateway -deployChaincode -pushd ../asset-transfer-basic/application-gateway-java -print "Executing Gradle Run" -./gradlew run -popd - - -stopNetwork - -{ set +x; } 2>/dev/null diff --git a/ci/scripts/run-test-network-hsm.sh b/ci/scripts/run-test-network-hsm.sh index 5ecd171538..39bfd5770a 100755 --- a/ci/scripts/run-test-network-hsm.sh +++ b/ci/scripts/run-test-network-hsm.sh @@ -34,31 +34,14 @@ function stopNetwork() { # Each test will create an independent scope by installing a new chaincode contract to the channel. createNetwork - -# Run typescript HSM application -print "Initializing Typescript HSM application" -export CHAINCODE_NAME=typescript_hsm -deployChaincode -pushd ../asset-transfer-basic/application-typescript-hsm -print "Setup SoftHSM" -export SOFTHSM2_CONF=$PWD/softhsm2.conf -print "install dependencies" -npm install -print "Building app.ts" -npm run build -print "Running the output app" -node dist/app.js -popd +echo 'go install pkcs11 enabled fabric-ca-client' +GOBIN=${PWD}/../bin go install -tags pkcs11 github.com/hyperledger/fabric-ca/cmd/fabric-ca-client@latest +fabric-ca-client version # Run Typescript HSM gateway application print "Initializing Typescript HSM Gateway application" export CHAINCODE_NAME=ts_hsm_gateway deployChaincode -echo 'Delete fabric-ca-client from samples bin' -rm ../bin/fabric-ca-client -echo 'go install pkcs11 enabled fabric-ca-client' -GOBIN=${PWD}/../bin go install -tags pkcs11 github.com/hyperledger/fabric-ca/cmd/fabric-ca-client@latest -fabric-ca-client version print "Initializing Typescript HSM gateway application" pushd ../hardware-security-module/scripts/ print "Enroll and register User in HSM" diff --git a/ci/scripts/run-test-network-private.sh b/ci/scripts/run-test-network-private.sh index 33b1c13d41..c973409b82 100755 --- a/ci/scripts/run-test-network-private.sh +++ b/ci/scripts/run-test-network-private.sh @@ -1,3 +1,5 @@ +#!/bin/bash + set -euo pipefail CHAINCODE_LANGUAGE=${CHAINCODE_LANGUAGE:-go} @@ -23,25 +25,12 @@ function stopNetwork() { ./network.sh down } -# Run Javascript application -createNetwork -print "Initializing Javascript application" -pushd ../asset-transfer-private-data/application-javascript -npm install -print "Executing app.js" -node app.js -popd -stopNetwork - - # Run typescript gateway application createNetwork print "Initializing typescript application" pushd ../asset-transfer-private-data/application-gateway-typescript npm install -print "Build typescript app" -npm run build -print "Executing app.js" +print "Start application" npm start popd stopNetwork diff --git a/ci/scripts/run-test-network-secured.sh b/ci/scripts/run-test-network-secured.sh index 6450ee984f..19d13f1f93 100755 --- a/ci/scripts/run-test-network-secured.sh +++ b/ci/scripts/run-test-network-secured.sh @@ -1,3 +1,5 @@ +#!/bin/bash + set -euo pipefail CHAINCODE_LANGUAGE=${CHAINCODE_LANGUAGE:-go} @@ -23,26 +25,12 @@ function stopNetwork() { ./network.sh down } -# Run Javascript application -createNetwork -print "Initializing Javascript application" -pushd ../asset-transfer-secured-agreement/application-javascript -npm install -print "Executing app.js" -node app.js -popd -stopNetwork -print "Remove wallet storage" -rm -R ../asset-transfer-secured-agreement/application-javascript/wallet - # Run Typescript Gateway application createNetwork print "Initializing typescript application" pushd ../asset-transfer-secured-agreement/application-gateway-typescript npm install -print "Build app" -npm run build -print "Executing dist/app.js" +print "Start application" npm start popd stopNetwork diff --git a/hardware-security-module/README.md b/hardware-security-module/README.md index 5131612353..2ffd0e35c2 100644 --- a/hardware-security-module/README.md +++ b/hardware-security-module/README.md @@ -32,7 +32,7 @@ To be able to register and enroll identities using an HSM you need a PKCS#11 ena To install this use the following command ```bash -go install -tags 'pkcs11' github.com/hyperledger/fabric-ca/cmd/fabric-ca-client@latest +go install -tags pkcs11 github.com/hyperledger/fabric-ca/cmd/fabric-ca-client@latest ``` ## Create Fabric network and deploy the smart contract diff --git a/hardware-security-module/application-typescript/package.json b/hardware-security-module/application-typescript/package.json index 8cd732cb41..a348ad487a 100644 --- a/hardware-security-module/application-typescript/package.json +++ b/hardware-security-module/application-typescript/package.json @@ -11,7 +11,7 @@ "prepare": "npm run build", "clean": "rimraf dist", "lint": "eslint src", - "start": "SOFTHSM2_CONF=${HOME}/softhsm2.conf node dist/hsm-sample.js", + "start": "SOFTHSM2_CONF=\"${SOFTHSM2_CONF:-${HOME}/softhsm2.conf}\" node dist/hsm-sample.js", "test": "echo \"Error: no test specified\" && exit 1" }, "author": "", diff --git a/hardware-security-module/scripts/generate-hsm-user.sh b/hardware-security-module/scripts/generate-hsm-user.sh index faeefe820d..ccfa5412bc 100755 --- a/hardware-security-module/scripts/generate-hsm-user.sh +++ b/hardware-security-module/scripts/generate-hsm-user.sh @@ -1,19 +1,16 @@ #!/usr/bin/env bash set -eo pipefail # script directory -SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) +SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" # define the CA setup CA_HOST=localhost -CA_URL=${CA_HOST}:7054 +CA_URL="${CA_HOST}:7054" TLS_CERT="${SCRIPT_DIR}/../../test-network/organizations/fabric-ca/org1/tls-cert.pem" -LocateHsmLib() { - if [[ -n "${PKCS11_LIB}" && -f "${PKCS11_LIB}" ]]; then - echo "${PKCS11_LIB}" - return - fi +export SOFTHSM2_CONF="${SOFTHSM2_CONF:-${HOME}/softhsm2.conf}" +LocateHsmLib() { local POSSIBLE_LIB_LOC=( \ '/usr/lib/softhsm/libsofthsm2.so' \ '/usr/lib/x86_64-linux-gnu/softhsm/libsofthsm2.so' \ @@ -29,35 +26,57 @@ LocateHsmLib() { done } -HSM2_LIB=$(LocateHsmLib) -[ -z "$HSM2_LIB" ] && echo No SoftHSM PKCS11 Library found, ensure you have installed softhsm2 && exit 1 +HSM2_LIB="${PKCS11_LIB:-$(LocateHsmLib)}" +[ -z "${HSM2_LIB}" ] && echo No SoftHSM PKCS11 Library found, ensure you have installed softhsm2 && exit 1 # create a softhsm2.conf file if one doesn't exist -HSM2_CONF=$HOME/softhsm2.conf -[ ! -f "$HSM2_CONF" ] && echo directories.tokendir = /tmp > "$HSM2_CONF" +if [ ! -f "${SOFTHSM2_CONF}" ]; then + TMPDIR="${TMPDIR:-/tmp}" + mkdir -p "${TMPDIR}/softhsm" + echo "directories.tokendir = ${TMPDIR}/softhsm" > "${SOFTHSM2_CONF}" +fi + +softhsm2-util --init-token --slot 0 --label 'ForFabric' --pin 98765432 --so-pin 1234 || true # Update the client config file to point to the softhsm pkcs11 library # which must be in $HOME/softhsm directory -CLIENT_CONFIG_TEMPLATE=${SCRIPT_DIR}/../ca-client-config/fabric-ca-client-config-template.yaml -CLIENT_CONFIG=${SCRIPT_DIR}/../ca-client-config/fabric-ca-client-config.yaml -cp $CLIENT_CONFIG_TEMPLATE $CLIENT_CONFIG +CLIENT_CONFIG_TEMPLATE="${SCRIPT_DIR}/../ca-client-config/fabric-ca-client-config-template.yaml" +CLIENT_CONFIG="${SCRIPT_DIR}/../ca-client-config/fabric-ca-client-config.yaml" -if [[ "$OSTYPE" == "darwin"* ]]; then - sed -i '' s+REPLACE_ME_HSMLIB+"${HSM2_LIB}"+g $CLIENT_CONFIG -else - sed -i s+REPLACE_ME_HSMLIB+"${HSM2_LIB}"+g $CLIENT_CONFIG -fi +CLIENT_CONFIG_CONTENT="$( sed "s+REPLACE_ME_HSMLIB+${HSM2_LIB}+g" "${CLIENT_CONFIG_TEMPLATE}" )" +echo "${CLIENT_CONFIG_CONTENT}" > "${CLIENT_CONFIG}" # create the users, remove any existing users -CRYPTO_PATH=$SCRIPT_DIR/../crypto-material/hsm -[ -d "$CRYPTO_PATH" ] && rm -fr "$CRYPTO_PATH" +CRYPTO_PATH="${SCRIPT_DIR}/../crypto-material/hsm" +[ -d "${CRYPTO_PATH}" ] && rm -fr "${CRYPTO_PATH}" # user passed in as parameter CAADMIN="admin" CAADMIN_PW="adminpw" -HSMUSER=$1 +HSMUSER="$1" + +fabric-ca-client enroll \ + -c "${CLIENT_CONFIG}" \ + -u "https://${CAADMIN}:${CAADMIN_PW}@${CA_URL}" \ + --mspdir "${CRYPTO_PATH}/${CAADMIN}" \ + --tls.certfiles "${TLS_CERT}" + +! fabric-ca-client register \ + -c "${CLIENT_CONFIG}" \ + --mspdir "${CRYPTO_PATH}/${CAADMIN}" \ + --id.name "${HSMUSER}" \ + --id.secret "${HSMUSER}" \ + --id.type client \ + --caname ca-org1 \ + --id.maxenrollments 0 \ + -m example.com \ + -u "https://${CA_URL}" \ + --tls.certfiles "${TLS_CERT}" \ + && echo user probably already registered, continuing -SOFTHSM2_CONF=$HSM2_CONF fabric-ca-client enroll -c $CLIENT_CONFIG -u https://$CAADMIN:$CAADMIN_PW@$CA_URL --mspdir "$CRYPTO_PATH"/$CAADMIN --tls.certfiles "${TLS_CERT}" -! SOFTHSM2_CONF=$HSM2_CONF fabric-ca-client register -c $CLIENT_CONFIG --mspdir "$CRYPTO_PATH"/$CAADMIN --id.name "$HSMUSER" --id.secret "$HSMUSER" --id.type client --caname ca-org1 --id.maxenrollments 0 -m example.com -u https://$CA_URL --tls.certfiles "${TLS_CERT}" && echo user probably already registered, continuing -SOFTHSM2_CONF=$HSM2_CONF fabric-ca-client enroll -c $CLIENT_CONFIG -u https://"$HSMUSER":"$HSMUSER"@$CA_URL --mspdir "$CRYPTO_PATH"/"$HSMUSER" --tls.certfiles "${TLS_CERT}" +fabric-ca-client enroll \ + -c "${CLIENT_CONFIG}" \ + -u "https://${HSMUSER}:${HSMUSER}@${CA_URL}" \ + --mspdir "${CRYPTO_PATH}/${HSMUSER}" \ + --tls.certfiles "${TLS_CERT}" diff --git a/off_chain_data/legacy-application-javascript/.eslintrc.yaml b/off_chain_data/legacy-application-javascript/.eslintrc.yaml deleted file mode 100644 index 050ac5ccc2..0000000000 --- a/off_chain_data/legacy-application-javascript/.eslintrc.yaml +++ /dev/null @@ -1,10 +0,0 @@ -env: - browser: true - commonjs: true - es6: true -globals: - Atomics: readonly - SharedArrayBuffer: readonly -parserOptions: - ecmaVersion: 2018 -rules: {} diff --git a/off_chain_data/legacy-application-javascript/.gitignore b/off_chain_data/legacy-application-javascript/.gitignore deleted file mode 100644 index cc6066a0be..0000000000 --- a/off_chain_data/legacy-application-javascript/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -addAssets.json -mychannel__lifecycle.log -mychannel_basic.log -nextblock.txt -wallet/ \ No newline at end of file diff --git a/off_chain_data/legacy-application-javascript/README.md b/off_chain_data/legacy-application-javascript/README.md deleted file mode 100644 index 27caee319c..0000000000 --- a/off_chain_data/legacy-application-javascript/README.md +++ /dev/null @@ -1,328 +0,0 @@ -# Off Chain data - -This sample demonstrates how you can use [Peer channel-based event services](https://hyperledger-fabric.readthedocs.io/en/latest/peer_event_services.html) -to replicate the data on your blockchain network to an off chain database. -Using an off chain database allows you to analyze the data from your network or -build a dashboard without degrading the performance of your application. - -This sample uses the [Fabric network event listener](https://hyperledger.github.io/fabric-sdk-node/release-1.4/tutorial-channel-events.html) from the Node.JS Fabric SDK to write data to local instance of -CouchDB. - -## Getting started - -This sample uses Node Fabric SDK application code to connect to a running instance -of the Fabric test network. Make sure that you are running the following -commands from the `off_chain_data/legacy-javascript` directory. - -### Starting the Network - -Use the following command to start the sample network: - -``` -./startFabric.sh -``` - -This command will deploy an instance of the Fabric test network. The network -consists of an ordering service, two peer organizations with one peers each, and -a CA for each org. The command also creates a channel named `mychannel`. The -`asset-transfer-basic` chaincode will be installed on both peers and deployed to -the channel. - -### Configuration - -The configuration for the listener is stored in the `config.json` file: - -``` -{ - "peer_name": "peer0.org1.example.com", - "channelid": "mychannel", - "use_couchdb":true, - "create_history_log":true, - "couchdb_address": "http://admin:password@localhost:5990" -} -``` - -`peer_name:` is the target peer for the listener. -`channelid:` is the channel name for block events. -`use_couchdb:` If set to true, events will be stored in a local instance of -CouchDB. If set to false, only a local log of events will be stored. -`create_history_log:` If true, a local log file will be created with all of the -block changes. -`couchdb_address:` is the local address for an off chain CouchDB database with username and password. - -### Create an instance of CouchDB - -If you set the "use_couchdb" option to true in `config.json`, you can run the -following command start a local instance of CouchDB using docker: - -``` -docker run -e COUCHDB_USER=admin -e COUCHDB_PASSWORD=password --publish 5990:5984 --detach --name offchaindb couchdb:3.2.2 -docker start offchaindb -``` - - -### Install dependencies - -You need to install Node.js version 8.9.x to use the sample application code. -Execute the following commands to install the required dependencies: - -``` -npm install -``` - -### Starting the Channel Event Listener - -After we have installed the application dependencies, we can use the Node.js SDK -to create the identity our listener application will use to interact with the -network. Run the following command to enroll the admin user: -``` -node enrollAdmin.js -``` - -You can then run the following command to register and enroll an application -user: - -``` -node registerUser.js -``` - -We can then use our application user to start the block event listener: - -``` -node blockEventListener.js -``` - -If the command is successful, you should see the output of the listener reading -the configuration blocks of `mychannel` in addition to the blocks that recorded -the approval and commitment of the assets chaincode definition. - -`blockEventListener.js` creates a listener named "offchain-listener" on the -channel `mychannel`. The listener writes each block added to the channel to a -processing map called BlockMap for temporary storage and ordering purposes. -`blockEventListener.js` uses `nextblock.txt` to keep track of the latest block -that was retrieved by the listener. The block number in `nextblock.txt` may be -set to a previous block number in order to replay previous blocks. The file -may also be deleted and all blocks will be replayed when the block listener is -started. - -`BlockProcessing.js` runs as a daemon and pulls each block in order from the -BlockMap. It then uses the read-write set of that block to extract the latest -key value data and store it in the database. The configuration blocks of -mychannel did not any data to the database because the blocks did not contain a -read-write set. - -The channel event listener also writes metadata from each block to a log file -defined as channelid_chaincodeid.log. In this example, events will be written to -a file named `mychannel_basic.log`. This allows you to record a history of -changes made by each block for each key in addition to storing the latest value -of the world state. - -**Note:** Leave the blockEventListener.js running in a terminal window. Open a -new window to execute the next parts of the demo. - -### Generate data on the blockchain - -Now that our listener is setup, we can generate data using the assets chaincode -and use our application to replicate the data to our database. Open a new -terminal and navigate to the `fabric-samples/off_chain_data/legacy-javascript` directory. - -You can use the `addAssets.js` file to add random sample data to blockchain. -The file uses the configuration information stored in `addAssets.json` to -create a series of assets. This file will be created during the first execution -of `addAssets.js` if it does not exist. This program can be run multiple times -without changing the properties. The `nextAssetNumber` will be incremented and -stored in the `addAssets.json` file. - -``` - { - "nextAssetNumber": 100, - "numberAssetsToAdd": 20 - } -``` - -Open a new window and run the following command to add 20 assets to the -blockchain: - -``` -node addAssets.js -``` - -After the assets have been added to the ledger, use the following command to -transfer one of the assets to a new owner: - -``` -node transferAsset.js asset110 james -``` - -Now run the following command to delete the asset that was transferred: - -``` -node deleteAsset.js asset110 -``` - -## Offchain CouchDB storage: - -If you followed the instructions above and set `use_couchdb` to true, -`blockEventListener.js` will create two tables in the local instance of CouchDB. -`blockEventListener.js` is written to create two tables for each channel and for -each chaincode. - -The first table is an offline representation of the current world state of the -blockchain ledger. This table was created using the read-write set data from -the blocks. If the listener is running, this table should be the same as the -latest values in the state database running on your peer. The table is named -after the channelid and chaincodeid, and is named mychannel_basic in this -example. You can navigate to this table using your browser: -http://127.0.0.1:5990/mychannel_basic/_all_docs - -A second table records each block as a historical record entry, and was created -using the block data that was recorded in the log file. The table name appends -history to the name of the first table, and is named mychannel_basic_history -in this example. You can also navigate to this table using your browser: -http://127.0.0.1:5990/mychannel_basic_history/_all_docs - -### Configure a map/reduce view for summarizing counts of assets by color: - -Now that we have state and history data replicated to tables in CouchDB, we -can use the following commands query our off-chain data. We will also add an -index to support a more complex query. Note that if the `blockEventListener.js` -is not running, the database commands below may fail since the database is only -created when events are received. - -Open a new terminal window and execute the following: - -``` -curl -X PUT http://127.0.0.1:5990/mychannel_basic/_design/colorviewdesign -d '{"views":{"colorview":{"map":"function (doc) { emit(doc.color, 1);}","reduce":"function ( keys , values , combine ) {return sum( values )}"}}}' -H 'Content-Type:application/json' -``` - -Execute a query to retrieve the total number of assets (reduce function): - -``` -curl -X GET http://127.0.0.1:5990/mychannel_basic/_design/colorviewdesign/_view/colorview?reduce=true -``` - -If successful, this command will return the number of assets in the blockchain -world state, without having to query the blockchain ledger: - -``` -{"rows":[ - {"key":null,"value":19} - ]} -``` - -Execute a new query to retrieve the number of assets by color (map function): - -``` -curl -X GET http://127.0.0.1:5990/mychannel_basic/_design/colorviewdesign/_view/colorview?group=true -``` - -The command will return a list of assets by color from the CouchDB database. - -``` -{"rows":[ - {"key":"blue","value":2}, - {"key":"green","value":2}, - {"key":"purple","value":3}, - {"key":"red","value":4}, - {"key":"white","value":6}, - {"key":"yellow","value":2} - ]} -``` - -To run a more complex command that reads through the block history database, we -will create an index of the blocknumber, sequence, and key fields. This index -will support a query that traces the history of each asset. Execute the -following command to create the index: - -``` -curl -X POST http://127.0.0.1:5990/mychannel_basic_history/_index -d '{"index":{"fields":["blocknumber", "sequence", "key"]},"name":"asset_history"}' -H 'Content-Type:application/json' -``` - -Now execute a query to retrieve the history for the asset we transferred and -then deleted: - -``` -curl -X POST http://127.0.0.1:5990/mychannel_basic_history/_find -d '{"selector":{"key":{"$eq":"asset110"}}, "fields":["blocknumber","is_delete","value"],"sort":[{"blocknumber":"asc"}, {"sequence":"asc"}]}' -H 'Content-Type:application/json' -``` - -You should see the transaction history of the asset that was created, -transferred, and then removed from the ledger. - -``` -{"docs":[ -{"blocknumber":12,"is_delete":false,"value":"{\"docType\":\"asset\",\"name\":\"asset110\",\"color\":\"blue\",\"size\":60,\"owner\":\"debra\"}"}, -{"blocknumber":22,"is_delete":false,"value":"{\"docType\":\"asset\",\"name\":\"asset110\",\"color\":\"blue\",\"size\":60,\"owner\":\"james\"}"}, -{"blocknumber":23,"is_delete":true,"value":""} - ]} -``` - -## Getting historical data from the network - -You can also use the `blockEventListener.js` program to retrieve historical data -from your network. This allows you to create a database that is up to date with -the latest data from the network or recover any blocks that the program may -have missed. - -If you ran through the example steps above, navigate back to the terminal window -where `blockEventListener.js` is running and close it. Once the listener is no -longer running, use the following command to add 20 more assets to the -ledger: - -``` -node addAssets.js -``` - -The listener will not be able to add the new assets to your CouchDB database. -If you check the current state table using the reduce command, you will only -be able to see the original assets in your database. - -``` -curl -X GET http://127.0.0.1:5990/mychannel_basic/_design/colorviewdesign/_view/colorview?reduce=true -``` - -To add the new data to your off-chain database, remove the `nextblock.txt` -file that kept track of the latest block read by `blockEventListener.js`: - -``` -rm nextblock.txt -``` - -You can new re-run the channel listener to read every block from the channel: - -``` -node blockEventListener.js -``` - -This will rebuild the CouchDB tables and include the 20 assets that have been -added to the ledger. If you run the reduce command against your database one -more time, - -``` -curl -X GET http://127.0.0.1:5990/mychannel_basic/_design/colorviewdesign/_view/colorview?reduce=true -``` - -you will be able to see that all of the assets have been added to your -database: - -``` -{"rows":[ -{"key":null,"value":39} -]} -``` - -## Clean up - -If you are finished using the sample application, you can bring down the network -and any accompanying artifacts by running the following command: -``` -./network-clean.sh -``` - -Running the script will complete the following actions: - -* Bring down the Fabric test network. -* Takes down the local CouchDB database. -* Remove the certificates you generated by deleting the `wallet` folder. -* Delete `nextblock.txt` so you can start with the first block next time you - operate the listener. -* Removes `addAssets.json`. diff --git a/off_chain_data/legacy-application-javascript/addAssets.js b/off_chain_data/legacy-application-javascript/addAssets.js deleted file mode 100644 index 38119571c1..0000000000 --- a/off_chain_data/legacy-application-javascript/addAssets.js +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Copyright IBM Corp. All Rights Reserved. - * - * SPDX-License-Identifier: Apache-2.0 - * - */ - -/* - * - * addAssets.js will add random sample data to blockchain. - * - * $ node addAssets.js - * - * addAssets will add 10 Assets by default with a starting Asset name of "Asset100". - * Additional Assets will be added by incrementing the number at the end of the Asset name. - * - * The properties for adding Assets are stored in addAssets.json. This file will be created - * during the first execution of the utility if it does not exist. The utility can be run - * multiple times without changing the properties. The nextAssetNumber will be incremented and - * stored in the JSON file. - * - * { - * "nextAssetNumber": 100, - * "numberAssetsToAdd": 10 - * } - * - */ - -'use strict'; - -const { Wallets, Gateway } = require('fabric-network'); -const fs = require('fs'); -const path = require('path'); - -const addAssetsConfigFile = path.resolve(__dirname, 'addAssets.json'); - -const colors=[ 'blue', 'red', 'yellow', 'green', 'white', 'purple' ]; -const owners=[ 'tom', 'fred', 'julie', 'james', 'janet', 'henry', 'alice', 'marie', 'sam', 'debra', 'nancy']; -const sizes=[ 10, 20, 30, 40, 50, 60, 70, 80, 90, 100 ]; -const appraisedValues=[ 300, 310, 320, 330, 340, 350, 360, 370, 380, 390 ]; -const docType='asset' - -const config = require('./config.json'); -const channelid = config.channelid; - -async function main() { - - try { - - let nextAssetNumber; - let numberAssetsToAdd; - let addAssetsConfig; - - // check to see if there is a config json defined - if (fs.existsSync(addAssetsConfigFile)) { - // read file the next asset and number of assets to create - let addAssetsConfigJSON = fs.readFileSync(addAssetsConfigFile, 'utf8'); - addAssetsConfig = JSON.parse(addAssetsConfigJSON); - nextAssetNumber = addAssetsConfig.nextAssetNumber; - numberAssetsToAdd = addAssetsConfig.numberAssetsToAdd; - } else { - nextAssetNumber = 100; - numberAssetsToAdd = 20; - // create a default config and save - addAssetsConfig = new Object; - addAssetsConfig.nextAssetNumber = nextAssetNumber; - addAssetsConfig.numberAssetsToAdd = numberAssetsToAdd; - fs.writeFileSync(addAssetsConfigFile, JSON.stringify(addAssetsConfig, null, 2)); - } - - // Parse the connection profile. - const ccpPath = path.resolve(__dirname, '..', '..', 'test-network','organizations','peerOrganizations','org1.example.com', 'connection-org1.json'); - const ccp = JSON.parse(fs.readFileSync(ccpPath, 'utf8')); - - // Configure a wallet. This wallet must already be primed with an identity that - // the application can use to interact with the peer node. - const walletPath = path.resolve(__dirname, 'wallet'); - const wallet = await Wallets.newFileSystemWallet(walletPath); - - // Create a new gateway, and connect to the gateway peer node(s). The identity - // specified must already exist in the specified wallet. - const gateway = new Gateway(); - await gateway.connect(ccp, { wallet, identity: 'appUser', discovery: { enabled: true, asLocalhost: true } }); - - // Get the network channel that the smart contract is deployed to. - const network = await gateway.getNetwork(channelid); - - // Get the smart contract from the network channel. - const contract = network.getContract('basic'); - - for (var counter = nextAssetNumber; counter < nextAssetNumber + numberAssetsToAdd; counter++) { - - var randomColor = Math.floor(Math.random() * (6)); - var randomOwner = Math.floor(Math.random() * (11)); - var randomSize = Math.floor(Math.random() * (10)); - var randomValue = Math.floor(Math.random() * (9)); - - // Submit the 'CreateAsset' transaction to the smart contract, and wait for it - // to be committed to the ledger. - await contract.submitTransaction('CreateAsset', docType+counter, colors[randomColor], ''+sizes[randomSize], owners[randomOwner],appraisedValues[randomValue]); - console.log("Adding asset: " + docType + counter + " owner:" + owners[randomOwner] + " color:" + colors[randomColor] + " size:" + '' + sizes[randomSize] + " appraised value:" + '' + appraisedValues[randomValue] ); - - } - - await gateway.disconnect(); - - addAssetsConfig.nextAssetNumber = nextAssetNumber + numberAssetsToAdd; - - fs.writeFileSync(addAssetsConfigFile, JSON.stringify(addAssetsConfig, null, 2)); - - } catch (error) { - console.error(`Failed to submit transaction: ${error}`); - process.exit(1); - } - -} - -main(); diff --git a/off_chain_data/legacy-application-javascript/blockEventListener.js b/off_chain_data/legacy-application-javascript/blockEventListener.js deleted file mode 100644 index 610ded88f7..0000000000 --- a/off_chain_data/legacy-application-javascript/blockEventListener.js +++ /dev/null @@ -1,179 +0,0 @@ -/* - * Copyright IBM Corp. All Rights Reserved. - * - * SPDX-License-Identifier: Apache-2.0 - * - */ - -/* - -blockEventListener.js is an nodejs application to listen for block events from -a specified channel. - -Configuration is stored in config.json: - -{ - "peer_name": "peer0.org1.example.com", - "channelid": "mychannel", - "use_couchdb":false, - "couchdb_address": "http://localhost:5990" -} - -peer_name: target peer for the listener -channelid: channel name for block events -use_couchdb: if set to true, events will be stored in a local couchdb -couchdb_address: local address for an off chain couchdb database - -Note: If use_couchdb is set to false, only a local log of events will be stored. - -Usage: - -node bockEventListener.js - -The block event listener will log events received to the console and write event blocks to -a log file based on the channelid and chaincode name. - -The event listener stores the next block to retrieve in a file named nextblock.txt. This file -is automatically created and initialized to zero if it does not exist. - -*/ - -'use strict'; - -const { Wallets, Gateway } = require('fabric-network'); -const fs = require('fs'); -const path = require('path'); - -const couchdbutil = require('./couchdbutil.js'); -const blockProcessing = require('./blockProcessing.js'); - -const config = require('./config.json'); -const channelid = config.channelid; -const peer_name = config.peer_name; -const use_couchdb = config.use_couchdb; -const couchdb_address = config.couchdb_address; - -const configPath = path.resolve(__dirname, 'nextblock.txt'); - -const nano = require('nano')(couchdb_address); - -// simple map to hold blocks for processing -class BlockMap { - constructor() { - this.list = [] - } - get(key) { - key = parseInt(key, 10).toString(); - return this.list[`block${key}`]; - } - set(key, value) { - this.list[`block${key}`] = value; - } - remove(key) { - key = parseInt(key, 10).toString(); - delete this.list[`block${key}`]; - } -} - -let ProcessingMap = new BlockMap() - -async function main() { - try { - - // initialize the next block to be 0 - let nextBlock = 0; - - // check to see if there is a next block already defined - if (fs.existsSync(configPath)) { - // read file containing the next block to read - nextBlock = fs.readFileSync(configPath, 'utf8'); - } else { - // store the next block as 0 - fs.writeFileSync(configPath, parseInt(nextBlock, 10)) - } - - // Create a new file system based wallet for managing identities. - const walletPath = path.join(process.cwd(), 'wallet'); - const wallet = await Wallets.newFileSystemWallet(walletPath); - console.log(`Wallet path: ${walletPath}`); - - // Check to see if we've already enrolled the user. - const userExists = await wallet.get('appUser'); - if (!userExists) { - console.log('An identity for the user "appUser" does not exist in the wallet'); - console.log('Run the enrollUser.js application before retrying'); - return; - } - - // Parse the connection profile. This would be the path to the file downloaded - // from the IBM Blockchain Platform operational console. - const ccpPath = path.resolve(__dirname, '..', '..', 'test-network','organizations','peerOrganizations','org1.example.com', 'connection-org1.json'); - const ccp = JSON.parse(fs.readFileSync(ccpPath, 'utf8')); - // Create a new gateway for connecting to our peer node. - const gateway = new Gateway(); - await gateway.connect(ccp, { wallet, identity: 'appUser', discovery: { enabled: true, asLocalhost: true } }); - - // Get the network (channel) our contract is deployed to. - const network = await gateway.getNetwork('mychannel'); - - const listener = async (event) => { - // Add the block to the processing map by block number - await ProcessingMap.set(event.blockNumber, event.blockData); - console.log(`Added block ${event.blockNumber} to ProcessingMap`); - }; - const options = { filtered: false, startBlock: parseInt(nextBlock, 10) }; - await network.addBlockListener(listener, options); - - console.log(`Listening for block events, nextblock: ${nextBlock}`); - - // start processing, looking for entries in the ProcessingMap - processPendingBlocks(ProcessingMap); - - } catch (error) { - console.error(`Failed to evaluate transaction: ${error}`); - process.exit(1); - } -} - -// listener function to check for blocks in the ProcessingMap -async function processPendingBlocks(ProcessingMap) { - - setTimeout(async () => { - - // get the next block number from nextblock.txt - let nextBlockNumber = fs.readFileSync(configPath, 'utf8'); - let processBlock; - - do { - - // get the next block to process from the ProcessingMap - processBlock = ProcessingMap.get(nextBlockNumber) - - if (processBlock == undefined) { - break; - } - - try { - await blockProcessing.processBlockEvent(channelid, processBlock, use_couchdb, nano) - } catch (error) { - console.error(`Failed to process block: ${error}`); - } - - // if successful, remove the block from the ProcessingMap - ProcessingMap.remove(nextBlockNumber); - - // increment the next block number to the next block - fs.writeFileSync(configPath, parseInt(nextBlockNumber, 10) + 1) - - // retrive the next block number to process - nextBlockNumber = fs.readFileSync(configPath, 'utf8'); - - } while (true); - - processPendingBlocks(ProcessingMap); - - }, 250); - -} - -main(); diff --git a/off_chain_data/legacy-application-javascript/blockProcessing.js b/off_chain_data/legacy-application-javascript/blockProcessing.js deleted file mode 100644 index 83275abcb6..0000000000 --- a/off_chain_data/legacy-application-javascript/blockProcessing.js +++ /dev/null @@ -1,217 +0,0 @@ -/* - * Copyright IBM Corp. All Rights Reserved. - * - * SPDX-License-Identifier: Apache-2.0 - * - */ - -'use strict'; - -const fs = require('fs'); -const path = require('path'); - -const couchdbutil = require('./couchdbutil.js'); - -const configPath = path.resolve(__dirname, 'nextblock.txt'); - -exports.processBlockEvent = async function (channelname, block, use_couchdb, nano) { - - return new Promise((async (resolve, reject) => { - - // reject the block if the block number is not defined - if (block.header.number == undefined) { - reject(new Error('Undefined block number')); - } - - const blockNumber = block.header.number - - console.log(`------------------------------------------------`); - console.log(`Block Number: ${blockNumber}`); - - // reject if the data is not set - if (block.data.data == undefined) { - reject(new Error('Data block is not defined')); - } - - const dataArray = block.data.data; - - // transaction filter for each transaction in dataArray - const txSuccess = block.metadata.metadata[2]; - - for (var dataItem in dataArray) { - - // reject if a timestamp is not set - if (dataArray[dataItem].payload.header.channel_header.timestamp == undefined) { - reject(new Error('Transaction timestamp is not defined')); - } - - // tx may be rejected at commit stage by peers - // only valid transactions (code=0) update the word state and off-chain db - // filter through valid tx, refer below for list of error codes - // https://github.com/hyperledger/fabric-sdk-node/blob/release-1.4/fabric-client/lib/protos/peer/transaction.proto - if (txSuccess[dataItem] !== 0) { - continue; - } - - const timestamp = dataArray[dataItem].payload.header.channel_header.timestamp; - - // continue to next tx if no actions are set - if (dataArray[dataItem].payload.data.actions == undefined) { - continue; - } - - // actions are stored as an array. In Fabric 1.4.3 only one - // action exists per tx so we may simply use actions[0] - // in case Fabric adds support for multiple actions - // a for loop is used for demonstration - const actions = dataArray[dataItem].payload.data.actions; - - // iterate through all actions - for (var actionItem in actions) { - - // reject if a chaincode id is not defined - if (actions[actionItem].payload.chaincode_proposal_payload.input.chaincode_spec.chaincode_id.name == undefined) { - reject(new Error('Chaincode name is not defined')); - } - - const chaincodeID = actions[actionItem].payload.chaincode_proposal_payload.input.chaincode_spec.chaincode_id.name - - // reject if there is no readwrite set - if (actions[actionItem].payload.action.proposal_response_payload.extension.results.ns_rwset == undefined) { - reject(new Error('No readwrite set is defined')); - } - - const rwSet = actions[actionItem].payload.action.proposal_response_payload.extension.results.ns_rwset - - for (var record in rwSet) { - - // ignore lscc events - if (rwSet[record].namespace != 'lscc' && rwSet[record].namespace != '_lifecycle') { - // create object to store properties - const writeObject = new Object(); - writeObject.blocknumber = blockNumber; - writeObject.chaincodeid = chaincodeID; - writeObject.timestamp = timestamp; - writeObject.values = rwSet[record].rwset.writes; - - console.log(`Transaction Timestamp: ${writeObject.timestamp}`); - console.log(`ChaincodeID: ${writeObject.chaincodeid}`); - console.log(writeObject.values); - - const logfilePath = path.resolve(__dirname, 'nextblock.txt'); - - // send the object to a log file - fs.appendFileSync(channelname + '_' + chaincodeID + '.log', JSON.stringify(writeObject) + "\n"); - - // if couchdb is configured, then write to couchdb - if (use_couchdb) { - try { - await writeValuesToCouchDBP(nano, channelname, writeObject); - } catch (error) { - - } - } - } - }; - }; - }; - - // update the nextblock.txt file to retrieve the next block - fs.writeFileSync(configPath, parseInt(blockNumber, 10) + 1) - - resolve(true); - - })); -} - -async function writeValuesToCouchDBP(nano, channelname, writeObject) { - - return new Promise((async (resolve, reject) => { - - try { - - // define the database for saving block events by key - this emulates world state - const dbname = channelname + '_' + writeObject.chaincodeid; - // define the database for saving all block events - this emulates history - const historydbname = channelname + '_' + writeObject.chaincodeid + '_history'; - // set values to the array of values received - const values = writeObject.values; - - try { - for (var sequence in values) { - let keyvalue = - values[ - sequence - ]; - - if ( - keyvalue.is_delete == - true - ) { - await couchdbutil.deleteRecord( - nano, - dbname, - keyvalue.key - ); - } else { - if ( - isJSON( - keyvalue.value - ) - ) { - - // insert or update value by key - this emulates world state behavior - await couchdbutil.writeToCouchDB( - nano, - dbname, - keyvalue.key, - JSON.parse( - keyvalue.value - ) - ); - } - } - - // add additional fields for history - keyvalue.timestamp = - writeObject.timestamp; - keyvalue.blocknumber = parseInt( - writeObject.blocknumber, - 10 - ); - keyvalue.sequence = parseInt( - sequence, - 10 - ); - - await couchdbutil.writeToCouchDB( - nano, - historydbname, - null, - keyvalue - ); - } - } catch (error) { - console.log(error); - reject(error); - } - - } catch (error) { - console.error(`Failed to write to couchdb: ${error}`); - reject(error); - } - - resolve(true); - - })); - -} - -function isJSON(value) { - try { - JSON.parse(value); - } catch (e) { - return false; - } - return true; -} diff --git a/off_chain_data/legacy-application-javascript/config.json b/off_chain_data/legacy-application-javascript/config.json deleted file mode 100644 index 5852531f18..0000000000 --- a/off_chain_data/legacy-application-javascript/config.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "peer_name": "peer0.org1.example.com", - "channelid": "mychannel", - "use_couchdb":true, - "create_history_log":true, - "couchdb_address": "http://admin:password@localhost:5990" -} diff --git a/off_chain_data/legacy-application-javascript/couchdbutil.js b/off_chain_data/legacy-application-javascript/couchdbutil.js deleted file mode 100644 index c82c8b0113..0000000000 --- a/off_chain_data/legacy-application-javascript/couchdbutil.js +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Copyright IBM Corp. All Rights Reserved. - * - * SPDX-License-Identifier: Apache-2.0 - * - */ - -'use strict'; - -exports.createDatabaseIfNotExists = function (nano, dbname) { - - return new Promise((async (resolve, reject) => { - await nano.db.get(dbname, async function (err, body) { - if (err) { - if (err.statusCode == 404) { - await nano.db.create(dbname, function (err, body) { - if (!err) { - resolve(true); - } else { - reject(err); - } - }); - } else { - reject(err); - } - } else { - resolve(true); - } - }); - })); -} - -exports.writeToCouchDB = async function (nano, dbname, key, value) { - - return new Promise((async (resolve, reject) => { - - try { - await this.createDatabaseIfNotExists(nano, dbname); - } catch (error) { - console.log("Error creating the database-"+error) - } - - const db = nano.use(dbname); - - // If a key is not specified, then this is an insert - if (key == null) { - db.insert(value, async function (err, body, header) { - if (err) { - reject(err); - } - } - ); - } else { - - // If a key is specified, then attempt to retrieve the record by key - db.get(key, async function (err, body) { - // parse the value - const updateValue = value; - // if the record was found, then update the revision to allow the update - if (err == null) { - updateValue._rev = body._rev - } - // update or insert the value - db.insert(updateValue, key, async function (err, body, header) { - if (err) { - reject(err); - } - }); - }); - } - - resolve(true); - - })); -} - - -exports.deleteRecord = async function (nano, dbname, key) { - - return new Promise((async (resolve, reject) => { - - try { - await this.createDatabaseIfNotExists(nano, dbname); - } catch (error) { - console.log("Error creating the database-"+error) - } - - const db = nano.use(dbname); - - // If a key is specified, then attempt to retrieve the record by key - db.get(key, async function (err, body) { - - // if the record was found, then update the revision to allow the update - if (err == null) { - - let revision = body._rev - - // update or insert the value - db.destroy(key, revision, async function (err, body, header) { - if (err) { - reject(err); - } - }); - - } - }); - - resolve(true); - - })); -} diff --git a/off_chain_data/legacy-application-javascript/deleteAsset.js b/off_chain_data/legacy-application-javascript/deleteAsset.js deleted file mode 100644 index 37a8ff5884..0000000000 --- a/off_chain_data/legacy-application-javascript/deleteAsset.js +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright IBM Corp. All Rights Reserved. - * - * SPDX-License-Identifier: Apache-2.0 - * - */ - -/* - * - * deleteAsset.js will delete a specified asset. Example: - * - * $ node deleteAsset.js asset100 - * - * The utility is meant to demonstrate delete block events. - */ - -'use strict'; - -const { Wallets, Gateway } = require('fabric-network'); -const fs = require('fs'); -const path = require('path'); - -const config = require('./config.json'); -const channelid = config.channelid; - -async function main() { - - if (process.argv[2] == undefined) { - console.log("Usage: node deleteAsset AssetId"); - process.exit(1); - } - - const deletekey = process.argv[2]; - - try { - - // Parse the connection profile. - const ccpPath = path.resolve(__dirname, '..', '..', 'test-network','organizations','peerOrganizations','org1.example.com', 'connection-org1.json'); - const ccp = JSON.parse(fs.readFileSync(ccpPath, 'utf8')); - - // Configure a wallet. This wallet must already be primed with an identity that - // the application can use to interact with the peer node. - const walletPath = path.resolve(__dirname, 'wallet'); - const wallet = await Wallets.newFileSystemWallet(walletPath); - - // Create a new gateway, and connect to the gateway peer node(s). The identity - // specified must already exist in the specified wallet. - const gateway = new Gateway(); - await gateway.connect(ccp, { wallet, identity: 'appUser', discovery: { enabled: true, asLocalhost: true } }); - - // Get the network channel that the smart contract is deployed to. - const network = await gateway.getNetwork(channelid); - - // Get the smart contract from the network channel. - const contract = network.getContract('basic'); - - await contract.submitTransaction('DeleteAsset', deletekey); - console.log("Deleted asset: " + deletekey); - - await gateway.disconnect(); - - } catch (error) { - console.error(`Failed to submit transaction: ${error}`); - process.exit(1); - } - -} - -main(); diff --git a/off_chain_data/legacy-application-javascript/enrollAdmin.js b/off_chain_data/legacy-application-javascript/enrollAdmin.js deleted file mode 100644 index fe4577e641..0000000000 --- a/off_chain_data/legacy-application-javascript/enrollAdmin.js +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright IBM Corp. All Rights Reserved. - * - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict'; - -const FabricCAServices = require('fabric-ca-client'); -const { Wallets, X509WalletMixin } = require('fabric-network'); -const fs = require('fs'); -const path = require('path'); - -async function main() { - try { - // load the network configuration - const ccpPath = path.resolve(__dirname, '..', '..', 'test-network', 'organizations', 'peerOrganizations', 'org1.example.com', 'connection-org1.json'); - let ccp = JSON.parse(fs.readFileSync(ccpPath, 'utf8')); - - // Create a new CA client for interacting with the CA. - const caURL = ccp.certificateAuthorities['ca.org1.example.com'].url; - const ca = new FabricCAServices(caURL); - - // Create a new file system based wallet for managing identities. - const walletPath = path.join(process.cwd(), 'wallet'); - const wallet = await Wallets.newFileSystemWallet(walletPath); - console.log(`Wallet path: ${walletPath}`); - - // Check to see if we've already enrolled the admin user. - const adminExists = await wallet.get('admin'); - if (adminExists) { - console.log('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. - const enrollment = await ca.enroll({ enrollmentID: 'admin', enrollmentSecret: 'adminpw' }); - const x509Identity = { - credentials: { - certificate: enrollment.certificate, - privateKey: enrollment.key.toBytes(), - }, - mspId: 'Org1MSP', - type: 'X.509', - }; - await wallet.put('admin', x509Identity); - console.log('Successfully enrolled admin user "admin" and imported it into the wallet'); - - } catch (error) { - console.error(`Failed to enroll admin user "admin": ${error}`); - process.exit(1); - } -} - -main(); diff --git a/off_chain_data/legacy-application-javascript/network-clean.sh b/off_chain_data/legacy-application-javascript/network-clean.sh deleted file mode 100755 index 1d24a2a742..0000000000 --- a/off_chain_data/legacy-application-javascript/network-clean.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash -# -# Copyright IBM Corp All Rights Reserved -# -# SPDX-License-Identifier: Apache-2.0 -# -# Exit on first error -set -ex - -# Bring the test network down -pushd ../test-network -./network.sh down -popd - -# clean out any old identites in the wallets -rm -rf wallet -rm -rf addAssets.json mychannel_basic.log mychannel__lifecycle.log nextblock.txt - -docker stop offchaindb -docker rm offchaindb diff --git a/off_chain_data/legacy-application-javascript/package.json b/off_chain_data/legacy-application-javascript/package.json deleted file mode 100644 index e4cb636e23..0000000000 --- a/off_chain_data/legacy-application-javascript/package.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "name": "offchaindata", - "version": "1.0.0", - "description": "Offchain Data application implemented in JavaScript", - "engines": { - "node": ">=8", - "npm": ">=5" - }, - "scripts": { - "lint": "eslint .", - "pretest": "npm run lint", - "test": "nyc mocha --recursive" - }, - "engineStrict": true, - "author": "Hyperledger", - "license": "Apache-2.0", - "dependencies": { - "fabric-ca-client": "^2.2.19", - "fabric-network": "^2.2.19" - }, - "devDependencies": { - "chai": "^4.2.0", - "eslint": "^5.9.0", - "mocha": "^5.2.0", - "nyc": "^13.1.0", - "sinon": "^7.1.1", - "sinon-chai": "^3.3.0" - }, - "nyc": { - "exclude": [ - "coverage/**", - "test/**" - ], - "reporter": [ - "text-summary", - "html" - ], - "all": true, - "check-coverage": true, - "statements": 100, - "branches": 100, - "functions": 100, - "lines": 100 - } -} diff --git a/off_chain_data/legacy-application-javascript/registerUser.js b/off_chain_data/legacy-application-javascript/registerUser.js deleted file mode 100644 index c1cefc5ba1..0000000000 --- a/off_chain_data/legacy-application-javascript/registerUser.js +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright IBM Corp. All Rights Reserved. - * - * SPDX-License-Identifier: Apache-2.0 - */ - -'use strict'; - -const { Wallets, Gateway, X509WalletMixin } = require('fabric-network'); -const FabricCAServices = require('fabric-ca-client'); -const fs = require('fs'); -const path = require('path'); - -async function main() { - try { - // load the network configuration - const ccpPath = path.resolve(__dirname, '..', '..', 'test-network','organizations','peerOrganizations','org1.example.com', 'connection-org1.json'); - const ccp = JSON.parse(fs.readFileSync(ccpPath, 'utf8')); - - // Create a new CA client for interacting with the CA. - const caURL = ccp.certificateAuthorities['ca.org1.example.com'].url; - const ca = new FabricCAServices(caURL); - - // Create a new file system based wallet for managing identities. - const walletPath = path.join(process.cwd(), 'wallet'); - const wallet = await Wallets.newFileSystemWallet(walletPath); - console.log(`Wallet path: ${walletPath}`); - - // Check to see if we've already enrolled the user. - const userExists = await wallet.get('appUser'); - if (userExists) { - console.log('An identity for the user "appUser" already exists in the wallet'); - return; - } - - // Check to see if we've already enrolled the admin user. - const adminIdentity = await wallet.get('admin'); - if (!adminIdentity) { - console.log('An identity for the admin user "admin" does not exist in the wallet'); - console.log('Run the enrollAdmin.js application 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, 'admin'); - - // Register the user, enroll the user, and import the new identity into the wallet. - const secret = await ca.register({ - affiliation: 'org1.department1', - enrollmentID: 'appUser', - role: 'client' - }, adminUser); - const enrollment = await ca.enroll({ - enrollmentID: 'appUser', - enrollmentSecret: secret - }); - const x509Identity = { - credentials: { - certificate: enrollment.certificate, - privateKey: enrollment.key.toBytes(), - }, - mspId: 'Org1MSP', - type: 'X.509', - }; - await wallet.put('appUser', x509Identity); - console.log('Successfully registered and enrolled admin user "appUser" and imported it into the wallet'); - - } catch (error) { - console.error(`Failed to register user "appUser": ${error}`); - process.exit(1); - } -} - -main(); diff --git a/off_chain_data/legacy-application-javascript/startFabric.sh b/off_chain_data/legacy-application-javascript/startFabric.sh deleted file mode 100755 index 3dc1a97a28..0000000000 --- a/off_chain_data/legacy-application-javascript/startFabric.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash -# -# Copyright IBM Corp All Rights Reserved -# -# SPDX-License-Identifier: Apache-2.0 -# -# Exit on first error -set -e pipefail - -starttime=$(date +%s) - -# launch network; create channel and join peer to channel -pushd ../../test-network - -# Fixes the issue of when running busybox in network down command on windows git bash -case "$(uname -s)" in - CYGWIN*|MINGW32*|MSYS*|MINGW*) - echo 'Running on MS Windows' - export MSYS_NO_PATHCONV=1 - ./network.sh down - unset MSYS_NO_PATHCONV - ;; - *) - ./network.sh down - ;; -esac -./network.sh up createChannel -ca -s couchdb -./network.sh deployCC -ccn basic -ccp ../asset-transfer-basic/chaincode-go/ -ccl go - -popd - -cat <