tMap = json.toMap();
- final String id = (String) tMap.get("ID");
-
- final String color = (String) tMap.get("Color");
- final String owner = (String) tMap.get("Owner");
- int size = 0;
- int appraisedValue = 0;
- if (tMap.containsKey("Size")) {
- size = Integer.parseInt((String) tMap.get("Size"));
- }
- if (tMap.containsKey("AppraisedValue")) {
- appraisedValue = Integer.parseInt((String) tMap.get("AppraisedValue"));
- }
- return new Asset(id, color, size, owner, appraisedValue);
-
- }
-
- @Override
- public boolean equals(final Object obj) {
- if (this == obj) {
- return true;
- }
-
- if ((obj == null) || (getClass() != obj.getClass())) {
- return false;
- }
-
- Asset other = (Asset) obj;
-
- return Objects.deepEquals(
- new String[]{getAssetID(), getColor(), getOwner()},
- new String[]{other.getAssetID(), other.getColor(), other.getOwner()})
- &&
- Objects.deepEquals(
- new int[]{getSize(), getAppraisedValue()},
- new int[]{other.getSize(), other.getAppraisedValue()});
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(getAssetID(), getColor(), getSize(), getOwner(), getAppraisedValue());
- }
-
- @Override
- public String toString() {
- return this.getClass().getSimpleName() + "@" + Integer.toHexString(hashCode())
- + " [assetID=" + assetID + ", appraisedValue=" + appraisedValue + ", color="
- + color + ", size=" + size + ", owner=" + owner + "]";
- }
-
-}
diff --git a/asset-transfer-events/chaincode-java/src/main/java/org/hyperledger/fabric/samples/events/AssetTransfer.java b/asset-transfer-events/chaincode-java/src/main/java/org/hyperledger/fabric/samples/events/AssetTransfer.java
deleted file mode 100644
index a892693a..00000000
--- a/asset-transfer-events/chaincode-java/src/main/java/org/hyperledger/fabric/samples/events/AssetTransfer.java
+++ /dev/null
@@ -1,299 +0,0 @@
-/*
- * SPDX-License-Identifier: Apache-2.0
- */
-
-package org.hyperledger.fabric.samples.events;
-
-import static java.nio.charset.StandardCharsets.UTF_8;
-
-import org.hyperledger.fabric.contract.Context;
-import org.hyperledger.fabric.contract.ContractInterface;
-import org.hyperledger.fabric.contract.annotation.Contact;
-import org.hyperledger.fabric.contract.annotation.Contract;
-import org.hyperledger.fabric.contract.annotation.Default;
-import org.hyperledger.fabric.contract.annotation.Info;
-import org.hyperledger.fabric.contract.annotation.License;
-import org.hyperledger.fabric.contract.annotation.Transaction;
-import org.hyperledger.fabric.shim.ChaincodeException;
-import org.hyperledger.fabric.shim.ChaincodeStub;
-
-import java.util.Map;
-
-/**
- * Main Chaincode class.
- *
- * @see org.hyperledger.fabric.shim.Chaincode
- *
- * Each chaincode transaction function must take, Context as first parameter.
- * Unless specified otherwise via annotation (@Contract or @Transaction), the contract name
- * is the class name (without package)
- * and the transaction name is the method name.
- */
-@Contract(
- name = "asset-transfer-events-java",
- info = @Info(
- title = "Asset Transfer Events",
- description = "The hyperlegendary asset transfer events sample",
- version = "0.0.1-SNAPSHOT",
- license = @License(
- name = "Apache 2.0 License",
- url = "http://www.apache.org/licenses/LICENSE-2.0.html"),
- contact = @Contact(
- email = "a.transfer@example.com",
- name = "Fabric Development Team",
- url = "https://hyperledger.example.com")))
-@Default
-public final class AssetTransfer implements ContractInterface {
-
- static final String IMPLICIT_COLLECTION_NAME_PREFIX = "_implicit_org_";
- static final String PRIVATE_PROPS_KEY = "asset_properties";
-
- /**
- * Retrieves the asset details with the specified ID
- *
- * @param ctx the transaction context
- * @param assetID the ID of the asset
- * @return the asset found on the ledger. Returns error if asset is not found
- */
- @Transaction(intent = Transaction.TYPE.EVALUATE)
- public String ReadAsset(final Context ctx, final String assetID) {
- System.out.printf("ReadAsset: ID %s\n", assetID);
-
- Asset asset = getState(ctx, assetID);
- String privData = readPrivateData(ctx, assetID);
- return asset.serialize(privData);
- }
-
- /**
- * Creates a new asset on the ledger. Saves the passed private data (asset properties) from transient map input.
- *
- * @param ctx the transaction context
- * Transient map with asset_properties key with asset json as value
- * @param assetID
- * @param color
- * @param size
- * @param owner
- * @param appraisedValue
- * @return the created asset
- */
- @Transaction(intent = Transaction.TYPE.SUBMIT)
- public Asset CreateAsset(final Context ctx, final String assetID, final String color, final int size, final String owner, final int appraisedValue) {
- ChaincodeStub stub = ctx.getStub();
- // input validations
- String errorMessage = null;
- if (assetID == null || assetID.equals("")) {
- errorMessage = String.format("Empty input: assetID");
- }
- if (owner == null || owner.equals("")) {
- errorMessage = String.format("Empty input: owner");
- }
-
- if (errorMessage != null) {
- System.err.println(errorMessage);
- throw new ChaincodeException(errorMessage, AssetTransferErrors.INCOMPLETE_INPUT.toString());
- }
- // Check if asset already exists
- byte[] assetJSON = ctx.getStub().getState(assetID);
- if (assetJSON != null && assetJSON.length > 0) {
- errorMessage = String.format("Asset %s already exists", assetID);
- System.err.println(errorMessage);
- throw new ChaincodeException(errorMessage, AssetTransferErrors.ASSET_ALREADY_EXISTS.toString());
- }
-
- Asset asset = new Asset(assetID, color, size, owner, appraisedValue);
-
- savePrivateData(ctx, assetID);
- assetJSON = asset.serialize();
- System.out.printf("CreateAsset Put: ID %s Data %s\n", assetID, new String(assetJSON));
-
- stub.putState(assetID, assetJSON);
- // add Event data to the transaction data. Event will be published after the block containing
- // this transaction is committed
- stub.setEvent("CreateAsset", assetJSON);
- return asset;
- }
-
-
- /**
- * TransferAsset transfers the asset to the new owner
- * Save any private data, if provided in transient map
- *
- * @param ctx the transaction context
- * @param assetID asset to delete
- * @param newOwner new owner for the asset
- * @return none
- */
- @Transaction(intent = Transaction.TYPE.SUBMIT)
- public void TransferAsset(final Context ctx, final String assetID, final String newOwner) {
- ChaincodeStub stub = ctx.getStub();
- String errorMessage = null;
-
- if (assetID == null || assetID.equals("")) {
- errorMessage = "Empty input: assetID";
- }
- if (newOwner == null || newOwner.equals("")) {
- errorMessage = "Empty input: newOwner";
- }
- if (errorMessage != null) {
- System.err.println(errorMessage);
- throw new ChaincodeException(errorMessage, AssetTransferErrors.INCOMPLETE_INPUT.toString());
- }
- System.out.printf("TransferAsset: verify asset %s exists\n", assetID);
- Asset thisAsset = getState(ctx, assetID);
- // Transfer asset to new owner
- thisAsset.setOwner(newOwner);
-
- System.out.printf(" Transfer Asset: ID %s to owner %s\n", assetID, newOwner);
- savePrivateData(ctx, assetID); // save private data if any
- byte[] assetJSON = thisAsset.serialize();
-
- stub.putState(assetID, assetJSON);
- stub.setEvent("TransferAsset", assetJSON); //publish Event
- }
-
- /**
- * Update existing asset on the ledger with provided parameters.
- * Saves the passed private data (asset properties) from transient map input.
- *
- * @param ctx the transaction context
- * Transient map with asset_properties key with asset json as value
- * @param assetID
- * @param color
- * @param size
- * @param owner
- * @param appraisedValue
- * @return the created asset
- */
- @Transaction(intent = Transaction.TYPE.SUBMIT)
- public Asset UpdateAsset(final Context ctx, final String assetID, final String color, final int size, final String owner, final int appraisedValue) {
- ChaincodeStub stub = ctx.getStub();
- // input validations
- String errorMessage = null;
- if (assetID == null || assetID.equals("")) {
- errorMessage = String.format("Empty input: assetID");
- }
-
- if (errorMessage != null) {
- System.err.println(errorMessage);
- throw new ChaincodeException(errorMessage, AssetTransferErrors.INCOMPLETE_INPUT.toString());
- }
- // reads from the Statedb. Check if asset already exists
- Asset asset = getState(ctx, assetID);
-
- if (owner != null) {
- asset.setOwner(owner);
- }
- if (color != null) {
- asset.setColor(color);
- }
- if (size > 0) {
- asset.setSize(size);
- }
- if (appraisedValue > 0) {
- asset.setAppraisedValue(appraisedValue);
- }
-
- savePrivateData(ctx, assetID);
- byte[] assetJSON = asset.serialize();
- System.out.printf("UpdateAsset Put: ID %s Data %s\n", assetID, new String(assetJSON));
- stub.putState(assetID, assetJSON);
- stub.setEvent("UpdateAsset", assetJSON); //publish Event
- return asset;
- }
-
- /**
- * Deletes a asset & related details from the ledger.
- *
- * @param ctx the transaction context
- * @param assetID asset to delete
- */
- @Transaction(intent = Transaction.TYPE.SUBMIT)
- public void DeleteAsset(final Context ctx, final String assetID) {
- ChaincodeStub stub = ctx.getStub();
- System.out.printf("DeleteAsset: verify asset %s exists\n", assetID);
- Asset asset = getState(ctx, assetID);
-
- System.out.printf(" DeleteAsset: ID %s\n", assetID);
- // delete private details of asset
- removePrivateData(ctx, assetID);
- stub.delState(assetID); // delete the key from Statedb
- stub.setEvent("DeleteAsset", asset.serialize()); // publish Event
- }
-
- private Asset getState(final Context ctx, final String assetID) {
- byte[] assetJSON = ctx.getStub().getState(assetID);
- if (assetJSON == null || assetJSON.length == 0) {
- String errorMessage = String.format("Asset %s does not exist", assetID);
- System.err.println(errorMessage);
- throw new ChaincodeException(errorMessage, AssetTransferErrors.ASSET_NOT_FOUND.toString());
- }
-
- try {
- Asset asset = Asset.deserialize(assetJSON);
- return asset;
- } catch (Exception e) {
- throw new ChaincodeException("Deserialize error: " + e.getMessage(), AssetTransferErrors.DATA_ERROR.toString());
- }
- }
-
- private String readPrivateData(final Context ctx, final String assetKey) {
- String peerMSPID = ctx.getStub().getMspId();
- String clientMSPID = ctx.getClientIdentity().getMSPID();
- String implicitCollectionName = getCollectionName(ctx);
- String privData = null;
- // only if ClientOrgMatchesPeerOrg
- if (peerMSPID.equals(clientMSPID)) {
- System.out.printf(" ReadPrivateData from collection %s, ID %s\n", implicitCollectionName, assetKey);
- byte[] propJSON = ctx.getStub().getPrivateData(implicitCollectionName, assetKey);
-
- if (propJSON != null && propJSON.length > 0) {
- privData = new String(propJSON, UTF_8);
- }
- }
- return privData;
- }
-
- private void savePrivateData(final Context ctx, final String assetKey) {
- String peerMSPID = ctx.getStub().getMspId();
- String clientMSPID = ctx.getClientIdentity().getMSPID();
- String implicitCollectionName = getCollectionName(ctx);
-
- if (peerMSPID.equals(clientMSPID)) {
- Map transientMap = ctx.getStub().getTransient();
- if (transientMap != null && transientMap.containsKey(PRIVATE_PROPS_KEY)) {
- byte[] transientAssetJSON = transientMap.get(PRIVATE_PROPS_KEY);
-
- System.out.printf("Asset's PrivateData Put in collection %s, ID %s\n", implicitCollectionName, assetKey);
- ctx.getStub().putPrivateData(implicitCollectionName, assetKey, transientAssetJSON);
- }
- }
- }
-
- private void removePrivateData(final Context ctx, final String assetKey) {
- String peerMSPID = ctx.getStub().getMspId();
- String clientMSPID = ctx.getClientIdentity().getMSPID();
- String implicitCollectionName = getCollectionName(ctx);
-
- if (peerMSPID.equals(clientMSPID)) {
- System.out.printf("PrivateData Delete from collection %s, ID %s\n", implicitCollectionName, assetKey);
- ctx.getStub().delPrivateData(implicitCollectionName, assetKey);
- }
- }
-
- // Return the implicit collection name, to use for private property persistance
- private String getCollectionName(final Context ctx) {
- // Get the MSP ID of submitting client identity
- String clientMSPID = ctx.getClientIdentity().getMSPID();
- String collectionName = IMPLICIT_COLLECTION_NAME_PREFIX + clientMSPID;
- return collectionName;
- }
-
- private enum AssetTransferErrors {
- INCOMPLETE_INPUT,
- INVALID_ACCESS,
- ASSET_NOT_FOUND,
- ASSET_ALREADY_EXISTS,
- DATA_ERROR
- }
-
-}
diff --git a/asset-transfer-events/chaincode-javascript/.eslintignore b/asset-transfer-events/chaincode-javascript/.eslintignore
deleted file mode 100644
index 15958470..00000000
--- a/asset-transfer-events/chaincode-javascript/.eslintignore
+++ /dev/null
@@ -1,5 +0,0 @@
-#
-# SPDX-License-Identifier: Apache-2.0
-#
-
-coverage
diff --git a/asset-transfer-events/chaincode-javascript/.eslintrc.js b/asset-transfer-events/chaincode-javascript/.eslintrc.js
deleted file mode 100644
index cb00fa96..00000000
--- a/asset-transfer-events/chaincode-javascript/.eslintrc.js
+++ /dev/null
@@ -1,39 +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',
- 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'],
- 'no-constant-condition': ['error', { checkLoops: false }]
- }
-};
diff --git a/asset-transfer-events/chaincode-javascript/.gitignore b/asset-transfer-events/chaincode-javascript/.gitignore
deleted file mode 100644
index eeace290..00000000
--- a/asset-transfer-events/chaincode-javascript/.gitignore
+++ /dev/null
@@ -1,15 +0,0 @@
-#
-# SPDX-License-Identifier: Apache-2.0
-#
-
-# Coverage directory used by tools like istanbul
-coverage
-
-# Report cache used by istanbul
-.nyc_output
-
-# Dependency directories
-node_modules/
-jspm_packages/
-
-package-lock.json
diff --git a/asset-transfer-events/chaincode-javascript/index.js b/asset-transfer-events/chaincode-javascript/index.js
deleted file mode 100644
index 3244cedf..00000000
--- a/asset-transfer-events/chaincode-javascript/index.js
+++ /dev/null
@@ -1,12 +0,0 @@
-/*
- * Copyright IBM Corp. All Rights Reserved.
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-
-'use strict';
-
-const assetTransferEvents = require('./lib/assetTransferEvents');
-
-module.exports.AssetTransferEvents = assetTransferEvents;
-module.exports.contracts = [assetTransferEvents];
diff --git a/asset-transfer-events/chaincode-javascript/lib/assetTransferEvents.js b/asset-transfer-events/chaincode-javascript/lib/assetTransferEvents.js
deleted file mode 100644
index 27c5acbd..00000000
--- a/asset-transfer-events/chaincode-javascript/lib/assetTransferEvents.js
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * Copyright IBM Corp. All Rights Reserved.
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-
-'use strict';
-
-const { Contract } = require('fabric-contract-api');
-
-async function savePrivateData(ctx, assetKey) {
- const clientOrg = ctx.clientIdentity.getMSPID();
- const peerOrg = ctx.stub.getMspID();
- const collection = '_implicit_org_' + peerOrg;
-
- if (clientOrg === peerOrg) {
- const transientMap = ctx.stub.getTransient();
- if (transientMap) {
- const properties = transientMap.get('asset_properties');
- if (properties) {
- await ctx.stub.putPrivateData(collection, assetKey, properties);
- }
- }
- }
-}
-
-async function removePrivateData(ctx, assetKey) {
- const clientOrg = ctx.clientIdentity.getMSPID();
- const peerOrg = ctx.stub.getMspID();
- const collection = '_implicit_org_' + peerOrg;
-
- if (clientOrg === peerOrg) {
- const propertiesBuffer = await ctx.stub.getPrivateData(collection, assetKey);
- if (propertiesBuffer && propertiesBuffer.length > 0) {
- await ctx.stub.deletePrivateData(collection, assetKey);
- }
- }
-}
-
-async function addPrivateData(ctx, assetKey, asset) {
- const clientOrg = ctx.clientIdentity.getMSPID();
- const peerOrg = ctx.stub.getMspID();
- const collection = '_implicit_org_' + peerOrg;
-
- if (clientOrg === peerOrg) {
- const propertiesBuffer = await ctx.stub.getPrivateData(collection, assetKey);
- if (propertiesBuffer && propertiesBuffer.length > 0) {
- const properties = JSON.parse(propertiesBuffer.toString());
- asset.asset_properties = properties;
- }
- }
-}
-
-async function readState(ctx, id) {
- const assetBuffer = await ctx.stub.getState(id); // get the asset from chaincode state
- if (!assetBuffer || assetBuffer.length === 0) {
- throw new Error(`The asset ${id} does not exist`);
- }
- const assetString = assetBuffer.toString();
- const asset = JSON.parse(assetString);
-
- return asset;
-}
-
-class AssetTransferEvents extends Contract {
-
- // CreateAsset issues a new asset to the world state with given details.
- async CreateAsset(ctx, id, color, size, owner, appraisedValue) {
- const asset = {
- ID: id,
- Color: color,
- Size: size,
- Owner: owner,
- AppraisedValue: appraisedValue,
- };
- await savePrivateData(ctx, id);
- const assetBuffer = Buffer.from(JSON.stringify(asset));
-
- ctx.stub.setEvent('CreateAsset', assetBuffer);
- return ctx.stub.putState(id, assetBuffer);
- }
-
- // TransferAsset updates the owner field of an asset with the given id in
- // the world state.
- async TransferAsset(ctx, id, newOwner) {
- const asset = await readState(ctx, id);
- asset.Owner = newOwner;
- const assetBuffer = Buffer.from(JSON.stringify(asset));
- await savePrivateData(ctx, id);
-
- ctx.stub.setEvent('TransferAsset', assetBuffer);
- return ctx.stub.putState(id, assetBuffer);
- }
-
- // ReadAsset returns the asset stored in the world state with given id.
- async ReadAsset(ctx, id) {
- const asset = await readState(ctx, id);
- await addPrivateData(ctx, asset.ID, asset);
-
- return JSON.stringify(asset);
- }
-
- // UpdateAsset updates an existing asset in the world state with provided parameters.
- async UpdateAsset(ctx, id, color, size, owner, appraisedValue) {
- const asset = await readState(ctx, id);
- asset.Color = color;
- asset.Size = size;
- asset.Owner = owner;
- asset.AppraisedValue = appraisedValue;
- const assetBuffer = Buffer.from(JSON.stringify(asset));
- await savePrivateData(ctx, id);
-
- ctx.stub.setEvent('UpdateAsset', assetBuffer);
- return ctx.stub.putState(id, assetBuffer);
- }
-
- // DeleteAsset deletes an given asset from the world state.
- async DeleteAsset(ctx, id) {
- const asset = await readState(ctx, id);
- const assetBuffer = Buffer.from(JSON.stringify(asset));
- await removePrivateData(ctx, id);
-
- ctx.stub.setEvent('DeleteAsset', assetBuffer);
- return ctx.stub.deleteState(id);
- }
-}
-
-module.exports = AssetTransferEvents;
diff --git a/asset-transfer-events/chaincode-javascript/npm-shrinkwrap.json b/asset-transfer-events/chaincode-javascript/npm-shrinkwrap.json
deleted file mode 100644
index 8f9fc8e5..00000000
--- a/asset-transfer-events/chaincode-javascript/npm-shrinkwrap.json
+++ /dev/null
@@ -1,3982 +0,0 @@
-{
- "name": "asset-transfer-events",
- "version": "1.0.0",
- "lockfileVersion": 3,
- "requires": true,
- "packages": {
- "": {
- "name": "asset-transfer-events",
- "version": "1.0.0",
- "license": "Apache-2.0",
- "dependencies": {
- "fabric-contract-api": "~2.5",
- "fabric-shim": "~2.5"
- },
- "devDependencies": {
- "chai": "^4.4.1",
- "eslint": "^8.57.0",
- "mocha": "^10.4.0",
- "nyc": "^15.1.0",
- "sinon": "^18.0.0",
- "sinon-chai": "^3.7.0"
- },
- "engines": {
- "node": ">=18"
- }
- },
- "node_modules/@ampproject/remapping": {
- "version": "2.3.0",
- "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz",
- "integrity": "sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==",
- "dev": true,
- "dependencies": {
- "@jridgewell/gen-mapping": "^0.3.5",
- "@jridgewell/trace-mapping": "^0.3.24"
- },
- "engines": {
- "node": ">=6.0.0"
- }
- },
- "node_modules/@babel/code-frame": {
- "version": "7.24.7",
- "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.24.7.tgz",
- "integrity": "sha512-BcYH1CVJBO9tvyIZ2jVeXgSIMvGZ2FDRvDdOIVQyuklNKSsx+eppDEBq/g47Ayw+RqNFE+URvOShmf+f/qwAlA==",
- "dev": true,
- "dependencies": {
- "@babel/highlight": "^7.24.7",
- "picocolors": "^1.0.0"
- },
- "engines": {
- "node": ">=6.9.0"
- }
- },
- "node_modules/@babel/compat-data": {
- "version": "7.24.7",
- "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.24.7.tgz",
- "integrity": "sha512-qJzAIcv03PyaWqxRgO4mSU3lihncDT296vnyuE2O8uA4w3UHWI4S3hgeZd1L8W1Bft40w9JxJ2b412iDUFFRhw==",
- "dev": true,
- "engines": {
- "node": ">=6.9.0"
- }
- },
- "node_modules/@babel/core": {
- "version": "7.24.7",
- "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.24.7.tgz",
- "integrity": "sha512-nykK+LEK86ahTkX/3TgauT0ikKoNCfKHEaZYTUVupJdTLzGNvrblu4u6fa7DhZONAltdf8e662t/abY8idrd/g==",
- "dev": true,
- "dependencies": {
- "@ampproject/remapping": "^2.2.0",
- "@babel/code-frame": "^7.24.7",
- "@babel/generator": "^7.24.7",
- "@babel/helper-compilation-targets": "^7.24.7",
- "@babel/helper-module-transforms": "^7.24.7",
- "@babel/helpers": "^7.24.7",
- "@babel/parser": "^7.24.7",
- "@babel/template": "^7.24.7",
- "@babel/traverse": "^7.24.7",
- "@babel/types": "^7.24.7",
- "convert-source-map": "^2.0.0",
- "debug": "^4.1.0",
- "gensync": "^1.0.0-beta.2",
- "json5": "^2.2.3",
- "semver": "^6.3.1"
- },
- "engines": {
- "node": ">=6.9.0"
- },
- "funding": {
- "type": "opencollective",
- "url": "https://opencollective.com/babel"
- }
- },
- "node_modules/@babel/core/node_modules/convert-source-map": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz",
- "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==",
- "dev": true
- },
- "node_modules/@babel/generator": {
- "version": "7.24.7",
- "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.24.7.tgz",
- "integrity": "sha512-oipXieGC3i45Y1A41t4tAqpnEZWgB/lC6Ehh6+rOviR5XWpTtMmLN+fGjz9vOiNRt0p6RtO6DtD0pdU3vpqdSA==",
- "dev": true,
- "dependencies": {
- "@babel/types": "^7.24.7",
- "@jridgewell/gen-mapping": "^0.3.5",
- "@jridgewell/trace-mapping": "^0.3.25",
- "jsesc": "^2.5.1"
- },
- "engines": {
- "node": ">=6.9.0"
- }
- },
- "node_modules/@babel/helper-compilation-targets": {
- "version": "7.24.7",
- "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.24.7.tgz",
- "integrity": "sha512-ctSdRHBi20qWOfy27RUb4Fhp07KSJ3sXcuSvTrXrc4aG8NSYDo1ici3Vhg9bg69y5bj0Mr1lh0aeEgTvc12rMg==",
- "dev": true,
- "dependencies": {
- "@babel/compat-data": "^7.24.7",
- "@babel/helper-validator-option": "^7.24.7",
- "browserslist": "^4.22.2",
- "lru-cache": "^5.1.1",
- "semver": "^6.3.1"
- },
- "engines": {
- "node": ">=6.9.0"
- }
- },
- "node_modules/@babel/helper-environment-visitor": {
- "version": "7.24.7",
- "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.24.7.tgz",
- "integrity": "sha512-DoiN84+4Gnd0ncbBOM9AZENV4a5ZiL39HYMyZJGZ/AZEykHYdJw0wW3kdcsh9/Kn+BRXHLkkklZ51ecPKmI1CQ==",
- "dev": true,
- "dependencies": {
- "@babel/types": "^7.24.7"
- },
- "engines": {
- "node": ">=6.9.0"
- }
- },
- "node_modules/@babel/helper-function-name": {
- "version": "7.24.7",
- "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.24.7.tgz",
- "integrity": "sha512-FyoJTsj/PEUWu1/TYRiXTIHc8lbw+TDYkZuoE43opPS5TrI7MyONBE1oNvfguEXAD9yhQRrVBnXdXzSLQl9XnA==",
- "dev": true,
- "dependencies": {
- "@babel/template": "^7.24.7",
- "@babel/types": "^7.24.7"
- },
- "engines": {
- "node": ">=6.9.0"
- }
- },
- "node_modules/@babel/helper-hoist-variables": {
- "version": "7.24.7",
- "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.24.7.tgz",
- "integrity": "sha512-MJJwhkoGy5c4ehfoRyrJ/owKeMl19U54h27YYftT0o2teQ3FJ3nQUf/I3LlJsX4l3qlw7WRXUmiyajvHXoTubQ==",
- "dev": true,
- "dependencies": {
- "@babel/types": "^7.24.7"
- },
- "engines": {
- "node": ">=6.9.0"
- }
- },
- "node_modules/@babel/helper-module-imports": {
- "version": "7.24.7",
- "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.24.7.tgz",
- "integrity": "sha512-8AyH3C+74cgCVVXow/myrynrAGv+nTVg5vKu2nZph9x7RcRwzmh0VFallJuFTZ9mx6u4eSdXZfcOzSqTUm0HCA==",
- "dev": true,
- "dependencies": {
- "@babel/traverse": "^7.24.7",
- "@babel/types": "^7.24.7"
- },
- "engines": {
- "node": ">=6.9.0"
- }
- },
- "node_modules/@babel/helper-module-transforms": {
- "version": "7.24.7",
- "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.24.7.tgz",
- "integrity": "sha512-1fuJEwIrp+97rM4RWdO+qrRsZlAeL1lQJoPqtCYWv0NL115XM93hIH4CSRln2w52SqvmY5hqdtauB6QFCDiZNQ==",
- "dev": true,
- "dependencies": {
- "@babel/helper-environment-visitor": "^7.24.7",
- "@babel/helper-module-imports": "^7.24.7",
- "@babel/helper-simple-access": "^7.24.7",
- "@babel/helper-split-export-declaration": "^7.24.7",
- "@babel/helper-validator-identifier": "^7.24.7"
- },
- "engines": {
- "node": ">=6.9.0"
- },
- "peerDependencies": {
- "@babel/core": "^7.0.0"
- }
- },
- "node_modules/@babel/helper-simple-access": {
- "version": "7.24.7",
- "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.24.7.tgz",
- "integrity": "sha512-zBAIvbCMh5Ts+b86r/CjU+4XGYIs+R1j951gxI3KmmxBMhCg4oQMsv6ZXQ64XOm/cvzfU1FmoCyt6+owc5QMYg==",
- "dev": true,
- "dependencies": {
- "@babel/traverse": "^7.24.7",
- "@babel/types": "^7.24.7"
- },
- "engines": {
- "node": ">=6.9.0"
- }
- },
- "node_modules/@babel/helper-split-export-declaration": {
- "version": "7.24.7",
- "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.24.7.tgz",
- "integrity": "sha512-oy5V7pD+UvfkEATUKvIjvIAH/xCzfsFVw7ygW2SI6NClZzquT+mwdTfgfdbUiceh6iQO0CHtCPsyze/MZ2YbAA==",
- "dev": true,
- "dependencies": {
- "@babel/types": "^7.24.7"
- },
- "engines": {
- "node": ">=6.9.0"
- }
- },
- "node_modules/@babel/helper-string-parser": {
- "version": "7.24.7",
- "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.24.7.tgz",
- "integrity": "sha512-7MbVt6xrwFQbunH2DNQsAP5sTGxfqQtErvBIvIMi6EQnbgUOuVYanvREcmFrOPhoXBrTtjhhP+lW+o5UfK+tDg==",
- "dev": true,
- "engines": {
- "node": ">=6.9.0"
- }
- },
- "node_modules/@babel/helper-validator-identifier": {
- "version": "7.24.7",
- "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.7.tgz",
- "integrity": "sha512-rR+PBcQ1SMQDDyF6X0wxtG8QyLCgUB0eRAGguqRLfkCA87l7yAP7ehq8SNj96OOGTO8OBV70KhuFYcIkHXOg0w==",
- "dev": true,
- "engines": {
- "node": ">=6.9.0"
- }
- },
- "node_modules/@babel/helper-validator-option": {
- "version": "7.24.7",
- "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.24.7.tgz",
- "integrity": "sha512-yy1/KvjhV/ZCL+SM7hBrvnZJ3ZuT9OuZgIJAGpPEToANvc3iM6iDvBnRjtElWibHU6n8/LPR/EjX9EtIEYO3pw==",
- "dev": true,
- "engines": {
- "node": ">=6.9.0"
- }
- },
- "node_modules/@babel/helpers": {
- "version": "7.24.7",
- "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.24.7.tgz",
- "integrity": "sha512-NlmJJtvcw72yRJRcnCmGvSi+3jDEg8qFu3z0AFoymmzLx5ERVWyzd9kVXr7Th9/8yIJi2Zc6av4Tqz3wFs8QWg==",
- "dev": true,
- "dependencies": {
- "@babel/template": "^7.24.7",
- "@babel/types": "^7.24.7"
- },
- "engines": {
- "node": ">=6.9.0"
- }
- },
- "node_modules/@babel/highlight": {
- "version": "7.24.7",
- "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.24.7.tgz",
- "integrity": "sha512-EStJpq4OuY8xYfhGVXngigBJRWxftKX9ksiGDnmlY3o7B/V7KIAc9X4oiK87uPJSc/vs5L869bem5fhZa8caZw==",
- "dev": true,
- "dependencies": {
- "@babel/helper-validator-identifier": "^7.24.7",
- "chalk": "^2.4.2",
- "js-tokens": "^4.0.0",
- "picocolors": "^1.0.0"
- },
- "engines": {
- "node": ">=6.9.0"
- }
- },
- "node_modules/@babel/highlight/node_modules/ansi-styles": {
- "version": "3.2.1",
- "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
- "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
- "dev": true,
- "dependencies": {
- "color-convert": "^1.9.0"
- },
- "engines": {
- "node": ">=4"
- }
- },
- "node_modules/@babel/highlight/node_modules/chalk": {
- "version": "2.4.2",
- "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
- "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==",
- "dev": true,
- "dependencies": {
- "ansi-styles": "^3.2.1",
- "escape-string-regexp": "^1.0.5",
- "supports-color": "^5.3.0"
- },
- "engines": {
- "node": ">=4"
- }
- },
- "node_modules/@babel/highlight/node_modules/color-convert": {
- "version": "1.9.3",
- "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
- "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
- "dev": true,
- "dependencies": {
- "color-name": "1.1.3"
- }
- },
- "node_modules/@babel/highlight/node_modules/color-name": {
- "version": "1.1.3",
- "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
- "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==",
- "dev": true
- },
- "node_modules/@babel/highlight/node_modules/escape-string-regexp": {
- "version": "1.0.5",
- "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
- "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==",
- "dev": true,
- "engines": {
- "node": ">=0.8.0"
- }
- },
- "node_modules/@babel/highlight/node_modules/has-flag": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
- "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==",
- "dev": true,
- "engines": {
- "node": ">=4"
- }
- },
- "node_modules/@babel/highlight/node_modules/supports-color": {
- "version": "5.5.0",
- "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
- "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
- "dev": true,
- "dependencies": {
- "has-flag": "^3.0.0"
- },
- "engines": {
- "node": ">=4"
- }
- },
- "node_modules/@babel/parser": {
- "version": "7.24.7",
- "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.24.7.tgz",
- "integrity": "sha512-9uUYRm6OqQrCqQdG1iCBwBPZgN8ciDBro2nIOFaiRz1/BCxaI7CNvQbDHvsArAC7Tw9Hda/B3U+6ui9u4HWXPw==",
- "dev": true,
- "bin": {
- "parser": "bin/babel-parser.js"
- },
- "engines": {
- "node": ">=6.0.0"
- }
- },
- "node_modules/@babel/template": {
- "version": "7.24.7",
- "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.24.7.tgz",
- "integrity": "sha512-jYqfPrU9JTF0PmPy1tLYHW4Mp4KlgxJD9l2nP9fD6yT/ICi554DmrWBAEYpIelzjHf1msDP3PxJIRt/nFNfBig==",
- "dev": true,
- "dependencies": {
- "@babel/code-frame": "^7.24.7",
- "@babel/parser": "^7.24.7",
- "@babel/types": "^7.24.7"
- },
- "engines": {
- "node": ">=6.9.0"
- }
- },
- "node_modules/@babel/traverse": {
- "version": "7.24.7",
- "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.24.7.tgz",
- "integrity": "sha512-yb65Ed5S/QAcewNPh0nZczy9JdYXkkAbIsEo+P7BE7yO3txAY30Y/oPa3QkQ5It3xVG2kpKMg9MsdxZaO31uKA==",
- "dev": true,
- "dependencies": {
- "@babel/code-frame": "^7.24.7",
- "@babel/generator": "^7.24.7",
- "@babel/helper-environment-visitor": "^7.24.7",
- "@babel/helper-function-name": "^7.24.7",
- "@babel/helper-hoist-variables": "^7.24.7",
- "@babel/helper-split-export-declaration": "^7.24.7",
- "@babel/parser": "^7.24.7",
- "@babel/types": "^7.24.7",
- "debug": "^4.3.1",
- "globals": "^11.1.0"
- },
- "engines": {
- "node": ">=6.9.0"
- }
- },
- "node_modules/@babel/traverse/node_modules/globals": {
- "version": "11.12.0",
- "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz",
- "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==",
- "dev": true,
- "engines": {
- "node": ">=4"
- }
- },
- "node_modules/@babel/types": {
- "version": "7.24.7",
- "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.24.7.tgz",
- "integrity": "sha512-XEFXSlxiG5td2EJRe8vOmRbaXVgfcBlszKujvVmWIK/UpywWljQCfzAv3RQCGujWQ1RD4YYWEAqDXfuJiy8f5Q==",
- "dev": true,
- "dependencies": {
- "@babel/helper-string-parser": "^7.24.7",
- "@babel/helper-validator-identifier": "^7.24.7",
- "to-fast-properties": "^2.0.0"
- },
- "engines": {
- "node": ">=6.9.0"
- }
- },
- "node_modules/@colors/colors": {
- "version": "1.6.0",
- "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.6.0.tgz",
- "integrity": "sha512-Ir+AOibqzrIsL6ajt3Rz3LskB7OiMVHqltZmspbW/TJuTVuyOMirVqAkjfY6JISiLHgyNqicAC8AyHHGzNd/dA==",
- "engines": {
- "node": ">=0.1.90"
- }
- },
- "node_modules/@dabh/diagnostics": {
- "version": "2.0.3",
- "resolved": "https://registry.npmjs.org/@dabh/diagnostics/-/diagnostics-2.0.3.tgz",
- "integrity": "sha512-hrlQOIi7hAfzsMqlGSFyVucrx38O+j6wiGOf//H2ecvIEqYN4ADBSS2iLMh5UFyDunCNniUIPk/q3riFv45xRA==",
- "dependencies": {
- "colorspace": "1.1.x",
- "enabled": "2.0.x",
- "kuler": "^2.0.0"
- }
- },
- "node_modules/@eslint-community/eslint-utils": {
- "version": "4.4.0",
- "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz",
- "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==",
- "dev": true,
- "dependencies": {
- "eslint-visitor-keys": "^3.3.0"
- },
- "engines": {
- "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
- },
- "peerDependencies": {
- "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0"
- }
- },
- "node_modules/@eslint-community/regexpp": {
- "version": "4.10.1",
- "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.10.1.tgz",
- "integrity": "sha512-Zm2NGpWELsQAD1xsJzGQpYfvICSsFkEpU0jxBjfdC6uNEWXcHnfs9hScFWtXVDVl+rBQJGrl4g1vcKIejpH9dA==",
- "dev": true,
- "engines": {
- "node": "^12.0.0 || ^14.0.0 || >=16.0.0"
- }
- },
- "node_modules/@eslint/eslintrc": {
- "version": "2.1.4",
- "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz",
- "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==",
- "dev": true,
- "dependencies": {
- "ajv": "^6.12.4",
- "debug": "^4.3.2",
- "espree": "^9.6.0",
- "globals": "^13.19.0",
- "ignore": "^5.2.0",
- "import-fresh": "^3.2.1",
- "js-yaml": "^4.1.0",
- "minimatch": "^3.1.2",
- "strip-json-comments": "^3.1.1"
- },
- "engines": {
- "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
- },
- "funding": {
- "url": "https://opencollective.com/eslint"
- }
- },
- "node_modules/@eslint/js": {
- "version": "8.57.0",
- "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.0.tgz",
- "integrity": "sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==",
- "dev": true,
- "engines": {
- "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
- }
- },
- "node_modules/@fidm/asn1": {
- "version": "1.0.4",
- "resolved": "https://registry.npmjs.org/@fidm/asn1/-/asn1-1.0.4.tgz",
- "integrity": "sha512-esd1jyNvRb2HVaQGq2Gg8Z0kbQPXzV9Tq5Z14KNIov6KfFD6PTaRIO8UpcsYiTNzOqJpmyzWgVTrUwFV3UF4TQ==",
- "engines": {
- "node": ">= 8"
- }
- },
- "node_modules/@fidm/x509": {
- "version": "1.2.1",
- "resolved": "https://registry.npmjs.org/@fidm/x509/-/x509-1.2.1.tgz",
- "integrity": "sha512-nwc2iesjyc9hkuzcrMCBXQRn653XuAUKorfWM8PZyJawiy1QzLj4vahwzaI25+pfpwOLvMzbJ0uKpWLDNmo16w==",
- "dependencies": {
- "@fidm/asn1": "^1.0.4",
- "tweetnacl": "^1.0.1"
- },
- "engines": {
- "node": ">= 8"
- }
- },
- "node_modules/@grpc/grpc-js": {
- "version": "1.10.9",
- "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.10.9.tgz",
- "integrity": "sha512-5tcgUctCG0qoNyfChZifz2tJqbRbXVO9J7X6duFcOjY3HUNCxg5D0ZCK7EP9vIcZ0zRpLU9bWkyCqVCLZ46IbQ==",
- "dependencies": {
- "@grpc/proto-loader": "^0.7.13",
- "@js-sdsl/ordered-map": "^4.4.2"
- },
- "engines": {
- "node": ">=12.10.0"
- }
- },
- "node_modules/@grpc/proto-loader": {
- "version": "0.7.13",
- "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.7.13.tgz",
- "integrity": "sha512-AiXO/bfe9bmxBjxxtYxFAXGZvMaN5s8kO+jBHAJCON8rJoB5YS/D6X7ZNc6XQkuHNmyl4CYaMI1fJ/Gn27RGGw==",
- "dependencies": {
- "lodash.camelcase": "^4.3.0",
- "long": "^5.0.0",
- "protobufjs": "^7.2.5",
- "yargs": "^17.7.2"
- },
- "bin": {
- "proto-loader-gen-types": "build/bin/proto-loader-gen-types.js"
- },
- "engines": {
- "node": ">=6"
- }
- },
- "node_modules/@humanwhocodes/config-array": {
- "version": "0.11.14",
- "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz",
- "integrity": "sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==",
- "deprecated": "Use @eslint/config-array instead",
- "dev": true,
- "dependencies": {
- "@humanwhocodes/object-schema": "^2.0.2",
- "debug": "^4.3.1",
- "minimatch": "^3.0.5"
- },
- "engines": {
- "node": ">=10.10.0"
- }
- },
- "node_modules/@humanwhocodes/module-importer": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz",
- "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==",
- "dev": true,
- "engines": {
- "node": ">=12.22"
- },
- "funding": {
- "type": "github",
- "url": "https://github.com/sponsors/nzakas"
- }
- },
- "node_modules/@humanwhocodes/object-schema": {
- "version": "2.0.3",
- "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz",
- "integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==",
- "deprecated": "Use @eslint/object-schema instead",
- "dev": true
- },
- "node_modules/@hyperledger/fabric-protos": {
- "version": "0.2.1",
- "resolved": "https://registry.npmjs.org/@hyperledger/fabric-protos/-/fabric-protos-0.2.1.tgz",
- "integrity": "sha512-qjm0vIQIfCall804tWDeA8p/mUfu14sl5Sj+PbOn2yDKJq+7ThoIhNsLAqf+BCxUfqsoqQq6AojhqQeTFyOOqg==",
- "dependencies": {
- "@grpc/grpc-js": "^1.9.0",
- "google-protobuf": "^3.21.0"
- },
- "engines": {
- "node": ">=14.15.0"
- }
- },
- "node_modules/@istanbuljs/load-nyc-config": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz",
- "integrity": "sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==",
- "dev": true,
- "dependencies": {
- "camelcase": "^5.3.1",
- "find-up": "^4.1.0",
- "get-package-type": "^0.1.0",
- "js-yaml": "^3.13.1",
- "resolve-from": "^5.0.0"
- },
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/@istanbuljs/load-nyc-config/node_modules/argparse": {
- "version": "1.0.10",
- "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz",
- "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==",
- "dev": true,
- "dependencies": {
- "sprintf-js": "~1.0.2"
- }
- },
- "node_modules/@istanbuljs/load-nyc-config/node_modules/find-up": {
- "version": "4.1.0",
- "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz",
- "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==",
- "dev": true,
- "dependencies": {
- "locate-path": "^5.0.0",
- "path-exists": "^4.0.0"
- },
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml": {
- "version": "3.14.1",
- "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz",
- "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==",
- "dev": true,
- "dependencies": {
- "argparse": "^1.0.7",
- "esprima": "^4.0.0"
- },
- "bin": {
- "js-yaml": "bin/js-yaml.js"
- }
- },
- "node_modules/@istanbuljs/load-nyc-config/node_modules/locate-path": {
- "version": "5.0.0",
- "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz",
- "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==",
- "dev": true,
- "dependencies": {
- "p-locate": "^4.1.0"
- },
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/@istanbuljs/load-nyc-config/node_modules/p-limit": {
- "version": "2.3.0",
- "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz",
- "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==",
- "dev": true,
- "dependencies": {
- "p-try": "^2.0.0"
- },
- "engines": {
- "node": ">=6"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/@istanbuljs/load-nyc-config/node_modules/p-locate": {
- "version": "4.1.0",
- "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz",
- "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==",
- "dev": true,
- "dependencies": {
- "p-limit": "^2.2.0"
- },
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/@istanbuljs/load-nyc-config/node_modules/resolve-from": {
- "version": "5.0.0",
- "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz",
- "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==",
- "dev": true,
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/@istanbuljs/schema": {
- "version": "0.1.3",
- "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz",
- "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==",
- "dev": true,
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/@jridgewell/gen-mapping": {
- "version": "0.3.5",
- "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz",
- "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==",
- "dev": true,
- "dependencies": {
- "@jridgewell/set-array": "^1.2.1",
- "@jridgewell/sourcemap-codec": "^1.4.10",
- "@jridgewell/trace-mapping": "^0.3.24"
- },
- "engines": {
- "node": ">=6.0.0"
- }
- },
- "node_modules/@jridgewell/resolve-uri": {
- "version": "3.1.2",
- "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz",
- "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==",
- "dev": true,
- "engines": {
- "node": ">=6.0.0"
- }
- },
- "node_modules/@jridgewell/set-array": {
- "version": "1.2.1",
- "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz",
- "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==",
- "dev": true,
- "engines": {
- "node": ">=6.0.0"
- }
- },
- "node_modules/@jridgewell/sourcemap-codec": {
- "version": "1.4.15",
- "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz",
- "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==",
- "dev": true
- },
- "node_modules/@jridgewell/trace-mapping": {
- "version": "0.3.25",
- "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz",
- "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==",
- "dev": true,
- "dependencies": {
- "@jridgewell/resolve-uri": "^3.1.0",
- "@jridgewell/sourcemap-codec": "^1.4.14"
- }
- },
- "node_modules/@js-sdsl/ordered-map": {
- "version": "4.4.2",
- "resolved": "https://registry.npmjs.org/@js-sdsl/ordered-map/-/ordered-map-4.4.2.tgz",
- "integrity": "sha512-iUKgm52T8HOE/makSxjqoWhe95ZJA1/G1sYsGev2JDKUSS14KAgg1LHb+Ba+IPow0xflbnSkOsZcO08C7w1gYw==",
- "funding": {
- "type": "opencollective",
- "url": "https://opencollective.com/js-sdsl"
- }
- },
- "node_modules/@nodelib/fs.scandir": {
- "version": "2.1.5",
- "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz",
- "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==",
- "dev": true,
- "dependencies": {
- "@nodelib/fs.stat": "2.0.5",
- "run-parallel": "^1.1.9"
- },
- "engines": {
- "node": ">= 8"
- }
- },
- "node_modules/@nodelib/fs.stat": {
- "version": "2.0.5",
- "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz",
- "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==",
- "dev": true,
- "engines": {
- "node": ">= 8"
- }
- },
- "node_modules/@nodelib/fs.walk": {
- "version": "1.2.8",
- "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz",
- "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==",
- "dev": true,
- "dependencies": {
- "@nodelib/fs.scandir": "2.1.5",
- "fastq": "^1.6.0"
- },
- "engines": {
- "node": ">= 8"
- }
- },
- "node_modules/@protobufjs/aspromise": {
- "version": "1.1.2",
- "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz",
- "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ=="
- },
- "node_modules/@protobufjs/base64": {
- "version": "1.1.2",
- "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz",
- "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg=="
- },
- "node_modules/@protobufjs/codegen": {
- "version": "2.0.4",
- "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz",
- "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg=="
- },
- "node_modules/@protobufjs/eventemitter": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz",
- "integrity": "sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q=="
- },
- "node_modules/@protobufjs/fetch": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz",
- "integrity": "sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==",
- "dependencies": {
- "@protobufjs/aspromise": "^1.1.1",
- "@protobufjs/inquire": "^1.1.0"
- }
- },
- "node_modules/@protobufjs/float": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz",
- "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ=="
- },
- "node_modules/@protobufjs/inquire": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz",
- "integrity": "sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q=="
- },
- "node_modules/@protobufjs/path": {
- "version": "1.1.2",
- "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz",
- "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA=="
- },
- "node_modules/@protobufjs/pool": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz",
- "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw=="
- },
- "node_modules/@protobufjs/utf8": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz",
- "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw=="
- },
- "node_modules/@sinonjs/commons": {
- "version": "3.0.1",
- "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.1.tgz",
- "integrity": "sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ==",
- "dev": true,
- "dependencies": {
- "type-detect": "4.0.8"
- }
- },
- "node_modules/@sinonjs/fake-timers": {
- "version": "11.2.2",
- "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-11.2.2.tgz",
- "integrity": "sha512-G2piCSxQ7oWOxwGSAyFHfPIsyeJGXYtc6mFbnFA+kRXkiEnTl8c/8jul2S329iFBnDI9HGoeWWAZvuvOkZccgw==",
- "dev": true,
- "dependencies": {
- "@sinonjs/commons": "^3.0.0"
- }
- },
- "node_modules/@sinonjs/samsam": {
- "version": "8.0.0",
- "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-8.0.0.tgz",
- "integrity": "sha512-Bp8KUVlLp8ibJZrnvq2foVhP0IVX2CIprMJPK0vqGqgrDa0OHVKeZyBykqskkrdxV6yKBPmGasO8LVjAKR3Gew==",
- "dev": true,
- "dependencies": {
- "@sinonjs/commons": "^2.0.0",
- "lodash.get": "^4.4.2",
- "type-detect": "^4.0.8"
- }
- },
- "node_modules/@sinonjs/samsam/node_modules/@sinonjs/commons": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-2.0.0.tgz",
- "integrity": "sha512-uLa0j859mMrg2slwQYdO/AkrOfmH+X6LTVmNTS9CqexuE2IvVORIkSpJLqePAbEnKJ77aMmCwr1NUZ57120Xcg==",
- "dev": true,
- "dependencies": {
- "type-detect": "4.0.8"
- }
- },
- "node_modules/@sinonjs/text-encoding": {
- "version": "0.7.2",
- "resolved": "https://registry.npmjs.org/@sinonjs/text-encoding/-/text-encoding-0.7.2.tgz",
- "integrity": "sha512-sXXKG+uL9IrKqViTtao2Ws6dy0znu9sOaP1di/jKGW1M6VssO8vlpXCQcpZ+jisQ1tTFAC5Jo/EOzFbggBagFQ==",
- "dev": true
- },
- "node_modules/@types/node": {
- "version": "16.18.98",
- "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.98.tgz",
- "integrity": "sha512-fpiC20NvLpTLAzo3oVBKIqBGR6Fx/8oAK/SSf7G+fydnXMY1x4x9RZ6sBXhqKlCU21g2QapUsbLlhv3+a7wS+Q=="
- },
- "node_modules/@types/triple-beam": {
- "version": "1.3.5",
- "resolved": "https://registry.npmjs.org/@types/triple-beam/-/triple-beam-1.3.5.tgz",
- "integrity": "sha512-6WaYesThRMCl19iryMYP7/x2OVgCtbIVflDGFpWnb9irXI3UjYE4AzmYuiUKY1AJstGijoY+MgUszMgRxIYTYw=="
- },
- "node_modules/@ungap/structured-clone": {
- "version": "1.2.0",
- "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz",
- "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==",
- "dev": true
- },
- "node_modules/acorn": {
- "version": "8.11.3",
- "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz",
- "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==",
- "dev": true,
- "bin": {
- "acorn": "bin/acorn"
- },
- "engines": {
- "node": ">=0.4.0"
- }
- },
- "node_modules/acorn-jsx": {
- "version": "5.3.2",
- "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz",
- "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==",
- "dev": true,
- "peerDependencies": {
- "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0"
- }
- },
- "node_modules/aggregate-error": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz",
- "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==",
- "dev": true,
- "dependencies": {
- "clean-stack": "^2.0.0",
- "indent-string": "^4.0.0"
- },
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/ajv": {
- "version": "6.12.6",
- "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz",
- "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==",
- "dependencies": {
- "fast-deep-equal": "^3.1.1",
- "fast-json-stable-stringify": "^2.0.0",
- "json-schema-traverse": "^0.4.1",
- "uri-js": "^4.2.2"
- },
- "funding": {
- "type": "github",
- "url": "https://github.com/sponsors/epoberezkin"
- }
- },
- "node_modules/ansi-colors": {
- "version": "4.1.1",
- "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz",
- "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==",
- "dev": true,
- "engines": {
- "node": ">=6"
- }
- },
- "node_modules/ansi-regex": {
- "version": "5.0.1",
- "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
- "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/ansi-styles": {
- "version": "4.3.0",
- "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
- "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
- "dependencies": {
- "color-convert": "^2.0.1"
- },
- "engines": {
- "node": ">=8"
- },
- "funding": {
- "url": "https://github.com/chalk/ansi-styles?sponsor=1"
- }
- },
- "node_modules/anymatch": {
- "version": "3.1.3",
- "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz",
- "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==",
- "dev": true,
- "dependencies": {
- "normalize-path": "^3.0.0",
- "picomatch": "^2.0.4"
- },
- "engines": {
- "node": ">= 8"
- }
- },
- "node_modules/append-transform": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/append-transform/-/append-transform-2.0.0.tgz",
- "integrity": "sha512-7yeyCEurROLQJFv5Xj4lEGTy0borxepjFv1g22oAdqFu//SrAlDl1O1Nxx15SH1RoliUml6p8dwJW9jvZughhg==",
- "dev": true,
- "dependencies": {
- "default-require-extensions": "^3.0.0"
- },
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/archy": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz",
- "integrity": "sha512-Xg+9RwCg/0p32teKdGMPTPnVXKD0w3DfHnFTficozsAgsvq2XenPJq/MYpzzQ/v8zrOyJn6Ds39VA4JIDwFfqw==",
- "dev": true
- },
- "node_modules/argparse": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
- "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==",
- "dev": true
- },
- "node_modules/assertion-error": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz",
- "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==",
- "dev": true,
- "engines": {
- "node": "*"
- }
- },
- "node_modules/async": {
- "version": "3.2.5",
- "resolved": "https://registry.npmjs.org/async/-/async-3.2.5.tgz",
- "integrity": "sha512-baNZyqaaLhyLVKm/DlvdW051MSgO6b8eVfIezl9E5PqWxFgzLm/wQntEW4zOytVburDEr0JlALEpdOFwvErLsg=="
- },
- "node_modules/balanced-match": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
- "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==",
- "dev": true
- },
- "node_modules/binary-extensions": {
- "version": "2.3.0",
- "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz",
- "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==",
- "dev": true,
- "engines": {
- "node": ">=8"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/brace-expansion": {
- "version": "1.1.11",
- "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
- "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
- "dev": true,
- "dependencies": {
- "balanced-match": "^1.0.0",
- "concat-map": "0.0.1"
- }
- },
- "node_modules/braces": {
- "version": "3.0.3",
- "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz",
- "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==",
- "dev": true,
- "dependencies": {
- "fill-range": "^7.1.1"
- },
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/browser-stdout": {
- "version": "1.3.1",
- "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz",
- "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==",
- "dev": true
- },
- "node_modules/browserslist": {
- "version": "4.23.1",
- "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.23.1.tgz",
- "integrity": "sha512-TUfofFo/KsK/bWZ9TWQ5O26tsWW4Uhmt8IYklbnUa70udB6P2wA7w7o4PY4muaEPBQaAX+CEnmmIA41NVHtPVw==",
- "dev": true,
- "funding": [
- {
- "type": "opencollective",
- "url": "https://opencollective.com/browserslist"
- },
- {
- "type": "tidelift",
- "url": "https://tidelift.com/funding/github/npm/browserslist"
- },
- {
- "type": "github",
- "url": "https://github.com/sponsors/ai"
- }
- ],
- "dependencies": {
- "caniuse-lite": "^1.0.30001629",
- "electron-to-chromium": "^1.4.796",
- "node-releases": "^2.0.14",
- "update-browserslist-db": "^1.0.16"
- },
- "bin": {
- "browserslist": "cli.js"
- },
- "engines": {
- "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7"
- }
- },
- "node_modules/caching-transform": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/caching-transform/-/caching-transform-4.0.0.tgz",
- "integrity": "sha512-kpqOvwXnjjN44D89K5ccQC+RUrsy7jB/XLlRrx0D7/2HNcTPqzsb6XgYoErwko6QsV184CA2YgS1fxDiiDZMWA==",
- "dev": true,
- "dependencies": {
- "hasha": "^5.0.0",
- "make-dir": "^3.0.0",
- "package-hash": "^4.0.0",
- "write-file-atomic": "^3.0.0"
- },
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/callsites": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",
- "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==",
- "dev": true,
- "engines": {
- "node": ">=6"
- }
- },
- "node_modules/camelcase": {
- "version": "5.3.1",
- "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz",
- "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==",
- "dev": true,
- "engines": {
- "node": ">=6"
- }
- },
- "node_modules/caniuse-lite": {
- "version": "1.0.30001633",
- "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001633.tgz",
- "integrity": "sha512-6sT0yf/z5jqf8tISAgpJDrmwOpLsrpnyCdD/lOZKvKkkJK4Dn0X5i7KF7THEZhOq+30bmhwBlNEaqPUiHiKtZg==",
- "dev": true,
- "funding": [
- {
- "type": "opencollective",
- "url": "https://opencollective.com/browserslist"
- },
- {
- "type": "tidelift",
- "url": "https://tidelift.com/funding/github/npm/caniuse-lite"
- },
- {
- "type": "github",
- "url": "https://github.com/sponsors/ai"
- }
- ]
- },
- "node_modules/chai": {
- "version": "4.4.1",
- "resolved": "https://registry.npmjs.org/chai/-/chai-4.4.1.tgz",
- "integrity": "sha512-13sOfMv2+DWduEU+/xbun3LScLoqN17nBeTLUsmDfKdoiC1fr0n9PU4guu4AhRcOVFk/sW8LyZWHuhWtQZiF+g==",
- "dev": true,
- "dependencies": {
- "assertion-error": "^1.1.0",
- "check-error": "^1.0.3",
- "deep-eql": "^4.1.3",
- "get-func-name": "^2.0.2",
- "loupe": "^2.3.6",
- "pathval": "^1.1.1",
- "type-detect": "^4.0.8"
- },
- "engines": {
- "node": ">=4"
- }
- },
- "node_modules/chalk": {
- "version": "4.1.2",
- "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
- "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
- "dev": true,
- "dependencies": {
- "ansi-styles": "^4.1.0",
- "supports-color": "^7.1.0"
- },
- "engines": {
- "node": ">=10"
- },
- "funding": {
- "url": "https://github.com/chalk/chalk?sponsor=1"
- }
- },
- "node_modules/check-error": {
- "version": "1.0.3",
- "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.3.tgz",
- "integrity": "sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg==",
- "dev": true,
- "dependencies": {
- "get-func-name": "^2.0.2"
- },
- "engines": {
- "node": "*"
- }
- },
- "node_modules/chokidar": {
- "version": "3.5.3",
- "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz",
- "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==",
- "dev": true,
- "funding": [
- {
- "type": "individual",
- "url": "https://paulmillr.com/funding/"
- }
- ],
- "dependencies": {
- "anymatch": "~3.1.2",
- "braces": "~3.0.2",
- "glob-parent": "~5.1.2",
- "is-binary-path": "~2.1.0",
- "is-glob": "~4.0.1",
- "normalize-path": "~3.0.0",
- "readdirp": "~3.6.0"
- },
- "engines": {
- "node": ">= 8.10.0"
- },
- "optionalDependencies": {
- "fsevents": "~2.3.2"
- }
- },
- "node_modules/chokidar/node_modules/glob-parent": {
- "version": "5.1.2",
- "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz",
- "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==",
- "dev": true,
- "dependencies": {
- "is-glob": "^4.0.1"
- },
- "engines": {
- "node": ">= 6"
- }
- },
- "node_modules/class-transformer": {
- "version": "0.4.0",
- "resolved": "https://registry.npmjs.org/class-transformer/-/class-transformer-0.4.0.tgz",
- "integrity": "sha512-ETWD/H2TbWbKEi7m9N4Km5+cw1hNcqJSxlSYhsLsNjQzWWiZIYA1zafxpK9PwVfaZ6AqR5rrjPVUBGESm5tQUA=="
- },
- "node_modules/clean-stack": {
- "version": "2.2.0",
- "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz",
- "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==",
- "dev": true,
- "engines": {
- "node": ">=6"
- }
- },
- "node_modules/cliui": {
- "version": "8.0.1",
- "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz",
- "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==",
- "dependencies": {
- "string-width": "^4.2.0",
- "strip-ansi": "^6.0.1",
- "wrap-ansi": "^7.0.0"
- },
- "engines": {
- "node": ">=12"
- }
- },
- "node_modules/color": {
- "version": "3.2.1",
- "resolved": "https://registry.npmjs.org/color/-/color-3.2.1.tgz",
- "integrity": "sha512-aBl7dZI9ENN6fUGC7mWpMTPNHmWUSNan9tuWN6ahh5ZLNk9baLJOnSMlrQkHcrfFgz2/RigjUVAjdx36VcemKA==",
- "dependencies": {
- "color-convert": "^1.9.3",
- "color-string": "^1.6.0"
- }
- },
- "node_modules/color-convert": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
- "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
- "dependencies": {
- "color-name": "~1.1.4"
- },
- "engines": {
- "node": ">=7.0.0"
- }
- },
- "node_modules/color-name": {
- "version": "1.1.4",
- "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
- "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="
- },
- "node_modules/color-string": {
- "version": "1.9.1",
- "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.9.1.tgz",
- "integrity": "sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg==",
- "dependencies": {
- "color-name": "^1.0.0",
- "simple-swizzle": "^0.2.2"
- }
- },
- "node_modules/color/node_modules/color-convert": {
- "version": "1.9.3",
- "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
- "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
- "dependencies": {
- "color-name": "1.1.3"
- }
- },
- "node_modules/color/node_modules/color-name": {
- "version": "1.1.3",
- "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
- "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw=="
- },
- "node_modules/colorspace": {
- "version": "1.1.4",
- "resolved": "https://registry.npmjs.org/colorspace/-/colorspace-1.1.4.tgz",
- "integrity": "sha512-BgvKJiuVu1igBUF2kEjRCZXol6wiiGbY5ipL/oVPwm0BL9sIpMIzM8IK7vwuxIIzOXMV3Ey5w+vxhm0rR/TN8w==",
- "dependencies": {
- "color": "^3.1.3",
- "text-hex": "1.0.x"
- }
- },
- "node_modules/commondir": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz",
- "integrity": "sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==",
- "dev": true
- },
- "node_modules/concat-map": {
- "version": "0.0.1",
- "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
- "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==",
- "dev": true
- },
- "node_modules/convert-source-map": {
- "version": "1.9.0",
- "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz",
- "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==",
- "dev": true
- },
- "node_modules/cross-spawn": {
- "version": "7.0.3",
- "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
- "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==",
- "dev": true,
- "dependencies": {
- "path-key": "^3.1.0",
- "shebang-command": "^2.0.0",
- "which": "^2.0.1"
- },
- "engines": {
- "node": ">= 8"
- }
- },
- "node_modules/debug": {
- "version": "4.3.5",
- "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.5.tgz",
- "integrity": "sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==",
- "dev": true,
- "dependencies": {
- "ms": "2.1.2"
- },
- "engines": {
- "node": ">=6.0"
- },
- "peerDependenciesMeta": {
- "supports-color": {
- "optional": true
- }
- }
- },
- "node_modules/decamelize": {
- "version": "1.2.0",
- "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz",
- "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==",
- "dev": true,
- "engines": {
- "node": ">=0.10.0"
- }
- },
- "node_modules/deep-eql": {
- "version": "4.1.4",
- "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.4.tgz",
- "integrity": "sha512-SUwdGfqdKOwxCPeVYjwSyRpJ7Z+fhpwIAtmCUdZIWZ/YP5R9WAsyuSgpLVDi9bjWoN2LXHNss/dk3urXtdQxGg==",
- "dev": true,
- "dependencies": {
- "type-detect": "^4.0.0"
- },
- "engines": {
- "node": ">=6"
- }
- },
- "node_modules/deep-is": {
- "version": "0.1.4",
- "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz",
- "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==",
- "dev": true
- },
- "node_modules/default-require-extensions": {
- "version": "3.0.1",
- "resolved": "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-3.0.1.tgz",
- "integrity": "sha512-eXTJmRbm2TIt9MgWTsOH1wEuhew6XGZcMeGKCtLedIg/NCsg1iBePXkceTdK4Fii7pzmN9tGsZhKzZ4h7O/fxw==",
- "dev": true,
- "dependencies": {
- "strip-bom": "^4.0.0"
- },
- "engines": {
- "node": ">=8"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/diff": {
- "version": "5.0.0",
- "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz",
- "integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==",
- "dev": true,
- "engines": {
- "node": ">=0.3.1"
- }
- },
- "node_modules/doctrine": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz",
- "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==",
- "dev": true,
- "dependencies": {
- "esutils": "^2.0.2"
- },
- "engines": {
- "node": ">=6.0.0"
- }
- },
- "node_modules/electron-to-chromium": {
- "version": "1.4.802",
- "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.802.tgz",
- "integrity": "sha512-TnTMUATbgNdPXVSHsxvNVSG0uEd6cSZsANjm8c9HbvflZVVn1yTRcmVXYT1Ma95/ssB/Dcd30AHweH2TE+dNpA==",
- "dev": true
- },
- "node_modules/emoji-regex": {
- "version": "8.0.0",
- "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
- "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="
- },
- "node_modules/enabled": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/enabled/-/enabled-2.0.0.tgz",
- "integrity": "sha512-AKrN98kuwOzMIdAizXGI86UFBoo26CL21UM763y1h/GMSJ4/OHU9k2YlsmBpyScFo/wbLzWQJBMCW4+IO3/+OQ=="
- },
- "node_modules/es6-error": {
- "version": "4.1.1",
- "resolved": "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz",
- "integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==",
- "dev": true
- },
- "node_modules/escalade": {
- "version": "3.1.2",
- "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz",
- "integrity": "sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==",
- "engines": {
- "node": ">=6"
- }
- },
- "node_modules/escape-string-regexp": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz",
- "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==",
- "dev": true,
- "engines": {
- "node": ">=10"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/eslint": {
- "version": "8.57.0",
- "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.0.tgz",
- "integrity": "sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==",
- "dev": true,
- "dependencies": {
- "@eslint-community/eslint-utils": "^4.2.0",
- "@eslint-community/regexpp": "^4.6.1",
- "@eslint/eslintrc": "^2.1.4",
- "@eslint/js": "8.57.0",
- "@humanwhocodes/config-array": "^0.11.14",
- "@humanwhocodes/module-importer": "^1.0.1",
- "@nodelib/fs.walk": "^1.2.8",
- "@ungap/structured-clone": "^1.2.0",
- "ajv": "^6.12.4",
- "chalk": "^4.0.0",
- "cross-spawn": "^7.0.2",
- "debug": "^4.3.2",
- "doctrine": "^3.0.0",
- "escape-string-regexp": "^4.0.0",
- "eslint-scope": "^7.2.2",
- "eslint-visitor-keys": "^3.4.3",
- "espree": "^9.6.1",
- "esquery": "^1.4.2",
- "esutils": "^2.0.2",
- "fast-deep-equal": "^3.1.3",
- "file-entry-cache": "^6.0.1",
- "find-up": "^5.0.0",
- "glob-parent": "^6.0.2",
- "globals": "^13.19.0",
- "graphemer": "^1.4.0",
- "ignore": "^5.2.0",
- "imurmurhash": "^0.1.4",
- "is-glob": "^4.0.0",
- "is-path-inside": "^3.0.3",
- "js-yaml": "^4.1.0",
- "json-stable-stringify-without-jsonify": "^1.0.1",
- "levn": "^0.4.1",
- "lodash.merge": "^4.6.2",
- "minimatch": "^3.1.2",
- "natural-compare": "^1.4.0",
- "optionator": "^0.9.3",
- "strip-ansi": "^6.0.1",
- "text-table": "^0.2.0"
- },
- "bin": {
- "eslint": "bin/eslint.js"
- },
- "engines": {
- "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
- },
- "funding": {
- "url": "https://opencollective.com/eslint"
- }
- },
- "node_modules/eslint-scope": {
- "version": "7.2.2",
- "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz",
- "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==",
- "dev": true,
- "dependencies": {
- "esrecurse": "^4.3.0",
- "estraverse": "^5.2.0"
- },
- "engines": {
- "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
- },
- "funding": {
- "url": "https://opencollective.com/eslint"
- }
- },
- "node_modules/eslint-visitor-keys": {
- "version": "3.4.3",
- "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz",
- "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==",
- "dev": true,
- "engines": {
- "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
- },
- "funding": {
- "url": "https://opencollective.com/eslint"
- }
- },
- "node_modules/espree": {
- "version": "9.6.1",
- "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz",
- "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==",
- "dev": true,
- "dependencies": {
- "acorn": "^8.9.0",
- "acorn-jsx": "^5.3.2",
- "eslint-visitor-keys": "^3.4.1"
- },
- "engines": {
- "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
- },
- "funding": {
- "url": "https://opencollective.com/eslint"
- }
- },
- "node_modules/esprima": {
- "version": "4.0.1",
- "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz",
- "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==",
- "dev": true,
- "bin": {
- "esparse": "bin/esparse.js",
- "esvalidate": "bin/esvalidate.js"
- },
- "engines": {
- "node": ">=4"
- }
- },
- "node_modules/esquery": {
- "version": "1.5.0",
- "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz",
- "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==",
- "dev": true,
- "dependencies": {
- "estraverse": "^5.1.0"
- },
- "engines": {
- "node": ">=0.10"
- }
- },
- "node_modules/esrecurse": {
- "version": "4.3.0",
- "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz",
- "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==",
- "dev": true,
- "dependencies": {
- "estraverse": "^5.2.0"
- },
- "engines": {
- "node": ">=4.0"
- }
- },
- "node_modules/estraverse": {
- "version": "5.3.0",
- "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz",
- "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==",
- "dev": true,
- "engines": {
- "node": ">=4.0"
- }
- },
- "node_modules/esutils": {
- "version": "2.0.3",
- "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz",
- "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==",
- "dev": true,
- "engines": {
- "node": ">=0.10.0"
- }
- },
- "node_modules/fabric-contract-api": {
- "version": "2.5.6",
- "resolved": "https://registry.npmjs.org/fabric-contract-api/-/fabric-contract-api-2.5.6.tgz",
- "integrity": "sha512-AosGb8tA+Jgt+pqMEgYNB3/J/P5QuWOC7yhXbhDmAAwUzn4Sc7pdWDICH1YyrFGZNFxMGQmqJmLVWUX8BKHy0w==",
- "dependencies": {
- "class-transformer": "^0.4.0",
- "fabric-shim-api": "2.5.6",
- "fast-safe-stringify": "^2.1.1",
- "get-params": "^0.1.2",
- "reflect-metadata": "^0.1.13",
- "winston": "^3.7.2"
- },
- "engines": {
- "node": ">=18"
- }
- },
- "node_modules/fabric-shim": {
- "version": "2.5.6",
- "resolved": "https://registry.npmjs.org/fabric-shim/-/fabric-shim-2.5.6.tgz",
- "integrity": "sha512-4Y8WNFhYuQ9QYSEgPXWdlXnrXjwOlM10sQQzE4kJ7cDh8a4LX0rn44FxtxTCB18lnzrSLMZ8/8Cr5m0c9NeXWA==",
- "dependencies": {
- "@fidm/x509": "^1.2.1",
- "@grpc/grpc-js": "~1.10.9",
- "@hyperledger/fabric-protos": "~0.2.1",
- "@types/node": "^16.11.1",
- "ajv": "^6.12.2",
- "fabric-contract-api": "2.5.6",
- "fabric-shim-api": "2.5.6",
- "fast-safe-stringify": "^2.1.1",
- "long": "^5.2.3",
- "reflect-metadata": "^0.1.13",
- "winston": "^3.7.2",
- "yargs": "^17.4.0",
- "yargs-parser": "^21.0.1"
- },
- "bin": {
- "fabric-chaincode-node": "cli.js"
- },
- "engines": {
- "node": ">=18"
- }
- },
- "node_modules/fabric-shim-api": {
- "version": "2.5.6",
- "resolved": "https://registry.npmjs.org/fabric-shim-api/-/fabric-shim-api-2.5.6.tgz",
- "integrity": "sha512-1L0nO7CJ31/gEOWKWHEeCqgB5HkqPVfRbpcS7L9eTscT7tffjg2OkZISvC+a7RiqihL0iyrXNBgBg5MwlSSN9g==",
- "engines": {
- "eslint": "^6.6.0",
- "node": ">=18"
- }
- },
- "node_modules/fast-deep-equal": {
- "version": "3.1.3",
- "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
- "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q=="
- },
- "node_modules/fast-json-stable-stringify": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz",
- "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw=="
- },
- "node_modules/fast-levenshtein": {
- "version": "2.0.6",
- "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz",
- "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==",
- "dev": true
- },
- "node_modules/fast-safe-stringify": {
- "version": "2.1.1",
- "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz",
- "integrity": "sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA=="
- },
- "node_modules/fastq": {
- "version": "1.17.1",
- "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz",
- "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==",
- "dev": true,
- "dependencies": {
- "reusify": "^1.0.4"
- }
- },
- "node_modules/fecha": {
- "version": "4.2.3",
- "resolved": "https://registry.npmjs.org/fecha/-/fecha-4.2.3.tgz",
- "integrity": "sha512-OP2IUU6HeYKJi3i0z4A19kHMQoLVs4Hc+DPqqxI2h/DPZHTm/vjsfC6P0b4jCMy14XizLBqvndQ+UilD7707Jw=="
- },
- "node_modules/file-entry-cache": {
- "version": "6.0.1",
- "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz",
- "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==",
- "dev": true,
- "dependencies": {
- "flat-cache": "^3.0.4"
- },
- "engines": {
- "node": "^10.12.0 || >=12.0.0"
- }
- },
- "node_modules/fill-range": {
- "version": "7.1.1",
- "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz",
- "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==",
- "dev": true,
- "dependencies": {
- "to-regex-range": "^5.0.1"
- },
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/find-cache-dir": {
- "version": "3.3.2",
- "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.2.tgz",
- "integrity": "sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig==",
- "dev": true,
- "dependencies": {
- "commondir": "^1.0.1",
- "make-dir": "^3.0.2",
- "pkg-dir": "^4.1.0"
- },
- "engines": {
- "node": ">=8"
- },
- "funding": {
- "url": "https://github.com/avajs/find-cache-dir?sponsor=1"
- }
- },
- "node_modules/find-up": {
- "version": "5.0.0",
- "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz",
- "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==",
- "dev": true,
- "dependencies": {
- "locate-path": "^6.0.0",
- "path-exists": "^4.0.0"
- },
- "engines": {
- "node": ">=10"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/flat": {
- "version": "5.0.2",
- "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz",
- "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==",
- "dev": true,
- "bin": {
- "flat": "cli.js"
- }
- },
- "node_modules/flat-cache": {
- "version": "3.2.0",
- "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz",
- "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==",
- "dev": true,
- "dependencies": {
- "flatted": "^3.2.9",
- "keyv": "^4.5.3",
- "rimraf": "^3.0.2"
- },
- "engines": {
- "node": "^10.12.0 || >=12.0.0"
- }
- },
- "node_modules/flatted": {
- "version": "3.3.1",
- "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.1.tgz",
- "integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==",
- "dev": true
- },
- "node_modules/fn.name": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/fn.name/-/fn.name-1.1.0.tgz",
- "integrity": "sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw=="
- },
- "node_modules/foreground-child": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-2.0.0.tgz",
- "integrity": "sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA==",
- "dev": true,
- "dependencies": {
- "cross-spawn": "^7.0.0",
- "signal-exit": "^3.0.2"
- },
- "engines": {
- "node": ">=8.0.0"
- }
- },
- "node_modules/fromentries": {
- "version": "1.3.2",
- "resolved": "https://registry.npmjs.org/fromentries/-/fromentries-1.3.2.tgz",
- "integrity": "sha512-cHEpEQHUg0f8XdtZCc2ZAhrHzKzT0MrFUTcvx+hfxYu7rGMDc5SKoXFh+n4YigxsHXRzc6OrCshdR1bWH6HHyg==",
- "dev": true,
- "funding": [
- {
- "type": "github",
- "url": "https://github.com/sponsors/feross"
- },
- {
- "type": "patreon",
- "url": "https://www.patreon.com/feross"
- },
- {
- "type": "consulting",
- "url": "https://feross.org/support"
- }
- ]
- },
- "node_modules/fs.realpath": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
- "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==",
- "dev": true
- },
- "node_modules/fsevents": {
- "version": "2.3.3",
- "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz",
- "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==",
- "dev": true,
- "hasInstallScript": true,
- "optional": true,
- "os": [
- "darwin"
- ],
- "engines": {
- "node": "^8.16.0 || ^10.6.0 || >=11.0.0"
- }
- },
- "node_modules/gensync": {
- "version": "1.0.0-beta.2",
- "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz",
- "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==",
- "dev": true,
- "engines": {
- "node": ">=6.9.0"
- }
- },
- "node_modules/get-caller-file": {
- "version": "2.0.5",
- "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz",
- "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==",
- "engines": {
- "node": "6.* || 8.* || >= 10.*"
- }
- },
- "node_modules/get-func-name": {
- "version": "2.0.2",
- "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz",
- "integrity": "sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==",
- "dev": true,
- "engines": {
- "node": "*"
- }
- },
- "node_modules/get-package-type": {
- "version": "0.1.0",
- "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz",
- "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==",
- "dev": true,
- "engines": {
- "node": ">=8.0.0"
- }
- },
- "node_modules/get-params": {
- "version": "0.1.2",
- "resolved": "https://registry.npmjs.org/get-params/-/get-params-0.1.2.tgz",
- "integrity": "sha512-41eOxtlGgHQRbFyA8KTH+w+32Em3cRdfBud7j67ulzmIfmaHX9doq47s0fa4P5o9H64BZX9nrYI6sJvk46Op+Q=="
- },
- "node_modules/glob": {
- "version": "8.1.0",
- "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz",
- "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==",
- "deprecated": "Glob versions prior to v9 are no longer supported",
- "dev": true,
- "dependencies": {
- "fs.realpath": "^1.0.0",
- "inflight": "^1.0.4",
- "inherits": "2",
- "minimatch": "^5.0.1",
- "once": "^1.3.0"
- },
- "engines": {
- "node": ">=12"
- },
- "funding": {
- "url": "https://github.com/sponsors/isaacs"
- }
- },
- "node_modules/glob-parent": {
- "version": "6.0.2",
- "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz",
- "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==",
- "dev": true,
- "dependencies": {
- "is-glob": "^4.0.3"
- },
- "engines": {
- "node": ">=10.13.0"
- }
- },
- "node_modules/glob/node_modules/brace-expansion": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz",
- "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==",
- "dev": true,
- "dependencies": {
- "balanced-match": "^1.0.0"
- }
- },
- "node_modules/glob/node_modules/minimatch": {
- "version": "5.1.6",
- "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz",
- "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==",
- "dev": true,
- "dependencies": {
- "brace-expansion": "^2.0.1"
- },
- "engines": {
- "node": ">=10"
- }
- },
- "node_modules/globals": {
- "version": "13.24.0",
- "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz",
- "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==",
- "dev": true,
- "dependencies": {
- "type-fest": "^0.20.2"
- },
- "engines": {
- "node": ">=8"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/google-protobuf": {
- "version": "3.21.2",
- "resolved": "https://registry.npmjs.org/google-protobuf/-/google-protobuf-3.21.2.tgz",
- "integrity": "sha512-3MSOYFO5U9mPGikIYCzK0SaThypfGgS6bHqrUGXG3DPHCrb+txNqeEcns1W0lkGfk0rCyNXm7xB9rMxnCiZOoA=="
- },
- "node_modules/graceful-fs": {
- "version": "4.2.11",
- "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz",
- "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==",
- "dev": true
- },
- "node_modules/graphemer": {
- "version": "1.4.0",
- "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz",
- "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==",
- "dev": true
- },
- "node_modules/has-flag": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
- "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
- "dev": true,
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/hasha": {
- "version": "5.2.2",
- "resolved": "https://registry.npmjs.org/hasha/-/hasha-5.2.2.tgz",
- "integrity": "sha512-Hrp5vIK/xr5SkeN2onO32H0MgNZ0f17HRNH39WfL0SYUNOTZ5Lz1TJ8Pajo/87dYGEFlLMm7mIc/k/s6Bvz9HQ==",
- "dev": true,
- "dependencies": {
- "is-stream": "^2.0.0",
- "type-fest": "^0.8.0"
- },
- "engines": {
- "node": ">=8"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/hasha/node_modules/type-fest": {
- "version": "0.8.1",
- "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz",
- "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==",
- "dev": true,
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/he": {
- "version": "1.2.0",
- "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz",
- "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==",
- "dev": true,
- "bin": {
- "he": "bin/he"
- }
- },
- "node_modules/html-escaper": {
- "version": "2.0.2",
- "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz",
- "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==",
- "dev": true
- },
- "node_modules/ignore": {
- "version": "5.3.1",
- "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz",
- "integrity": "sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==",
- "dev": true,
- "engines": {
- "node": ">= 4"
- }
- },
- "node_modules/import-fresh": {
- "version": "3.3.0",
- "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz",
- "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==",
- "dev": true,
- "dependencies": {
- "parent-module": "^1.0.0",
- "resolve-from": "^4.0.0"
- },
- "engines": {
- "node": ">=6"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/imurmurhash": {
- "version": "0.1.4",
- "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz",
- "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==",
- "dev": true,
- "engines": {
- "node": ">=0.8.19"
- }
- },
- "node_modules/indent-string": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz",
- "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==",
- "dev": true,
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/inflight": {
- "version": "1.0.6",
- "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
- "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==",
- "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.",
- "dev": true,
- "dependencies": {
- "once": "^1.3.0",
- "wrappy": "1"
- }
- },
- "node_modules/inherits": {
- "version": "2.0.4",
- "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
- "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
- },
- "node_modules/is-arrayish": {
- "version": "0.3.2",
- "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz",
- "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ=="
- },
- "node_modules/is-binary-path": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz",
- "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==",
- "dev": true,
- "dependencies": {
- "binary-extensions": "^2.0.0"
- },
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/is-extglob": {
- "version": "2.1.1",
- "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
- "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==",
- "dev": true,
- "engines": {
- "node": ">=0.10.0"
- }
- },
- "node_modules/is-fullwidth-code-point": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
- "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/is-glob": {
- "version": "4.0.3",
- "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz",
- "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==",
- "dev": true,
- "dependencies": {
- "is-extglob": "^2.1.1"
- },
- "engines": {
- "node": ">=0.10.0"
- }
- },
- "node_modules/is-number": {
- "version": "7.0.0",
- "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
- "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
- "dev": true,
- "engines": {
- "node": ">=0.12.0"
- }
- },
- "node_modules/is-path-inside": {
- "version": "3.0.3",
- "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz",
- "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==",
- "dev": true,
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/is-plain-obj": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz",
- "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==",
- "dev": true,
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/is-stream": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz",
- "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==",
- "engines": {
- "node": ">=8"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/is-typedarray": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz",
- "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==",
- "dev": true
- },
- "node_modules/is-unicode-supported": {
- "version": "0.1.0",
- "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz",
- "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==",
- "dev": true,
- "engines": {
- "node": ">=10"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/is-windows": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz",
- "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==",
- "dev": true,
- "engines": {
- "node": ">=0.10.0"
- }
- },
- "node_modules/isexe": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
- "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==",
- "dev": true
- },
- "node_modules/istanbul-lib-coverage": {
- "version": "3.2.2",
- "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz",
- "integrity": "sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==",
- "dev": true,
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/istanbul-lib-hook": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-3.0.0.tgz",
- "integrity": "sha512-Pt/uge1Q9s+5VAZ+pCo16TYMWPBIl+oaNIjgLQxcX0itS6ueeaA+pEfThZpH8WxhFgCiEb8sAJY6MdUKgiIWaQ==",
- "dev": true,
- "dependencies": {
- "append-transform": "^2.0.0"
- },
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/istanbul-lib-instrument": {
- "version": "4.0.3",
- "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.3.tgz",
- "integrity": "sha512-BXgQl9kf4WTCPCCpmFGoJkz/+uhvm7h7PFKUYxh7qarQd3ER33vHG//qaE8eN25l07YqZPpHXU9I09l/RD5aGQ==",
- "dev": true,
- "dependencies": {
- "@babel/core": "^7.7.5",
- "@istanbuljs/schema": "^0.1.2",
- "istanbul-lib-coverage": "^3.0.0",
- "semver": "^6.3.0"
- },
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/istanbul-lib-processinfo": {
- "version": "2.0.3",
- "resolved": "https://registry.npmjs.org/istanbul-lib-processinfo/-/istanbul-lib-processinfo-2.0.3.tgz",
- "integrity": "sha512-NkwHbo3E00oybX6NGJi6ar0B29vxyvNwoC7eJ4G4Yq28UfY758Hgn/heV8VRFhevPED4LXfFz0DQ8z/0kw9zMg==",
- "dev": true,
- "dependencies": {
- "archy": "^1.0.0",
- "cross-spawn": "^7.0.3",
- "istanbul-lib-coverage": "^3.2.0",
- "p-map": "^3.0.0",
- "rimraf": "^3.0.0",
- "uuid": "^8.3.2"
- },
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/istanbul-lib-report": {
- "version": "3.0.1",
- "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz",
- "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==",
- "dev": true,
- "dependencies": {
- "istanbul-lib-coverage": "^3.0.0",
- "make-dir": "^4.0.0",
- "supports-color": "^7.1.0"
- },
- "engines": {
- "node": ">=10"
- }
- },
- "node_modules/istanbul-lib-report/node_modules/make-dir": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz",
- "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==",
- "dev": true,
- "dependencies": {
- "semver": "^7.5.3"
- },
- "engines": {
- "node": ">=10"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/istanbul-lib-report/node_modules/semver": {
- "version": "7.6.2",
- "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz",
- "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==",
- "dev": true,
- "bin": {
- "semver": "bin/semver.js"
- },
- "engines": {
- "node": ">=10"
- }
- },
- "node_modules/istanbul-lib-source-maps": {
- "version": "4.0.1",
- "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz",
- "integrity": "sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==",
- "dev": true,
- "dependencies": {
- "debug": "^4.1.1",
- "istanbul-lib-coverage": "^3.0.0",
- "source-map": "^0.6.1"
- },
- "engines": {
- "node": ">=10"
- }
- },
- "node_modules/istanbul-reports": {
- "version": "3.1.7",
- "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.7.tgz",
- "integrity": "sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g==",
- "dev": true,
- "dependencies": {
- "html-escaper": "^2.0.0",
- "istanbul-lib-report": "^3.0.0"
- },
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/js-tokens": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
- "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==",
- "dev": true
- },
- "node_modules/js-yaml": {
- "version": "4.1.0",
- "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz",
- "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==",
- "dev": true,
- "dependencies": {
- "argparse": "^2.0.1"
- },
- "bin": {
- "js-yaml": "bin/js-yaml.js"
- }
- },
- "node_modules/jsesc": {
- "version": "2.5.2",
- "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz",
- "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==",
- "dev": true,
- "bin": {
- "jsesc": "bin/jsesc"
- },
- "engines": {
- "node": ">=4"
- }
- },
- "node_modules/json-buffer": {
- "version": "3.0.1",
- "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz",
- "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==",
- "dev": true
- },
- "node_modules/json-schema-traverse": {
- "version": "0.4.1",
- "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz",
- "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg=="
- },
- "node_modules/json-stable-stringify-without-jsonify": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz",
- "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==",
- "dev": true
- },
- "node_modules/json5": {
- "version": "2.2.3",
- "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz",
- "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==",
- "dev": true,
- "bin": {
- "json5": "lib/cli.js"
- },
- "engines": {
- "node": ">=6"
- }
- },
- "node_modules/just-extend": {
- "version": "6.2.0",
- "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-6.2.0.tgz",
- "integrity": "sha512-cYofQu2Xpom82S6qD778jBDpwvvy39s1l/hrYij2u9AMdQcGRpaBu6kY4mVhuno5kJVi1DAz4aiphA2WI1/OAw==",
- "dev": true
- },
- "node_modules/keyv": {
- "version": "4.5.4",
- "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz",
- "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==",
- "dev": true,
- "dependencies": {
- "json-buffer": "3.0.1"
- }
- },
- "node_modules/kuler": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/kuler/-/kuler-2.0.0.tgz",
- "integrity": "sha512-Xq9nH7KlWZmXAtodXDDRE7vs6DU1gTU8zYDHDiWLSip45Egwq3plLHzPn27NgvzL2r1LMPC1vdqh98sQxtqj4A=="
- },
- "node_modules/levn": {
- "version": "0.4.1",
- "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz",
- "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==",
- "dev": true,
- "dependencies": {
- "prelude-ls": "^1.2.1",
- "type-check": "~0.4.0"
- },
- "engines": {
- "node": ">= 0.8.0"
- }
- },
- "node_modules/locate-path": {
- "version": "6.0.0",
- "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz",
- "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==",
- "dev": true,
- "dependencies": {
- "p-locate": "^5.0.0"
- },
- "engines": {
- "node": ">=10"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/lodash.camelcase": {
- "version": "4.3.0",
- "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz",
- "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA=="
- },
- "node_modules/lodash.flattendeep": {
- "version": "4.4.0",
- "resolved": "https://registry.npmjs.org/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz",
- "integrity": "sha512-uHaJFihxmJcEX3kT4I23ABqKKalJ/zDrDg0lsFtc1h+3uw49SIJ5beyhx5ExVRti3AvKoOJngIj7xz3oylPdWQ==",
- "dev": true
- },
- "node_modules/lodash.get": {
- "version": "4.4.2",
- "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz",
- "integrity": "sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ==",
- "dev": true
- },
- "node_modules/lodash.merge": {
- "version": "4.6.2",
- "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz",
- "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==",
- "dev": true
- },
- "node_modules/log-symbols": {
- "version": "4.1.0",
- "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz",
- "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==",
- "dev": true,
- "dependencies": {
- "chalk": "^4.1.0",
- "is-unicode-supported": "^0.1.0"
- },
- "engines": {
- "node": ">=10"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/logform": {
- "version": "2.6.0",
- "resolved": "https://registry.npmjs.org/logform/-/logform-2.6.0.tgz",
- "integrity": "sha512-1ulHeNPp6k/LD8H91o7VYFBng5i1BDE7HoKxVbZiGFidS1Rj65qcywLxX+pVfAPoQJEjRdvKcusKwOupHCVOVQ==",
- "dependencies": {
- "@colors/colors": "1.6.0",
- "@types/triple-beam": "^1.3.2",
- "fecha": "^4.2.0",
- "ms": "^2.1.1",
- "safe-stable-stringify": "^2.3.1",
- "triple-beam": "^1.3.0"
- },
- "engines": {
- "node": ">= 12.0.0"
- }
- },
- "node_modules/long": {
- "version": "5.2.3",
- "resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz",
- "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q=="
- },
- "node_modules/loupe": {
- "version": "2.3.7",
- "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.7.tgz",
- "integrity": "sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA==",
- "dev": true,
- "dependencies": {
- "get-func-name": "^2.0.1"
- }
- },
- "node_modules/lru-cache": {
- "version": "5.1.1",
- "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz",
- "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==",
- "dev": true,
- "dependencies": {
- "yallist": "^3.0.2"
- }
- },
- "node_modules/make-dir": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz",
- "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==",
- "dev": true,
- "dependencies": {
- "semver": "^6.0.0"
- },
- "engines": {
- "node": ">=8"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/minimatch": {
- "version": "3.1.2",
- "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
- "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
- "dev": true,
- "dependencies": {
- "brace-expansion": "^1.1.7"
- },
- "engines": {
- "node": "*"
- }
- },
- "node_modules/mocha": {
- "version": "10.4.0",
- "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.4.0.tgz",
- "integrity": "sha512-eqhGB8JKapEYcC4ytX/xrzKforgEc3j1pGlAXVy3eRwrtAy5/nIfT1SvgGzfN0XZZxeLq0aQWkOUAmqIJiv+bA==",
- "dev": true,
- "dependencies": {
- "ansi-colors": "4.1.1",
- "browser-stdout": "1.3.1",
- "chokidar": "3.5.3",
- "debug": "4.3.4",
- "diff": "5.0.0",
- "escape-string-regexp": "4.0.0",
- "find-up": "5.0.0",
- "glob": "8.1.0",
- "he": "1.2.0",
- "js-yaml": "4.1.0",
- "log-symbols": "4.1.0",
- "minimatch": "5.0.1",
- "ms": "2.1.3",
- "serialize-javascript": "6.0.0",
- "strip-json-comments": "3.1.1",
- "supports-color": "8.1.1",
- "workerpool": "6.2.1",
- "yargs": "16.2.0",
- "yargs-parser": "20.2.4",
- "yargs-unparser": "2.0.0"
- },
- "bin": {
- "_mocha": "bin/_mocha",
- "mocha": "bin/mocha.js"
- },
- "engines": {
- "node": ">= 14.0.0"
- }
- },
- "node_modules/mocha/node_modules/brace-expansion": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz",
- "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==",
- "dev": true,
- "dependencies": {
- "balanced-match": "^1.0.0"
- }
- },
- "node_modules/mocha/node_modules/cliui": {
- "version": "7.0.4",
- "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz",
- "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==",
- "dev": true,
- "dependencies": {
- "string-width": "^4.2.0",
- "strip-ansi": "^6.0.0",
- "wrap-ansi": "^7.0.0"
- }
- },
- "node_modules/mocha/node_modules/debug": {
- "version": "4.3.4",
- "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz",
- "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==",
- "dev": true,
- "dependencies": {
- "ms": "2.1.2"
- },
- "engines": {
- "node": ">=6.0"
- },
- "peerDependenciesMeta": {
- "supports-color": {
- "optional": true
- }
- }
- },
- "node_modules/mocha/node_modules/debug/node_modules/ms": {
- "version": "2.1.2",
- "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
- "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==",
- "dev": true
- },
- "node_modules/mocha/node_modules/minimatch": {
- "version": "5.0.1",
- "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.0.1.tgz",
- "integrity": "sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==",
- "dev": true,
- "dependencies": {
- "brace-expansion": "^2.0.1"
- },
- "engines": {
- "node": ">=10"
- }
- },
- "node_modules/mocha/node_modules/ms": {
- "version": "2.1.3",
- "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
- "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
- "dev": true
- },
- "node_modules/mocha/node_modules/supports-color": {
- "version": "8.1.1",
- "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz",
- "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==",
- "dev": true,
- "dependencies": {
- "has-flag": "^4.0.0"
- },
- "engines": {
- "node": ">=10"
- },
- "funding": {
- "url": "https://github.com/chalk/supports-color?sponsor=1"
- }
- },
- "node_modules/mocha/node_modules/yargs": {
- "version": "16.2.0",
- "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz",
- "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==",
- "dev": true,
- "dependencies": {
- "cliui": "^7.0.2",
- "escalade": "^3.1.1",
- "get-caller-file": "^2.0.5",
- "require-directory": "^2.1.1",
- "string-width": "^4.2.0",
- "y18n": "^5.0.5",
- "yargs-parser": "^20.2.2"
- },
- "engines": {
- "node": ">=10"
- }
- },
- "node_modules/mocha/node_modules/yargs-parser": {
- "version": "20.2.4",
- "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz",
- "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==",
- "dev": true,
- "engines": {
- "node": ">=10"
- }
- },
- "node_modules/ms": {
- "version": "2.1.2",
- "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
- "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
- },
- "node_modules/natural-compare": {
- "version": "1.4.0",
- "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz",
- "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==",
- "dev": true
- },
- "node_modules/nise": {
- "version": "6.0.0",
- "resolved": "https://registry.npmjs.org/nise/-/nise-6.0.0.tgz",
- "integrity": "sha512-K8ePqo9BFvN31HXwEtTNGzgrPpmvgciDsFz8aztFjt4LqKO/JeFD8tBOeuDiCMXrIl/m1YvfH8auSpxfaD09wg==",
- "dev": true,
- "dependencies": {
- "@sinonjs/commons": "^3.0.0",
- "@sinonjs/fake-timers": "^11.2.2",
- "@sinonjs/text-encoding": "^0.7.2",
- "just-extend": "^6.2.0",
- "path-to-regexp": "^6.2.1"
- }
- },
- "node_modules/node-preload": {
- "version": "0.2.1",
- "resolved": "https://registry.npmjs.org/node-preload/-/node-preload-0.2.1.tgz",
- "integrity": "sha512-RM5oyBy45cLEoHqCeh+MNuFAxO0vTFBLskvQbOKnEE7YTTSN4tbN8QWDIPQ6L+WvKsB/qLEGpYe2ZZ9d4W9OIQ==",
- "dev": true,
- "dependencies": {
- "process-on-spawn": "^1.0.0"
- },
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/node-releases": {
- "version": "2.0.14",
- "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.14.tgz",
- "integrity": "sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==",
- "dev": true
- },
- "node_modules/normalize-path": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz",
- "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==",
- "dev": true,
- "engines": {
- "node": ">=0.10.0"
- }
- },
- "node_modules/nyc": {
- "version": "15.1.0",
- "resolved": "https://registry.npmjs.org/nyc/-/nyc-15.1.0.tgz",
- "integrity": "sha512-jMW04n9SxKdKi1ZMGhvUTHBN0EICCRkHemEoE5jm6mTYcqcdas0ATzgUgejlQUHMvpnOZqGB5Xxsv9KxJW1j8A==",
- "dev": true,
- "dependencies": {
- "@istanbuljs/load-nyc-config": "^1.0.0",
- "@istanbuljs/schema": "^0.1.2",
- "caching-transform": "^4.0.0",
- "convert-source-map": "^1.7.0",
- "decamelize": "^1.2.0",
- "find-cache-dir": "^3.2.0",
- "find-up": "^4.1.0",
- "foreground-child": "^2.0.0",
- "get-package-type": "^0.1.0",
- "glob": "^7.1.6",
- "istanbul-lib-coverage": "^3.0.0",
- "istanbul-lib-hook": "^3.0.0",
- "istanbul-lib-instrument": "^4.0.0",
- "istanbul-lib-processinfo": "^2.0.2",
- "istanbul-lib-report": "^3.0.0",
- "istanbul-lib-source-maps": "^4.0.0",
- "istanbul-reports": "^3.0.2",
- "make-dir": "^3.0.0",
- "node-preload": "^0.2.1",
- "p-map": "^3.0.0",
- "process-on-spawn": "^1.0.0",
- "resolve-from": "^5.0.0",
- "rimraf": "^3.0.0",
- "signal-exit": "^3.0.2",
- "spawn-wrap": "^2.0.0",
- "test-exclude": "^6.0.0",
- "yargs": "^15.0.2"
- },
- "bin": {
- "nyc": "bin/nyc.js"
- },
- "engines": {
- "node": ">=8.9"
- }
- },
- "node_modules/nyc/node_modules/cliui": {
- "version": "6.0.0",
- "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz",
- "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==",
- "dev": true,
- "dependencies": {
- "string-width": "^4.2.0",
- "strip-ansi": "^6.0.0",
- "wrap-ansi": "^6.2.0"
- }
- },
- "node_modules/nyc/node_modules/find-up": {
- "version": "4.1.0",
- "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz",
- "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==",
- "dev": true,
- "dependencies": {
- "locate-path": "^5.0.0",
- "path-exists": "^4.0.0"
- },
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/nyc/node_modules/glob": {
- "version": "7.2.3",
- "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz",
- "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==",
- "deprecated": "Glob versions prior to v9 are no longer supported",
- "dev": true,
- "dependencies": {
- "fs.realpath": "^1.0.0",
- "inflight": "^1.0.4",
- "inherits": "2",
- "minimatch": "^3.1.1",
- "once": "^1.3.0",
- "path-is-absolute": "^1.0.0"
- },
- "engines": {
- "node": "*"
- },
- "funding": {
- "url": "https://github.com/sponsors/isaacs"
- }
- },
- "node_modules/nyc/node_modules/locate-path": {
- "version": "5.0.0",
- "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz",
- "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==",
- "dev": true,
- "dependencies": {
- "p-locate": "^4.1.0"
- },
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/nyc/node_modules/p-limit": {
- "version": "2.3.0",
- "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz",
- "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==",
- "dev": true,
- "dependencies": {
- "p-try": "^2.0.0"
- },
- "engines": {
- "node": ">=6"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/nyc/node_modules/p-locate": {
- "version": "4.1.0",
- "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz",
- "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==",
- "dev": true,
- "dependencies": {
- "p-limit": "^2.2.0"
- },
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/nyc/node_modules/resolve-from": {
- "version": "5.0.0",
- "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz",
- "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==",
- "dev": true,
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/nyc/node_modules/wrap-ansi": {
- "version": "6.2.0",
- "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz",
- "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==",
- "dev": true,
- "dependencies": {
- "ansi-styles": "^4.0.0",
- "string-width": "^4.1.0",
- "strip-ansi": "^6.0.0"
- },
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/nyc/node_modules/y18n": {
- "version": "4.0.3",
- "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz",
- "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==",
- "dev": true
- },
- "node_modules/nyc/node_modules/yargs": {
- "version": "15.4.1",
- "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz",
- "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==",
- "dev": true,
- "dependencies": {
- "cliui": "^6.0.0",
- "decamelize": "^1.2.0",
- "find-up": "^4.1.0",
- "get-caller-file": "^2.0.1",
- "require-directory": "^2.1.1",
- "require-main-filename": "^2.0.0",
- "set-blocking": "^2.0.0",
- "string-width": "^4.2.0",
- "which-module": "^2.0.0",
- "y18n": "^4.0.0",
- "yargs-parser": "^18.1.2"
- },
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/nyc/node_modules/yargs-parser": {
- "version": "18.1.3",
- "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz",
- "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==",
- "dev": true,
- "dependencies": {
- "camelcase": "^5.0.0",
- "decamelize": "^1.2.0"
- },
- "engines": {
- "node": ">=6"
- }
- },
- "node_modules/once": {
- "version": "1.4.0",
- "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
- "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==",
- "dev": true,
- "dependencies": {
- "wrappy": "1"
- }
- },
- "node_modules/one-time": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/one-time/-/one-time-1.0.0.tgz",
- "integrity": "sha512-5DXOiRKwuSEcQ/l0kGCF6Q3jcADFv5tSmRaJck/OqkVFcOzutB134KRSfF0xDrL39MNnqxbHBbUUcjZIhTgb2g==",
- "dependencies": {
- "fn.name": "1.x.x"
- }
- },
- "node_modules/optionator": {
- "version": "0.9.4",
- "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz",
- "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==",
- "dev": true,
- "dependencies": {
- "deep-is": "^0.1.3",
- "fast-levenshtein": "^2.0.6",
- "levn": "^0.4.1",
- "prelude-ls": "^1.2.1",
- "type-check": "^0.4.0",
- "word-wrap": "^1.2.5"
- },
- "engines": {
- "node": ">= 0.8.0"
- }
- },
- "node_modules/p-limit": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz",
- "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==",
- "dev": true,
- "dependencies": {
- "yocto-queue": "^0.1.0"
- },
- "engines": {
- "node": ">=10"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/p-locate": {
- "version": "5.0.0",
- "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz",
- "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==",
- "dev": true,
- "dependencies": {
- "p-limit": "^3.0.2"
- },
- "engines": {
- "node": ">=10"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/p-map": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz",
- "integrity": "sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==",
- "dev": true,
- "dependencies": {
- "aggregate-error": "^3.0.0"
- },
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/p-try": {
- "version": "2.2.0",
- "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz",
- "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==",
- "dev": true,
- "engines": {
- "node": ">=6"
- }
- },
- "node_modules/package-hash": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/package-hash/-/package-hash-4.0.0.tgz",
- "integrity": "sha512-whdkPIooSu/bASggZ96BWVvZTRMOFxnyUG5PnTSGKoJE2gd5mbVNmR2Nj20QFzxYYgAXpoqC+AiXzl+UMRh7zQ==",
- "dev": true,
- "dependencies": {
- "graceful-fs": "^4.1.15",
- "hasha": "^5.0.0",
- "lodash.flattendeep": "^4.4.0",
- "release-zalgo": "^1.0.0"
- },
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/parent-module": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz",
- "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==",
- "dev": true,
- "dependencies": {
- "callsites": "^3.0.0"
- },
- "engines": {
- "node": ">=6"
- }
- },
- "node_modules/path-exists": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz",
- "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==",
- "dev": true,
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/path-is-absolute": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
- "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==",
- "dev": true,
- "engines": {
- "node": ">=0.10.0"
- }
- },
- "node_modules/path-key": {
- "version": "3.1.1",
- "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz",
- "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==",
- "dev": true,
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/path-to-regexp": {
- "version": "6.2.2",
- "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.2.2.tgz",
- "integrity": "sha512-GQX3SSMokngb36+whdpRXE+3f9V8UzyAorlYvOGx87ufGHehNTn5lCxrKtLyZ4Yl/wEKnNnr98ZzOwwDZV5ogw==",
- "dev": true
- },
- "node_modules/pathval": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz",
- "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==",
- "dev": true,
- "engines": {
- "node": "*"
- }
- },
- "node_modules/picocolors": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.1.tgz",
- "integrity": "sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==",
- "dev": true
- },
- "node_modules/picomatch": {
- "version": "2.3.1",
- "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz",
- "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==",
- "dev": true,
- "engines": {
- "node": ">=8.6"
- },
- "funding": {
- "url": "https://github.com/sponsors/jonschlinkert"
- }
- },
- "node_modules/pkg-dir": {
- "version": "4.2.0",
- "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz",
- "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==",
- "dev": true,
- "dependencies": {
- "find-up": "^4.0.0"
- },
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/pkg-dir/node_modules/find-up": {
- "version": "4.1.0",
- "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz",
- "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==",
- "dev": true,
- "dependencies": {
- "locate-path": "^5.0.0",
- "path-exists": "^4.0.0"
- },
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/pkg-dir/node_modules/locate-path": {
- "version": "5.0.0",
- "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz",
- "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==",
- "dev": true,
- "dependencies": {
- "p-locate": "^4.1.0"
- },
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/pkg-dir/node_modules/p-limit": {
- "version": "2.3.0",
- "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz",
- "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==",
- "dev": true,
- "dependencies": {
- "p-try": "^2.0.0"
- },
- "engines": {
- "node": ">=6"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/pkg-dir/node_modules/p-locate": {
- "version": "4.1.0",
- "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz",
- "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==",
- "dev": true,
- "dependencies": {
- "p-limit": "^2.2.0"
- },
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/prelude-ls": {
- "version": "1.2.1",
- "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz",
- "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==",
- "dev": true,
- "engines": {
- "node": ">= 0.8.0"
- }
- },
- "node_modules/process-on-spawn": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/process-on-spawn/-/process-on-spawn-1.0.0.tgz",
- "integrity": "sha512-1WsPDsUSMmZH5LeMLegqkPDrsGgsWwk1Exipy2hvB0o/F0ASzbpIctSCcZIK1ykJvtTJULEH+20WOFjMvGnCTg==",
- "dev": true,
- "dependencies": {
- "fromentries": "^1.2.0"
- },
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/protobufjs": {
- "version": "7.3.2",
- "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.3.2.tgz",
- "integrity": "sha512-RXyHaACeqXeqAKGLDl68rQKbmObRsTIn4TYVUUug1KfS47YWCo5MacGITEryugIgZqORCvJWEk4l449POg5Txg==",
- "hasInstallScript": true,
- "dependencies": {
- "@protobufjs/aspromise": "^1.1.2",
- "@protobufjs/base64": "^1.1.2",
- "@protobufjs/codegen": "^2.0.4",
- "@protobufjs/eventemitter": "^1.1.0",
- "@protobufjs/fetch": "^1.1.0",
- "@protobufjs/float": "^1.0.2",
- "@protobufjs/inquire": "^1.1.0",
- "@protobufjs/path": "^1.1.2",
- "@protobufjs/pool": "^1.1.0",
- "@protobufjs/utf8": "^1.1.0",
- "@types/node": ">=13.7.0",
- "long": "^5.0.0"
- },
- "engines": {
- "node": ">=12.0.0"
- }
- },
- "node_modules/punycode": {
- "version": "2.3.1",
- "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz",
- "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==",
- "engines": {
- "node": ">=6"
- }
- },
- "node_modules/queue-microtask": {
- "version": "1.2.3",
- "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz",
- "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==",
- "dev": true,
- "funding": [
- {
- "type": "github",
- "url": "https://github.com/sponsors/feross"
- },
- {
- "type": "patreon",
- "url": "https://www.patreon.com/feross"
- },
- {
- "type": "consulting",
- "url": "https://feross.org/support"
- }
- ]
- },
- "node_modules/randombytes": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz",
- "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==",
- "dev": true,
- "dependencies": {
- "safe-buffer": "^5.1.0"
- }
- },
- "node_modules/readable-stream": {
- "version": "3.6.2",
- "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz",
- "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==",
- "dependencies": {
- "inherits": "^2.0.3",
- "string_decoder": "^1.1.1",
- "util-deprecate": "^1.0.1"
- },
- "engines": {
- "node": ">= 6"
- }
- },
- "node_modules/readdirp": {
- "version": "3.6.0",
- "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz",
- "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==",
- "dev": true,
- "dependencies": {
- "picomatch": "^2.2.1"
- },
- "engines": {
- "node": ">=8.10.0"
- }
- },
- "node_modules/reflect-metadata": {
- "version": "0.1.14",
- "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.1.14.tgz",
- "integrity": "sha512-ZhYeb6nRaXCfhnndflDK8qI6ZQ/YcWZCISRAWICW9XYqMUwjZM9Z0DveWX/ABN01oxSHwVxKQmxeYZSsm0jh5A=="
- },
- "node_modules/release-zalgo": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/release-zalgo/-/release-zalgo-1.0.0.tgz",
- "integrity": "sha512-gUAyHVHPPC5wdqX/LG4LWtRYtgjxyX78oanFNTMMyFEfOqdC54s3eE82imuWKbOeqYht2CrNf64Qb8vgmmtZGA==",
- "dev": true,
- "dependencies": {
- "es6-error": "^4.0.1"
- },
- "engines": {
- "node": ">=4"
- }
- },
- "node_modules/require-directory": {
- "version": "2.1.1",
- "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz",
- "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==",
- "engines": {
- "node": ">=0.10.0"
- }
- },
- "node_modules/require-main-filename": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz",
- "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==",
- "dev": true
- },
- "node_modules/resolve-from": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz",
- "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==",
- "dev": true,
- "engines": {
- "node": ">=4"
- }
- },
- "node_modules/reusify": {
- "version": "1.0.4",
- "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz",
- "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==",
- "dev": true,
- "engines": {
- "iojs": ">=1.0.0",
- "node": ">=0.10.0"
- }
- },
- "node_modules/rimraf": {
- "version": "3.0.2",
- "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz",
- "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==",
- "deprecated": "Rimraf versions prior to v4 are no longer supported",
- "dev": true,
- "dependencies": {
- "glob": "^7.1.3"
- },
- "bin": {
- "rimraf": "bin.js"
- },
- "funding": {
- "url": "https://github.com/sponsors/isaacs"
- }
- },
- "node_modules/rimraf/node_modules/glob": {
- "version": "7.2.3",
- "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz",
- "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==",
- "deprecated": "Glob versions prior to v9 are no longer supported",
- "dev": true,
- "dependencies": {
- "fs.realpath": "^1.0.0",
- "inflight": "^1.0.4",
- "inherits": "2",
- "minimatch": "^3.1.1",
- "once": "^1.3.0",
- "path-is-absolute": "^1.0.0"
- },
- "engines": {
- "node": "*"
- },
- "funding": {
- "url": "https://github.com/sponsors/isaacs"
- }
- },
- "node_modules/run-parallel": {
- "version": "1.2.0",
- "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz",
- "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==",
- "dev": true,
- "funding": [
- {
- "type": "github",
- "url": "https://github.com/sponsors/feross"
- },
- {
- "type": "patreon",
- "url": "https://www.patreon.com/feross"
- },
- {
- "type": "consulting",
- "url": "https://feross.org/support"
- }
- ],
- "dependencies": {
- "queue-microtask": "^1.2.2"
- }
- },
- "node_modules/safe-buffer": {
- "version": "5.2.1",
- "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
- "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
- "funding": [
- {
- "type": "github",
- "url": "https://github.com/sponsors/feross"
- },
- {
- "type": "patreon",
- "url": "https://www.patreon.com/feross"
- },
- {
- "type": "consulting",
- "url": "https://feross.org/support"
- }
- ]
- },
- "node_modules/safe-stable-stringify": {
- "version": "2.4.3",
- "resolved": "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-2.4.3.tgz",
- "integrity": "sha512-e2bDA2WJT0wxseVd4lsDP4+3ONX6HpMXQa1ZhFQ7SU+GjvORCmShbCMltrtIDfkYhVHrOcPtj+KhmDBdPdZD1g==",
- "engines": {
- "node": ">=10"
- }
- },
- "node_modules/semver": {
- "version": "6.3.1",
- "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",
- "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==",
- "dev": true,
- "bin": {
- "semver": "bin/semver.js"
- }
- },
- "node_modules/serialize-javascript": {
- "version": "6.0.0",
- "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz",
- "integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==",
- "dev": true,
- "dependencies": {
- "randombytes": "^2.1.0"
- }
- },
- "node_modules/set-blocking": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz",
- "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==",
- "dev": true
- },
- "node_modules/shebang-command": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz",
- "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==",
- "dev": true,
- "dependencies": {
- "shebang-regex": "^3.0.0"
- },
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/shebang-regex": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz",
- "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==",
- "dev": true,
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/signal-exit": {
- "version": "3.0.7",
- "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz",
- "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==",
- "dev": true
- },
- "node_modules/simple-swizzle": {
- "version": "0.2.2",
- "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz",
- "integrity": "sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==",
- "dependencies": {
- "is-arrayish": "^0.3.1"
- }
- },
- "node_modules/sinon": {
- "version": "18.0.0",
- "resolved": "https://registry.npmjs.org/sinon/-/sinon-18.0.0.tgz",
- "integrity": "sha512-+dXDXzD1sBO6HlmZDd7mXZCR/y5ECiEiGCBSGuFD/kZ0bDTofPYc6JaeGmPSF+1j1MejGUWkORbYOLDyvqCWpA==",
- "dev": true,
- "dependencies": {
- "@sinonjs/commons": "^3.0.1",
- "@sinonjs/fake-timers": "^11.2.2",
- "@sinonjs/samsam": "^8.0.0",
- "diff": "^5.2.0",
- "nise": "^6.0.0",
- "supports-color": "^7"
- },
- "funding": {
- "type": "opencollective",
- "url": "https://opencollective.com/sinon"
- }
- },
- "node_modules/sinon-chai": {
- "version": "3.7.0",
- "resolved": "https://registry.npmjs.org/sinon-chai/-/sinon-chai-3.7.0.tgz",
- "integrity": "sha512-mf5NURdUaSdnatJx3uhoBOrY9dtL19fiOtAdT1Azxg3+lNJFiuN0uzaU3xX1LeAfL17kHQhTAJgpsfhbMJMY2g==",
- "dev": true,
- "peerDependencies": {
- "chai": "^4.0.0",
- "sinon": ">=4.0.0"
- }
- },
- "node_modules/sinon/node_modules/diff": {
- "version": "5.2.0",
- "resolved": "https://registry.npmjs.org/diff/-/diff-5.2.0.tgz",
- "integrity": "sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A==",
- "dev": true,
- "engines": {
- "node": ">=0.3.1"
- }
- },
- "node_modules/source-map": {
- "version": "0.6.1",
- "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
- "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
- "dev": true,
- "engines": {
- "node": ">=0.10.0"
- }
- },
- "node_modules/spawn-wrap": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/spawn-wrap/-/spawn-wrap-2.0.0.tgz",
- "integrity": "sha512-EeajNjfN9zMnULLwhZZQU3GWBoFNkbngTUPfaawT4RkMiviTxcX0qfhVbGey39mfctfDHkWtuecgQ8NJcyQWHg==",
- "dev": true,
- "dependencies": {
- "foreground-child": "^2.0.0",
- "is-windows": "^1.0.2",
- "make-dir": "^3.0.0",
- "rimraf": "^3.0.0",
- "signal-exit": "^3.0.2",
- "which": "^2.0.1"
- },
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/sprintf-js": {
- "version": "1.0.3",
- "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz",
- "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==",
- "dev": true
- },
- "node_modules/stack-trace": {
- "version": "0.0.10",
- "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz",
- "integrity": "sha512-KGzahc7puUKkzyMt+IqAep+TVNbKP+k2Lmwhub39m1AsTSkaDutx56aDCo+HLDzf/D26BIHTJWNiTG1KAJiQCg==",
- "engines": {
- "node": "*"
- }
- },
- "node_modules/string_decoder": {
- "version": "1.3.0",
- "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz",
- "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==",
- "dependencies": {
- "safe-buffer": "~5.2.0"
- }
- },
- "node_modules/string-width": {
- "version": "4.2.3",
- "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
- "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
- "dependencies": {
- "emoji-regex": "^8.0.0",
- "is-fullwidth-code-point": "^3.0.0",
- "strip-ansi": "^6.0.1"
- },
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/strip-ansi": {
- "version": "6.0.1",
- "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
- "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
- "dependencies": {
- "ansi-regex": "^5.0.1"
- },
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/strip-bom": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz",
- "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==",
- "dev": true,
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/strip-json-comments": {
- "version": "3.1.1",
- "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz",
- "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==",
- "dev": true,
- "engines": {
- "node": ">=8"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/supports-color": {
- "version": "7.2.0",
- "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
- "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
- "dev": true,
- "dependencies": {
- "has-flag": "^4.0.0"
- },
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/test-exclude": {
- "version": "6.0.0",
- "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz",
- "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==",
- "dev": true,
- "dependencies": {
- "@istanbuljs/schema": "^0.1.2",
- "glob": "^7.1.4",
- "minimatch": "^3.0.4"
- },
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/test-exclude/node_modules/glob": {
- "version": "7.2.3",
- "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz",
- "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==",
- "deprecated": "Glob versions prior to v9 are no longer supported",
- "dev": true,
- "dependencies": {
- "fs.realpath": "^1.0.0",
- "inflight": "^1.0.4",
- "inherits": "2",
- "minimatch": "^3.1.1",
- "once": "^1.3.0",
- "path-is-absolute": "^1.0.0"
- },
- "engines": {
- "node": "*"
- },
- "funding": {
- "url": "https://github.com/sponsors/isaacs"
- }
- },
- "node_modules/text-hex": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/text-hex/-/text-hex-1.0.0.tgz",
- "integrity": "sha512-uuVGNWzgJ4yhRaNSiubPY7OjISw4sw4E5Uv0wbjp+OzcbmVU/rsT8ujgcXJhn9ypzsgr5vlzpPqP+MBBKcGvbg=="
- },
- "node_modules/text-table": {
- "version": "0.2.0",
- "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz",
- "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==",
- "dev": true
- },
- "node_modules/to-fast-properties": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz",
- "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==",
- "dev": true,
- "engines": {
- "node": ">=4"
- }
- },
- "node_modules/to-regex-range": {
- "version": "5.0.1",
- "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
- "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
- "dev": true,
- "dependencies": {
- "is-number": "^7.0.0"
- },
- "engines": {
- "node": ">=8.0"
- }
- },
- "node_modules/triple-beam": {
- "version": "1.4.1",
- "resolved": "https://registry.npmjs.org/triple-beam/-/triple-beam-1.4.1.tgz",
- "integrity": "sha512-aZbgViZrg1QNcG+LULa7nhZpJTZSLm/mXnHXnbAbjmN5aSa0y7V+wvv6+4WaBtpISJzThKy+PIPxc1Nq1EJ9mg==",
- "engines": {
- "node": ">= 14.0.0"
- }
- },
- "node_modules/tweetnacl": {
- "version": "1.0.3",
- "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz",
- "integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw=="
- },
- "node_modules/type-check": {
- "version": "0.4.0",
- "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz",
- "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==",
- "dev": true,
- "dependencies": {
- "prelude-ls": "^1.2.1"
- },
- "engines": {
- "node": ">= 0.8.0"
- }
- },
- "node_modules/type-detect": {
- "version": "4.0.8",
- "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz",
- "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==",
- "dev": true,
- "engines": {
- "node": ">=4"
- }
- },
- "node_modules/type-fest": {
- "version": "0.20.2",
- "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz",
- "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==",
- "dev": true,
- "engines": {
- "node": ">=10"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/typedarray-to-buffer": {
- "version": "3.1.5",
- "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz",
- "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==",
- "dev": true,
- "dependencies": {
- "is-typedarray": "^1.0.0"
- }
- },
- "node_modules/update-browserslist-db": {
- "version": "1.0.16",
- "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.16.tgz",
- "integrity": "sha512-KVbTxlBYlckhF5wgfyZXTWnMn7MMZjMu9XG8bPlliUOP9ThaF4QnhP8qrjrH7DRzHfSk0oQv1wToW+iA5GajEQ==",
- "dev": true,
- "funding": [
- {
- "type": "opencollective",
- "url": "https://opencollective.com/browserslist"
- },
- {
- "type": "tidelift",
- "url": "https://tidelift.com/funding/github/npm/browserslist"
- },
- {
- "type": "github",
- "url": "https://github.com/sponsors/ai"
- }
- ],
- "dependencies": {
- "escalade": "^3.1.2",
- "picocolors": "^1.0.1"
- },
- "bin": {
- "update-browserslist-db": "cli.js"
- },
- "peerDependencies": {
- "browserslist": ">= 4.21.0"
- }
- },
- "node_modules/uri-js": {
- "version": "4.4.1",
- "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz",
- "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==",
- "dependencies": {
- "punycode": "^2.1.0"
- }
- },
- "node_modules/util-deprecate": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
- "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw=="
- },
- "node_modules/uuid": {
- "version": "8.3.2",
- "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
- "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==",
- "dev": true,
- "bin": {
- "uuid": "dist/bin/uuid"
- }
- },
- "node_modules/which": {
- "version": "2.0.2",
- "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
- "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
- "dev": true,
- "dependencies": {
- "isexe": "^2.0.0"
- },
- "bin": {
- "node-which": "bin/node-which"
- },
- "engines": {
- "node": ">= 8"
- }
- },
- "node_modules/which-module": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.1.tgz",
- "integrity": "sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==",
- "dev": true
- },
- "node_modules/winston": {
- "version": "3.13.0",
- "resolved": "https://registry.npmjs.org/winston/-/winston-3.13.0.tgz",
- "integrity": "sha512-rwidmA1w3SE4j0E5MuIufFhyJPBDG7Nu71RkZor1p2+qHvJSZ9GYDA81AyleQcZbh/+V6HjeBdfnTZJm9rSeQQ==",
- "dependencies": {
- "@colors/colors": "^1.6.0",
- "@dabh/diagnostics": "^2.0.2",
- "async": "^3.2.3",
- "is-stream": "^2.0.0",
- "logform": "^2.4.0",
- "one-time": "^1.0.0",
- "readable-stream": "^3.4.0",
- "safe-stable-stringify": "^2.3.1",
- "stack-trace": "0.0.x",
- "triple-beam": "^1.3.0",
- "winston-transport": "^4.7.0"
- },
- "engines": {
- "node": ">= 12.0.0"
- }
- },
- "node_modules/winston-transport": {
- "version": "4.7.0",
- "resolved": "https://registry.npmjs.org/winston-transport/-/winston-transport-4.7.0.tgz",
- "integrity": "sha512-ajBj65K5I7denzer2IYW6+2bNIVqLGDHqDw3Ow8Ohh+vdW+rv4MZ6eiDvHoKhfJFZ2auyN8byXieDDJ96ViONg==",
- "dependencies": {
- "logform": "^2.3.2",
- "readable-stream": "^3.6.0",
- "triple-beam": "^1.3.0"
- },
- "engines": {
- "node": ">= 12.0.0"
- }
- },
- "node_modules/word-wrap": {
- "version": "1.2.5",
- "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz",
- "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==",
- "dev": true,
- "engines": {
- "node": ">=0.10.0"
- }
- },
- "node_modules/workerpool": {
- "version": "6.2.1",
- "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.2.1.tgz",
- "integrity": "sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw==",
- "dev": true
- },
- "node_modules/wrap-ansi": {
- "version": "7.0.0",
- "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
- "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==",
- "dependencies": {
- "ansi-styles": "^4.0.0",
- "string-width": "^4.1.0",
- "strip-ansi": "^6.0.0"
- },
- "engines": {
- "node": ">=10"
- },
- "funding": {
- "url": "https://github.com/chalk/wrap-ansi?sponsor=1"
- }
- },
- "node_modules/wrappy": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
- "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==",
- "dev": true
- },
- "node_modules/write-file-atomic": {
- "version": "3.0.3",
- "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz",
- "integrity": "sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==",
- "dev": true,
- "dependencies": {
- "imurmurhash": "^0.1.4",
- "is-typedarray": "^1.0.0",
- "signal-exit": "^3.0.2",
- "typedarray-to-buffer": "^3.1.5"
- }
- },
- "node_modules/y18n": {
- "version": "5.0.8",
- "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz",
- "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==",
- "engines": {
- "node": ">=10"
- }
- },
- "node_modules/yallist": {
- "version": "3.1.1",
- "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz",
- "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==",
- "dev": true
- },
- "node_modules/yargs": {
- "version": "17.7.2",
- "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz",
- "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==",
- "dependencies": {
- "cliui": "^8.0.1",
- "escalade": "^3.1.1",
- "get-caller-file": "^2.0.5",
- "require-directory": "^2.1.1",
- "string-width": "^4.2.3",
- "y18n": "^5.0.5",
- "yargs-parser": "^21.1.1"
- },
- "engines": {
- "node": ">=12"
- }
- },
- "node_modules/yargs-parser": {
- "version": "21.1.1",
- "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz",
- "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==",
- "engines": {
- "node": ">=12"
- }
- },
- "node_modules/yargs-unparser": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz",
- "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==",
- "dev": true,
- "dependencies": {
- "camelcase": "^6.0.0",
- "decamelize": "^4.0.0",
- "flat": "^5.0.2",
- "is-plain-obj": "^2.1.0"
- },
- "engines": {
- "node": ">=10"
- }
- },
- "node_modules/yargs-unparser/node_modules/camelcase": {
- "version": "6.3.0",
- "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz",
- "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==",
- "dev": true,
- "engines": {
- "node": ">=10"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/yargs-unparser/node_modules/decamelize": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz",
- "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==",
- "dev": true,
- "engines": {
- "node": ">=10"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/yocto-queue": {
- "version": "0.1.0",
- "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz",
- "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==",
- "dev": true,
- "engines": {
- "node": ">=10"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- }
- }
-}
diff --git a/asset-transfer-events/chaincode-javascript/package.json b/asset-transfer-events/chaincode-javascript/package.json
deleted file mode 100644
index 05587582..00000000
--- a/asset-transfer-events/chaincode-javascript/package.json
+++ /dev/null
@@ -1,48 +0,0 @@
-{
- "name": "asset-transfer-events",
- "version": "1.0.0",
- "description": "Asset-Transfer-Events contract implemented in JavaScript",
- "main": "index.js",
- "engines": {
- "node": ">=18"
- },
- "scripts": {
- "lint": "eslint .",
- "pretest": "npm run lint",
- "test": "nyc mocha --recursive",
- "start": "fabric-chaincode-node start"
- },
- "engineStrict": true,
- "author": "Hyperledger",
- "license": "Apache-2.0",
- "dependencies": {
- "fabric-contract-api": "~2.5",
- "fabric-shim": "~2.5"
- },
- "devDependencies": {
- "chai": "^4.4.1",
- "eslint": "^8.57.0",
- "mocha": "^10.4.0",
- "nyc": "^15.1.0",
- "sinon": "^18.0.0",
- "sinon-chai": "^3.7.0"
- },
- "nyc": {
- "exclude": [
- "coverage/**",
- "test/**",
- "index.js",
- ".eslintrc.js"
- ],
- "reporter": [
- "text-summary",
- "html"
- ],
- "all": true,
- "check-coverage": true,
- "statements": 100,
- "branches": 100,
- "functions": 100,
- "lines": 100
- }
-}
diff --git a/asset-transfer-events/chaincode-javascript/test/assetTransferEvents.test.js b/asset-transfer-events/chaincode-javascript/test/assetTransferEvents.test.js
deleted file mode 100644
index 552b8ad7..00000000
--- a/asset-transfer-events/chaincode-javascript/test/assetTransferEvents.test.js
+++ /dev/null
@@ -1,229 +0,0 @@
-/*
- * Copyright IBM Corp. All Rights Reserved.
- *
- * SPDX-License-Identifier: Apache-2.0
-*/
-
-'use strict';
-const sinon = require('sinon');
-const chai = require('chai');
-const sinonChai = require('sinon-chai');
-const expect = chai.expect;
-
-const { Context } = require('fabric-contract-api');
-const { ChaincodeStub, ClientIdentity } = require('fabric-shim');
-
-const AssetTransfer = require('../lib/assetTransferEvents.js');
-
-let assert = sinon.assert;
-chai.use(sinonChai);
-
-describe('Asset Transfer Events Tests', () => {
- let transactionContext, chaincodeStub, clientIdentity, asset;
- let transientMap, asset_properties;
-
- beforeEach(() => {
- transactionContext = new Context();
-
- chaincodeStub = sinon.createStubInstance(ChaincodeStub);
- chaincodeStub.getMspID.returns('org1');
- transactionContext.setChaincodeStub(chaincodeStub);
-
- clientIdentity = sinon.createStubInstance(ClientIdentity);
- clientIdentity.getMSPID.returns('org1');
- transactionContext.clientIdentity = clientIdentity;
-
- chaincodeStub.putState.callsFake((key, value) => {
- if (!chaincodeStub.states) {
- chaincodeStub.states = {};
- }
- chaincodeStub.states[key] = value;
- });
-
- chaincodeStub.getState.callsFake(async (key) => {
- let ret;
- if (chaincodeStub.states) {
- ret = chaincodeStub.states[key];
- }
- return Promise.resolve(ret);
- });
-
- chaincodeStub.deleteState.callsFake(async (key) => {
- if (chaincodeStub.states) {
- delete chaincodeStub.states[key];
- }
- return Promise.resolve(key);
- });
-
- chaincodeStub.getStateByRange.callsFake(async () => {
- function* internalGetStateByRange() {
- if (chaincodeStub.states) {
- // Shallow copy
- const copied = Object.assign({}, chaincodeStub.states);
-
- for (let key in copied) {
- yield {value: copied[key]};
- }
- }
- }
-
- return Promise.resolve(internalGetStateByRange());
- });
-
- asset = {
- ID: 'asset1',
- Color: 'blue',
- Size: 5,
- Owner: 'Tomoko',
- AppraisedValue: 300,
- };
- const randomNumber = Math.floor(Math.random() * 100) + 1;
- asset_properties = {
- object_type: 'asset_properties',
- asset_id: 'asset1',
- Price: '90',
- salt: Buffer.from(randomNumber.toString()).toString('hex')
- };
- transientMap = new Map();
- transientMap.set('asset_properties', Buffer.from(JSON.stringify(asset_properties)));
- });
-
- describe('Test CreateAsset', () => {
- it('should return error on CreateAsset', async () => {
- chaincodeStub.putState.rejects('failed inserting key');
-
- let assetTransfer = new AssetTransfer();
- try {
- await assetTransfer.CreateAsset(transactionContext, asset.ID, asset.Color, asset.Size, asset.Owner, asset.AppraisedValue);
- assert.fail('CreateAsset should have failed');
- } catch(err) {
- expect(err.name).to.equal('failed inserting key');
- }
- });
-
- it('should return success on CreateAsset', async () => {
- let assetTransfer = new AssetTransfer();
-
- await assetTransfer.CreateAsset(transactionContext, asset.ID, asset.Color, asset.Size, asset.Owner, asset.AppraisedValue);
-
- let ret = JSON.parse((await chaincodeStub.getState(asset.ID)).toString());
- expect(ret).to.eql(asset);
- });
- it('should return success on CreateAsset with transient data', async () => {
- let assetTransfer = new AssetTransfer();
- chaincodeStub.getTransient.returns(transientMap);
- await assetTransfer.CreateAsset(transactionContext, asset.ID, asset.Color, asset.Size, asset.Owner, asset.AppraisedValue);
-
- let ret = JSON.parse((await chaincodeStub.getState(asset.ID)).toString());
- expect(ret).to.eql(asset);
- });
- });
-
- describe('Test ReadAsset', () => {
- it('should return error on ReadAsset', async () => {
- let assetTransfer = new AssetTransfer();
- await assetTransfer.CreateAsset(transactionContext, asset.ID, asset.Color, asset.Size, asset.Owner, asset.AppraisedValue);
-
- try {
- await assetTransfer.ReadAsset(transactionContext, 'asset2');
- assert.fail('ReadAsset should have failed');
- } catch (err) {
- expect(err.message).to.equal('The asset asset2 does not exist');
- }
- });
-
- it('should return success on ReadAsset', async () => {
- let assetTransfer = new AssetTransfer();
- await assetTransfer.CreateAsset(transactionContext, asset.ID, asset.Color, asset.Size, asset.Owner, asset.AppraisedValue);
- const assetString = await assetTransfer.ReadAsset(transactionContext, 'asset1');
- const readAsset = JSON.parse(assetString);
- expect(readAsset).to.eql(asset);
- });
-
- it('should return success on ReadAsset with private data', async () => {
- asset.asset_properties = asset_properties;
- let assetTransfer = new AssetTransfer();
- await assetTransfer.CreateAsset(transactionContext, asset.ID, asset.Color, asset.Size, asset.Owner, asset.AppraisedValue);
- chaincodeStub.getPrivateData.returns(Buffer.from(JSON.stringify(asset_properties)));
- const assetString = await assetTransfer.ReadAsset(transactionContext, 'asset1');
- const readAsset = JSON.parse(assetString);
- expect(readAsset).to.eql(asset);
- });
- });
-
- describe('Test UpdateAsset', () => {
- it('should return error on UpdateAsset', async () => {
- let assetTransfer = new AssetTransfer();
- await assetTransfer.CreateAsset(transactionContext, asset.ID, asset.Color, asset.Size, asset.Owner, asset.AppraisedValue);
-
- try {
- await assetTransfer.UpdateAsset(transactionContext, 'asset2', 'orange', 10, 'Me', 500);
- assert.fail('UpdateAsset should have failed');
- } catch (err) {
- expect(err.message).to.equal('The asset asset2 does not exist');
- }
- });
-
- it('should return success on UpdateAsset', async () => {
- let assetTransfer = new AssetTransfer();
- await assetTransfer.CreateAsset(transactionContext, asset.ID, asset.Color, asset.Size, asset.Owner, asset.AppraisedValue);
-
- await assetTransfer.UpdateAsset(transactionContext, 'asset1', 'orange', 10, 'Me', 500);
- let ret = JSON.parse(await chaincodeStub.getState(asset.ID));
- let expected = {
- ID: 'asset1',
- Color: 'orange',
- Size: 10,
- Owner: 'Me',
- AppraisedValue: 500
- };
- expect(ret).to.eql(expected);
- });
- });
-
- describe('Test DeleteAsset', () => {
- it('should return error on DeleteAsset', async () => {
- let assetTransfer = new AssetTransfer();
- await assetTransfer.CreateAsset(transactionContext, asset.ID, asset.Color, asset.Size, asset.Owner, asset.AppraisedValue);
-
- try {
- await assetTransfer.DeleteAsset(transactionContext, 'asset2');
- assert.fail('DeleteAsset should have failed');
- } catch (err) {
- expect(err.message).to.equal('The asset asset2 does not exist');
- }
- });
-
- it('should return success on DeleteAsset', async () => {
- let assetTransfer = new AssetTransfer();
- await assetTransfer.CreateAsset(transactionContext, asset.ID, asset.Color, asset.Size, asset.Owner, asset.AppraisedValue);
-
- await assetTransfer.DeleteAsset(transactionContext, asset.ID);
- let ret = await chaincodeStub.getState(asset.ID);
- expect(ret).to.equal(undefined);
- });
- });
-
- describe('Test TransferAsset', () => {
- it('should return error on TransferAsset', async () => {
- let assetTransfer = new AssetTransfer();
- await assetTransfer.CreateAsset(transactionContext, asset.ID, asset.Color, asset.Size, asset.Owner, asset.AppraisedValue);
-
- try {
- await assetTransfer.TransferAsset(transactionContext, 'asset2', 'Me');
- assert.fail('DeleteAsset should have failed');
- } catch (err) {
- expect(err.message).to.equal('The asset asset2 does not exist');
- }
- });
-
- it('should return success on TransferAsset', async () => {
- let assetTransfer = new AssetTransfer();
- await assetTransfer.CreateAsset(transactionContext, asset.ID, asset.Color, asset.Size, asset.Owner, asset.AppraisedValue);
-
- await assetTransfer.TransferAsset(transactionContext, asset.ID, 'Me');
- let ret = JSON.parse((await chaincodeStub.getState(asset.ID)).toString());
- expect(ret).to.eql(Object.assign({}, asset, {Owner: 'Me'}));
- });
- });
-});
diff --git a/asset-transfer-ledger-queries/application-java/.gitattributes b/asset-transfer-ledger-queries/application-java/.gitattributes
deleted file mode 100644
index 00a51aff..00000000
--- a/asset-transfer-ledger-queries/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-ledger-queries/application-java/build.gradle b/asset-transfer-ledger-queries/application-java/build.gradle
deleted file mode 100644
index a204249d..00000000
--- a/asset-transfer-ledger-queries/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-ledger-queries/application-java/gradle/wrapper/gradle-wrapper.jar b/asset-transfer-ledger-queries/application-java/gradle/wrapper/gradle-wrapper.jar
deleted file mode 100644
index d64cd491..00000000
Binary files a/asset-transfer-ledger-queries/application-java/gradle/wrapper/gradle-wrapper.jar and /dev/null differ
diff --git a/asset-transfer-ledger-queries/application-java/gradle/wrapper/gradle-wrapper.properties b/asset-transfer-ledger-queries/application-java/gradle/wrapper/gradle-wrapper.properties
deleted file mode 100644
index e2847c82..00000000
--- a/asset-transfer-ledger-queries/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.11.1-bin.zip
-networkTimeout=10000
-validateDistributionUrl=true
-zipStoreBase=GRADLE_USER_HOME
-zipStorePath=wrapper/dists
diff --git a/asset-transfer-ledger-queries/application-java/gradlew b/asset-transfer-ledger-queries/application-java/gradlew
deleted file mode 100755
index 1aa94a42..00000000
--- a/asset-transfer-ledger-queries/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=SC2039,SC3045
- MAX_FD=$( ulimit -H -n ) ||
- warn "Could not query maximum file descriptor limit"
- esac
- case $MAX_FD in #(
- '' | soft) :;; #(
- *)
- # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
- # shellcheck disable=SC2039,SC3045
- ulimit -n "$MAX_FD" ||
- warn "Could not set maximum file descriptor limit to $MAX_FD"
- esac
-fi
-
-# Collect all arguments for the java command, stacking in reverse order:
-# * args from the command line
-# * the main class name
-# * -classpath
-# * -D...appname settings
-# * --module-path (only if needed)
-# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
-
-# For Cygwin or MSYS, switch paths to Windows format before running java
-if "$cygwin" || "$msys" ; then
- APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
- CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
-
- JAVACMD=$( cygpath --unix "$JAVACMD" )
-
- # Now convert the arguments - kludge to limit ourselves to /bin/sh
- for arg do
- if
- case $arg in #(
- -*) false ;; # don't mess with options #(
- /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
- [ -e "$t" ] ;; #(
- *) false ;;
- esac
- then
- arg=$( cygpath --path --ignore --mixed "$arg" )
- fi
- # Roll the args list around exactly as many times as the number of
- # args, so each arg winds up back in the position where it started, but
- # possibly modified.
- #
- # NB: a `for` loop captures its iteration list before it begins, so
- # changing the positional parameters here affects neither the number of
- # iterations, nor the values presented in `arg`.
- shift # remove old arg
- set -- "$@" "$arg" # push replacement arg
- done
-fi
-
-
-# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
-
-# Collect all arguments for the java command:
-# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
-# and any embedded shellness will be escaped.
-# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
-# treated as '${Hostname}' itself on the command line.
-
-set -- \
- "-Dorg.gradle.appname=$APP_BASE_NAME" \
- -classpath "$CLASSPATH" \
- org.gradle.wrapper.GradleWrapperMain \
- "$@"
-
-# Stop when "xargs" is not available.
-if ! command -v xargs >/dev/null 2>&1
-then
- die "xargs is not available"
-fi
-
-# Use "xargs" to parse quoted args.
-#
-# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
-#
-# In Bash we could simply go:
-#
-# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
-# set -- "${ARGS[@]}" "$@"
-#
-# but POSIX shell has neither arrays nor command substitution, so instead we
-# post-process each arg (as a line of input to sed) to backslash-escape any
-# character that might be a shell metacharacter, then use eval to reverse
-# that process (while maintaining the separation between arguments), and wrap
-# the whole thing up as a single "set" statement.
-#
-# This will of course break if any of these variables contains a newline or
-# an unmatched quote.
-#
-
-eval "set -- $(
- printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
- xargs -n1 |
- sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
- tr '\n' ' '
- )" '"$@"'
-
-exec "$JAVACMD" "$@"
diff --git a/asset-transfer-ledger-queries/application-java/gradlew.bat b/asset-transfer-ledger-queries/application-java/gradlew.bat
deleted file mode 100644
index 25da30db..00000000
--- a/asset-transfer-ledger-queries/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. 1>&2
-echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
-echo. 1>&2
-echo Please set the JAVA_HOME variable in your environment to match the 1>&2
-echo location of your Java installation. 1>&2
-
-goto fail
-
-:findJavaFromJavaHome
-set JAVA_HOME=%JAVA_HOME:"=%
-set JAVA_EXE=%JAVA_HOME%/bin/java.exe
-
-if exist "%JAVA_EXE%" goto execute
-
-echo. 1>&2
-echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
-echo. 1>&2
-echo Please set the JAVA_HOME variable in your environment to match the 1>&2
-echo location of your Java installation. 1>&2
-
-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-ledger-queries/application-java/settings.gradle b/asset-transfer-ledger-queries/application-java/settings.gradle
deleted file mode 100644
index 5423bc7d..00000000
--- a/asset-transfer-ledger-queries/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-ledger-queries/application-java/src/main/java/application/java/App.java b/asset-transfer-ledger-queries/application-java/src/main/java/application/java/App.java
deleted file mode 100644
index 595d6f33..00000000
--- a/asset-transfer-ledger-queries/application-java/src/main/java/application/java/App.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * Copyright IBM Corp. All Rights Reserved.
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-
-// Running TestApp:
-// gradle runApp
-
-package application.java;
-
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import org.hyperledger.fabric.gateway.Contract;
-import org.hyperledger.fabric.gateway.Gateway;
-import org.hyperledger.fabric.gateway.Network;
-import org.hyperledger.fabric.gateway.Wallet;
-import org.hyperledger.fabric.gateway.Wallets;
-
-
-public class App {
-
- static {
- System.setProperty("org.hyperledger.fabric.sdk.service_discovery.as_localhost", "true");
- }
-
- // helper function for getting connected to the gateway
- public static Gateway connect() throws Exception{
- // Load a file system based wallet for managing identities.
- Path walletPath = Paths.get("wallet");
- Wallet wallet = Wallets.newFileSystemWallet(walletPath);
- // load a CCP
- Path networkConfigPath = Paths.get("..", "..", "test-network", "organizations", "peerOrganizations", "org1.example.com", "connection-org1.yaml");
-
- Gateway.Builder builder = Gateway.createBuilder();
- builder.identity(wallet, "appUser").networkConfig(networkConfigPath).discovery(true);
- return builder.connect();
- }
-
- public static void main(String[] args) throws Exception {
- // enrolls the admin and registers the user
- try {
- EnrollAdmin.main(null);
- RegisterUser.main(null);
- } catch (Exception e) {
- System.err.println(e);
- }
-
- // connect to the network and invoke the smart contract
- try (Gateway gateway = connect()) {
-
- // get the network and contract
- Network network = gateway.getNetwork("mychannel");
- Contract contract = network.getContract("ledger");
-
- byte[] result;
-
- System.out.println("Submit Transaction: InitLedger creates the initial set of assets on the ledger.");
- contract.submitTransaction("InitLedger");
-
- System.out.println("\n");
- // passing in 2 empty strings will query all the assets
- result = contract.evaluateTransaction("GetAssetsByRange", "", "");
- System.out.println("Evaluate Transaction: GetAssetsByRange, result: " + new String(result));
-
- System.out.println("\n");
- System.out.println("Submit Transaction: CreateAsset asset13");
- // CreateAsset creates an asset with ID asset13, color yellow, owner Tom, size 5 and appraisedValue of 1300
- contract.submitTransaction("CreateAsset", "asset13", "yellow", "5", "Tom", "1300");
-
- System.out.println("\n");
- System.out.println("Evaluate Transaction: ReadAsset asset13");
- // ReadAsset returns an asset with given assetID
- result = contract.evaluateTransaction("ReadAsset", "asset13");
- System.out.println("result: " + new String(result));
-
- System.out.println("\n");
- System.out.println("Evaluate Transaction: AssetExists asset1");
- // AssetExists returns "true" if an asset with given assetID exist
- result = contract.evaluateTransaction("AssetExists", "asset1");
- System.out.println("result: " + new String(result));
-
- System.out.println("\n");
- System.out.println("Submit Transaction: DeleteAsset asset1");
- contract.submitTransaction("DeleteAsset", "asset1");
-
- 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: TransferAsset asset2 from owner Tomoko > owner Tom");
- // TransferAsset transfers an asset with given ID to new owner Tom
- contract.submitTransaction("TransferAsset", "asset2", "Tom");
-
- // Rich Query with Pagination (Only supported if CouchDB is used as state database)
- System.out.println("\n");
- System.out.println("Evaluate Transaction:QueryAssetsWithPagination Tom's assets");
- result = contract.evaluateTransaction("QueryAssetsWithPagination","{\"selector\":{\"docType\":\"asset\",\"owner\":\"Tom\"}, \"use_index\":[\"_design/indexOwnerDoc\", \"indexOwner\"]}","3","");
- System.out.println("result: " + new String(result));
-
- System.out.println("\n");
- System.out.println("Submit Transaction: TransferAssetByColor yellow assets > newOwner Michel");
- contract.submitTransaction("TransferAssetByColor", "yellow", "Michel");
-
- // Rich Query (Only supported if CouchDB is used as state database):
- System.out.println("\n");
- System.out.println("Evaluate Transaction:QueryAssetsByOwner Michel");
- result = contract.evaluateTransaction("QueryAssetsByOwner", "Michel");
- System.out.println("result: " + new String(result));
-
- System.out.println("\n");
- System.out.println("Evaluate Transaction:GetAssetHistory asset13");
- result = contract.evaluateTransaction("GetAssetHistory", "asset13");
- System.out.println("result: " + new String(result));
-
- // Rich Query (Only supported if CouchDB is used as state database):
- System.out.println("\n");
- System.out.println("Evaluate Transaction:QueryAssets assets of size 15");
- result = contract.evaluateTransaction("QueryAssets", "{\"selector\":{\"size\":15}}");
- System.out.println("result: " + new String(result));
-
- // Rich Query with index design doc and index name specified (Only supported if CouchDB is used as state database):
- System.out.println("\n");
- System.out.println("Evaluate Transaction:QueryAssets Jin Soo's assets");
- result = contract.evaluateTransaction("QueryAssets","{\"selector\":{\"docType\":\"asset\",\"owner\":\"Jin Soo\"}, \"use_index\":[\"_design/indexOwnerDoc\", \"indexOwner\"]}");
- System.out.println("result: " + new String(result));
-
- // Range Query with Pagination
- System.out.println("\n");
- System.out.println("Evaluate Transaction:GetAssetsByRangeWithPagination assets 3-5");
- result = contract.evaluateTransaction("GetAssetsByRangeWithPagination", "asset3", "asset6", "3","");
- System.out.println("result: " + new String(result));
- }
- catch(Exception e){
- System.err.println(e);
- System.exit(1);
- }
-
- }
-}
diff --git a/asset-transfer-ledger-queries/application-java/src/main/java/application/java/EnrollAdmin.java b/asset-transfer-ledger-queries/application-java/src/main/java/application/java/EnrollAdmin.java
deleted file mode 100644
index 563a35f1..00000000
--- a/asset-transfer-ledger-queries/application-java/src/main/java/application/java/EnrollAdmin.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright IBM Corp. All Rights Reserved.
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-
-package application.java;
-
-import java.nio.file.Paths;
-import java.util.Properties;
-
-import org.hyperledger.fabric.gateway.Wallet;
-import org.hyperledger.fabric.gateway.Wallets;
-import org.hyperledger.fabric.gateway.Identities;
-import org.hyperledger.fabric.gateway.Identity;
-import org.hyperledger.fabric.sdk.Enrollment;
-import org.hyperledger.fabric.sdk.security.CryptoSuite;
-import org.hyperledger.fabric.sdk.security.CryptoSuiteFactory;
-import org.hyperledger.fabric_ca.sdk.EnrollmentRequest;
-import org.hyperledger.fabric_ca.sdk.HFCAClient;
-
-public class EnrollAdmin {
-
- public static void main(String[] args) throws Exception {
-
- // Create a CA client for interacting with the CA.
- Properties props = new Properties();
- props.put("pemFile",
- "../../test-network/organizations/peerOrganizations/org1.example.com/ca/ca.org1.example.com-cert.pem");
- props.put("allowAllHostNames", "true");
- HFCAClient caClient = HFCAClient.createNewInstance("https://localhost:7054", props);
- CryptoSuite cryptoSuite = CryptoSuiteFactory.getDefault().getCryptoSuite();
- caClient.setCryptoSuite(cryptoSuite);
-
- // Create a wallet for managing identities
- Wallet wallet = Wallets.newFileSystemWallet(Paths.get("wallet"));
-
- // Check to see if we've already enrolled the admin user.
- if (wallet.get("admin") != null) {
- System.out.println("An identity for the admin user \"admin\" already exists in the wallet");
- return;
- }
-
- // Enroll the admin user, and import the new identity into the wallet.
- final EnrollmentRequest enrollmentRequestTLS = new EnrollmentRequest();
- enrollmentRequestTLS.addHost("localhost");
- enrollmentRequestTLS.setProfile("tls");
- Enrollment enrollment = caClient.enroll("admin", "adminpw", enrollmentRequestTLS);
- Identity user = Identities.newX509Identity("Org1MSP", enrollment);
- wallet.put("admin", user);
- System.out.println("Successfully enrolled user \"admin\" and imported it into the wallet");
- }
-}
diff --git a/asset-transfer-ledger-queries/application-java/src/main/java/application/java/RegisterUser.java b/asset-transfer-ledger-queries/application-java/src/main/java/application/java/RegisterUser.java
deleted file mode 100644
index 367b4a39..00000000
--- a/asset-transfer-ledger-queries/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("appUser") != null) {
- System.out.println("An identity for the user \"appUser\" already exists in the wallet");
- return;
- }
-
- X509Identity adminIdentity = (X509Identity)wallet.get("admin");
- if (adminIdentity == null) {
- System.out.println("\"admin\" needs to be enrolled and added to the wallet first");
- return;
- }
- User admin = new User() {
-
- @Override
- public String getName() {
- return "admin";
- }
-
- @Override
- public Set getRoles() {
- return null;
- }
-
- @Override
- public String getAccount() {
- return null;
- }
-
- @Override
- public String getAffiliation() {
- return "org1.department1";
- }
-
- @Override
- public Enrollment getEnrollment() {
- return new Enrollment() {
-
- @Override
- public PrivateKey getKey() {
- return adminIdentity.getPrivateKey();
- }
-
- @Override
- public String getCert() {
- return Identities.toPemString(adminIdentity.getCertificate());
- }
- };
- }
-
- @Override
- public String getMspId() {
- return "Org1MSP";
- }
-
- };
-
- // Register the user, enroll the user, and import the new identity into the wallet.
- RegistrationRequest registrationRequest = new RegistrationRequest("appUser");
- registrationRequest.setAffiliation("org1.department1");
- registrationRequest.setEnrollmentID("appUser");
- String enrollmentSecret = caClient.register(registrationRequest, admin);
- Enrollment enrollment = caClient.enroll("appUser", enrollmentSecret);
- Identity user = Identities.newX509Identity("Org1MSP", enrollment);
- wallet.put("appUser", user);
- System.out.println("Successfully enrolled user \"appUser\" and imported it into the wallet");
- }
-
-}
diff --git a/asset-transfer-ledger-queries/application-java/src/main/resources/log4j.properties b/asset-transfer-ledger-queries/application-java/src/main/resources/log4j.properties
deleted file mode 100644
index f1f841fe..00000000
--- a/asset-transfer-ledger-queries/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-ledger-queries/application-javascript/.eslintignore b/asset-transfer-ledger-queries/application-javascript/.eslintignore
deleted file mode 100644
index 15958470..00000000
--- a/asset-transfer-ledger-queries/application-javascript/.eslintignore
+++ /dev/null
@@ -1,5 +0,0 @@
-#
-# SPDX-License-Identifier: Apache-2.0
-#
-
-coverage
diff --git a/asset-transfer-ledger-queries/application-javascript/.eslintrc.js b/asset-transfer-ledger-queries/application-javascript/.eslintrc.js
deleted file mode 100644
index 072edaf6..00000000
--- a/asset-transfer-ledger-queries/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-ledger-queries/application-javascript/.gitignore b/asset-transfer-ledger-queries/application-javascript/.gitignore
deleted file mode 100644
index 21b287f7..00000000
--- a/asset-transfer-ledger-queries/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-ledger-queries/application-javascript/app.js b/asset-transfer-ledger-queries/application-javascript/app.js
deleted file mode 100644
index 0aa179a8..00000000
--- a/asset-transfer-ledger-queries/application-javascript/app.js
+++ /dev/null
@@ -1,252 +0,0 @@
-/*
- * Copyright IBM Corp. All Rights Reserved.
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-
-'use strict';
-
-const { Gateway, Wallets } = require('fabric-network');
-const FabricCAServices = require('fabric-ca-client');
-const path = require('path');
-const { buildCAClient, registerAndEnrollUser, enrollAdmin } = require('../../test-application/javascript/CAUtil.js');
-const { buildCCPOrg1, buildWallet } = require('../../test-application/javascript/AppUtil.js');
-
-const channelName = 'mychannel';
-const chaincodeName = 'ledger';
-const mspOrg1 = 'Org1MSP';
-
-const walletPath = path.join(__dirname, 'wallet');
-const userId = 'appUser';
-
-function prettyJSONString(inputString) {
- return JSON.stringify(JSON.parse(inputString), null, 2);
-}
-
-// pre-requisites:
-// - fabric-sample two organization test-network setup with two peers, ordering service,
-// and 2 certificate authorities, with the state database using couchdb
-// ===> from directory /fabric-samples/test-network
-// ./network.sh up createChannel -ca -s couchdb
-// - Use any of the asset-transfer-ledger-queries chaincodes deployed on the channel "mychannel"
-// with the chaincode name of "ledger". 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 ledger -ccp ../asset-transfer-ledger-queries/chaincode-javascript/ -ccl javascript
-// - Be sure that node.js is installed
-// ===> from directory /fabric-samples/asset-transfer-ledger-queries/application-javascript
-// node -v
-// - npm installed code dependencies
-// ===> from directory /fabric-samples/asset-transfer-ledger-queries/application-javascript
-// npm install
-// - to run this test application
-// ===> from directory /fabric-samples/asset-transfer-ledger-queries/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-ledger-queries/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 ledger queries operations with any of the asset-transfer-ledger-queries 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() {
- let skipInit = false;
- if (process.argv.length > 2) {
- if (process.argv[2] === 'skipInit') {
- skipInit = true;
- }
- }
-
- 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, userId, '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: userId,
- 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.
- if (!skipInit) {
- try {
- console.log('\n--> Submit Transaction: InitLedger, function creates the initial set of assets on the ledger');
- await contract.submitTransaction('InitLedger');
- console.log('*** Result: committed');
- } catch (initError) {
- // this is error is OK if we are rerunning this app without restarting
- console.log(`******** initLedger failed :: ${initError}`);
- }
- } else {
- console.log('*** not executing "InitLedger');
- }
-
- let result;
-
- // Let's try a query operation (function).
- // This will be sent to just one peer and the results will be shown.
- console.log('\n--> Evaluate Transaction: GetAssetsByRange, function returns assets in a specific range from asset1 to before asset6');
- result = await contract.evaluateTransaction('GetAssetsByRange', 'asset1', 'asset6');
- console.log(`*** Result: ${prettyJSONString(result.toString())}`);
-
- console.log('\n--> Evaluate Transaction: GetAssetsByRange, function use an open start and open end range to return assest1 to asset6');
- result = await contract.evaluateTransaction('GetAssetsByRange', '', '');
- console.log(`*** Result: ${prettyJSONString(result.toString())}`);
-
- console.log('\n--> Evaluate Transaction: GetAssetsByRange, function use an fixed start (asset3) and open end range to return assest3 to asset6');
- result = await contract.evaluateTransaction('GetAssetsByRange', 'asset3', '');
- console.log(`*** Result: ${prettyJSONString(result.toString())}`);
-
- console.log('\n--> Evaluate Transaction: GetAssetsByRange, function use an open start and fixed end (asset3) range to return assest1 to asset2');
- result = await contract.evaluateTransaction('GetAssetsByRange', '', 'asset3');
- 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(asset7), color(yellow), size(5), owner(Tom), and appraisedValue(1300) arguments');
- await contract.submitTransaction('CreateAsset', 'asset7', 'yellow', '5', 'Tom', '1300');
- console.log('*** Result: committed');
-
- console.log('\n--> Evaluate Transaction: ReadAsset, function returns information about an asset with ID(asset7)');
- result = await contract.evaluateTransaction('ReadAsset', 'asset7');
- console.log(`*** Result: ${prettyJSONString(result.toString())}`);
-
- console.log('\n--> Evaluate Transaction: AssetExists, function returns "true" if an asset with ID(asset7) exist');
- result = await contract.evaluateTransaction('AssetExists', 'asset7');
- console.log(`*** Result: ${prettyJSONString(result.toString())}`);
-
- // Now let's try to submit a transaction that deletes an asset
- // 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: DeleteAsset with ID(asset7)');
- await contract.submitTransaction('DeleteAsset', 'asset7');
- console.log('*** Result: committed');
-
- console.log('\n--> Evaluate Transaction: AssetExists, function returns "false" if an asset with ID(asset7) does not exist');
- result = await contract.evaluateTransaction('AssetExists', 'asset7');
- console.log(`*** Result: ${prettyJSONString(result.toString())}`);
-
- console.log('\n--> Submit Transaction: TransferAsset, transfer asset(asset2) to new owner(Max)');
- await contract.submitTransaction('TransferAsset', 'asset2', 'Max');
- console.log('*** Result: committed');
-
- console.log('\n--> Evaluate Transaction: ReadAsset, function returns information about an asset with ID(asset2)');
- result = await contract.evaluateTransaction('ReadAsset', 'asset2');
- console.log(`*** Result: ${prettyJSONString(result.toString())}`);
-
- // Rich Query with Pagination (Only supported if CouchDB is used as state database)
- console.log('\n--> Evaluate Transaction: QueryAssetsWithPagination, function returns "Max" assets');
- result = await contract.evaluateTransaction('QueryAssetsWithPagination', '{"selector":{"docType":"asset","owner":"Max"}, "use_index":["_design/indexOwnerDoc", "indexOwner"]}', '1', '');
- console.log(`*** Result: ${prettyJSONString(result.toString())}`);
-
- // Recover the bookmark from previous query. Normally it will be inside a variable.
- const resultJson = JSON.parse(result.toString());
-
- console.log('\n--> Evaluate Transaction: QueryAssetsWithPagination, function returns "Max" assets next page');
- result = await contract.evaluateTransaction('QueryAssetsWithPagination', '{"selector":{"docType":"asset","owner":"Max"}, "use_index":["_design/indexOwnerDoc", "indexOwner"]}', '1', resultJson.bookmark);
- console.log(`*** Result: ${prettyJSONString(result.toString())}`);
-
- console.log('\n--> Submit Transaction: TransferAssetByColor, transfer all yellow assets to new owner(Michel)');
- await contract.submitTransaction('TransferAssetByColor', 'yellow', 'Michel');
- console.log('*** Result: committed');
-
- // Rich Query (Only supported if CouchDB is used as state database):
- console.log('\n--> Evaluate Transaction: QueryAssetsByOwner, find all assets with owner(Michel)');
- result = await contract.evaluateTransaction('QueryAssetsByOwner', 'Michel');
- console.log(`*** Result: ${prettyJSONString(result.toString())}`);
-
- console.log('\n--> Evaluate Transaction: GetAssetHistory, get the history of an asset(asset7)');
- result = await contract.evaluateTransaction('GetAssetHistory', 'asset7');
- console.log(`*** Result: ${prettyJSONString(result.toString())}`);
-
- // Rich Query (Only supported if CouchDB is used as state database):
- console.log('\n--> Evaluate Transaction: QueryAssets, assets of size 15');
- result = await contract.evaluateTransaction('QueryAssets', '{"selector":{"size":15}}');
- console.log(`*** Result: ${prettyJSONString(result.toString())}`);
-
- // Rich Query with index design doc and index name specified (Only supported if CouchDB is used as state database):
- console.log('\n--> Evaluate Transaction: QueryAssets, Jin Soo\'s assets');
- result = await contract.evaluateTransaction('QueryAssets', '{"selector":{"docType":"asset","owner":"Jin Soo"}, "use_index":["_design/indexOwnerDoc", "indexOwner"]}');
- console.log(`*** Result: ${prettyJSONString(result.toString())}`);
-
- // Range Query with Pagination
- console.log('\n--> Evaluate Transaction: GetAssetsByRangeWithPagination - get page 1 of assets from asset2 to asset6 (asset2, asset3)');
- result = await contract.evaluateTransaction('GetAssetsByRangeWithPagination', 'asset2', 'asset6', '2', '');
- console.log(`*** Result: ${prettyJSONString(result.toString())}`);
-
- // Range Query with Pagination
- console.log('\n--> Evaluate Transaction: GetAssetsByRangeWithPagination - get page 2 of assets from asset2 to asset6 (asset4, asset5)');
- result = await contract.evaluateTransaction('GetAssetsByRangeWithPagination', 'asset2', 'asset6', '2', 'asset4');
- console.log(`*** Result: ${prettyJSONString(result.toString())}`);
-
- console.log('*** all tests completed');
- } 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);
- }
-
- console.log('*** application ending');
-
-}
-
-main();
diff --git a/asset-transfer-ledger-queries/application-javascript/package.json b/asset-transfer-ledger-queries/application-javascript/package.json
deleted file mode 100644
index a3cafb86..00000000
--- a/asset-transfer-ledger-queries/application-javascript/package.json
+++ /dev/null
@@ -1,23 +0,0 @@
-{
- "name": "asset-transfer-ledger-queries",
- "version": "1.0.0",
- "description": "Asset transfer ledger queries application implemented in JavaScript",
- "engines": {
- "node": ">=12",
- "npm": ">=5"
- },
- "engineStrict": true,
- "author": "Hyperledger",
- "license": "Apache-2.0",
- "scripts": {
- "run": "node app.js",
- "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-ledger-queries/chaincode-go/META-INF/statedb/couchdb/indexes/indexOwner.json b/asset-transfer-ledger-queries/chaincode-go/META-INF/statedb/couchdb/indexes/indexOwner.json
deleted file mode 100644
index 305f0904..00000000
--- a/asset-transfer-ledger-queries/chaincode-go/META-INF/statedb/couchdb/indexes/indexOwner.json
+++ /dev/null
@@ -1 +0,0 @@
-{"index":{"fields":["docType","owner"]},"ddoc":"indexOwnerDoc", "name":"indexOwner","type":"json"}
diff --git a/asset-transfer-ledger-queries/chaincode-go/asset_transfer_ledger_chaincode.go b/asset-transfer-ledger-queries/chaincode-go/asset_transfer_ledger_chaincode.go
deleted file mode 100644
index 45eb1ba0..00000000
--- a/asset-transfer-ledger-queries/chaincode-go/asset_transfer_ledger_chaincode.go
+++ /dev/null
@@ -1,469 +0,0 @@
-/*
- SPDX-License-Identifier: Apache-2.0
-*/
-
-/*
-====CHAINCODE EXECUTION SAMPLES (CLI) ==================
-
-==== Invoke assets ====
-peer chaincode invoke -C myc1 -n asset_transfer -c '{"Args":["CreateAsset","asset1","blue","5","tom","35"]}'
-peer chaincode invoke -C myc1 -n asset_transfer -c '{"Args":["CreateAsset","asset2","red","4","tom","50"]}'
-peer chaincode invoke -C myc1 -n asset_transfer -c '{"Args":["CreateAsset","asset3","blue","6","tom","70"]}'
-peer chaincode invoke -C myc1 -n asset_transfer -c '{"Args":["TransferAsset","asset2","jerry"]}'
-peer chaincode invoke -C myc1 -n asset_transfer -c '{"Args":["TransferAssetByColor","blue","jerry"]}'
-peer chaincode invoke -C myc1 -n asset_transfer -c '{"Args":["DeleteAsset","asset1"]}'
-
-==== Query assets ====
-peer chaincode query -C myc1 -n asset_transfer -c '{"Args":["ReadAsset","asset1"]}'
-peer chaincode query -C myc1 -n asset_transfer -c '{"Args":["GetAssetsByRange","asset1","asset3"]}'
-peer chaincode query -C myc1 -n asset_transfer -c '{"Args":["GetAssetHistory","asset1"]}'
-
-Rich Query (Only supported if CouchDB is used as state database):
-peer chaincode query -C myc1 -n asset_transfer -c '{"Args":["QueryAssetsByOwner","tom"]}'
-peer chaincode query -C myc1 -n asset_transfer -c '{"Args":["QueryAssets","{\"selector\":{\"owner\":\"tom\"}}"]}'
-
-Rich Query with Pagination (Only supported if CouchDB is used as state database):
-peer chaincode query -C myc1 -n asset_transfer -c '{"Args":["QueryAssetsWithPagination","{\"selector\":{\"owner\":\"tom\"}}","3",""]}'
-
-INDEXES TO SUPPORT COUCHDB RICH QUERIES
-
-Indexes in CouchDB are required in order to make JSON queries efficient and are required for
-any JSON query with a sort. Indexes may be packaged alongside
-chaincode in a META-INF/statedb/couchdb/indexes directory. Each index must be defined in its own
-text file with extension *.json with the index definition formatted in JSON following the
-CouchDB index JSON syntax as documented at:
-http://docs.couchdb.org/en/2.3.1/api/database/find.html#db-index
-
-This asset transfer ledger example chaincode demonstrates a packaged
-index which you can find in META-INF/statedb/couchdb/indexes/indexOwner.json.
-
-If you have access to the your peer's CouchDB state database in a development environment,
-you may want to iteratively test various indexes in support of your chaincode queries. You
-can use the CouchDB Fauxton interface or a command line curl utility to create and update
-indexes. Then once you finalize an index, include the index definition alongside your
-chaincode in the META-INF/statedb/couchdb/indexes directory, for packaging and deployment
-to managed environments.
-
-In the examples below you can find index definitions that support asset transfer ledger
-chaincode queries, along with the syntax that you can use in development environments
-to create the indexes in the CouchDB Fauxton interface or a curl command line utility.
-
-
-Index for docType, owner.
-
-Example curl command line to define index in the CouchDB channel_chaincode database
-curl -i -X POST -H "Content-Type: application/json" -d "{\"index\":{\"fields\":[\"docType\",\"owner\"]},\"name\":\"indexOwner\",\"ddoc\":\"indexOwnerDoc\",\"type\":\"json\"}" http://hostname:port/myc1_assets/_index
-
-
-Index for docType, owner, size (descending order).
-
-Example curl command line to define index in the CouchDB channel_chaincode database:
-curl -i -X POST -H "Content-Type: application/json" -d "{\"index\":{\"fields\":[{\"size\":\"desc\"},{\"docType\":\"desc\"},{\"owner\":\"desc\"}]},\"ddoc\":\"indexSizeSortDoc\", \"name\":\"indexSizeSortDesc\",\"type\":\"json\"}" http://hostname:port/myc1_assets/_index
-
-Rich Query with index design doc and index name specified (Only supported if CouchDB is used as state database):
-peer chaincode query -C myc1 -n asset_transfer -c '{"Args":["QueryAssets","{\"selector\":{\"docType\":\"asset\",\"owner\":\"tom\"}, \"use_index\":[\"_design/indexOwnerDoc\", \"indexOwner\"]}"]}'
-
-Rich Query with index design doc specified only (Only supported if CouchDB is used as state database):
-peer chaincode query -C myc1 -n asset_transfer -c '{"Args":["QueryAssets","{\"selector\":{\"docType\":{\"$eq\":\"asset\"},\"owner\":{\"$eq\":\"tom\"},\"size\":{\"$gt\":0}},\"fields\":[\"docType\",\"owner\",\"size\"],\"sort\":[{\"size\":\"desc\"}],\"use_index\":\"_design/indexSizeSortDoc\"}"]}'
-*/
-
-package main
-
-import (
- "encoding/json"
- "fmt"
- "log"
- "time"
-
- "github.com/hyperledger/fabric-chaincode-go/v2/shim"
- "github.com/hyperledger/fabric-contract-api-go/v2/contractapi"
-)
-
-const index = "color~name"
-
-// SimpleChaincode implements the fabric-contract-api-go programming model
-type SimpleChaincode struct {
- contractapi.Contract
-}
-
-type Asset struct {
- DocType string `json:"docType"` //docType is used to distinguish the various types of objects in state database
- ID string `json:"ID"` //the field tags are needed to keep case from bouncing around
- Color string `json:"color"`
- Size int `json:"size"`
- Owner string `json:"owner"`
- AppraisedValue int `json:"appraisedValue"`
-}
-
-// HistoryQueryResult structure used for returning result of history query
-type HistoryQueryResult struct {
- Record *Asset `json:"record"`
- TxId string `json:"txId"`
- Timestamp time.Time `json:"timestamp"`
- IsDelete bool `json:"isDelete"`
-}
-
-// PaginatedQueryResult structure used for returning paginated query results and metadata
-type PaginatedQueryResult struct {
- Records []*Asset `json:"records"`
- FetchedRecordsCount int32 `json:"fetchedRecordsCount"`
- Bookmark string `json:"bookmark"`
-}
-
-// CreateAsset initializes a new asset in the ledger
-func (t *SimpleChaincode) CreateAsset(ctx contractapi.TransactionContextInterface, assetID, color string, size int, owner string, appraisedValue int) error {
- exists, err := t.AssetExists(ctx, assetID)
- if err != nil {
- return fmt.Errorf("failed to get asset: %v", err)
- }
- if exists {
- return fmt.Errorf("asset already exists: %s", assetID)
- }
-
- asset := &Asset{
- DocType: "asset",
- ID: assetID,
- Color: color,
- Size: size,
- Owner: owner,
- AppraisedValue: appraisedValue,
- }
- assetBytes, err := json.Marshal(asset)
- if err != nil {
- return err
- }
-
- err = ctx.GetStub().PutState(assetID, assetBytes)
- if err != nil {
- return err
- }
-
- // Create an index to enable color-based range queries, e.g. return all blue assets.
- // An 'index' is a normal key-value entry in the ledger.
- // The key is a composite key, with the elements that you want to range query on listed first.
- // In our case, the composite key is based on indexName~color~name.
- // This will enable very efficient state range queries based on composite keys matching indexName~color~*
- colorNameIndexKey, err := ctx.GetStub().CreateCompositeKey(index, []string{asset.Color, asset.ID})
- if err != nil {
- return err
- }
- // Save index entry to world state. Only the key name is needed, no need to store a duplicate copy of the asset.
- // Note - passing a 'nil' value will effectively delete the key from state, therefore we pass null character as value
- value := []byte{0x00}
- return ctx.GetStub().PutState(colorNameIndexKey, value)
-}
-
-// ReadAsset retrieves an asset from the ledger
-func (t *SimpleChaincode) ReadAsset(ctx contractapi.TransactionContextInterface, assetID string) (*Asset, error) {
- assetBytes, err := ctx.GetStub().GetState(assetID)
- if err != nil {
- return nil, fmt.Errorf("failed to get asset %s: %v", assetID, err)
- }
- if assetBytes == nil {
- return nil, fmt.Errorf("asset %s does not exist", assetID)
- }
-
- var asset Asset
- err = json.Unmarshal(assetBytes, &asset)
- if err != nil {
- return nil, err
- }
-
- return &asset, nil
-}
-
-// DeleteAsset removes an asset key-value pair from the ledger
-func (t *SimpleChaincode) DeleteAsset(ctx contractapi.TransactionContextInterface, assetID string) error {
- asset, err := t.ReadAsset(ctx, assetID)
- if err != nil {
- return err
- }
-
- err = ctx.GetStub().DelState(assetID)
- if err != nil {
- return fmt.Errorf("failed to delete asset %s: %v", assetID, err)
- }
-
- colorNameIndexKey, err := ctx.GetStub().CreateCompositeKey(index, []string{asset.Color, asset.ID})
- if err != nil {
- return err
- }
-
- // Delete index entry
- return ctx.GetStub().DelState(colorNameIndexKey)
-}
-
-// TransferAsset transfers an asset by setting a new owner name on the asset
-func (t *SimpleChaincode) TransferAsset(ctx contractapi.TransactionContextInterface, assetID, newOwner string) error {
- asset, err := t.ReadAsset(ctx, assetID)
- if err != nil {
- return err
- }
-
- asset.Owner = newOwner
- assetBytes, err := json.Marshal(asset)
- if err != nil {
- return err
- }
-
- return ctx.GetStub().PutState(assetID, assetBytes)
-}
-
-// constructQueryResponseFromIterator constructs a slice of assets from the resultsIterator
-func constructQueryResponseFromIterator(resultsIterator shim.StateQueryIteratorInterface) ([]*Asset, error) {
- var assets []*Asset
- for resultsIterator.HasNext() {
- queryResult, err := resultsIterator.Next()
- if err != nil {
- return nil, err
- }
- var asset Asset
- err = json.Unmarshal(queryResult.Value, &asset)
- if err != nil {
- return nil, err
- }
- assets = append(assets, &asset)
- }
-
- return assets, nil
-}
-
-// GetAssetsByRange performs a range query based on the start and end keys provided.
-// Read-only function results are not typically submitted to ordering. If the read-only
-// results are submitted to ordering, or if the query is used in an update transaction
-// and submitted to ordering, then the committing peers will re-execute to guarantee that
-// result sets are stable between endorsement time and commit time. The transaction is
-// invalidated by the committing peers if the result set has changed between endorsement
-// time and commit time.
-// Therefore, range queries are a safe option for performing update transactions based on query results.
-func (t *SimpleChaincode) GetAssetsByRange(ctx contractapi.TransactionContextInterface, startKey, endKey string) ([]*Asset, error) {
- resultsIterator, err := ctx.GetStub().GetStateByRange(startKey, endKey)
- if err != nil {
- return nil, err
- }
- defer resultsIterator.Close()
-
- return constructQueryResponseFromIterator(resultsIterator)
-}
-
-// TransferAssetByColor will transfer assets of a given color to a certain new owner.
-// Uses GetStateByPartialCompositeKey (range query) against color~name 'index'.
-// Committing peers will re-execute range queries to guarantee that result sets are stable
-// between endorsement time and commit time. The transaction is invalidated by the
-// committing peers if the result set has changed between endorsement time and commit time.
-// Therefore, range queries are a safe option for performing update transactions based on query results.
-// Example: GetStateByPartialCompositeKey/RangeQuery
-func (t *SimpleChaincode) TransferAssetByColor(ctx contractapi.TransactionContextInterface, color, newOwner string) error {
- // Execute a key range query on all keys starting with 'color'
- coloredAssetResultsIterator, err := ctx.GetStub().GetStateByPartialCompositeKey(index, []string{color})
- if err != nil {
- return err
- }
- defer coloredAssetResultsIterator.Close()
-
- for coloredAssetResultsIterator.HasNext() {
- responseRange, err := coloredAssetResultsIterator.Next()
- if err != nil {
- return err
- }
-
- _, compositeKeyParts, err := ctx.GetStub().SplitCompositeKey(responseRange.Key)
- if err != nil {
- return err
- }
-
- if len(compositeKeyParts) > 1 {
- returnedAssetID := compositeKeyParts[1]
- asset, err := t.ReadAsset(ctx, returnedAssetID)
- if err != nil {
- return err
- }
- asset.Owner = newOwner
- assetBytes, err := json.Marshal(asset)
- if err != nil {
- return err
- }
- err = ctx.GetStub().PutState(returnedAssetID, assetBytes)
- if err != nil {
- return fmt.Errorf("transfer failed for asset %s: %v", returnedAssetID, err)
- }
- }
- }
-
- return nil
-}
-
-// QueryAssetsByOwner queries for assets based on the owners name.
-// This is an example of a parameterized query where the query logic is baked into the chaincode,
-// and accepting a single query parameter (owner).
-// Only available on state databases that support rich query (e.g. CouchDB)
-// Example: Parameterized rich query
-func (t *SimpleChaincode) QueryAssetsByOwner(ctx contractapi.TransactionContextInterface, owner string) ([]*Asset, error) {
- queryString := fmt.Sprintf(`{"selector":{"docType":"asset","owner":"%s"}}`, owner)
- return getQueryResultForQueryString(ctx, queryString)
-}
-
-// QueryAssets uses a query string to perform a query for assets.
-// Query string matching state database syntax is passed in and executed as is.
-// Supports ad hoc queries that can be defined at runtime by the client.
-// If this is not desired, follow the QueryAssetsForOwner example for parameterized queries.
-// Only available on state databases that support rich query (e.g. CouchDB)
-// Example: Ad hoc rich query
-func (t *SimpleChaincode) QueryAssets(ctx contractapi.TransactionContextInterface, queryString string) ([]*Asset, error) {
- return getQueryResultForQueryString(ctx, queryString)
-}
-
-// getQueryResultForQueryString executes the passed in query string.
-// The result set is built and returned as a byte array containing the JSON results.
-func getQueryResultForQueryString(ctx contractapi.TransactionContextInterface, queryString string) ([]*Asset, error) {
- resultsIterator, err := ctx.GetStub().GetQueryResult(queryString)
- if err != nil {
- return nil, err
- }
- defer resultsIterator.Close()
-
- return constructQueryResponseFromIterator(resultsIterator)
-}
-
-// GetAssetsByRangeWithPagination performs a range query based on the start and end key,
-// page size and a bookmark.
-// The number of fetched records will be equal to or lesser than the page size.
-// Paginated range queries are only valid for read only transactions.
-// Example: Pagination with Range Query
-func (t *SimpleChaincode) GetAssetsByRangeWithPagination(ctx contractapi.TransactionContextInterface, startKey string, endKey string, pageSize int, bookmark string) (*PaginatedQueryResult, error) {
-
- resultsIterator, responseMetadata, err := ctx.GetStub().GetStateByRangeWithPagination(startKey, endKey, int32(pageSize), bookmark)
- if err != nil {
- return nil, err
- }
- defer resultsIterator.Close()
-
- assets, err := constructQueryResponseFromIterator(resultsIterator)
- if err != nil {
- return nil, err
- }
-
- return &PaginatedQueryResult{
- Records: assets,
- FetchedRecordsCount: responseMetadata.FetchedRecordsCount,
- Bookmark: responseMetadata.Bookmark,
- }, nil
-}
-
-// QueryAssetsWithPagination uses a query string, page size and a bookmark to perform a query
-// for assets. Query string matching state database syntax is passed in and executed as is.
-// The number of fetched records would be equal to or lesser than the specified page size.
-// Supports ad hoc queries that can be defined at runtime by the client.
-// If this is not desired, follow the QueryAssetsForOwner example for parameterized queries.
-// Only available on state databases that support rich query (e.g. CouchDB)
-// Paginated queries are only valid for read only transactions.
-// Example: Pagination with Ad hoc Rich Query
-func (t *SimpleChaincode) QueryAssetsWithPagination(ctx contractapi.TransactionContextInterface, queryString string, pageSize int, bookmark string) (*PaginatedQueryResult, error) {
-
- return getQueryResultForQueryStringWithPagination(ctx, queryString, int32(pageSize), bookmark)
-}
-
-// getQueryResultForQueryStringWithPagination executes the passed in query string with
-// pagination info. The result set is built and returned as a byte array containing the JSON results.
-func getQueryResultForQueryStringWithPagination(ctx contractapi.TransactionContextInterface, queryString string, pageSize int32, bookmark string) (*PaginatedQueryResult, error) {
-
- resultsIterator, responseMetadata, err := ctx.GetStub().GetQueryResultWithPagination(queryString, pageSize, bookmark)
- if err != nil {
- return nil, err
- }
- defer resultsIterator.Close()
-
- assets, err := constructQueryResponseFromIterator(resultsIterator)
- if err != nil {
- return nil, err
- }
-
- return &PaginatedQueryResult{
- Records: assets,
- FetchedRecordsCount: responseMetadata.FetchedRecordsCount,
- Bookmark: responseMetadata.Bookmark,
- }, nil
-}
-
-// GetAssetHistory returns the chain of custody for an asset since issuance.
-func (t *SimpleChaincode) GetAssetHistory(ctx contractapi.TransactionContextInterface, assetID string) ([]HistoryQueryResult, error) {
- log.Printf("GetAssetHistory: ID %v", assetID)
-
- resultsIterator, err := ctx.GetStub().GetHistoryForKey(assetID)
- if err != nil {
- return nil, err
- }
- defer resultsIterator.Close()
-
- var records []HistoryQueryResult
- for resultsIterator.HasNext() {
- response, err := resultsIterator.Next()
- if err != nil {
- return nil, err
- }
-
- var asset Asset
- if len(response.Value) > 0 {
- err = json.Unmarshal(response.Value, &asset)
- if err != nil {
- return nil, err
- }
- } else {
- asset = Asset{
- ID: assetID,
- }
- }
-
- record := HistoryQueryResult{
- TxId: response.TxId,
- Timestamp: response.Timestamp.AsTime(),
- Record: &asset,
- IsDelete: response.IsDelete,
- }
- records = append(records, record)
- }
-
- return records, nil
-}
-
-// AssetExists returns true when asset with given ID exists in the ledger.
-func (t *SimpleChaincode) AssetExists(ctx contractapi.TransactionContextInterface, assetID string) (bool, error) {
- assetBytes, err := ctx.GetStub().GetState(assetID)
- if err != nil {
- return false, fmt.Errorf("failed to read asset %s from world state. %v", assetID, err)
- }
-
- return assetBytes != nil, nil
-}
-
-// InitLedger creates the initial set of assets in the ledger.
-func (t *SimpleChaincode) InitLedger(ctx contractapi.TransactionContextInterface) error {
- assets := []Asset{
- {DocType: "asset", ID: "asset1", Color: "blue", Size: 5, Owner: "Tomoko", AppraisedValue: 300},
- {DocType: "asset", ID: "asset2", Color: "red", Size: 5, Owner: "Brad", AppraisedValue: 400},
- {DocType: "asset", ID: "asset3", Color: "green", Size: 10, Owner: "Jin Soo", AppraisedValue: 500},
- {DocType: "asset", ID: "asset4", Color: "yellow", Size: 10, Owner: "Max", AppraisedValue: 600},
- {DocType: "asset", ID: "asset5", Color: "black", Size: 15, Owner: "Adriana", AppraisedValue: 700},
- {DocType: "asset", ID: "asset6", Color: "white", Size: 15, Owner: "Michel", AppraisedValue: 800},
- }
-
- for _, asset := range assets {
- err := t.CreateAsset(ctx, asset.ID, asset.Color, asset.Size, asset.Owner, asset.AppraisedValue)
- if err != nil {
- return err
- }
- }
-
- return nil
-}
-
-func main() {
- chaincode, err := contractapi.NewChaincode(&SimpleChaincode{})
- if err != nil {
- log.Panicf("Error creating asset chaincode: %v", err)
- }
-
- if err := chaincode.Start(); err != nil {
- log.Panicf("Error starting asset chaincode: %v", err)
- }
-}
diff --git a/asset-transfer-ledger-queries/chaincode-go/go.mod b/asset-transfer-ledger-queries/chaincode-go/go.mod
deleted file mode 100644
index 000abbbd..00000000
--- a/asset-transfer-ledger-queries/chaincode-go/go.mod
+++ /dev/null
@@ -1,28 +0,0 @@
-module github.com/hyperledger/fabric-samples/asset-transfer-ledger-queries/chaincode-go
-
-go 1.22.0
-
-require (
- github.com/hyperledger/fabric-chaincode-go/v2 v2.0.0
- github.com/hyperledger/fabric-contract-api-go/v2 v2.2.0
-)
-
-require (
- github.com/go-openapi/jsonpointer v0.21.0 // indirect
- github.com/go-openapi/jsonreference v0.21.0 // indirect
- github.com/go-openapi/spec v0.21.0 // indirect
- github.com/go-openapi/swag v0.23.0 // indirect
- github.com/hyperledger/fabric-protos-go-apiv2 v0.3.4 // indirect
- github.com/josharian/intern v1.0.0 // indirect
- github.com/mailru/easyjson v0.7.7 // indirect
- github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect
- github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
- github.com/xeipuuv/gojsonschema v1.2.0 // indirect
- golang.org/x/net v0.28.0 // indirect
- golang.org/x/sys v0.24.0 // indirect
- golang.org/x/text v0.17.0 // indirect
- google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f // indirect
- google.golang.org/grpc v1.67.0 // indirect
- google.golang.org/protobuf v1.36.1 // indirect
- gopkg.in/yaml.v3 v3.0.1 // indirect
-)
diff --git a/asset-transfer-ledger-queries/chaincode-go/go.sum b/asset-transfer-ledger-queries/chaincode-go/go.sum
deleted file mode 100644
index fa4d3b24..00000000
--- a/asset-transfer-ledger-queries/chaincode-go/go.sum
+++ /dev/null
@@ -1,61 +0,0 @@
-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/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1rr/O9oNQ=
-github.com/go-openapi/jsonpointer v0.21.0/go.mod h1:IUyH9l/+uyhIYQ/PXVA41Rexl+kOkAPDdXEYns6fzUY=
-github.com/go-openapi/jsonreference v0.21.0 h1:Rs+Y7hSXT83Jacb7kFyjn4ijOuVGSvOdF2+tg1TRrwQ=
-github.com/go-openapi/jsonreference v0.21.0/go.mod h1:LmZmgsrTkVg9LG4EaHeY8cBDslNPMo06cago5JNLkm4=
-github.com/go-openapi/spec v0.21.0 h1:LTVzPc3p/RzRnkQqLRndbAzjY0d0BCL72A6j3CdL9ZY=
-github.com/go-openapi/spec v0.21.0/go.mod h1:78u6VdPw81XU44qEWGhtr982gJ5BWg2c0I5XwVMotYk=
-github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+GrE=
-github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ=
-github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
-github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
-github.com/hyperledger/fabric-chaincode-go/v2 v2.0.0 h1:IhkHfrl5X/fVnmB6pWeCYCdIJRi9bxj+WTnVN8DtW3c=
-github.com/hyperledger/fabric-chaincode-go/v2 v2.0.0/go.mod h1:PHHaFffjw7p7n9bmCfcm7RqDqYdivNEsJdiNIKZo5Lk=
-github.com/hyperledger/fabric-contract-api-go/v2 v2.2.0 h1:rmUoBmciB0GL/miqcbJmJbgp5QTWoJUrZo+CNxrNLF4=
-github.com/hyperledger/fabric-contract-api-go/v2 v2.2.0/go.mod h1:FeWeO/jwGjiME7ak3GufqKIcwkejtzrDG4QxbfKydWs=
-github.com/hyperledger/fabric-protos-go-apiv2 v0.3.4 h1:YJrd+gMaeY0/vsN0aS0QkEKTivGoUnSRIXxGJ7KI+Pc=
-github.com/hyperledger/fabric-protos-go-apiv2 v0.3.4/go.mod h1:bau/6AJhvEcu9GKKYHlDXAxXKzYNfhP6xu2GXuxEcFk=
-github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
-github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
-github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
-github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
-github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
-github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
-github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=
-github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
-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/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8=
-github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4=
-github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
-github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY=
-github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
-github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
-github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
-github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
-github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=
-github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb h1:zGWFAtiMcyryUHoUjUJX0/lt1H2+i2Ka2n+D3DImSNo=
-github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=
-github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHovont7NscjpAxXsDA8S8BMYve8Y5+7cuRE7R0=
-github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ=
-github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74=
-github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y=
-golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE=
-golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg=
-golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg=
-golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
-golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc=
-golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
-google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f h1:BWUVssLB0HVOSY78gIdvk1dTVYtT1y8SBWtPYuTJ/6w=
-google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM=
-google.golang.org/grpc v1.67.0 h1:IdH9y6PF5MPSdAntIcpjQ+tXO41pcQsfZV2RxtQgVcw=
-google.golang.org/grpc v1.67.0/go.mod h1:1gLDyUQU7CTLJI90u3nXZ9ekeghjeM7pTDZlqFNg2AA=
-google.golang.org/protobuf v1.36.1 h1:yBPeRvTftaleIgM3PZ/WBIZ7XM/eEYAaEyCwvyjq/gk=
-google.golang.org/protobuf v1.36.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
-gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
-gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
-gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
-gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
-gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
diff --git a/asset-transfer-ledger-queries/chaincode-javascript/.eslintignore b/asset-transfer-ledger-queries/chaincode-javascript/.eslintignore
deleted file mode 100644
index 15958470..00000000
--- a/asset-transfer-ledger-queries/chaincode-javascript/.eslintignore
+++ /dev/null
@@ -1,5 +0,0 @@
-#
-# SPDX-License-Identifier: Apache-2.0
-#
-
-coverage
diff --git a/asset-transfer-ledger-queries/chaincode-javascript/.eslintrc.js b/asset-transfer-ledger-queries/chaincode-javascript/.eslintrc.js
deleted file mode 100644
index 072edaf6..00000000
--- a/asset-transfer-ledger-queries/chaincode-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-ledger-queries/chaincode-javascript/META-INF/statedb/couchdb/indexes/indexOwner.json b/asset-transfer-ledger-queries/chaincode-javascript/META-INF/statedb/couchdb/indexes/indexOwner.json
deleted file mode 100644
index 305f0904..00000000
--- a/asset-transfer-ledger-queries/chaincode-javascript/META-INF/statedb/couchdb/indexes/indexOwner.json
+++ /dev/null
@@ -1 +0,0 @@
-{"index":{"fields":["docType","owner"]},"ddoc":"indexOwnerDoc", "name":"indexOwner","type":"json"}
diff --git a/asset-transfer-ledger-queries/chaincode-javascript/index.js b/asset-transfer-ledger-queries/chaincode-javascript/index.js
deleted file mode 100644
index 5c7b6e0d..00000000
--- a/asset-transfer-ledger-queries/chaincode-javascript/index.js
+++ /dev/null
@@ -1,13 +0,0 @@
-/*
- * Copyright IBM Corp. All Rights Reserved.
- *
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-
-'use strict';
-
-const CC = require('./lib/asset_transfer_ledger_chaincode.js');
-
-module.exports.CC = CC;
-module.exports.contracts = [ CC ];
diff --git a/asset-transfer-ledger-queries/chaincode-javascript/lib/asset_transfer_ledger_chaincode.js b/asset-transfer-ledger-queries/chaincode-javascript/lib/asset_transfer_ledger_chaincode.js
deleted file mode 100644
index fbd92152..00000000
--- a/asset-transfer-ledger-queries/chaincode-javascript/lib/asset_transfer_ledger_chaincode.js
+++ /dev/null
@@ -1,411 +0,0 @@
-/*
- * Copyright IBM Corp. All Rights Reserved.
- *
- * SPDX-License-Identifier: Apache-2.0
-*/
-
-// ====CHAINCODE EXECUTION SAMPLES (CLI) ==================
-
-// ==== Invoke assets ====
-// peer chaincode invoke -C CHANNEL_NAME -n asset_transfer -c '{"Args":["CreateAsset","asset1","blue","35","Tom","100"]}'
-// peer chaincode invoke -C CHANNEL_NAME -n asset_transfer -c '{"Args":["CreateAsset","asset2","red","50","Tom","150"]}'
-// peer chaincode invoke -C CHANNEL_NAME -n asset_transfer -c '{"Args":["CreateAsset","asset3","blue","70","Tom","200"]}'
-// peer chaincode invoke -C CHANNEL_NAME -n asset_transfer -c '{"Args":["TransferAsset","asset2","jerry"]}'
-// peer chaincode invoke -C CHANNEL_NAME -n asset_transfer -c '{"Args":["TransferAssetByColor","blue","jerry"]}'
-// peer chaincode invoke -C CHANNEL_NAME -n asset_transfer -c '{"Args":["DeleteAsset","asset1"]}'
-
-// ==== Query assets ====
-// peer chaincode query -C CHANNEL_NAME -n asset_transfer -c '{"Args":["ReadAsset","asset1"]}'
-// peer chaincode query -C CHANNEL_NAME -n asset_transfer -c '{"Args":["GetAssetsByRange","asset1","asset3"]}'
-// peer chaincode query -C CHANNEL_NAME -n asset_transfer -c '{"Args":["GetAssetHistory","asset1"]}'
-
-// Rich Query (Only supported if CouchDB is used as state database):
-// peer chaincode query -C CHANNEL_NAME -n asset_transfer -c '{"Args":["QueryAssetsByOwner","Tom"]}' output issue
-// peer chaincode query -C CHANNEL_NAME -n asset_transfer -c '{"Args":["QueryAssets","{\"selector\":{\"owner\":\"Tom\"}}"]}'
-
-// Rich Query with Pagination (Only supported if CouchDB is used as state database):
-// peer chaincode query -C CHANNEL_NAME -n asset_transfer -c '{"Args":["QueryAssetsWithPagination","{\"selector\":{\"owner\":\"Tom\"}}","3",""]}'
-
-// INDEXES TO SUPPORT COUCHDB RICH QUERIES
-//
-// Indexes in CouchDB are required in order to make JSON queries efficient and are required for
-// any JSON query with a sort. Indexes may be packaged alongside
-// chaincode in a META-INF/statedb/couchdb/indexes directory. Each index must be defined in its own
-// text file with extension *.json with the index definition formatted in JSON following the
-// CouchDB index JSON syntax as documented at:
-// http://docs.couchdb.org/en/2.3.1/api/database/find.html#db-index
-//
-// This asset transfer ledger example chaincode demonstrates a packaged
-// index which you can find in META-INF/statedb/couchdb/indexes/indexOwner.json.
-//
-// If you have access to the your peer's CouchDB state database in a development environment,
-// you may want to iteratively test various indexes in support of your chaincode queries. You
-// can use the CouchDB Fauxton interface or a command line curl utility to create and update
-// indexes. Then once you finalize an index, include the index definition alongside your
-// chaincode in the META-INF/statedb/couchdb/indexes directory, for packaging and deployment
-// to managed environments.
-//
-// In the examples below you can find index definitions that support asset transfer ledger
-// chaincode queries, along with the syntax that you can use in development environments
-// to create the indexes in the CouchDB Fauxton interface or a curl command line utility.
-//
-
-// Index for docType, owner.
-//
-// Example curl command line to define index in the CouchDB channel_chaincode database
-// curl -i -X POST -H "Content-Type: application/json" -d "{\"index\":{\"fields\":[\"docType\",\"owner\"]},\"name\":\"indexOwner\",\"ddoc\":\"indexOwnerDoc\",\"type\":\"json\"}" http://hostname:port/myc1_assets/_index
-//
-
-// Index for docType, owner, size (descending order).
-//
-// Example curl command line to define index in the CouchDB channel_chaincode database
-// curl -i -X POST -H "Content-Type: application/json" -d "{\"index\":{\"fields\":[{\"size\":\"desc\"},{\"docType\":\"desc\"},{\"owner\":\"desc\"}]},\"ddoc\":\"indexSizeSortDoc\", \"name\":\"indexSizeSortDesc\",\"type\":\"json\"}" http://hostname:port/myc1_assets/_index
-
-// Rich Query with index design doc and index name specified (Only supported if CouchDB is used as state database):
-// peer chaincode query -C CHANNEL_NAME -n ledger -c '{"Args":["QueryAssets","{\"selector\":{\"docType\":\"asset\",\"owner\":\"Tom\"}, \"use_index\":[\"_design/indexOwnerDoc\", \"indexOwner\"]}"]}'
-
-// Rich Query with index design doc specified only (Only supported if CouchDB is used as state database):
-// peer chaincode query -C CHANNEL_NAME -n ledger -c '{"Args":["QueryAssets","{\"selector\":{\"docType\":{\"$eq\":\"asset\"},\"owner\":{\"$eq\":\"Tom\"},\"size\":{\"$gt\":0}},\"fields\":[\"docType\",\"owner\",\"size\"],\"sort\":[{\"size\":\"desc\"}],\"use_index\":\"_design/indexSizeSortDoc\"}"]}'
-
-'use strict';
-
-const {Contract} = require('fabric-contract-api');
-
-class Chaincode extends Contract {
-
- // CreateAsset - create a new asset, store into chaincode state
- async CreateAsset(ctx, assetID, color, size, owner, appraisedValue) {
- const exists = await this.AssetExists(ctx, assetID);
- if (exists) {
- throw new Error(`The asset ${assetID} already exists`);
- }
-
- // ==== Create asset object and marshal to JSON ====
- let asset = {
- docType: 'asset',
- assetID: assetID,
- color: color,
- size: size,
- owner: owner,
- appraisedValue: appraisedValue
- };
-
-
- // === Save asset to state ===
- await ctx.stub.putState(assetID, Buffer.from(JSON.stringify(asset)));
- let indexName = 'color~name';
- let colorNameIndexKey = await ctx.stub.createCompositeKey(indexName, [asset.color, asset.assetID]);
-
- // Save index entry to state. Only the key name is needed, no need to store a duplicate copy of the marble.
- // Note - passing a 'nil' value will effectively delete the key from state, therefore we pass null character as value
- await ctx.stub.putState(colorNameIndexKey, Buffer.from('\u0000'));
- }
-
- // ReadAsset returns the asset stored in the world state with given id.
- async ReadAsset(ctx, id) {
- const assetJSON = await ctx.stub.getState(id); // get the asset from chaincode state
- if (!assetJSON || assetJSON.length === 0) {
- throw new Error(`Asset ${id} does not exist`);
- }
-
- return assetJSON.toString();
- }
-
- // delete - remove a asset key/value pair from state
- async DeleteAsset(ctx, id) {
- if (!id) {
- throw new Error('Asset name must not be empty');
- }
-
- let exists = await this.AssetExists(ctx, id);
- if (!exists) {
- throw new Error(`Asset ${id} does not exist`);
- }
-
- // to maintain the color~name index, we need to read the asset first and get its color
- let valAsbytes = await ctx.stub.getState(id); // get the asset from chaincode state
- let jsonResp = {};
- if (!valAsbytes) {
- jsonResp.error = `Asset does not exist: ${id}`;
- throw new Error(jsonResp);
- }
- let assetJSON;
- try {
- assetJSON = JSON.parse(valAsbytes.toString());
- } catch (err) {
- jsonResp = {};
- jsonResp.error = `Failed to decode JSON of: ${id}`;
- throw new Error(jsonResp);
- }
- await ctx.stub.deleteState(id); //remove the asset from chaincode state
-
- // delete the index
- let indexName = 'color~name';
- let colorNameIndexKey = ctx.stub.createCompositeKey(indexName, [assetJSON.color, assetJSON.assetID]);
- if (!colorNameIndexKey) {
- throw new Error(' Failed to create the createCompositeKey');
- }
- // Delete index entry to state.
- await ctx.stub.deleteState(colorNameIndexKey);
- }
-
- // TransferAsset transfers a asset by setting a new owner name on the asset
- async TransferAsset(ctx, assetName, newOwner) {
-
- let assetAsBytes = await ctx.stub.getState(assetName);
- if (!assetAsBytes || !assetAsBytes.toString()) {
- throw new Error(`Asset ${assetName} does not exist`);
- }
- let assetToTransfer = {};
- try {
- assetToTransfer = JSON.parse(assetAsBytes.toString()); //unmarshal
- } catch (err) {
- let jsonResp = {};
- jsonResp.error = 'Failed to decode JSON of: ' + assetName;
- throw new Error(jsonResp);
- }
- assetToTransfer.owner = newOwner; //change the owner
-
- let assetJSONasBytes = Buffer.from(JSON.stringify(assetToTransfer));
- await ctx.stub.putState(assetName, assetJSONasBytes); //rewrite the asset
- }
-
- // GetAssetsByRange performs a range query based on the start and end keys provided.
- // Read-only function results are not typically submitted to ordering. If the read-only
- // results are submitted to ordering, or if the query is used in an update transaction
- // and submitted to ordering, then the committing peers will re-execute to guarantee that
- // result sets are stable between endorsement time and commit time. The transaction is
- // invalidated by the committing peers if the result set has changed between endorsement
- // time and commit time.
- // Therefore, range queries are a safe option for performing update transactions based on query results.
- async GetAssetsByRange(ctx, startKey, endKey) {
-
- let resultsIterator = await ctx.stub.getStateByRange(startKey, endKey);
- let results = await this._GetAllResults(resultsIterator, false);
-
- return JSON.stringify(results);
- }
-
- // TransferAssetByColor will transfer assets of a given color to a certain new owner.
- // Uses a GetStateByPartialCompositeKey (range query) against color~name 'index'.
- // Committing peers will re-execute range queries to guarantee that result sets are stable
- // between endorsement time and commit time. The transaction is invalidated by the
- // committing peers if the result set has changed between endorsement time and commit time.
- // Therefore, range queries are a safe option for performing update transactions based on query results.
- // Example: GetStateByPartialCompositeKey/RangeQuery
- async TransferAssetByColor(ctx, color, newOwner) {
- // Query the color~name index by color
- // This will execute a key range query on all keys starting with 'color'
- let coloredAssetResultsIterator = await ctx.stub.getStateByPartialCompositeKey('color~name', [color]);
-
- // Iterate through result set and for each asset found, transfer to newOwner
- let responseRange = await coloredAssetResultsIterator.next();
- while (!responseRange.done) {
- if (!responseRange || !responseRange.value || !responseRange.value.key) {
- return;
- }
-
- let objectType;
- let attributes;
- (
- {objectType, attributes} = await ctx.stub.splitCompositeKey(responseRange.value.key)
- );
-
- console.log(objectType);
- let returnedAssetName = attributes[1];
-
- // Now call the transfer function for the found asset.
- // Re-use the same function that is used to transfer individual assets
- await this.TransferAsset(ctx, returnedAssetName, newOwner);
- responseRange = await coloredAssetResultsIterator.next();
- }
- }
-
- // QueryAssetsByOwner queries for assets based on a passed in owner.
- // This is an example of a parameterized query where the query logic is baked into the chaincode,
- // and accepting a single query parameter (owner).
- // Only available on state databases that support rich query (e.g. CouchDB)
- // Example: Parameterized rich query
- async QueryAssetsByOwner(ctx, owner) {
- let queryString = {};
- queryString.selector = {};
- queryString.selector.docType = 'asset';
- queryString.selector.owner = owner;
- return await this.GetQueryResultForQueryString(ctx, JSON.stringify(queryString)); //shim.success(queryResults);
- }
-
- // Example: Ad hoc rich query
- // QueryAssets uses a query string to perform a query for assets.
- // Query string matching state database syntax is passed in and executed as is.
- // Supports ad hoc queries that can be defined at runtime by the client.
- // If this is not desired, follow the QueryAssetsForOwner example for parameterized queries.
- // Only available on state databases that support rich query (e.g. CouchDB)
- async QueryAssets(ctx, queryString) {
- return await this.GetQueryResultForQueryString(ctx, queryString);
- }
-
- // GetQueryResultForQueryString executes the passed in query string.
- // Result set is built and returned as a byte array containing the JSON results.
- async GetQueryResultForQueryString(ctx, queryString) {
-
- let resultsIterator = await ctx.stub.getQueryResult(queryString);
- let results = await this._GetAllResults(resultsIterator, false);
-
- return JSON.stringify(results);
- }
-
- // Example: Pagination with Range Query
- // GetAssetsByRangeWithPagination performs a range query based on the start & end key,
- // page size and a bookmark.
- // The number of fetched records will be equal to or lesser than the page size.
- // Paginated range queries are only valid for read only transactions.
- async GetAssetsByRangeWithPagination(ctx, startKey, endKey, pageSize, bookmark) {
-
- const {iterator, metadata} = await ctx.stub.getStateByRangeWithPagination(startKey, endKey, pageSize, bookmark);
- let results = {};
-
- results.results = await this._GetAllResults(iterator, false);
-
- results.fetchedRecordsCount = metadata.fetchedRecordsCount;
-
- results.bookmark = metadata.bookmark;
-
- return JSON.stringify(results);
- }
-
- // Example: Pagination with Ad hoc Rich Query
- // QueryAssetsWithPagination uses a query string, page size and a bookmark to perform a query
- // for assets. Query string matching state database syntax is passed in and executed as is.
- // The number of fetched records would be equal to or lesser than the specified page size.
- // Supports ad hoc queries that can be defined at runtime by the client.
- // If this is not desired, follow the QueryAssetsForOwner example for parameterized queries.
- // Only available on state databases that support rich query (e.g. CouchDB)
- // Paginated queries are only valid for read only transactions.
- async QueryAssetsWithPagination(ctx, queryString, pageSize, bookmark) {
-
- const {iterator, metadata} = await ctx.stub.getQueryResultWithPagination(queryString, pageSize, bookmark);
- let results = {};
-
- results.results = await this._GetAllResults(iterator, false);
-
- results.fetchedRecordsCount = metadata.fetchedRecordsCount;
-
- results.bookmark = metadata.bookmark;
-
- return JSON.stringify(results);
- }
-
- // GetAssetHistory returns the chain of custody for an asset since issuance.
- async GetAssetHistory(ctx, assetName) {
-
- let resultsIterator = await ctx.stub.getHistoryForKey(assetName);
- let results = await this._GetAllResults(resultsIterator, true);
-
- return JSON.stringify(results);
- }
-
- // AssetExists returns true when asset with given ID exists in world state
- async AssetExists(ctx, assetName) {
- // ==== Check if asset already exists ====
- let assetState = await ctx.stub.getState(assetName);
- return assetState && assetState.length > 0;
- }
-
- // This is JavaScript so without Funcation Decorators, all functions are assumed
- // to be transaction functions
- //
- // For internal functions... prefix them with _
- async _GetAllResults(iterator, isHistory) {
- let allResults = [];
- let res = await iterator.next();
- while (!res.done) {
- if (res.value && res.value.value.toString()) {
- let jsonRes = {};
- console.log(res.value.value.toString('utf8'));
- if (isHistory && isHistory === true) {
- jsonRes.TxId = res.value.txId;
- jsonRes.Timestamp = res.value.timestamp;
- try {
- jsonRes.Value = JSON.parse(res.value.value.toString('utf8'));
- } catch (err) {
- console.log(err);
- jsonRes.Value = res.value.value.toString('utf8');
- }
- } else {
- jsonRes.Key = res.value.key;
- try {
- jsonRes.Record = JSON.parse(res.value.value.toString('utf8'));
- } catch (err) {
- console.log(err);
- jsonRes.Record = res.value.value.toString('utf8');
- }
- }
- allResults.push(jsonRes);
- }
- res = await iterator.next();
- }
- iterator.close();
- return allResults;
- }
-
- // InitLedger creates sample assets in the ledger
- async InitLedger(ctx) {
- const assets = [
- {
- assetID: 'asset1',
- color: 'blue',
- size: 5,
- owner: 'Tom',
- appraisedValue: 100
- },
- {
- assetID: 'asset2',
- color: 'red',
- size: 5,
- owner: 'Brad',
- appraisedValue: 100
- },
- {
- assetID: 'asset3',
- color: 'green',
- size: 10,
- owner: 'Jin Soo',
- appraisedValue: 200
- },
- {
- assetID: 'asset4',
- color: 'yellow',
- size: 10,
- owner: 'Max',
- appraisedValue: 200
- },
- {
- assetID: 'asset5',
- color: 'black',
- size: 15,
- owner: 'Adriana',
- appraisedValue: 250
- },
- {
- assetID: 'asset6',
- color: 'white',
- size: 15,
- owner: 'Michel',
- appraisedValue: 250
- },
- ];
-
- for (const asset of assets) {
- await this.CreateAsset(
- ctx,
- asset.assetID,
- asset.color,
- asset.size,
- asset.owner,
- asset.appraisedValue
- );
- }
- }
-}
-
-module.exports = Chaincode;
diff --git a/asset-transfer-ledger-queries/chaincode-javascript/npm-shrinkwrap.json b/asset-transfer-ledger-queries/chaincode-javascript/npm-shrinkwrap.json
deleted file mode 100644
index 46c74951..00000000
--- a/asset-transfer-ledger-queries/chaincode-javascript/npm-shrinkwrap.json
+++ /dev/null
@@ -1,1733 +0,0 @@
-{
- "name": "asset-transfer-ledger-queries",
- "version": "1.0.0",
- "lockfileVersion": 3,
- "requires": true,
- "packages": {
- "": {
- "name": "asset-transfer-ledger-queries",
- "version": "1.0.0",
- "license": "Apache-2.0",
- "dependencies": {
- "fabric-contract-api": "~2.5",
- "fabric-shim": "~2.5"
- },
- "devDependencies": {
- "eslint": "^8.57.0"
- },
- "engines": {
- "node": ">=18"
- }
- },
- "node_modules/@colors/colors": {
- "version": "1.6.0",
- "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.6.0.tgz",
- "integrity": "sha512-Ir+AOibqzrIsL6ajt3Rz3LskB7OiMVHqltZmspbW/TJuTVuyOMirVqAkjfY6JISiLHgyNqicAC8AyHHGzNd/dA==",
- "engines": {
- "node": ">=0.1.90"
- }
- },
- "node_modules/@dabh/diagnostics": {
- "version": "2.0.3",
- "resolved": "https://registry.npmjs.org/@dabh/diagnostics/-/diagnostics-2.0.3.tgz",
- "integrity": "sha512-hrlQOIi7hAfzsMqlGSFyVucrx38O+j6wiGOf//H2ecvIEqYN4ADBSS2iLMh5UFyDunCNniUIPk/q3riFv45xRA==",
- "dependencies": {
- "colorspace": "1.1.x",
- "enabled": "2.0.x",
- "kuler": "^2.0.0"
- }
- },
- "node_modules/@eslint-community/eslint-utils": {
- "version": "4.4.0",
- "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz",
- "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==",
- "dev": true,
- "dependencies": {
- "eslint-visitor-keys": "^3.3.0"
- },
- "engines": {
- "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
- },
- "peerDependencies": {
- "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0"
- }
- },
- "node_modules/@eslint-community/regexpp": {
- "version": "4.10.1",
- "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.10.1.tgz",
- "integrity": "sha512-Zm2NGpWELsQAD1xsJzGQpYfvICSsFkEpU0jxBjfdC6uNEWXcHnfs9hScFWtXVDVl+rBQJGrl4g1vcKIejpH9dA==",
- "dev": true,
- "engines": {
- "node": "^12.0.0 || ^14.0.0 || >=16.0.0"
- }
- },
- "node_modules/@eslint/eslintrc": {
- "version": "2.1.4",
- "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz",
- "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==",
- "dev": true,
- "dependencies": {
- "ajv": "^6.12.4",
- "debug": "^4.3.2",
- "espree": "^9.6.0",
- "globals": "^13.19.0",
- "ignore": "^5.2.0",
- "import-fresh": "^3.2.1",
- "js-yaml": "^4.1.0",
- "minimatch": "^3.1.2",
- "strip-json-comments": "^3.1.1"
- },
- "engines": {
- "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
- },
- "funding": {
- "url": "https://opencollective.com/eslint"
- }
- },
- "node_modules/@eslint/js": {
- "version": "8.57.0",
- "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.0.tgz",
- "integrity": "sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==",
- "dev": true,
- "engines": {
- "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
- }
- },
- "node_modules/@fidm/asn1": {
- "version": "1.0.4",
- "resolved": "https://registry.npmjs.org/@fidm/asn1/-/asn1-1.0.4.tgz",
- "integrity": "sha512-esd1jyNvRb2HVaQGq2Gg8Z0kbQPXzV9Tq5Z14KNIov6KfFD6PTaRIO8UpcsYiTNzOqJpmyzWgVTrUwFV3UF4TQ==",
- "engines": {
- "node": ">= 8"
- }
- },
- "node_modules/@fidm/x509": {
- "version": "1.2.1",
- "resolved": "https://registry.npmjs.org/@fidm/x509/-/x509-1.2.1.tgz",
- "integrity": "sha512-nwc2iesjyc9hkuzcrMCBXQRn653XuAUKorfWM8PZyJawiy1QzLj4vahwzaI25+pfpwOLvMzbJ0uKpWLDNmo16w==",
- "dependencies": {
- "@fidm/asn1": "^1.0.4",
- "tweetnacl": "^1.0.1"
- },
- "engines": {
- "node": ">= 8"
- }
- },
- "node_modules/@grpc/grpc-js": {
- "version": "1.10.9",
- "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.10.9.tgz",
- "integrity": "sha512-5tcgUctCG0qoNyfChZifz2tJqbRbXVO9J7X6duFcOjY3HUNCxg5D0ZCK7EP9vIcZ0zRpLU9bWkyCqVCLZ46IbQ==",
- "dependencies": {
- "@grpc/proto-loader": "^0.7.13",
- "@js-sdsl/ordered-map": "^4.4.2"
- },
- "engines": {
- "node": ">=12.10.0"
- }
- },
- "node_modules/@grpc/proto-loader": {
- "version": "0.7.13",
- "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.7.13.tgz",
- "integrity": "sha512-AiXO/bfe9bmxBjxxtYxFAXGZvMaN5s8kO+jBHAJCON8rJoB5YS/D6X7ZNc6XQkuHNmyl4CYaMI1fJ/Gn27RGGw==",
- "dependencies": {
- "lodash.camelcase": "^4.3.0",
- "long": "^5.0.0",
- "protobufjs": "^7.2.5",
- "yargs": "^17.7.2"
- },
- "bin": {
- "proto-loader-gen-types": "build/bin/proto-loader-gen-types.js"
- },
- "engines": {
- "node": ">=6"
- }
- },
- "node_modules/@humanwhocodes/config-array": {
- "version": "0.11.14",
- "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz",
- "integrity": "sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==",
- "deprecated": "Use @eslint/config-array instead",
- "dev": true,
- "dependencies": {
- "@humanwhocodes/object-schema": "^2.0.2",
- "debug": "^4.3.1",
- "minimatch": "^3.0.5"
- },
- "engines": {
- "node": ">=10.10.0"
- }
- },
- "node_modules/@humanwhocodes/module-importer": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz",
- "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==",
- "dev": true,
- "engines": {
- "node": ">=12.22"
- },
- "funding": {
- "type": "github",
- "url": "https://github.com/sponsors/nzakas"
- }
- },
- "node_modules/@humanwhocodes/object-schema": {
- "version": "2.0.3",
- "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz",
- "integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==",
- "deprecated": "Use @eslint/object-schema instead",
- "dev": true
- },
- "node_modules/@hyperledger/fabric-protos": {
- "version": "0.2.1",
- "resolved": "https://registry.npmjs.org/@hyperledger/fabric-protos/-/fabric-protos-0.2.1.tgz",
- "integrity": "sha512-qjm0vIQIfCall804tWDeA8p/mUfu14sl5Sj+PbOn2yDKJq+7ThoIhNsLAqf+BCxUfqsoqQq6AojhqQeTFyOOqg==",
- "dependencies": {
- "@grpc/grpc-js": "^1.9.0",
- "google-protobuf": "^3.21.0"
- },
- "engines": {
- "node": ">=14.15.0"
- }
- },
- "node_modules/@js-sdsl/ordered-map": {
- "version": "4.4.2",
- "resolved": "https://registry.npmjs.org/@js-sdsl/ordered-map/-/ordered-map-4.4.2.tgz",
- "integrity": "sha512-iUKgm52T8HOE/makSxjqoWhe95ZJA1/G1sYsGev2JDKUSS14KAgg1LHb+Ba+IPow0xflbnSkOsZcO08C7w1gYw==",
- "funding": {
- "type": "opencollective",
- "url": "https://opencollective.com/js-sdsl"
- }
- },
- "node_modules/@nodelib/fs.scandir": {
- "version": "2.1.5",
- "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz",
- "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==",
- "dev": true,
- "dependencies": {
- "@nodelib/fs.stat": "2.0.5",
- "run-parallel": "^1.1.9"
- },
- "engines": {
- "node": ">= 8"
- }
- },
- "node_modules/@nodelib/fs.stat": {
- "version": "2.0.5",
- "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz",
- "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==",
- "dev": true,
- "engines": {
- "node": ">= 8"
- }
- },
- "node_modules/@nodelib/fs.walk": {
- "version": "1.2.8",
- "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz",
- "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==",
- "dev": true,
- "dependencies": {
- "@nodelib/fs.scandir": "2.1.5",
- "fastq": "^1.6.0"
- },
- "engines": {
- "node": ">= 8"
- }
- },
- "node_modules/@protobufjs/aspromise": {
- "version": "1.1.2",
- "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz",
- "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ=="
- },
- "node_modules/@protobufjs/base64": {
- "version": "1.1.2",
- "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz",
- "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg=="
- },
- "node_modules/@protobufjs/codegen": {
- "version": "2.0.4",
- "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz",
- "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg=="
- },
- "node_modules/@protobufjs/eventemitter": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz",
- "integrity": "sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q=="
- },
- "node_modules/@protobufjs/fetch": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz",
- "integrity": "sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==",
- "dependencies": {
- "@protobufjs/aspromise": "^1.1.1",
- "@protobufjs/inquire": "^1.1.0"
- }
- },
- "node_modules/@protobufjs/float": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz",
- "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ=="
- },
- "node_modules/@protobufjs/inquire": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz",
- "integrity": "sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q=="
- },
- "node_modules/@protobufjs/path": {
- "version": "1.1.2",
- "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz",
- "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA=="
- },
- "node_modules/@protobufjs/pool": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz",
- "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw=="
- },
- "node_modules/@protobufjs/utf8": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz",
- "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw=="
- },
- "node_modules/@types/node": {
- "version": "16.18.98",
- "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.98.tgz",
- "integrity": "sha512-fpiC20NvLpTLAzo3oVBKIqBGR6Fx/8oAK/SSf7G+fydnXMY1x4x9RZ6sBXhqKlCU21g2QapUsbLlhv3+a7wS+Q=="
- },
- "node_modules/@types/triple-beam": {
- "version": "1.3.5",
- "resolved": "https://registry.npmjs.org/@types/triple-beam/-/triple-beam-1.3.5.tgz",
- "integrity": "sha512-6WaYesThRMCl19iryMYP7/x2OVgCtbIVflDGFpWnb9irXI3UjYE4AzmYuiUKY1AJstGijoY+MgUszMgRxIYTYw=="
- },
- "node_modules/@ungap/structured-clone": {
- "version": "1.2.0",
- "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz",
- "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==",
- "dev": true
- },
- "node_modules/acorn": {
- "version": "8.11.3",
- "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz",
- "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==",
- "dev": true,
- "bin": {
- "acorn": "bin/acorn"
- },
- "engines": {
- "node": ">=0.4.0"
- }
- },
- "node_modules/acorn-jsx": {
- "version": "5.3.2",
- "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz",
- "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==",
- "dev": true,
- "peerDependencies": {
- "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0"
- }
- },
- "node_modules/ajv": {
- "version": "6.12.6",
- "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz",
- "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==",
- "dependencies": {
- "fast-deep-equal": "^3.1.1",
- "fast-json-stable-stringify": "^2.0.0",
- "json-schema-traverse": "^0.4.1",
- "uri-js": "^4.2.2"
- },
- "funding": {
- "type": "github",
- "url": "https://github.com/sponsors/epoberezkin"
- }
- },
- "node_modules/ansi-regex": {
- "version": "5.0.1",
- "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
- "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/ansi-styles": {
- "version": "4.3.0",
- "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
- "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
- "dependencies": {
- "color-convert": "^2.0.1"
- },
- "engines": {
- "node": ">=8"
- },
- "funding": {
- "url": "https://github.com/chalk/ansi-styles?sponsor=1"
- }
- },
- "node_modules/argparse": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
- "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==",
- "dev": true
- },
- "node_modules/async": {
- "version": "3.2.5",
- "resolved": "https://registry.npmjs.org/async/-/async-3.2.5.tgz",
- "integrity": "sha512-baNZyqaaLhyLVKm/DlvdW051MSgO6b8eVfIezl9E5PqWxFgzLm/wQntEW4zOytVburDEr0JlALEpdOFwvErLsg=="
- },
- "node_modules/balanced-match": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
- "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==",
- "dev": true
- },
- "node_modules/brace-expansion": {
- "version": "1.1.11",
- "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
- "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
- "dev": true,
- "dependencies": {
- "balanced-match": "^1.0.0",
- "concat-map": "0.0.1"
- }
- },
- "node_modules/callsites": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",
- "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==",
- "dev": true,
- "engines": {
- "node": ">=6"
- }
- },
- "node_modules/chalk": {
- "version": "4.1.2",
- "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
- "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
- "dev": true,
- "dependencies": {
- "ansi-styles": "^4.1.0",
- "supports-color": "^7.1.0"
- },
- "engines": {
- "node": ">=10"
- },
- "funding": {
- "url": "https://github.com/chalk/chalk?sponsor=1"
- }
- },
- "node_modules/class-transformer": {
- "version": "0.4.0",
- "resolved": "https://registry.npmjs.org/class-transformer/-/class-transformer-0.4.0.tgz",
- "integrity": "sha512-ETWD/H2TbWbKEi7m9N4Km5+cw1hNcqJSxlSYhsLsNjQzWWiZIYA1zafxpK9PwVfaZ6AqR5rrjPVUBGESm5tQUA=="
- },
- "node_modules/cliui": {
- "version": "8.0.1",
- "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz",
- "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==",
- "dependencies": {
- "string-width": "^4.2.0",
- "strip-ansi": "^6.0.1",
- "wrap-ansi": "^7.0.0"
- },
- "engines": {
- "node": ">=12"
- }
- },
- "node_modules/color": {
- "version": "3.2.1",
- "resolved": "https://registry.npmjs.org/color/-/color-3.2.1.tgz",
- "integrity": "sha512-aBl7dZI9ENN6fUGC7mWpMTPNHmWUSNan9tuWN6ahh5ZLNk9baLJOnSMlrQkHcrfFgz2/RigjUVAjdx36VcemKA==",
- "dependencies": {
- "color-convert": "^1.9.3",
- "color-string": "^1.6.0"
- }
- },
- "node_modules/color-convert": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
- "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
- "dependencies": {
- "color-name": "~1.1.4"
- },
- "engines": {
- "node": ">=7.0.0"
- }
- },
- "node_modules/color-name": {
- "version": "1.1.4",
- "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
- "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="
- },
- "node_modules/color-string": {
- "version": "1.9.1",
- "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.9.1.tgz",
- "integrity": "sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg==",
- "dependencies": {
- "color-name": "^1.0.0",
- "simple-swizzle": "^0.2.2"
- }
- },
- "node_modules/color/node_modules/color-convert": {
- "version": "1.9.3",
- "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
- "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
- "dependencies": {
- "color-name": "1.1.3"
- }
- },
- "node_modules/color/node_modules/color-name": {
- "version": "1.1.3",
- "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
- "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw=="
- },
- "node_modules/colorspace": {
- "version": "1.1.4",
- "resolved": "https://registry.npmjs.org/colorspace/-/colorspace-1.1.4.tgz",
- "integrity": "sha512-BgvKJiuVu1igBUF2kEjRCZXol6wiiGbY5ipL/oVPwm0BL9sIpMIzM8IK7vwuxIIzOXMV3Ey5w+vxhm0rR/TN8w==",
- "dependencies": {
- "color": "^3.1.3",
- "text-hex": "1.0.x"
- }
- },
- "node_modules/concat-map": {
- "version": "0.0.1",
- "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
- "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==",
- "dev": true
- },
- "node_modules/cross-spawn": {
- "version": "7.0.3",
- "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
- "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==",
- "dev": true,
- "dependencies": {
- "path-key": "^3.1.0",
- "shebang-command": "^2.0.0",
- "which": "^2.0.1"
- },
- "engines": {
- "node": ">= 8"
- }
- },
- "node_modules/debug": {
- "version": "4.3.5",
- "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.5.tgz",
- "integrity": "sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==",
- "dev": true,
- "dependencies": {
- "ms": "2.1.2"
- },
- "engines": {
- "node": ">=6.0"
- },
- "peerDependenciesMeta": {
- "supports-color": {
- "optional": true
- }
- }
- },
- "node_modules/deep-is": {
- "version": "0.1.4",
- "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz",
- "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==",
- "dev": true
- },
- "node_modules/doctrine": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz",
- "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==",
- "dev": true,
- "dependencies": {
- "esutils": "^2.0.2"
- },
- "engines": {
- "node": ">=6.0.0"
- }
- },
- "node_modules/emoji-regex": {
- "version": "8.0.0",
- "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
- "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="
- },
- "node_modules/enabled": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/enabled/-/enabled-2.0.0.tgz",
- "integrity": "sha512-AKrN98kuwOzMIdAizXGI86UFBoo26CL21UM763y1h/GMSJ4/OHU9k2YlsmBpyScFo/wbLzWQJBMCW4+IO3/+OQ=="
- },
- "node_modules/escalade": {
- "version": "3.1.2",
- "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz",
- "integrity": "sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==",
- "engines": {
- "node": ">=6"
- }
- },
- "node_modules/escape-string-regexp": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz",
- "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==",
- "dev": true,
- "engines": {
- "node": ">=10"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/eslint": {
- "version": "8.57.0",
- "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.0.tgz",
- "integrity": "sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==",
- "dev": true,
- "dependencies": {
- "@eslint-community/eslint-utils": "^4.2.0",
- "@eslint-community/regexpp": "^4.6.1",
- "@eslint/eslintrc": "^2.1.4",
- "@eslint/js": "8.57.0",
- "@humanwhocodes/config-array": "^0.11.14",
- "@humanwhocodes/module-importer": "^1.0.1",
- "@nodelib/fs.walk": "^1.2.8",
- "@ungap/structured-clone": "^1.2.0",
- "ajv": "^6.12.4",
- "chalk": "^4.0.0",
- "cross-spawn": "^7.0.2",
- "debug": "^4.3.2",
- "doctrine": "^3.0.0",
- "escape-string-regexp": "^4.0.0",
- "eslint-scope": "^7.2.2",
- "eslint-visitor-keys": "^3.4.3",
- "espree": "^9.6.1",
- "esquery": "^1.4.2",
- "esutils": "^2.0.2",
- "fast-deep-equal": "^3.1.3",
- "file-entry-cache": "^6.0.1",
- "find-up": "^5.0.0",
- "glob-parent": "^6.0.2",
- "globals": "^13.19.0",
- "graphemer": "^1.4.0",
- "ignore": "^5.2.0",
- "imurmurhash": "^0.1.4",
- "is-glob": "^4.0.0",
- "is-path-inside": "^3.0.3",
- "js-yaml": "^4.1.0",
- "json-stable-stringify-without-jsonify": "^1.0.1",
- "levn": "^0.4.1",
- "lodash.merge": "^4.6.2",
- "minimatch": "^3.1.2",
- "natural-compare": "^1.4.0",
- "optionator": "^0.9.3",
- "strip-ansi": "^6.0.1",
- "text-table": "^0.2.0"
- },
- "bin": {
- "eslint": "bin/eslint.js"
- },
- "engines": {
- "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
- },
- "funding": {
- "url": "https://opencollective.com/eslint"
- }
- },
- "node_modules/eslint-scope": {
- "version": "7.2.2",
- "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz",
- "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==",
- "dev": true,
- "dependencies": {
- "esrecurse": "^4.3.0",
- "estraverse": "^5.2.0"
- },
- "engines": {
- "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
- },
- "funding": {
- "url": "https://opencollective.com/eslint"
- }
- },
- "node_modules/eslint-visitor-keys": {
- "version": "3.4.3",
- "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz",
- "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==",
- "dev": true,
- "engines": {
- "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
- },
- "funding": {
- "url": "https://opencollective.com/eslint"
- }
- },
- "node_modules/espree": {
- "version": "9.6.1",
- "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz",
- "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==",
- "dev": true,
- "dependencies": {
- "acorn": "^8.9.0",
- "acorn-jsx": "^5.3.2",
- "eslint-visitor-keys": "^3.4.1"
- },
- "engines": {
- "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
- },
- "funding": {
- "url": "https://opencollective.com/eslint"
- }
- },
- "node_modules/esquery": {
- "version": "1.5.0",
- "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz",
- "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==",
- "dev": true,
- "dependencies": {
- "estraverse": "^5.1.0"
- },
- "engines": {
- "node": ">=0.10"
- }
- },
- "node_modules/esrecurse": {
- "version": "4.3.0",
- "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz",
- "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==",
- "dev": true,
- "dependencies": {
- "estraverse": "^5.2.0"
- },
- "engines": {
- "node": ">=4.0"
- }
- },
- "node_modules/estraverse": {
- "version": "5.3.0",
- "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz",
- "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==",
- "dev": true,
- "engines": {
- "node": ">=4.0"
- }
- },
- "node_modules/esutils": {
- "version": "2.0.3",
- "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz",
- "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==",
- "dev": true,
- "engines": {
- "node": ">=0.10.0"
- }
- },
- "node_modules/fabric-contract-api": {
- "version": "2.5.6",
- "resolved": "https://registry.npmjs.org/fabric-contract-api/-/fabric-contract-api-2.5.6.tgz",
- "integrity": "sha512-AosGb8tA+Jgt+pqMEgYNB3/J/P5QuWOC7yhXbhDmAAwUzn4Sc7pdWDICH1YyrFGZNFxMGQmqJmLVWUX8BKHy0w==",
- "dependencies": {
- "class-transformer": "^0.4.0",
- "fabric-shim-api": "2.5.6",
- "fast-safe-stringify": "^2.1.1",
- "get-params": "^0.1.2",
- "reflect-metadata": "^0.1.13",
- "winston": "^3.7.2"
- },
- "engines": {
- "node": ">=18"
- }
- },
- "node_modules/fabric-shim": {
- "version": "2.5.6",
- "resolved": "https://registry.npmjs.org/fabric-shim/-/fabric-shim-2.5.6.tgz",
- "integrity": "sha512-4Y8WNFhYuQ9QYSEgPXWdlXnrXjwOlM10sQQzE4kJ7cDh8a4LX0rn44FxtxTCB18lnzrSLMZ8/8Cr5m0c9NeXWA==",
- "dependencies": {
- "@fidm/x509": "^1.2.1",
- "@grpc/grpc-js": "~1.10.9",
- "@hyperledger/fabric-protos": "~0.2.1",
- "@types/node": "^16.11.1",
- "ajv": "^6.12.2",
- "fabric-contract-api": "2.5.6",
- "fabric-shim-api": "2.5.6",
- "fast-safe-stringify": "^2.1.1",
- "long": "^5.2.3",
- "reflect-metadata": "^0.1.13",
- "winston": "^3.7.2",
- "yargs": "^17.4.0",
- "yargs-parser": "^21.0.1"
- },
- "bin": {
- "fabric-chaincode-node": "cli.js"
- },
- "engines": {
- "node": ">=18"
- }
- },
- "node_modules/fabric-shim-api": {
- "version": "2.5.6",
- "resolved": "https://registry.npmjs.org/fabric-shim-api/-/fabric-shim-api-2.5.6.tgz",
- "integrity": "sha512-1L0nO7CJ31/gEOWKWHEeCqgB5HkqPVfRbpcS7L9eTscT7tffjg2OkZISvC+a7RiqihL0iyrXNBgBg5MwlSSN9g==",
- "engines": {
- "eslint": "^6.6.0",
- "node": ">=18"
- }
- },
- "node_modules/fast-deep-equal": {
- "version": "3.1.3",
- "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
- "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q=="
- },
- "node_modules/fast-json-stable-stringify": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz",
- "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw=="
- },
- "node_modules/fast-levenshtein": {
- "version": "2.0.6",
- "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz",
- "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==",
- "dev": true
- },
- "node_modules/fast-safe-stringify": {
- "version": "2.1.1",
- "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz",
- "integrity": "sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA=="
- },
- "node_modules/fastq": {
- "version": "1.17.1",
- "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz",
- "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==",
- "dev": true,
- "dependencies": {
- "reusify": "^1.0.4"
- }
- },
- "node_modules/fecha": {
- "version": "4.2.3",
- "resolved": "https://registry.npmjs.org/fecha/-/fecha-4.2.3.tgz",
- "integrity": "sha512-OP2IUU6HeYKJi3i0z4A19kHMQoLVs4Hc+DPqqxI2h/DPZHTm/vjsfC6P0b4jCMy14XizLBqvndQ+UilD7707Jw=="
- },
- "node_modules/file-entry-cache": {
- "version": "6.0.1",
- "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz",
- "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==",
- "dev": true,
- "dependencies": {
- "flat-cache": "^3.0.4"
- },
- "engines": {
- "node": "^10.12.0 || >=12.0.0"
- }
- },
- "node_modules/find-up": {
- "version": "5.0.0",
- "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz",
- "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==",
- "dev": true,
- "dependencies": {
- "locate-path": "^6.0.0",
- "path-exists": "^4.0.0"
- },
- "engines": {
- "node": ">=10"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/flat-cache": {
- "version": "3.2.0",
- "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz",
- "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==",
- "dev": true,
- "dependencies": {
- "flatted": "^3.2.9",
- "keyv": "^4.5.3",
- "rimraf": "^3.0.2"
- },
- "engines": {
- "node": "^10.12.0 || >=12.0.0"
- }
- },
- "node_modules/flatted": {
- "version": "3.3.1",
- "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.1.tgz",
- "integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==",
- "dev": true
- },
- "node_modules/fn.name": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/fn.name/-/fn.name-1.1.0.tgz",
- "integrity": "sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw=="
- },
- "node_modules/fs.realpath": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
- "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==",
- "dev": true
- },
- "node_modules/get-caller-file": {
- "version": "2.0.5",
- "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz",
- "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==",
- "engines": {
- "node": "6.* || 8.* || >= 10.*"
- }
- },
- "node_modules/get-params": {
- "version": "0.1.2",
- "resolved": "https://registry.npmjs.org/get-params/-/get-params-0.1.2.tgz",
- "integrity": "sha512-41eOxtlGgHQRbFyA8KTH+w+32Em3cRdfBud7j67ulzmIfmaHX9doq47s0fa4P5o9H64BZX9nrYI6sJvk46Op+Q=="
- },
- "node_modules/glob": {
- "version": "7.2.3",
- "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz",
- "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==",
- "deprecated": "Glob versions prior to v9 are no longer supported",
- "dev": true,
- "dependencies": {
- "fs.realpath": "^1.0.0",
- "inflight": "^1.0.4",
- "inherits": "2",
- "minimatch": "^3.1.1",
- "once": "^1.3.0",
- "path-is-absolute": "^1.0.0"
- },
- "engines": {
- "node": "*"
- },
- "funding": {
- "url": "https://github.com/sponsors/isaacs"
- }
- },
- "node_modules/glob-parent": {
- "version": "6.0.2",
- "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz",
- "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==",
- "dev": true,
- "dependencies": {
- "is-glob": "^4.0.3"
- },
- "engines": {
- "node": ">=10.13.0"
- }
- },
- "node_modules/globals": {
- "version": "13.24.0",
- "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz",
- "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==",
- "dev": true,
- "dependencies": {
- "type-fest": "^0.20.2"
- },
- "engines": {
- "node": ">=8"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/google-protobuf": {
- "version": "3.21.2",
- "resolved": "https://registry.npmjs.org/google-protobuf/-/google-protobuf-3.21.2.tgz",
- "integrity": "sha512-3MSOYFO5U9mPGikIYCzK0SaThypfGgS6bHqrUGXG3DPHCrb+txNqeEcns1W0lkGfk0rCyNXm7xB9rMxnCiZOoA=="
- },
- "node_modules/graphemer": {
- "version": "1.4.0",
- "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz",
- "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==",
- "dev": true
- },
- "node_modules/has-flag": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
- "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
- "dev": true,
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/ignore": {
- "version": "5.3.1",
- "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz",
- "integrity": "sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==",
- "dev": true,
- "engines": {
- "node": ">= 4"
- }
- },
- "node_modules/import-fresh": {
- "version": "3.3.0",
- "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz",
- "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==",
- "dev": true,
- "dependencies": {
- "parent-module": "^1.0.0",
- "resolve-from": "^4.0.0"
- },
- "engines": {
- "node": ">=6"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/imurmurhash": {
- "version": "0.1.4",
- "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz",
- "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==",
- "dev": true,
- "engines": {
- "node": ">=0.8.19"
- }
- },
- "node_modules/inflight": {
- "version": "1.0.6",
- "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
- "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==",
- "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.",
- "dev": true,
- "dependencies": {
- "once": "^1.3.0",
- "wrappy": "1"
- }
- },
- "node_modules/inherits": {
- "version": "2.0.4",
- "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
- "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
- },
- "node_modules/is-arrayish": {
- "version": "0.3.2",
- "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz",
- "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ=="
- },
- "node_modules/is-extglob": {
- "version": "2.1.1",
- "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
- "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==",
- "dev": true,
- "engines": {
- "node": ">=0.10.0"
- }
- },
- "node_modules/is-fullwidth-code-point": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
- "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/is-glob": {
- "version": "4.0.3",
- "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz",
- "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==",
- "dev": true,
- "dependencies": {
- "is-extglob": "^2.1.1"
- },
- "engines": {
- "node": ">=0.10.0"
- }
- },
- "node_modules/is-path-inside": {
- "version": "3.0.3",
- "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz",
- "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==",
- "dev": true,
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/is-stream": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz",
- "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==",
- "engines": {
- "node": ">=8"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/isexe": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
- "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==",
- "dev": true
- },
- "node_modules/js-yaml": {
- "version": "4.1.0",
- "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz",
- "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==",
- "dev": true,
- "dependencies": {
- "argparse": "^2.0.1"
- },
- "bin": {
- "js-yaml": "bin/js-yaml.js"
- }
- },
- "node_modules/json-buffer": {
- "version": "3.0.1",
- "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz",
- "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==",
- "dev": true
- },
- "node_modules/json-schema-traverse": {
- "version": "0.4.1",
- "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz",
- "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg=="
- },
- "node_modules/json-stable-stringify-without-jsonify": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz",
- "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==",
- "dev": true
- },
- "node_modules/keyv": {
- "version": "4.5.4",
- "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz",
- "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==",
- "dev": true,
- "dependencies": {
- "json-buffer": "3.0.1"
- }
- },
- "node_modules/kuler": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/kuler/-/kuler-2.0.0.tgz",
- "integrity": "sha512-Xq9nH7KlWZmXAtodXDDRE7vs6DU1gTU8zYDHDiWLSip45Egwq3plLHzPn27NgvzL2r1LMPC1vdqh98sQxtqj4A=="
- },
- "node_modules/levn": {
- "version": "0.4.1",
- "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz",
- "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==",
- "dev": true,
- "dependencies": {
- "prelude-ls": "^1.2.1",
- "type-check": "~0.4.0"
- },
- "engines": {
- "node": ">= 0.8.0"
- }
- },
- "node_modules/locate-path": {
- "version": "6.0.0",
- "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz",
- "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==",
- "dev": true,
- "dependencies": {
- "p-locate": "^5.0.0"
- },
- "engines": {
- "node": ">=10"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/lodash.camelcase": {
- "version": "4.3.0",
- "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz",
- "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA=="
- },
- "node_modules/lodash.merge": {
- "version": "4.6.2",
- "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz",
- "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==",
- "dev": true
- },
- "node_modules/logform": {
- "version": "2.6.0",
- "resolved": "https://registry.npmjs.org/logform/-/logform-2.6.0.tgz",
- "integrity": "sha512-1ulHeNPp6k/LD8H91o7VYFBng5i1BDE7HoKxVbZiGFidS1Rj65qcywLxX+pVfAPoQJEjRdvKcusKwOupHCVOVQ==",
- "dependencies": {
- "@colors/colors": "1.6.0",
- "@types/triple-beam": "^1.3.2",
- "fecha": "^4.2.0",
- "ms": "^2.1.1",
- "safe-stable-stringify": "^2.3.1",
- "triple-beam": "^1.3.0"
- },
- "engines": {
- "node": ">= 12.0.0"
- }
- },
- "node_modules/long": {
- "version": "5.2.3",
- "resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz",
- "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q=="
- },
- "node_modules/minimatch": {
- "version": "3.1.2",
- "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
- "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
- "dev": true,
- "dependencies": {
- "brace-expansion": "^1.1.7"
- },
- "engines": {
- "node": "*"
- }
- },
- "node_modules/ms": {
- "version": "2.1.2",
- "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
- "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
- },
- "node_modules/natural-compare": {
- "version": "1.4.0",
- "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz",
- "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==",
- "dev": true
- },
- "node_modules/once": {
- "version": "1.4.0",
- "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
- "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==",
- "dev": true,
- "dependencies": {
- "wrappy": "1"
- }
- },
- "node_modules/one-time": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/one-time/-/one-time-1.0.0.tgz",
- "integrity": "sha512-5DXOiRKwuSEcQ/l0kGCF6Q3jcADFv5tSmRaJck/OqkVFcOzutB134KRSfF0xDrL39MNnqxbHBbUUcjZIhTgb2g==",
- "dependencies": {
- "fn.name": "1.x.x"
- }
- },
- "node_modules/optionator": {
- "version": "0.9.4",
- "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz",
- "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==",
- "dev": true,
- "dependencies": {
- "deep-is": "^0.1.3",
- "fast-levenshtein": "^2.0.6",
- "levn": "^0.4.1",
- "prelude-ls": "^1.2.1",
- "type-check": "^0.4.0",
- "word-wrap": "^1.2.5"
- },
- "engines": {
- "node": ">= 0.8.0"
- }
- },
- "node_modules/p-limit": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz",
- "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==",
- "dev": true,
- "dependencies": {
- "yocto-queue": "^0.1.0"
- },
- "engines": {
- "node": ">=10"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/p-locate": {
- "version": "5.0.0",
- "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz",
- "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==",
- "dev": true,
- "dependencies": {
- "p-limit": "^3.0.2"
- },
- "engines": {
- "node": ">=10"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/parent-module": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz",
- "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==",
- "dev": true,
- "dependencies": {
- "callsites": "^3.0.0"
- },
- "engines": {
- "node": ">=6"
- }
- },
- "node_modules/path-exists": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz",
- "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==",
- "dev": true,
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/path-is-absolute": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
- "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==",
- "dev": true,
- "engines": {
- "node": ">=0.10.0"
- }
- },
- "node_modules/path-key": {
- "version": "3.1.1",
- "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz",
- "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==",
- "dev": true,
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/prelude-ls": {
- "version": "1.2.1",
- "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz",
- "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==",
- "dev": true,
- "engines": {
- "node": ">= 0.8.0"
- }
- },
- "node_modules/protobufjs": {
- "version": "7.3.2",
- "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.3.2.tgz",
- "integrity": "sha512-RXyHaACeqXeqAKGLDl68rQKbmObRsTIn4TYVUUug1KfS47YWCo5MacGITEryugIgZqORCvJWEk4l449POg5Txg==",
- "hasInstallScript": true,
- "dependencies": {
- "@protobufjs/aspromise": "^1.1.2",
- "@protobufjs/base64": "^1.1.2",
- "@protobufjs/codegen": "^2.0.4",
- "@protobufjs/eventemitter": "^1.1.0",
- "@protobufjs/fetch": "^1.1.0",
- "@protobufjs/float": "^1.0.2",
- "@protobufjs/inquire": "^1.1.0",
- "@protobufjs/path": "^1.1.2",
- "@protobufjs/pool": "^1.1.0",
- "@protobufjs/utf8": "^1.1.0",
- "@types/node": ">=13.7.0",
- "long": "^5.0.0"
- },
- "engines": {
- "node": ">=12.0.0"
- }
- },
- "node_modules/punycode": {
- "version": "2.3.1",
- "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz",
- "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==",
- "engines": {
- "node": ">=6"
- }
- },
- "node_modules/queue-microtask": {
- "version": "1.2.3",
- "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz",
- "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==",
- "dev": true,
- "funding": [
- {
- "type": "github",
- "url": "https://github.com/sponsors/feross"
- },
- {
- "type": "patreon",
- "url": "https://www.patreon.com/feross"
- },
- {
- "type": "consulting",
- "url": "https://feross.org/support"
- }
- ]
- },
- "node_modules/readable-stream": {
- "version": "3.6.2",
- "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz",
- "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==",
- "dependencies": {
- "inherits": "^2.0.3",
- "string_decoder": "^1.1.1",
- "util-deprecate": "^1.0.1"
- },
- "engines": {
- "node": ">= 6"
- }
- },
- "node_modules/reflect-metadata": {
- "version": "0.1.14",
- "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.1.14.tgz",
- "integrity": "sha512-ZhYeb6nRaXCfhnndflDK8qI6ZQ/YcWZCISRAWICW9XYqMUwjZM9Z0DveWX/ABN01oxSHwVxKQmxeYZSsm0jh5A=="
- },
- "node_modules/require-directory": {
- "version": "2.1.1",
- "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz",
- "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==",
- "engines": {
- "node": ">=0.10.0"
- }
- },
- "node_modules/resolve-from": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz",
- "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==",
- "dev": true,
- "engines": {
- "node": ">=4"
- }
- },
- "node_modules/reusify": {
- "version": "1.0.4",
- "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz",
- "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==",
- "dev": true,
- "engines": {
- "iojs": ">=1.0.0",
- "node": ">=0.10.0"
- }
- },
- "node_modules/rimraf": {
- "version": "3.0.2",
- "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz",
- "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==",
- "deprecated": "Rimraf versions prior to v4 are no longer supported",
- "dev": true,
- "dependencies": {
- "glob": "^7.1.3"
- },
- "bin": {
- "rimraf": "bin.js"
- },
- "funding": {
- "url": "https://github.com/sponsors/isaacs"
- }
- },
- "node_modules/run-parallel": {
- "version": "1.2.0",
- "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz",
- "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==",
- "dev": true,
- "funding": [
- {
- "type": "github",
- "url": "https://github.com/sponsors/feross"
- },
- {
- "type": "patreon",
- "url": "https://www.patreon.com/feross"
- },
- {
- "type": "consulting",
- "url": "https://feross.org/support"
- }
- ],
- "dependencies": {
- "queue-microtask": "^1.2.2"
- }
- },
- "node_modules/safe-buffer": {
- "version": "5.2.1",
- "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
- "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
- "funding": [
- {
- "type": "github",
- "url": "https://github.com/sponsors/feross"
- },
- {
- "type": "patreon",
- "url": "https://www.patreon.com/feross"
- },
- {
- "type": "consulting",
- "url": "https://feross.org/support"
- }
- ]
- },
- "node_modules/safe-stable-stringify": {
- "version": "2.4.3",
- "resolved": "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-2.4.3.tgz",
- "integrity": "sha512-e2bDA2WJT0wxseVd4lsDP4+3ONX6HpMXQa1ZhFQ7SU+GjvORCmShbCMltrtIDfkYhVHrOcPtj+KhmDBdPdZD1g==",
- "engines": {
- "node": ">=10"
- }
- },
- "node_modules/shebang-command": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz",
- "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==",
- "dev": true,
- "dependencies": {
- "shebang-regex": "^3.0.0"
- },
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/shebang-regex": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz",
- "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==",
- "dev": true,
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/simple-swizzle": {
- "version": "0.2.2",
- "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz",
- "integrity": "sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==",
- "dependencies": {
- "is-arrayish": "^0.3.1"
- }
- },
- "node_modules/stack-trace": {
- "version": "0.0.10",
- "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz",
- "integrity": "sha512-KGzahc7puUKkzyMt+IqAep+TVNbKP+k2Lmwhub39m1AsTSkaDutx56aDCo+HLDzf/D26BIHTJWNiTG1KAJiQCg==",
- "engines": {
- "node": "*"
- }
- },
- "node_modules/string_decoder": {
- "version": "1.3.0",
- "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz",
- "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==",
- "dependencies": {
- "safe-buffer": "~5.2.0"
- }
- },
- "node_modules/string-width": {
- "version": "4.2.3",
- "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
- "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
- "dependencies": {
- "emoji-regex": "^8.0.0",
- "is-fullwidth-code-point": "^3.0.0",
- "strip-ansi": "^6.0.1"
- },
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/strip-ansi": {
- "version": "6.0.1",
- "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
- "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
- "dependencies": {
- "ansi-regex": "^5.0.1"
- },
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/strip-json-comments": {
- "version": "3.1.1",
- "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz",
- "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==",
- "dev": true,
- "engines": {
- "node": ">=8"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/supports-color": {
- "version": "7.2.0",
- "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
- "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
- "dev": true,
- "dependencies": {
- "has-flag": "^4.0.0"
- },
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/text-hex": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/text-hex/-/text-hex-1.0.0.tgz",
- "integrity": "sha512-uuVGNWzgJ4yhRaNSiubPY7OjISw4sw4E5Uv0wbjp+OzcbmVU/rsT8ujgcXJhn9ypzsgr5vlzpPqP+MBBKcGvbg=="
- },
- "node_modules/text-table": {
- "version": "0.2.0",
- "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz",
- "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==",
- "dev": true
- },
- "node_modules/triple-beam": {
- "version": "1.4.1",
- "resolved": "https://registry.npmjs.org/triple-beam/-/triple-beam-1.4.1.tgz",
- "integrity": "sha512-aZbgViZrg1QNcG+LULa7nhZpJTZSLm/mXnHXnbAbjmN5aSa0y7V+wvv6+4WaBtpISJzThKy+PIPxc1Nq1EJ9mg==",
- "engines": {
- "node": ">= 14.0.0"
- }
- },
- "node_modules/tweetnacl": {
- "version": "1.0.3",
- "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz",
- "integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw=="
- },
- "node_modules/type-check": {
- "version": "0.4.0",
- "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz",
- "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==",
- "dev": true,
- "dependencies": {
- "prelude-ls": "^1.2.1"
- },
- "engines": {
- "node": ">= 0.8.0"
- }
- },
- "node_modules/type-fest": {
- "version": "0.20.2",
- "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz",
- "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==",
- "dev": true,
- "engines": {
- "node": ">=10"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/uri-js": {
- "version": "4.4.1",
- "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz",
- "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==",
- "dependencies": {
- "punycode": "^2.1.0"
- }
- },
- "node_modules/util-deprecate": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
- "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw=="
- },
- "node_modules/which": {
- "version": "2.0.2",
- "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
- "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
- "dev": true,
- "dependencies": {
- "isexe": "^2.0.0"
- },
- "bin": {
- "node-which": "bin/node-which"
- },
- "engines": {
- "node": ">= 8"
- }
- },
- "node_modules/winston": {
- "version": "3.13.0",
- "resolved": "https://registry.npmjs.org/winston/-/winston-3.13.0.tgz",
- "integrity": "sha512-rwidmA1w3SE4j0E5MuIufFhyJPBDG7Nu71RkZor1p2+qHvJSZ9GYDA81AyleQcZbh/+V6HjeBdfnTZJm9rSeQQ==",
- "dependencies": {
- "@colors/colors": "^1.6.0",
- "@dabh/diagnostics": "^2.0.2",
- "async": "^3.2.3",
- "is-stream": "^2.0.0",
- "logform": "^2.4.0",
- "one-time": "^1.0.0",
- "readable-stream": "^3.4.0",
- "safe-stable-stringify": "^2.3.1",
- "stack-trace": "0.0.x",
- "triple-beam": "^1.3.0",
- "winston-transport": "^4.7.0"
- },
- "engines": {
- "node": ">= 12.0.0"
- }
- },
- "node_modules/winston-transport": {
- "version": "4.7.0",
- "resolved": "https://registry.npmjs.org/winston-transport/-/winston-transport-4.7.0.tgz",
- "integrity": "sha512-ajBj65K5I7denzer2IYW6+2bNIVqLGDHqDw3Ow8Ohh+vdW+rv4MZ6eiDvHoKhfJFZ2auyN8byXieDDJ96ViONg==",
- "dependencies": {
- "logform": "^2.3.2",
- "readable-stream": "^3.6.0",
- "triple-beam": "^1.3.0"
- },
- "engines": {
- "node": ">= 12.0.0"
- }
- },
- "node_modules/word-wrap": {
- "version": "1.2.5",
- "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz",
- "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==",
- "dev": true,
- "engines": {
- "node": ">=0.10.0"
- }
- },
- "node_modules/wrap-ansi": {
- "version": "7.0.0",
- "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
- "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==",
- "dependencies": {
- "ansi-styles": "^4.0.0",
- "string-width": "^4.1.0",
- "strip-ansi": "^6.0.0"
- },
- "engines": {
- "node": ">=10"
- },
- "funding": {
- "url": "https://github.com/chalk/wrap-ansi?sponsor=1"
- }
- },
- "node_modules/wrappy": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
- "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==",
- "dev": true
- },
- "node_modules/y18n": {
- "version": "5.0.8",
- "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz",
- "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==",
- "engines": {
- "node": ">=10"
- }
- },
- "node_modules/yargs": {
- "version": "17.7.2",
- "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz",
- "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==",
- "dependencies": {
- "cliui": "^8.0.1",
- "escalade": "^3.1.1",
- "get-caller-file": "^2.0.5",
- "require-directory": "^2.1.1",
- "string-width": "^4.2.3",
- "y18n": "^5.0.5",
- "yargs-parser": "^21.1.1"
- },
- "engines": {
- "node": ">=12"
- }
- },
- "node_modules/yargs-parser": {
- "version": "21.1.1",
- "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz",
- "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==",
- "engines": {
- "node": ">=12"
- }
- },
- "node_modules/yocto-queue": {
- "version": "0.1.0",
- "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz",
- "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==",
- "dev": true,
- "engines": {
- "node": ">=10"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- }
- }
-}
diff --git a/asset-transfer-ledger-queries/chaincode-javascript/package.json b/asset-transfer-ledger-queries/chaincode-javascript/package.json
deleted file mode 100644
index 384069fa..00000000
--- a/asset-transfer-ledger-queries/chaincode-javascript/package.json
+++ /dev/null
@@ -1,23 +0,0 @@
-{
- "name": "asset-transfer-ledger-queries",
- "version": "1.0.0",
- "description": "asset chaincode implemented in node.js",
- "main": "index.js",
- "engines": {
- "node": ">=18"
- },
- "scripts": {
- "start": "fabric-chaincode-node start",
- "lint": "eslint *.js */**.js",
- "test": ""
- },
- "engine-strict": true,
- "license": "Apache-2.0",
- "dependencies": {
- "fabric-contract-api": "~2.5",
- "fabric-shim": "~2.5"
- },
- "devDependencies": {
- "eslint": "^8.57.0"
- }
-}
diff --git a/asset-transfer-private-data/README.md b/asset-transfer-private-data/README.md
deleted file mode 100644
index 0df860a8..00000000
--- a/asset-transfer-private-data/README.md
+++ /dev/null
@@ -1,79 +0,0 @@
-# Asset transfer private data sample
-
-The asset transfer private data sample demonstrates:
-
-- Usage of organization private data collections
-- Read data from the organization private data collection.
-- Store data in organization private data collection.
-
-For more information about private data, visit the
-[Private Data](https://hyperledger-fabric.readthedocs.io/en/latest/private-data-arch.html)
-page in the Fabric documentation.
-
-## About the sample
-
-This sample includes smart contract and application code in multiple languages. In a use-case similar to basic asset transfer (see [asset-transfer-basic](../asset-transfer-basic) folder) this sample shows sending and receiving of asset along with its private data owned by organizations during create / delete of an asset , and during transfer of an asset to a new owner.
-
-### Application
-
-Please refer the below link to understand the application flow.
-https://hyperledger-fabric.readthedocs.io/en/latest/private-data/private-data.html#example-scenario-asset-transfer-using-private-data-collections
-
-### Smart Contract
-
-The smart contract (in folder `chaincode-xyz`) implements the following functions to support the application:
-
-CreateAsset
-AgreeToTransfer
-TransferAsset
-DeleteAsset
-DeleteTranferAgreement
-
-ReadAsset
-ReadAssetPrivateDetails
-ReadTransferAgreement
-GetAssetByRange
-QueryAssetByOwner
-QueryAssets
-getQueryResultForQueryString
-
-## Running the sample
-
-Like other samples, the Fabric test network is used to deploy and run this sample. Follow these steps in order:
-
-1. Create the test network and a channel (from the `test-network` folder).
- ```
- ./network.sh up createChannel -c mychannel -ca
- ```
-
-2. Deploy one of the smart contract implementations (from the `test-network` folder).
- ```
- # To deploy the Java chaincode implementation
- ./network.sh deployCC -ccn private -ccp ../asset-transfer-private-data/chaincode-java -ccl java -ccep "OR('Org1MSP.peer','Org2MSP.peer')" -cccg '../asset-transfer-private-data/chaincode-java/collections_config.json' -ccep "OR('Org1MSP.peer','Org2MSP.peer')"
-
- # To deploy the go chaincode implementation
- ./network.sh deployCC -ccn private -ccp ../asset-transfer-private-data/chaincode-go -ccl go -ccep "OR('Org1MSP.peer','Org2MSP.peer')" -cccg '../asset-transfer-private-data/chaincode-go/collections_config.json' -ccep "OR('Org1MSP.peer','Org2MSP.peer')"
-
- # To deploy the typescript chaincode implementation
- ./network.sh deployCC -ccn private -ccp ../asset-transfer-private-data/chaincode-typescript/ -ccl typescript -ccep "OR('Org1MSP.peer','Org2MSP.peer')" -cccg ../asset-transfer-private-data/chaincode-typescript/collections_config.json
- ```
-
-3. Run the application (from the `asset-transfer-private-data` folder).
- ```
- # To run the Typescript sample application
- cd application-gateway-typescript
- npm install
- npm start
-
- # To run the Go sample application
- cd application-gateway-go
- go run .
- ```
-
-## Clean up
-
-When you are finished, you can bring down the test network (from the `test-network` folder). The command will remove all the nodes of the test network, and delete any ledger data that you created.
-
-```
-./network.sh down
-```
diff --git a/asset-transfer-private-data/application-gateway-go/app.go b/asset-transfer-private-data/application-gateway-go/app.go
deleted file mode 100644
index 5274e3ab..00000000
--- a/asset-transfer-private-data/application-gateway-go/app.go
+++ /dev/null
@@ -1,398 +0,0 @@
-/*
-Copyright 2024 IBM All Rights Reserved.
-
-SPDX-License-Identifier: Apache-2.0
-*/
-
-package main
-
-import (
- "bytes"
- "encoding/json"
- "errors"
- "fmt"
- "strings"
- "time"
-
- "github.com/hyperledger/fabric-gateway/pkg/client"
- "github.com/hyperledger/fabric-gateway/pkg/hash"
- "github.com/hyperledger/fabric-protos-go-apiv2/gateway"
- "google.golang.org/grpc/status"
-)
-
-type transient = map[string][]byte
-
-const (
- channelName = "mychannel"
- chaincodeName = "private"
- mspIDOrg1 = "Org1MSP"
- mspIDOrg2 = "Org2MSP"
-
- // Collection names.
- org1PrivateCollectionName = "Org1MSPPrivateCollection"
- org2PrivateCollectionName = "Org2MSPPrivateCollection"
-
- Red = "\033[31m"
- Reset = "\033[0m"
-)
-
-// Use a unique key so that we can run multiple times.
-var now = time.Now()
-var assetID1 = fmt.Sprintf("asset%d", now.Unix())
-var assetID2 = fmt.Sprintf("asset%d", now.Unix()+1)
-
-func main() {
- clientOrg1 := newGrpcConnection(
- tlsCertPathOrg1,
- peerEndpointOrg1,
- peerNameOrg1,
- )
- defer clientOrg1.Close()
-
- gatewayOrg1, err := client.Connect(
- newIdentity(certDirectoryPathOrg1, mspIDOrg1),
- client.WithSign(newSign(keyDirectoryPathOrg1)),
- client.WithClientConnection(clientOrg1),
- client.WithHash(hash.SHA256),
- )
- if err != nil {
- panic(err)
- }
- defer gatewayOrg1.Close()
-
- clientOrg2 := newGrpcConnection(
- tlsCertPathOrg2,
- peerEndpointOrg2,
- peerNameOrg2,
- )
- defer clientOrg2.Close()
-
- gatewayOrg2, err := client.Connect(
- newIdentity(certDirectoryPathOrg2, mspIDOrg2),
- client.WithSign(newSign(keyDirectoryPathOrg2)),
- client.WithClientConnection(clientOrg2),
- client.WithHash(hash.SHA256),
- )
- if err != nil {
- panic(err)
- }
- defer gatewayOrg2.Close()
-
- // Get the smart contract as an Org1 client.
- contractOrg1 := gatewayOrg1.GetNetwork(channelName).GetContract(chaincodeName)
-
- // Get the smart contract as an Org1 client.
- contractOrg2 := gatewayOrg2.GetNetwork(channelName).GetContract(chaincodeName)
-
- fmt.Println("~~~~~~~~~~~~~~~~ As Org1 Client ~~~~~~~~~~~~~~~~")
-
- // Create new assets on the ledger.
- createAssets(contractOrg1)
-
- // Read asset from the Org1's private data collection with ID in the given range.
- getAssetByRange(contractOrg1)
-
- // Attempt to transfer asset without prior approval from Org2, transaction expected to fail.
- fmt.Println("\nAttempt TransferAsset without prior AgreeToTransfer")
- err = transferAsset(contractOrg1, assetID1)
- if err == nil {
- doFail("TransferAsset transaction succeeded when it was expected to fail")
- }
- fmt.Printf("*** Received expected error: %+v\n", errorWithDetails(err))
-
- fmt.Println("\n~~~~~~~~~~~~~~~~ As Org2 Client ~~~~~~~~~~~~~~~~")
-
- // Read the asset by ID.
- readAssetByID(contractOrg2, assetID1)
-
- // Make agreement to transfer the asset from Org1 to Org2.
- agreeToTransfer(contractOrg2, assetID1)
-
- fmt.Println("\n~~~~~~~~~~~~~~~~ As Org1 Client ~~~~~~~~~~~~~~~~")
-
- // Read transfer agreement.
- readTransferAgreement(contractOrg1, assetID1)
-
- // Transfer asset to Org2.
- if err := transferAsset(contractOrg1, assetID1); err != nil {
- doFail(fmt.Sprintf("TransferAsset transaction failed when it was expected to succeed: %+v\n", errorWithDetails(err)))
- }
-
- // Again ReadAsset: results will show that the buyer identity now owns the asset.
- readAssetByID(contractOrg1, assetID1)
-
- // Confirm that transfer removed the private details from the Org1 collection.
- org1ReadSuccess := readAssetPrivateDetails(contractOrg1, assetID1, org1PrivateCollectionName)
- if org1ReadSuccess {
- doFail(fmt.Sprintf("Asset private data still exists in %s", org1PrivateCollectionName))
- }
-
- fmt.Println("\n~~~~~~~~~~~~~~~~ As Org2 Client ~~~~~~~~~~~~~~~~")
-
- // Org2 can read asset private details: Org2 is owner, and private details exist in new owner's Collection.
- org2ReadSuccess := readAssetPrivateDetails(contractOrg2, assetID1, org2PrivateCollectionName)
- if !org2ReadSuccess {
- doFail(fmt.Sprintf("Asset private data not found in %s", org2PrivateCollectionName))
- }
-
- fmt.Println("\nAttempt DeleteAsset using non-owner organization")
- err = deleteAsset(contractOrg2, assetID2)
- if err == nil {
- doFail("DeleteAsset transaction succeeded when it was expected to fail")
- }
- fmt.Printf("*** Received expected error: %+v\n", errorWithDetails(err))
-
- fmt.Println("\n~~~~~~~~~~~~~~~~ As Org1 Client ~~~~~~~~~~~~~~~~")
-
- // Delete AssetID2 as Org1.
- if err := deleteAsset(contractOrg1, assetID2); err != nil {
- doFail(fmt.Sprintf("DeleteAsset transaction failed when it was expected to succeed: %+v\n", errorWithDetails(err)))
- }
-
- // Trigger a purge of the private data for the asset.
- // The previous delete is optional if purge is used.
- if err := purgeAsset(contractOrg1, assetID2); err != nil {
- doFail(fmt.Sprintf("PurgeAsset transaction failed when it was expected to succeed: %+v\n", errorWithDetails(err)))
- }
-}
-
-func createAssets(contract *client.Contract) {
- assetType := "ValuableAsset"
-
- fmt.Printf("\n--> Submit Transaction: CreateAsset, ID: %s\n", assetID1)
-
- type assetTransientInput struct {
- ObjectType string
- AssetID string
- Color string
- Size uint8
- AppraisedValue uint16
- }
-
- asset1Data := assetTransientInput{
- ObjectType: assetType,
- AssetID: assetID1,
- Color: "green",
- Size: 20,
- AppraisedValue: 100,
- }
-
- if _, err := contract.Submit(
- "CreateAsset",
- client.WithTransient(transient{
- "asset_properties": marshal(asset1Data),
- }),
- ); err != nil {
- panic(err)
- }
-
- logTxCommitSuccess()
- fmt.Printf("\n--> Submit Transaction: CreateAsset, ID: %s\n", assetID2)
-
- asset2Data := assetTransientInput{
- ObjectType: assetType,
- AssetID: assetID2,
- Color: "blue",
- Size: 35,
- AppraisedValue: 727,
- }
-
- if _, err := contract.Submit(
- "CreateAsset",
- client.WithTransient(transient{
- "asset_properties": marshal(asset2Data),
- }),
- ); err != nil {
- panic(err)
- }
-
- logTxCommitSuccess()
-}
-
-func getAssetByRange(contract *client.Contract) {
- // GetAssetByRange returns assets on the ledger with ID in the range of startKey (inclusive) and endKey (exclusive).
- fmt.Printf("\n--> Evaluate Transaction: GetAssetByRange from %s\n", org1PrivateCollectionName)
-
- resultBytes, err := contract.EvaluateTransaction("GetAssetByRange", assetID1, fmt.Sprintf("asset%d", now.Unix()+2))
- if err != nil {
- panic(err)
- }
-
- if len(resultBytes) == 0 {
- doFail("Received empty query list for GetAssetByRange")
- }
-
- fmt.Printf("*** Result: %s\n", formatJSON(resultBytes))
-}
-
-func readAssetByID(contract *client.Contract, assetID string) {
- fmt.Printf("\n--> Evaluate Transaction: ReadAsset, ID: %s\n", assetID)
-
- resultBytes, err := contract.EvaluateTransaction("ReadAsset", assetID)
- if err != nil {
- panic(err)
- }
-
- if len(resultBytes) == 0 {
- doFail("Received empty result for ReadAsset")
- }
-
- fmt.Printf("*** Result: %s\n", formatJSON(resultBytes))
-}
-
-func agreeToTransfer(contract *client.Contract, assetID string) {
- // Buyer from Org2 agrees to buy the asset.
- // To purchase the asset, the buyer needs to agree to the same value as the asset owner.
- dataForAgreement := struct {
- AssetID string `json:"assetID"`
- AppraisedValue int `json:"appraisedValue"`
- }{assetID, 100}
- fmt.Printf("\n--> Submit Transaction: AgreeToTransfer, payload: %+v\n", dataForAgreement)
-
- if _, err := contract.Submit(
- "AgreeToTransfer",
- client.WithTransient(transient{
- "asset_value": marshal(dataForAgreement),
- }),
- ); err != nil {
- panic(err)
- }
-
- logTxCommitSuccess()
-}
-
-func readTransferAgreement(contract *client.Contract, assetID string) {
- fmt.Printf("\n--> Evaluate Transaction: ReadTransferAgreement, ID: %s\n", assetID)
-
- resultBytes, err := contract.EvaluateTransaction("ReadTransferAgreement", assetID)
- if err != nil {
- panic(err)
- }
-
- if len(resultBytes) == 0 {
- doFail("Received empty result for ReadTransferAgreement")
- }
-
- fmt.Printf("*** Result: %s\n", formatJSON(resultBytes))
-}
-
-func transferAsset(contract *client.Contract, assetID string) (err error) {
- fmt.Printf("\n--> Submit Transaction: TransferAsset, ID: %s\n", assetID)
-
- buyerDetails := struct {
- AssetID string `json:"assetID"`
- BuyerMSP string `json:"buyerMSP"`
- }{assetID, mspIDOrg2}
-
- if _, err = contract.Submit(
- "TransferAsset",
- client.WithTransient(transient{
- "asset_owner": marshal(buyerDetails),
- }),
- ); err != nil {
- return
- }
-
- logTxCommitSuccess()
- return
-}
-
-func deleteAsset(contract *client.Contract, assetID string) (err error) {
- fmt.Printf("\n--> Submit Transaction: DeleteAsset, ID: %s\n", assetID)
-
- dataForDelete := struct{ AssetID string }{assetID}
-
- if _, err = contract.Submit(
- "DeleteAsset",
- client.WithTransient(transient{
- "asset_delete": marshal(dataForDelete),
- }),
- ); err != nil {
- return
- }
-
- logTxCommitSuccess()
- return
-}
-
-func purgeAsset(contract *client.Contract, assetID string) (err error) {
- fmt.Printf("\n--> Submit Transaction: PurgeAsset, ID: %s\n", assetID)
-
- dataForPurge := struct{ AssetID string }{assetID}
-
- if _, err = contract.Submit(
- "PurgeAsset",
- client.WithTransient(transient{
- "asset_purge": marshal(dataForPurge),
- }),
- ); err != nil {
- return
- }
-
- logTxCommitSuccess()
- return
-}
-
-func readAssetPrivateDetails(contract *client.Contract, assetID, collectionName string) bool {
- fmt.Printf("\n--> Evaluate Transaction: ReadAssetPrivateDetails from %s, ID: %s\n", collectionName, assetID)
-
- resultBytes, err := contract.EvaluateTransaction("ReadAssetPrivateDetails", collectionName, assetID)
- if err != nil {
- panic(err)
- }
-
- if len(resultBytes) == 0 {
- fmt.Println("*** No result")
- return false
- }
-
- fmt.Printf("*** Result: %s\n", formatJSON(resultBytes))
-
- return true
-}
-
-func marshal(value any) []byte {
- valueAsBytes, err := json.Marshal(&value)
- if err != nil {
- panic(err)
- }
-
- return valueAsBytes
-}
-
-func logTxCommitSuccess() {
- fmt.Println("*** Transaction committed successfully")
-}
-
-func doFail(msg string) {
- fmt.Println(Red + msg + Reset)
- panic(errors.New(msg))
-}
-
-func formatJSON(data []byte) string {
- var result bytes.Buffer
- if err := json.Indent(&result, data, "", " "); err != nil {
- panic(fmt.Errorf("failed to parse JSON: %w", err))
- }
- return result.String()
-}
-
-func errorWithDetails(err error) error {
- var buf strings.Builder
-
- statusErr := status.Convert(err)
- errDetails := statusErr.Details()
- if len(errDetails) > 0 {
- buf.WriteString("\nError Details:")
-
- for _, errDetail := range errDetails {
- if detail, ok := errDetail.(*gateway.ErrorDetail); ok {
- buf.WriteString(fmt.Sprintf("\n- address: %s", detail.GetAddress()))
- buf.WriteString(fmt.Sprintf("\n- mspID: %s", detail.GetMspId()))
- buf.WriteString(fmt.Sprintf("\n- message: %s\n", detail.GetMessage()))
- }
- }
- }
-
- return fmt.Errorf("%w%s", err, buf.String())
-}
diff --git a/asset-transfer-private-data/application-gateway-go/connect.go b/asset-transfer-private-data/application-gateway-go/connect.go
deleted file mode 100644
index 3bd76863..00000000
--- a/asset-transfer-private-data/application-gateway-go/connect.go
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
-Copyright 2022 IBM All Rights Reserved.
-
-SPDX-License-Identifier: Apache-2.0
-*/
-
-package main
-
-import (
- "crypto/x509"
- "fmt"
- "os"
- "path"
-
- "github.com/hyperledger/fabric-gateway/pkg/identity"
- "google.golang.org/grpc"
- "google.golang.org/grpc/credentials"
-)
-
-const (
- cryptoPathOrg1 = "../../test-network/organizations/peerOrganizations/org1.example.com"
- keyDirectoryPathOrg1 = cryptoPathOrg1 + "/users/User1@org1.example.com/msp/keystore"
- certDirectoryPathOrg1 = cryptoPathOrg1 + "/users/User1@org1.example.com/msp/signcerts"
- tlsCertPathOrg1 = cryptoPathOrg1 + "/peers/peer0.org1.example.com/tls/ca.crt"
- peerEndpointOrg1 = "dns:///localhost:7051"
- peerNameOrg1 = "peer0.org1.example.com"
- cryptoPathOrg2 = "../../test-network/organizations/peerOrganizations/org2.example.com"
- keyDirectoryPathOrg2 = cryptoPathOrg2 + "/users/User1@org2.example.com/msp/keystore"
- certDirectoryPathOrg2 = cryptoPathOrg2 + "/users/User1@org2.example.com/msp/signcerts"
- tlsCertPathOrg2 = cryptoPathOrg2 + "/peers/peer0.org2.example.com/tls/ca.crt"
- peerEndpointOrg2 = "dns:///localhost:9051"
- peerNameOrg2 = "peer0.org2.example.com"
-)
-
-// newGrpcConnection creates a gRPC connection to the Gateway server.
-func newGrpcConnection(tlsCertPath, peerEndpoint, peerName string) *grpc.ClientConn {
- certificatePEM, err := os.ReadFile(tlsCertPath)
- if err != nil {
- panic(fmt.Errorf("failed to read TLS certificate file: %w", err))
- }
-
- certificate, err := identity.CertificateFromPEM(certificatePEM)
- if err != nil {
- panic(err)
- }
-
- certPool := x509.NewCertPool()
- certPool.AddCert(certificate)
- transportCredentials := credentials.NewClientTLSFromCert(certPool, peerName)
-
- connection, err := grpc.NewClient(peerEndpoint, grpc.WithTransportCredentials(transportCredentials))
- if err != nil {
- panic(fmt.Errorf("failed to create gRPC connection: %w", err))
- }
-
- return connection
-}
-
-// newIdentity creates a client identity for this Gateway connection using an X.509 certificate.
-func newIdentity(certDirectoryPath, mspId string) *identity.X509Identity {
- certificatePEM, err := readFirstFile(certDirectoryPath)
- if err != nil {
- panic(fmt.Errorf("failed to read certificate file: %w", err))
- }
-
- certificate, err := identity.CertificateFromPEM(certificatePEM)
- if err != nil {
- panic(err)
- }
-
- id, err := identity.NewX509Identity(mspId, certificate)
- if err != nil {
- panic(err)
- }
-
- return id
-}
-
-// newSign creates a function that generates a digital signature from a message digest using a private key.
-func newSign(keyDirectoryPash string) identity.Sign {
- privateKeyPEM, err := readFirstFile(keyDirectoryPash)
- if err != nil {
- panic(fmt.Errorf("failed to read private key file: %w", err))
- }
-
- privateKey, err := identity.PrivateKeyFromPEM(privateKeyPEM)
- if err != nil {
- panic(err)
- }
-
- sign, err := identity.NewPrivateKeySign(privateKey)
- if err != nil {
- panic(err)
- }
-
- return sign
-}
-
-func readFirstFile(dirPath string) ([]byte, error) {
- dir, err := os.Open(dirPath)
- if err != nil {
- return nil, err
- }
-
- fileNames, err := dir.Readdirnames(1)
- if err != nil {
- return nil, err
- }
-
- return os.ReadFile(path.Join(dirPath, fileNames[0]))
-}
diff --git a/asset-transfer-private-data/application-gateway-go/go.mod b/asset-transfer-private-data/application-gateway-go/go.mod
deleted file mode 100644
index 83a97113..00000000
--- a/asset-transfer-private-data/application-gateway-go/go.mod
+++ /dev/null
@@ -1,23 +0,0 @@
-module assetTransfer
-
-go 1.22.0
-
-require (
- github.com/hyperledger/fabric-gateway v1.6.0
- google.golang.org/grpc v1.67.0
-)
-
-require (
- github.com/golang/protobuf v1.5.3 // indirect
- github.com/hyperledger/fabric-protos-go v0.0.0-20200707132912-fee30f3ccd23 // indirect
- github.com/hyperledger/fabric-protos-go-apiv2 v0.3.3 // indirect
- github.com/hyperledger/fabric-sdk-go v1.0.0 // indirect
- github.com/miekg/pkcs11 v1.1.1 // indirect
- github.com/pkg/errors v0.8.1 // indirect
- golang.org/x/crypto v0.27.0 // indirect
- golang.org/x/net v0.29.0 // indirect
- golang.org/x/sys v0.25.0 // indirect
- golang.org/x/text v0.18.0 // indirect
- google.golang.org/genproto/googleapis/rpc v0.0.0-20240924160255-9d4c2d233b61 // indirect
- google.golang.org/protobuf v1.34.2 // indirect
-)
diff --git a/asset-transfer-private-data/application-gateway-go/go.sum b/asset-transfer-private-data/application-gateway-go/go.sum
deleted file mode 100644
index 5306d77e..00000000
--- a/asset-transfer-private-data/application-gateway-go/go.sum
+++ /dev/null
@@ -1,223 +0,0 @@
-bitbucket.org/liamstask/goose v0.0.0-20150115234039-8488cc47d90c/go.mod h1:hSVuE3qU7grINVSwrmzHfpg9k87ALBk+XaualNyUzI4=
-cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
-github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
-github.com/GeertJohan/go.incremental v1.0.0/go.mod h1:6fAjUhbVuX1KcMD3c8TEgVUqmo4seqhv0i0kdATSkM0=
-github.com/GeertJohan/go.rice v1.0.0/go.mod h1:eH6gbSOAUv07dQuZVnBmoDP8mgsM1rtixis4Tib9if0=
-github.com/Knetic/govaluate v3.0.0+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0=
-github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g=
-github.com/akavel/rsrc v0.8.0/go.mod h1:uLoCtb9J+EyAqh+26kdrTgmzRBFPGOolLWKpdxkKq+c=
-github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
-github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
-github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/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/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/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/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/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/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
-github.com/go-sql-driver/mysql v1.3.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w=
-github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
-github.com/gogo/protobuf v1.1.1/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/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/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
-github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
-github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
-github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
-github.com/google/certificate-transparency-go v1.0.21/go.mod h1:QeJfpSbVSfYc7RgB3gJFj9cbuQMMchQxrWXz8Ruopmg=
-github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
-github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
-github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
-github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
-github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
-github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
-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/go.mod h1:YpITBI/+ZayA3XWY5lF302K7PAsFYjEEPM/zr3hegA8=
-github.com/hyperledger/fabric-gateway v1.6.0 h1:mPdXFSHdEjT0cmhsqKBfFMTVyBvfJXlO3Neicp/c27E=
-github.com/hyperledger/fabric-gateway v1.6.0/go.mod h1:qHdJcgC6UrTxfYH+YIyAhPUkeNri0gPpyP/6xmiYrZo=
-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-protos-go-apiv2 v0.3.3 h1:Xpd6fzG/KjAOHJsq7EQXY2l+qi/y8muxBaY7R6QWABk=
-github.com/hyperledger/fabric-protos-go-apiv2 v0.3.3/go.mod h1:2pq0ui6ZWA0cC8J+eCErgnMDCS1kPOEYVY+06ZAK0qE=
-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/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
-github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
-github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
-github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
-github.com/kylelemons/go-gypsy v0.0.0-20160905020020-08cad365cd28/go.mod h1:T/T7jsxVqf9k/zYOqbgNAsANsjxTd1Yq3htjDhQ1H0c=
-github.com/lib/pq v0.0.0-20180201184707-88edab080323/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
-github.com/magiconair/properties v1.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/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
-github.com/miekg/pkcs11 v1.0.3/go.mod h1:XsNlhZGX73bx86s2hdc/FuaLm2CPZJemRLMA+WTFxgs=
-github.com/miekg/pkcs11 v1.1.1 h1:Ugu9pdy6vAYku5DEpVWVFPYnzV+bxB+iRdbuFSu7TvU=
-github.com/miekg/pkcs11 v1.1.1/go.mod h1:XsNlhZGX73bx86s2hdc/FuaLm2CPZJemRLMA+WTFxgs=
-github.com/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/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/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/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/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
-github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
-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/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/go.mod h1:5KUK8ByomD5Ti5Artl0RtHeI5pTF7MIDuXL3yY520V4=
-github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
-github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo=
-github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
-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/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
-github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
-github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
-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/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/go.mod h1:w7kd3qXHh8FNaczNjslXqvFQiv5mMWRXlL9klTUAHc8=
-github.com/zmap/zlint v0.0.0-20190806154020-fd021b4cfbeb/go.mod h1:29UiAJNsiVdvTBFCJW8e3q6dcDbOoPkhMgttOSCIMMY=
-go.uber.org/mock v0.4.0 h1:VcM4ZOtdbR4f6VXfiOpwpVJDL6lCReaZ6mw31wqh7KU=
-go.uber.org/mock v0.4.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc=
-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/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
-golang.org/x/crypto v0.27.0 h1:GXm2NjJrPaiv/h1tb2UH8QfgC/hOf/+z0p6PT8o1w7A=
-golang.org/x/crypto v0.27.0/go.mod h1:1Xngt8kV6Dvbssa53Ziq6Eqn0HqbZi5Z6R0ZpwQzt70=
-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/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
-golang.org/x/net v0.29.0 h1:5ORfpBpCs4HzDYoodCDBbwHzdR5UrLBZ3sOnUJmFoHo=
-golang.org/x/net v0.29.0/go.mod h1:gLkgy8jTGERgjzMic6DS9+SP0ajcu6Xu3Orq/SpETg0=
-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/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34=
-golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
-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/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
-golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224=
-golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
-golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
-golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
-golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
-golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
-golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
-golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
-golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
-golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/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/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20240924160255-9d4c2d233b61 h1:N9BgCIAUvn/M+p4NJccWPWb3BWh88+zyL0ll9HgbEeM=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20240924160255-9d4c2d233b61/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU=
-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/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk=
-google.golang.org/grpc v1.67.0 h1:IdH9y6PF5MPSdAntIcpjQ+tXO41pcQsfZV2RxtQgVcw=
-google.golang.org/grpc v1.67.0/go.mod h1:1gLDyUQU7CTLJI90u3nXZ9ekeghjeM7pTDZlqFNg2AA=
-google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
-google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
-google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg=
-google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw=
-gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
-gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
-gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
-gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
-gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
-gopkg.in/yaml.v2 v2.2.1/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/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
-gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
-gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
-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-private-data/application-gateway-typescript/.gitignore b/asset-transfer-private-data/application-gateway-typescript/.gitignore
deleted file mode 100644
index 99e5af9f..00000000
--- a/asset-transfer-private-data/application-gateway-typescript/.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/
-
-# Compiled TypeScript files
-dist
diff --git a/asset-transfer-private-data/application-gateway-typescript/.npmrc b/asset-transfer-private-data/application-gateway-typescript/.npmrc
deleted file mode 100644
index b6f27f13..00000000
--- a/asset-transfer-private-data/application-gateway-typescript/.npmrc
+++ /dev/null
@@ -1 +0,0 @@
-engine-strict=true
diff --git a/asset-transfer-private-data/application-gateway-typescript/README.md b/asset-transfer-private-data/application-gateway-typescript/README.md
deleted file mode 100644
index 94cc79c0..00000000
--- a/asset-transfer-private-data/application-gateway-typescript/README.md
+++ /dev/null
@@ -1,10 +0,0 @@
-# Asset Transfer Private Data Sample
-
-This app uses fabric-samples/test-network based setup and the companion chaincode asset-transfer-private-data/chaincode-go/ with chaincode endorsement policy as "OR('Org1MSP.peer','Org2MSP.peer')"
-
-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.
-
-For more details refer:
-https://hyperledger-fabric.readthedocs.io/en/release-2.4/private_data_tutorial.html#pd-use-case
-
diff --git a/asset-transfer-private-data/application-gateway-typescript/eslint.config.mjs b/asset-transfer-private-data/application-gateway-typescript/eslint.config.mjs
deleted file mode 100644
index 9ef6b243..00000000
--- a/asset-transfer-private-data/application-gateway-typescript/eslint.config.mjs
+++ /dev/null
@@ -1,13 +0,0 @@
-import js from '@eslint/js';
-import tseslint from 'typescript-eslint';
-
-export default tseslint.config(js.configs.recommended, ...tseslint.configs.strictTypeChecked, {
- languageOptions: {
- ecmaVersion: 2023,
- sourceType: 'module',
- parserOptions: {
- project: 'tsconfig.json',
- tsconfigRootDir: import.meta.dirname,
- },
- },
-});
diff --git a/asset-transfer-private-data/application-gateway-typescript/package.json b/asset-transfer-private-data/application-gateway-typescript/package.json
deleted file mode 100644
index 96d609bf..00000000
--- a/asset-transfer-private-data/application-gateway-typescript/package.json
+++ /dev/null
@@ -1,33 +0,0 @@
-{
- "name": "asset-transfer-private-data",
- "version": "1.0.0",
- "description": "Asset transfer private data application implemented in typeScript using fabric-gateway",
- "main": "dist/index.js",
- "typings": "dist/index.d.ts",
- "engines": {
- "node": ">=18"
- },
- "scripts": {
- "build": "tsc",
- "build:watch": "tsc -w",
- "lint": "eslint src",
- "prepare": "npm run build",
- "pretest": "npm run lint",
- "start": "node dist/app.js"
- },
- "engineStrict": true,
- "author": "Hyperledger",
- "license": "Apache-2.0",
- "dependencies": {
- "@grpc/grpc-js": "^1.12.2",
- "@hyperledger/fabric-gateway": "^1.7.0"
- },
- "devDependencies": {
- "@eslint/js": "^9.3.0",
- "@tsconfig/node18": "^18.2.2",
- "@types/node": "^18.18.6",
- "eslint": "^8.57.0",
- "typescript": "~5.4",
- "typescript-eslint": "^7.13.0"
- }
-}
diff --git a/asset-transfer-private-data/application-gateway-typescript/src/app.ts b/asset-transfer-private-data/application-gateway-typescript/src/app.ts
deleted file mode 100644
index 1e190227..00000000
--- a/asset-transfer-private-data/application-gateway-typescript/src/app.ts
+++ /dev/null
@@ -1,302 +0,0 @@
-/*
- * Copyright IBM Corp. All Rights Reserved.
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-
-import { connect, Contract, hash } from '@hyperledger/fabric-gateway';
-import { TextDecoder } from 'util';
-import {
- certDirectoryPathOrg1, certDirectoryPathOrg2, keyDirectoryPathOrg1, keyDirectoryPathOrg2, newGrpcConnection, newIdentity,
- newSigner, peerEndpointOrg1, peerEndpointOrg2, peerNameOrg1, peerNameOrg2, tlsCertPathOrg1, tlsCertPathOrg2
-} from './connect';
-
-const channelName = 'mychannel';
-const chaincodeName = 'private';
-const mspIdOrg1 = 'Org1MSP';
-const mspIdOrg2 = 'Org2MSP';
-
-const utf8Decoder = new TextDecoder();
-
-// Collection names.
-const org1PrivateCollectionName = 'Org1MSPPrivateCollection';
-const org2PrivateCollectionName = 'Org2MSPPrivateCollection';
-
-const RED = '\x1b[31m\n';
-const RESET = '\x1b[0m';
-
-// Use a unique key so that we can run multiple times.
-const now = Date.now();
-const assetID1 = `asset${String(now)}`;
-const assetID2 = `asset${String(now + 1)}`;
-
-async function main(): Promise {
- const clientOrg1 = await newGrpcConnection(
- tlsCertPathOrg1,
- peerEndpointOrg1,
- peerNameOrg1
- );
-
- const gatewayOrg1 = connect({
- client: clientOrg1,
- identity: await newIdentity(certDirectoryPathOrg1, mspIdOrg1),
- signer: await newSigner(keyDirectoryPathOrg1),
- hash: hash.sha256,
- });
-
- const clientOrg2 = await newGrpcConnection(
- tlsCertPathOrg2,
- peerEndpointOrg2,
- peerNameOrg2
- );
-
- const gatewayOrg2 = connect({
- client: clientOrg2,
- identity: await newIdentity(certDirectoryPathOrg2, mspIdOrg2),
- signer: await newSigner(keyDirectoryPathOrg2),
- hash: hash.sha256,
- });
-
- try {
- // Get the smart contract as an Org1 client.
- const contractOrg1 = gatewayOrg1
- .getNetwork(channelName)
- .getContract(chaincodeName);
-
- // Get the smart contract as an Org2 client.
- const contractOrg2 = gatewayOrg2
- .getNetwork(channelName)
- .getContract(chaincodeName);
-
- console.log('\n~~~~~~~~~~~~~~~~ As Org1 Client ~~~~~~~~~~~~~~~~');
-
- // Create new assets on the ledger.
- await createAssets(contractOrg1);
-
- // Read asset from the Org1's private data collection with ID in the given range.
- await getAssetByRange(contractOrg1);
-
- try {
- // Attempt to transfer asset without prior approval from Org2, transaction expected to fail.
- console.log('\nAttempt TransferAsset without prior AgreeToTransfer');
- await transferAsset(contractOrg1, assetID1);
- doFail('TransferAsset transaction succeeded when it was expected to fail');
- } catch (e) {
- console.log('*** Received expected error:', e);
- }
-
- console.log('\n~~~~~~~~~~~~~~~~ As Org2 Client ~~~~~~~~~~~~~~~~');
-
- // Read the asset by ID.
- await readAssetByID(contractOrg2, assetID1);
-
- // Make agreement to transfer the asset from Org1 to Org2.
- await agreeToTransfer(contractOrg2, assetID1);
-
- console.log('\n~~~~~~~~~~~~~~~~ As Org1 Client ~~~~~~~~~~~~~~~~');
-
- // Read transfer agreement.
- await readTransferAgreement(contractOrg1, assetID1);
-
- // Transfer asset to Org2.
- await transferAsset(contractOrg1, assetID1);
-
- // Again ReadAsset: results will show that the buyer identity now owns the asset.
- await readAssetByID(contractOrg1, assetID1);
-
- // Confirm that transfer removed the private details from the Org1 collection.
- const org1ReadSuccess = await readAssetPrivateDetails(contractOrg1, assetID1, org1PrivateCollectionName);
- if (org1ReadSuccess) {
- doFail(`Asset private data still exists in ${org1PrivateCollectionName}`);
- }
-
- console.log('\n~~~~~~~~~~~~~~~~ As Org2 Client ~~~~~~~~~~~~~~~~');
-
- // Org2 can read asset private details: Org2 is owner, and private details exist in new owner's collection.
- const org2ReadSuccess = await readAssetPrivateDetails(contractOrg2, assetID1, org2PrivateCollectionName);
- if (!org2ReadSuccess) {
- doFail(`Asset private data not found in ${org2PrivateCollectionName}`);
- }
-
- try {
- console.log('\nAttempt DeleteAsset using non-owner organization');
- await deleteAsset(contractOrg2, assetID2);
- doFail('DeleteAsset transaction succeeded when it was expected to fail');
- } catch (e) {
- console.log('*** Received expected error:', e);
- }
-
- console.log('\n~~~~~~~~~~~~~~~~ As Org1 Client ~~~~~~~~~~~~~~~~');
-
- // Delete AssetID2 as Org1.
- await deleteAsset(contractOrg1, assetID2);
-
- // Trigger a purge of the private data for the asset.
- // The previous delete is optional if purge is used.
- await purgeAsset(contractOrg1, assetID2);
- } finally {
- gatewayOrg1.close();
- clientOrg1.close();
-
- gatewayOrg2.close();
- clientOrg2.close();
- }
-}
-
-main().catch((error: unknown) => {
- console.error('******** FAILED to run the application:', error);
- process.exitCode = 1;
-});
-
-/**
- * Submit a transaction synchronously, blocking until it has been committed to the ledger.
- */
-async function createAssets(contract: Contract): Promise {
- const assetType = 'ValuableAsset';
-
- console.log(`\n--> Submit Transaction: CreateAsset, ID: ${assetID1}`);
-
- const asset1Data = {
- objectType: assetType,
- assetID: assetID1,
- color: 'green',
- size: 20,
- appraisedValue: 100,
- };
-
- await contract.submit('CreateAsset', {
- transientData: { asset_properties: JSON.stringify(asset1Data) },
- });
-
- console.log('*** Transaction committed successfully');
- console.log(`\n--> Submit Transaction: CreateAsset, ID: ${assetID2}`);
-
- const asset2Data = {
- objectType: assetType,
- assetID: assetID2,
- color: 'blue',
- size: 35,
- appraisedValue: 727,
- };
-
- await contract.submit('CreateAsset', {
- transientData: { asset_properties: JSON.stringify(asset2Data) },
- });
-
- console.log('*** Transaction committed successfully');
-}
-
-async function getAssetByRange(contract: Contract): Promise {
- // GetAssetByRange returns assets on the ledger with ID in the range of startKey (inclusive) and endKey (exclusive).
- console.log(`\n--> Evaluate Transaction: GetAssetByRange from ${org1PrivateCollectionName}`);
-
- const resultBytes = await contract.evaluateTransaction(
- 'GetAssetByRange',
- assetID1,
- `asset${String(now + 2)}`
- );
-
- const resultString = utf8Decoder.decode(resultBytes);
- if (!resultString) {
- doFail('Received empty query list for GetAssetByRange');
- }
- const result: unknown = JSON.parse(resultString);
- console.log('*** Result:', result);
-}
-
-async function readAssetByID(contract: Contract, assetID: string): Promise {
- console.log(`\n--> Evaluate Transaction: ReadAsset, ID: ${assetID}`);
- const resultBytes = await contract.evaluateTransaction('ReadAsset', assetID);
-
- const resultString = utf8Decoder.decode(resultBytes);
- if (!resultString) {
- doFail('Received empty result for ReadAsset');
- }
- const result: unknown = JSON.parse(resultString);
- console.log('*** Result:', result);
-}
-
-async function agreeToTransfer(contract: Contract, assetID: string): Promise {
- // Buyer from Org2 agrees to buy the asset.
- // To purchase the asset, the buyer needs to agree to the same value as the asset owner.
-
- const dataForAgreement = { assetID, appraisedValue: 100 };
- console.log('\n--> Submit Transaction: AgreeToTransfer, payload:', dataForAgreement);
-
- await contract.submit('AgreeToTransfer', {
- transientData: { asset_value: JSON.stringify(dataForAgreement) },
- });
-
- console.log('*** Transaction committed successfully');
-}
-
-async function readTransferAgreement(contract: Contract, assetID: string): Promise {
- console.log(`\n--> Evaluate Transaction: ReadTransferAgreement, ID: ${assetID}`);
-
- const resultBytes = await contract.evaluateTransaction(
- 'ReadTransferAgreement',
- assetID
- );
-
- const resultString = utf8Decoder.decode(resultBytes);
- if (!resultString) {
- doFail('Received no result for ReadTransferAgreement');
- }
- const result: unknown = JSON.parse(resultString);
- console.log('*** Result:', result);
-}
-
-async function transferAsset(contract: Contract, assetID: string): Promise {
- console.log(`\n--> Submit Transaction: TransferAsset, ID: ${assetID}`);
-
- const buyerDetails = { assetID, buyerMSP: mspIdOrg2 };
- await contract.submit('TransferAsset', {
- transientData: { asset_owner: JSON.stringify(buyerDetails) },
- });
-
- console.log('*** Transaction committed successfully');
-}
-
-async function deleteAsset(contract: Contract, assetID: string): Promise {
- console.log('\n--> Submit Transaction: DeleteAsset, ID:', assetID);
- const dataForDelete = { assetID };
- await contract.submit('DeleteAsset', {
- transientData: { asset_delete: JSON.stringify(dataForDelete) },
- });
-
- console.log('*** Transaction committed successfully');
-}
-
-async function purgeAsset(contract: Contract, assetID: string): Promise {
- console.log('\n--> Submit Transaction: PurgeAsset, ID:', assetID);
- const dataForPurge = { assetID };
- await contract.submit('PurgeAsset', {
- transientData: { asset_purge: JSON.stringify(dataForPurge) },
- });
-
- console.log('*** Transaction committed successfully');
-}
-
-async function readAssetPrivateDetails(contract: Contract, assetID: string, collectionName: string): Promise {
- console.log(`\n--> Evaluate Transaction: ReadAssetPrivateDetails from ${collectionName}, ID: ${assetID}`);
-
- const resultBytes = await contract.evaluateTransaction(
- 'ReadAssetPrivateDetails',
- collectionName,
- assetID
- );
-
- const resultJson = utf8Decoder.decode(resultBytes);
- if (!resultJson) {
- console.log('*** No result');
- return false;
- }
- const result: unknown = JSON.parse(resultJson);
- console.log('*** Result:', result);
- return true;
-}
-
-export function doFail(msgString: string): never {
- console.error(`${RED}\t${msgString}${RESET}`);
- throw new Error(msgString);
-}
diff --git a/asset-transfer-private-data/application-gateway-typescript/src/connect.ts b/asset-transfer-private-data/application-gateway-typescript/src/connect.ts
deleted file mode 100644
index 0fe7f3a3..00000000
--- a/asset-transfer-private-data/application-gateway-typescript/src/connect.ts
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * Copyright IBM Corp. All Rights Reserved.
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-
-import * as grpc from '@grpc/grpc-js';
-import { Identity, Signer, signers } from '@hyperledger/fabric-gateway';
-import * as crypto from 'crypto';
-import { promises as fs } from 'fs';
-import * as path from 'path';
-
-// Path to org1 crypto materials.
-const cryptoPathOrg1 = path.resolve(
- __dirname,
- '..',
- '..',
- '..',
- 'test-network',
- 'organizations',
- 'peerOrganizations',
- 'org1.example.com'
-);
-
-// Path to org1 user private key directory.
-export const keyDirectoryPathOrg1 = path.resolve(
- cryptoPathOrg1,
- 'users',
- 'User1@org1.example.com',
- 'msp',
- 'keystore'
-);
-
-// Path to org1 user certificate.
-export const certDirectoryPathOrg1 = path.resolve(
- cryptoPathOrg1,
- 'users',
- 'User1@org1.example.com',
- 'msp',
- 'signcerts'
-);
-
-// Path to org1 peer tls certificate.
-export const tlsCertPathOrg1 = path.resolve(
- cryptoPathOrg1,
- 'peers',
- 'peer0.org1.example.com',
- 'tls',
- 'ca.crt'
-);
-
-// Path to org2 crypto materials.
-export const cryptoPathOrg2 = path.resolve(
- __dirname,
- '..',
- '..',
- '..',
- 'test-network',
- 'organizations',
- 'peerOrganizations',
- 'org2.example.com'
-);
-
-// Path to org2 user private key directory.
-export const keyDirectoryPathOrg2 = path.resolve(
- cryptoPathOrg2,
- 'users',
- 'User1@org2.example.com',
- 'msp',
- 'keystore'
-);
-
-// Path to org2 user certificate.
-export const certDirectoryPathOrg2 = path.resolve(
- cryptoPathOrg2,
- 'users',
- 'User1@org2.example.com',
- 'msp',
- 'signcerts'
-);
-
-// Path to org2 peer tls certificate.
-export const tlsCertPathOrg2 = path.resolve(
- cryptoPathOrg2,
- 'peers',
- 'peer0.org2.example.com',
- 'tls',
- 'ca.crt'
-);
-
-// Gateway peer endpoint.
-export const peerEndpointOrg1 = 'localhost:7051';
-export const peerEndpointOrg2 = 'localhost:9051';
-
-// Gateway peer container name.
-export const peerNameOrg1 = 'peer0.org1.example.com';
-export const peerNameOrg2 = 'peer0.org2.example.com';
-
-
-export async function newGrpcConnection(
- tlsCertPath: string,
- peerEndpoint: string,
- peerName: string
-): Promise {
- const tlsRootCert = await fs.readFile(tlsCertPath);
- const tlsCredentials = grpc.credentials.createSsl(tlsRootCert);
- return new grpc.Client(peerEndpoint, tlsCredentials, {
- 'grpc.ssl_target_name_override': peerName,
- });
-}
-
-export async function newIdentity(
- certDirectoryPath: string,
- mspId: string
-): Promise {
- const certPath = await getFirstDirFileName(certDirectoryPath);
- const credentials = await fs.readFile(certPath);
- return { mspId, credentials };
-}
-
-export async function newSigner(keyDirectoryPath: string): Promise {
- const keyPath = await getFirstDirFileName(keyDirectoryPath);
- const privateKeyPem = await fs.readFile(keyPath);
- const privateKey = crypto.createPrivateKey(privateKeyPem);
- return signers.newPrivateKeySigner(privateKey);
-}
-
-async function getFirstDirFileName(dirPath: string): Promise {
- const files = await fs.readdir(dirPath);
- const file = files[0];
- if (!file) {
- throw new Error(`No files in directory: ${dirPath}`);
- }
- return path.join(dirPath, file);
-}
diff --git a/asset-transfer-private-data/application-gateway-typescript/tsconfig.json b/asset-transfer-private-data/application-gateway-typescript/tsconfig.json
deleted file mode 100644
index 4c20df24..00000000
--- a/asset-transfer-private-data/application-gateway-typescript/tsconfig.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "extends": "@tsconfig/node18/tsconfig.json",
- "compilerOptions": {
- "outDir": "dist",
- "declaration": true,
- "declarationMap": true,
- "sourceMap": true,
- "noUnusedLocals": true,
- "noImplicitReturns": true,
- "noUncheckedIndexedAccess": true,
- "forceConsistentCasingInFileNames": true
- },
- "include": ["./src/**/*"],
- "exclude": ["./src/**/*.spec.ts"]
-}
diff --git a/asset-transfer-private-data/chaincode-go/META-INF/statedb/couchdb/collections/assetCollection/indexes/indexOwner.json b/asset-transfer-private-data/chaincode-go/META-INF/statedb/couchdb/collections/assetCollection/indexes/indexOwner.json
deleted file mode 100644
index e2d1d087..00000000
--- a/asset-transfer-private-data/chaincode-go/META-INF/statedb/couchdb/collections/assetCollection/indexes/indexOwner.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "index": {
- "fields": [
- "objectType",
- "owner"
- ]
- },
- "ddoc": "indexOwnerDoc",
- "name": "indexOwner",
- "type": "json"
-}
-
diff --git a/asset-transfer-private-data/chaincode-go/README.md b/asset-transfer-private-data/chaincode-go/README.md
deleted file mode 100644
index f87a95c6..00000000
--- a/asset-transfer-private-data/chaincode-go/README.md
+++ /dev/null
@@ -1 +0,0 @@
-[Using Private Data tutorial](https://hyperledger-fabric.readthedocs.io/en/latest/private_data_tutorial.html)
diff --git a/asset-transfer-private-data/chaincode-go/chaincode/asset_queries.go b/asset-transfer-private-data/chaincode-go/chaincode/asset_queries.go
deleted file mode 100644
index 0542947a..00000000
--- a/asset-transfer-private-data/chaincode-go/chaincode/asset_queries.go
+++ /dev/null
@@ -1,190 +0,0 @@
-/*
-Copyright IBM Corp. All Rights Reserved.
-
-SPDX-License-Identifier: Apache-2.0
-*/
-
-package chaincode
-
-import (
- "encoding/json"
- "fmt"
- "log"
-
- "github.com/hyperledger/fabric-contract-api-go/v2/contractapi"
-)
-
-// ReadAsset reads the information from collection
-func (s *SmartContract) ReadAsset(ctx contractapi.TransactionContextInterface, assetID string) (*Asset, error) {
-
- log.Printf("ReadAsset: collection %v, ID %v", assetCollection, assetID)
- assetJSON, err := ctx.GetStub().GetPrivateData(assetCollection, assetID) //get the asset from chaincode state
- if err != nil {
- return nil, fmt.Errorf("failed to read asset: %v", err)
- }
-
- // No Asset found, return empty response
- if assetJSON == nil {
- log.Printf("%v does not exist in collection %v", assetID, assetCollection)
- return nil, nil
- }
-
- var asset *Asset
- err = json.Unmarshal(assetJSON, &asset)
- if err != nil {
- return nil, fmt.Errorf("failed to unmarshal JSON: %v", err)
- }
-
- return asset, nil
-
-}
-
-// ReadAssetPrivateDetails reads the asset private details in organization specific collection
-func (s *SmartContract) ReadAssetPrivateDetails(ctx contractapi.TransactionContextInterface, collection string, assetID string) (*AssetPrivateDetails, error) {
- log.Printf("ReadAssetPrivateDetails: collection %v, ID %v", collection, assetID)
- assetDetailsJSON, err := ctx.GetStub().GetPrivateData(collection, assetID) // Get the asset from chaincode state
- if err != nil {
- return nil, fmt.Errorf("failed to read asset details: %v", err)
- }
- if assetDetailsJSON == nil {
- log.Printf("AssetPrivateDetails for %v does not exist in collection %v", assetID, collection)
- return nil, nil
- }
-
- var assetDetails *AssetPrivateDetails
- err = json.Unmarshal(assetDetailsJSON, &assetDetails)
- if err != nil {
- return nil, fmt.Errorf("failed to unmarshal JSON: %v", err)
- }
-
- return assetDetails, nil
-}
-
-// ReadTransferAgreement gets the buyer's identity from the transfer agreement from collection
-func (s *SmartContract) ReadTransferAgreement(ctx contractapi.TransactionContextInterface, assetID string) (*TransferAgreement, error) {
- log.Printf("ReadTransferAgreement: collection %v, ID %v", assetCollection, assetID)
- // composite key for TransferAgreement of this asset
- transferAgreeKey, err := ctx.GetStub().CreateCompositeKey(transferAgreementObjectType, []string{assetID})
- if err != nil {
- return nil, fmt.Errorf("failed to create composite key: %v", err)
- }
-
- buyerIdentity, err := ctx.GetStub().GetPrivateData(assetCollection, transferAgreeKey) // Get the identity from collection
- if err != nil {
- return nil, fmt.Errorf("failed to read TransferAgreement: %v", err)
- }
- if buyerIdentity == nil {
- log.Printf("TransferAgreement for %v does not exist", assetID)
- return nil, nil
- }
- agreement := &TransferAgreement{
- ID: assetID,
- BuyerID: string(buyerIdentity),
- }
- return agreement, nil
-}
-
-// GetAssetByRange performs a range query based on the start and end keys provided. Range
-// queries can be used to read data from private data collections, but can not be used in
-// a transaction that also writes to private data.
-func (s *SmartContract) GetAssetByRange(ctx contractapi.TransactionContextInterface, startKey string, endKey string) ([]*Asset, error) {
-
- resultsIterator, err := ctx.GetStub().GetPrivateDataByRange(assetCollection, startKey, endKey)
- if err != nil {
- return nil, err
- }
- defer resultsIterator.Close()
-
- results := []*Asset{}
-
- for resultsIterator.HasNext() {
- response, err := resultsIterator.Next()
- if err != nil {
- return nil, err
- }
-
- var asset *Asset
- err = json.Unmarshal(response.Value, &asset)
- if err != nil {
- return nil, fmt.Errorf("failed to unmarshal JSON: %v", err)
- }
-
- results = append(results, asset)
- }
-
- return results, nil
-
-}
-
-// =======Rich queries =========================================================================
-// Two examples of rich queries are provided below (parameterized query and ad hoc query).
-// Rich queries pass a query string to the state database.
-// Rich queries are only supported by state database implementations
-// that support rich query (e.g. CouchDB).
-// The query string is in the syntax of the underlying state database.
-// With rich queries there is no guarantee that the result set hasn't changed between
-// endorsement time and commit time, aka 'phantom reads'.
-// Therefore, rich queries should not be used in update transactions, unless the
-// application handles the possibility of result set changes between endorsement and commit time.
-// Rich queries can be used for point-in-time queries against a peer.
-// ============================================================================================
-
-// ===== Example: Parameterized rich query =================================================
-
-// QueryAssetByOwner queries for assets based on assetType, owner.
-// This is an example of a parameterized query where the query logic is baked into the chaincode,
-// and accepting a single query parameter (owner).
-// Only available on state databases that support rich query (e.g. CouchDB)
-// =========================================================================================
-func (s *SmartContract) QueryAssetByOwner(ctx contractapi.TransactionContextInterface, assetType string, owner string) ([]*Asset, error) {
-
- queryString := fmt.Sprintf("{\"selector\":{\"objectType\":\"%v\",\"owner\":\"%v\"}}", assetType, owner)
-
- queryResults, err := s.getQueryResultForQueryString(ctx, queryString)
- if err != nil {
- return nil, err
- }
- return queryResults, nil
-}
-
-// QueryAssets uses a query string to perform a query for assets.
-// Query string matching state database syntax is passed in and executed as is.
-// Supports ad hoc queries that can be defined at runtime by the client.
-// If this is not desired, follow the QueryAssetByOwner example for parameterized queries.
-// Only available on state databases that support rich query (e.g. CouchDB)
-func (s *SmartContract) QueryAssets(ctx contractapi.TransactionContextInterface, queryString string) ([]*Asset, error) {
-
- queryResults, err := s.getQueryResultForQueryString(ctx, queryString)
- if err != nil {
- return nil, err
- }
- return queryResults, nil
-}
-
-// getQueryResultForQueryString executes the passed in query string.
-func (s *SmartContract) getQueryResultForQueryString(ctx contractapi.TransactionContextInterface, queryString string) ([]*Asset, error) {
-
- resultsIterator, err := ctx.GetStub().GetPrivateDataQueryResult(assetCollection, queryString)
- if err != nil {
- return nil, err
- }
- defer resultsIterator.Close()
-
- results := []*Asset{}
-
- for resultsIterator.HasNext() {
- response, err := resultsIterator.Next()
- if err != nil {
- return nil, err
- }
- var asset *Asset
-
- err = json.Unmarshal(response.Value, &asset)
- if err != nil {
- return nil, fmt.Errorf("failed to unmarshal JSON: %v", err)
- }
-
- results = append(results, asset)
- }
- return results, nil
-}
diff --git a/asset-transfer-private-data/chaincode-go/chaincode/asset_queries_test.go b/asset-transfer-private-data/chaincode-go/chaincode/asset_queries_test.go
deleted file mode 100644
index c35e9f20..00000000
--- a/asset-transfer-private-data/chaincode-go/chaincode/asset_queries_test.go
+++ /dev/null
@@ -1,185 +0,0 @@
-/*
-Copyright IBM Corp. All Rights Reserved.
-
-SPDX-License-Identifier: Apache-2.0
-*/
-package chaincode_test
-
-import (
- "encoding/json"
- "fmt"
- "testing"
-
- "github.com/hyperledger/fabric-protos-go-apiv2/ledger/queryresult"
-
- "github.com/hyperledger/fabric-samples/asset-transfer-private-data/chaincode-go/chaincode"
- "github.com/hyperledger/fabric-samples/asset-transfer-private-data/chaincode-go/chaincode/mocks"
- "github.com/stretchr/testify/require"
-)
-
-/*
-For details on generating the mocks, see comments in the file asset_transfer_test.go
-*/
-func TestReadAsset(t *testing.T) {
- transactionContext, chaincodeStub := prepMocksAsOrg1()
- assetTransferCC := chaincode.SmartContract{}
-
- assetBytes, err := assetTransferCC.ReadAsset(transactionContext, "id1")
- require.NoError(t, err)
- require.Nil(t, assetBytes)
-
- chaincodeStub.GetPrivateDataReturns(nil, fmt.Errorf("unable to retrieve asset"))
- assetBytes, err = assetTransferCC.ReadAsset(transactionContext, "id1")
- require.EqualError(t, err, "failed to read asset: unable to retrieve asset")
-
- testAsset := &chaincode.Asset{
- ID: "id1",
- Type: "testfulasset",
- Color: "gray",
- Size: 7,
- Owner: myOrg1Clientid,
- }
- setReturnPrivateDataInStub(t, chaincodeStub, testAsset)
- assetRead, err := assetTransferCC.ReadAsset(transactionContext, "id1")
- require.NoError(t, err)
- require.Equal(t, testAsset, assetRead)
-}
-
-func TestReadAssetPrivateDetails(t *testing.T) {
- transactionContext, chaincodeStub := prepMocksAsOrg1()
- assetTransferCC := chaincode.SmartContract{}
-
- assetBytes, err := assetTransferCC.ReadAssetPrivateDetails(transactionContext, myOrg1PrivCollection, "id1")
- require.NoError(t, err)
- require.Nil(t, assetBytes)
-
- // read from the collection with no access
- chaincodeStub.GetPrivateDataReturns(nil, fmt.Errorf("collection not found"))
- assetBytes, err = assetTransferCC.ReadAssetPrivateDetails(transactionContext, myOrg2PrivCollection, "id1")
- require.EqualError(t, err, "failed to read asset details: collection not found")
-
- returnPrivData := &chaincode.AssetPrivateDetails{
- ID: "id1",
- AppraisedValue: 5,
- }
- setReturnAssetPrivateDetailsInStub(t, chaincodeStub, returnPrivData)
- assetRead, err := assetTransferCC.ReadAssetPrivateDetails(transactionContext, myOrg1PrivCollection, "id1")
- require.NoError(t, err)
- require.Equal(t, returnPrivData, assetRead)
-}
-
-func TestReadTransferAgreement(t *testing.T) {
- transactionContext, chaincodeStub := prepMocksAsOrg1()
- assetTransferCC := chaincode.SmartContract{}
-
- // TransferAgreement does not exist
- assetBytes, err := assetTransferCC.ReadTransferAgreement(transactionContext, "id1")
- require.NoError(t, err)
- require.Nil(t, assetBytes)
-
- chaincodeStub.GetPrivateDataReturns([]byte(myOrg2Clientid), nil)
- expectedData := &chaincode.TransferAgreement{
- ID: "id1",
- BuyerID: myOrg2Clientid,
- }
- dataRead, err := assetTransferCC.ReadTransferAgreement(transactionContext, "id1")
- require.NoError(t, err)
- require.Equal(t, expectedData, dataRead)
-}
-
-func TestQueryAssetByOwner(t *testing.T) {
- transactionContext, chaincodeStub := prepMocksAsOrg1()
-
- asset := &chaincode.Asset{Type: "valuableasset", ID: "asset1", Owner: "user1"}
- asset1Bytes, err := json.Marshal(asset)
- require.NoError(t, err)
-
- iterator := &mocks.StateQueryIterator{}
- iterator.HasNextReturnsOnCall(0, true)
- iterator.HasNextReturnsOnCall(1, false)
- iterator.NextReturns(&queryresult.KV{Value: asset1Bytes}, nil)
- chaincodeStub.GetPrivateDataQueryResultReturns(iterator, nil)
-
- assetTransferCC := &chaincode.SmartContract{}
- assets, err := assetTransferCC.QueryAssetByOwner(transactionContext, "valuableasset", "user1")
- require.NoError(t, err)
- require.Equal(t, []*chaincode.Asset{asset}, assets)
-
- iterator.HasNextReturns(true)
- iterator.NextReturns(nil, fmt.Errorf("failed retrieving next item"))
- assets, err = assetTransferCC.QueryAssetByOwner(transactionContext, "valuableasset", "user1")
- require.EqualError(t, err, "failed retrieving next item")
- require.Nil(t, assets)
-
-}
-
-func TestQueryAssets(t *testing.T) {
- transactionContext, chaincodeStub := prepMocksAsOrg1()
- // Iterator with no records
- iterator := &mocks.StateQueryIterator{}
- iterator.HasNextReturns(false)
- chaincodeStub.GetPrivateDataQueryResultReturns(iterator, nil)
-
- assetTransferCC := &chaincode.SmartContract{}
- assets, err := assetTransferCC.QueryAssets(transactionContext, "querystr")
- require.NoError(t, err)
- require.Equal(t, []*chaincode.Asset{}, assets)
-
- iterator = &mocks.StateQueryIterator{}
- chaincodeStub.GetPrivateDataQueryResultReturns(iterator, nil)
- iterator.HasNextReturns(true)
- iterator.NextReturns(nil, fmt.Errorf("failed retrieving next item"))
- assets, err = assetTransferCC.QueryAssets(transactionContext, "querystr")
- require.EqualError(t, err, "failed retrieving next item")
- require.Nil(t, assets)
-
- asset := &chaincode.Asset{Type: "valuableasset", ID: "asset1", Owner: "user1"}
- asset1Bytes, err := json.Marshal(asset)
- require.NoError(t, err)
-
- iterator = &mocks.StateQueryIterator{}
- chaincodeStub.GetPrivateDataQueryResultReturns(iterator, nil)
- iterator.HasNextReturnsOnCall(0, true)
- iterator.HasNextReturnsOnCall(1, false)
- iterator.NextReturns(&queryresult.KV{Value: asset1Bytes}, nil)
-
- assets, err = assetTransferCC.QueryAssets(transactionContext, "querystr")
- require.NoError(t, err)
- require.Equal(t, []*chaincode.Asset{asset}, assets)
-}
-
-func TestGetAssetByRange(t *testing.T) {
- transactionContext, chaincodeStub := prepMocksAsOrg1()
- // Iterator with no records
- iterator := &mocks.StateQueryIterator{}
- iterator.HasNextReturns(false)
- chaincodeStub.GetPrivateDataByRangeReturns(iterator, nil)
-
- assetTransferCC := &chaincode.SmartContract{}
- assets, err := assetTransferCC.GetAssetByRange(transactionContext, "st", "end")
- require.NoError(t, err)
- require.Equal(t, []*chaincode.Asset{}, assets)
-
- iterator = &mocks.StateQueryIterator{}
- chaincodeStub.GetPrivateDataByRangeReturns(iterator, nil)
- iterator.HasNextReturns(true)
- iterator.NextReturns(nil, fmt.Errorf("failed retrieving next item"))
- assets, err = assetTransferCC.GetAssetByRange(transactionContext, "st", "end")
- require.EqualError(t, err, "failed retrieving next item")
- require.Nil(t, assets)
-
- asset := &chaincode.Asset{Type: "valuableasset", ID: "asset1", Owner: "user1"}
- asset1Bytes, err := json.Marshal(asset)
- require.NoError(t, err)
-
- iterator = &mocks.StateQueryIterator{}
- chaincodeStub.GetPrivateDataByRangeReturns(iterator, nil)
- iterator.HasNextReturnsOnCall(0, true)
- iterator.HasNextReturnsOnCall(1, false)
- iterator.NextReturns(&queryresult.KV{Value: asset1Bytes}, nil)
-
- assets, err = assetTransferCC.GetAssetByRange(transactionContext, "st", "end")
- require.NoError(t, err)
- require.Equal(t, []*chaincode.Asset{asset}, assets)
-
-}
diff --git a/asset-transfer-private-data/chaincode-go/chaincode/asset_transfer.go b/asset-transfer-private-data/chaincode-go/chaincode/asset_transfer.go
deleted file mode 100644
index 58817a56..00000000
--- a/asset-transfer-private-data/chaincode-go/chaincode/asset_transfer.go
+++ /dev/null
@@ -1,652 +0,0 @@
-/*
-Copyright IBM Corp. All Rights Reserved.
-
-SPDX-License-Identifier: Apache-2.0
-*/
-
-package chaincode
-
-import (
- "bytes"
- "encoding/base64"
- "encoding/json"
- "fmt"
- "log"
-
- "github.com/hyperledger/fabric-chaincode-go/v2/shim"
- "github.com/hyperledger/fabric-contract-api-go/v2/contractapi"
-)
-
-const assetCollection = "assetCollection"
-const transferAgreementObjectType = "transferAgreement"
-
-// SmartContract of this fabric sample
-type SmartContract struct {
- contractapi.Contract
-}
-
-// Asset describes main asset details that are visible to all organizations
-type Asset struct {
- Type string `json:"objectType"` //Type is used to distinguish the various types of objects in state database
- ID string `json:"assetID"`
- Color string `json:"color"`
- Size int `json:"size"`
- Owner string `json:"owner"`
-}
-
-// AssetPrivateDetails describes details that are private to owners
-type AssetPrivateDetails struct {
- ID string `json:"assetID"`
- AppraisedValue int `json:"appraisedValue"`
-}
-
-// TransferAgreement describes the buyer agreement returned by ReadTransferAgreement
-type TransferAgreement struct {
- ID string `json:"assetID"`
- BuyerID string `json:"buyerID"`
-}
-
-// CreateAsset creates a new asset by placing the main asset details in the assetCollection
-// that can be read by both organizations. The appraisal value is stored in the owners org specific collection.
-func (s *SmartContract) CreateAsset(ctx contractapi.TransactionContextInterface) error {
-
- // Get new asset from transient map
- transientMap, err := ctx.GetStub().GetTransient()
- if err != nil {
- return fmt.Errorf("error getting transient: %v", err)
- }
-
- // Asset properties are private, therefore they get passed in transient field, instead of func args
- transientAssetJSON, ok := transientMap["asset_properties"]
- if !ok {
- // log error to stdout
- return fmt.Errorf("asset not found in the transient map input")
- }
-
- type assetTransientInput struct {
- Type string `json:"objectType"` //Type is used to distinguish the various types of objects in state database
- ID string `json:"assetID"`
- Color string `json:"color"`
- Size int `json:"size"`
- AppraisedValue int `json:"appraisedValue"`
- }
-
- var assetInput assetTransientInput
- err = json.Unmarshal(transientAssetJSON, &assetInput)
- if err != nil {
- return fmt.Errorf("failed to unmarshal JSON: %v", err)
- }
-
- if len(assetInput.Type) == 0 {
- return fmt.Errorf("objectType field must be a non-empty string")
- }
- if len(assetInput.ID) == 0 {
- return fmt.Errorf("assetID field must be a non-empty string")
- }
- if len(assetInput.Color) == 0 {
- return fmt.Errorf("color field must be a non-empty string")
- }
- if assetInput.Size <= 0 {
- return fmt.Errorf("size field must be a positive integer")
- }
- if assetInput.AppraisedValue <= 0 {
- return fmt.Errorf("appraisedValue field must be a positive integer")
- }
-
- // Check if asset already exists
- assetAsBytes, err := ctx.GetStub().GetPrivateData(assetCollection, assetInput.ID)
- if err != nil {
- return fmt.Errorf("failed to get asset: %v", err)
- } else if assetAsBytes != nil {
- fmt.Println("Asset already exists: " + assetInput.ID)
- return fmt.Errorf("this asset already exists: " + assetInput.ID)
- }
-
- // Get ID of submitting client identity
- clientID, err := submittingClientIdentity(ctx)
- if err != nil {
- return err
- }
-
- // Verify that the client is submitting request to peer in their organization
- // This is to ensure that a client from another org doesn't attempt to read or
- // write private data from this peer.
- err = verifyClientOrgMatchesPeerOrg(ctx)
- if err != nil {
- return fmt.Errorf("CreateAsset cannot be performed: Error %v", err)
- }
-
- // Make submitting client the owner
- asset := Asset{
- Type: assetInput.Type,
- ID: assetInput.ID,
- Color: assetInput.Color,
- Size: assetInput.Size,
- Owner: clientID,
- }
- assetJSONasBytes, err := json.Marshal(asset)
- if err != nil {
- return fmt.Errorf("failed to marshal asset into JSON: %v", err)
- }
-
- // Save asset to private data collection
- // Typical logger, logs to stdout/file in the fabric managed docker container, running this chaincode
- // Look for container name like dev-peer0.org1.example.com-{chaincodename_version}-xyz
- log.Printf("CreateAsset Put: collection %v, ID %v, owner %v", assetCollection, assetInput.ID, clientID)
-
- err = ctx.GetStub().PutPrivateData(assetCollection, assetInput.ID, assetJSONasBytes)
- if err != nil {
- return fmt.Errorf("failed to put asset into private data collecton: %v", err)
- }
-
- // Save asset details to collection visible to owning organization
- assetPrivateDetails := AssetPrivateDetails{
- ID: assetInput.ID,
- AppraisedValue: assetInput.AppraisedValue,
- }
-
- assetPrivateDetailsAsBytes, err := json.Marshal(assetPrivateDetails) // marshal asset details to JSON
- if err != nil {
- return fmt.Errorf("failed to marshal into JSON: %v", err)
- }
-
- // Get collection name for this organization.
- orgCollection, err := getCollectionName(ctx)
- if err != nil {
- return fmt.Errorf("failed to infer private collection name for the org: %v", err)
- }
-
- // Put asset appraised value into owners org specific private data collection
- log.Printf("Put: collection %v, ID %v", orgCollection, assetInput.ID)
- err = ctx.GetStub().PutPrivateData(orgCollection, assetInput.ID, assetPrivateDetailsAsBytes)
- if err != nil {
- return fmt.Errorf("failed to put asset private details: %v", err)
- }
- return nil
-}
-
-// AgreeToTransfer is used by the potential buyer of the asset to agree to the
-// asset value. The agreed to appraisal value is stored in the buying orgs
-// org specifc collection, while the buyer client ID is stored in the asset collection
-// using a composite key
-func (s *SmartContract) AgreeToTransfer(ctx contractapi.TransactionContextInterface) error {
-
- // Get ID of submitting client identity
- clientID, err := submittingClientIdentity(ctx)
- if err != nil {
- return err
- }
-
- // Value is private, therefore it gets passed in transient field
- transientMap, err := ctx.GetStub().GetTransient()
- if err != nil {
- return fmt.Errorf("error getting transient: %v", err)
- }
-
- // Persist the JSON bytes as-is so that there is no risk of nondeterministic marshaling.
- valueJSONasBytes, ok := transientMap["asset_value"]
- if !ok {
- return fmt.Errorf("asset_value key not found in the transient map")
- }
-
- // Unmarshal the tranisent map to get the asset ID.
- var valueJSON AssetPrivateDetails
- err = json.Unmarshal(valueJSONasBytes, &valueJSON)
- if err != nil {
- return fmt.Errorf("failed to unmarshal JSON: %v", err)
- }
-
- // Do some error checking since we get the chance
- if len(valueJSON.ID) == 0 {
- return fmt.Errorf("assetID field must be a non-empty string")
- }
- if valueJSON.AppraisedValue <= 0 {
- return fmt.Errorf("appraisedValue field must be a positive integer")
- }
-
- // Read asset from the private data collection
- asset, err := s.ReadAsset(ctx, valueJSON.ID)
- if err != nil {
- return fmt.Errorf("error reading asset: %v", err)
- }
- if asset == nil {
- return fmt.Errorf("%v does not exist", valueJSON.ID)
- }
- // Verify that the client is submitting request to peer in their organization
- err = verifyClientOrgMatchesPeerOrg(ctx)
- if err != nil {
- return fmt.Errorf("AgreeToTransfer cannot be performed: Error %v", err)
- }
-
- // Get collection name for this organization. Needs to be read by a member of the organization.
- orgCollection, err := getCollectionName(ctx)
- if err != nil {
- return fmt.Errorf("failed to infer private collection name for the org: %v", err)
- }
-
- log.Printf("AgreeToTransfer Put: collection %v, ID %v", orgCollection, valueJSON.ID)
- // Put agreed value in the org specifc private data collection
- err = ctx.GetStub().PutPrivateData(orgCollection, valueJSON.ID, valueJSONasBytes)
- if err != nil {
- return fmt.Errorf("failed to put asset bid: %v", err)
- }
-
- // Create agreeement that indicates which identity has agreed to purchase
- // In a more realistic transfer scenario, a transfer agreement would be secured to ensure that it cannot
- // be overwritten by another channel member
- transferAgreeKey, err := ctx.GetStub().CreateCompositeKey(transferAgreementObjectType, []string{valueJSON.ID})
- if err != nil {
- return fmt.Errorf("failed to create composite key: %v", err)
- }
-
- log.Printf("AgreeToTransfer Put: collection %v, ID %v, Key %v", assetCollection, valueJSON.ID, transferAgreeKey)
- err = ctx.GetStub().PutPrivateData(assetCollection, transferAgreeKey, []byte(clientID))
- if err != nil {
- return fmt.Errorf("failed to put asset bid: %v", err)
- }
-
- return nil
-}
-
-// TransferAsset transfers the asset to the new owner by setting a new owner ID
-func (s *SmartContract) TransferAsset(ctx contractapi.TransactionContextInterface) error {
-
- transientMap, err := ctx.GetStub().GetTransient()
- if err != nil {
- return fmt.Errorf("error getting transient %v", err)
- }
-
- // Asset properties are private, therefore they get passed in transient field
- transientTransferJSON, ok := transientMap["asset_owner"]
- if !ok {
- return fmt.Errorf("asset owner not found in the transient map")
- }
-
- type assetTransferTransientInput struct {
- ID string `json:"assetID"`
- BuyerMSP string `json:"buyerMSP"`
- }
-
- var assetTransferInput assetTransferTransientInput
- err = json.Unmarshal(transientTransferJSON, &assetTransferInput)
- if err != nil {
- return fmt.Errorf("failed to unmarshal JSON: %v", err)
- }
-
- if len(assetTransferInput.ID) == 0 {
- return fmt.Errorf("assetID field must be a non-empty string")
- }
- if len(assetTransferInput.BuyerMSP) == 0 {
- return fmt.Errorf("buyerMSP field must be a non-empty string")
- }
- log.Printf("TransferAsset: verify asset exists ID %v", assetTransferInput.ID)
- // Read asset from the private data collection
- asset, err := s.ReadAsset(ctx, assetTransferInput.ID)
- if err != nil {
- return fmt.Errorf("error reading asset: %v", err)
- }
- if asset == nil {
- return fmt.Errorf("%v does not exist", assetTransferInput.ID)
- }
- // Verify that the client is submitting request to peer in their organization
- err = verifyClientOrgMatchesPeerOrg(ctx)
- if err != nil {
- return fmt.Errorf("TransferAsset cannot be performed: Error %v", err)
- }
-
- // Verify transfer details and transfer owner
- err = s.verifyAgreement(ctx, assetTransferInput.ID, asset.Owner, assetTransferInput.BuyerMSP)
- if err != nil {
- return fmt.Errorf("failed transfer verification: %v", err)
- }
-
- transferAgreement, err := s.ReadTransferAgreement(ctx, assetTransferInput.ID)
- if err != nil {
- return fmt.Errorf("failed ReadTransferAgreement to find buyerID: %v", err)
- }
- if transferAgreement.BuyerID == "" {
- return fmt.Errorf("BuyerID not found in TransferAgreement for %v", assetTransferInput.ID)
- }
-
- // Transfer asset in private data collection to new owner
- asset.Owner = transferAgreement.BuyerID
-
- assetJSONasBytes, err := json.Marshal(asset)
- if err != nil {
- return fmt.Errorf("failed marshalling asset %v: %v", assetTransferInput.ID, err)
- }
-
- log.Printf("TransferAsset Put: collection %v, ID %v", assetCollection, assetTransferInput.ID)
- err = ctx.GetStub().PutPrivateData(assetCollection, assetTransferInput.ID, assetJSONasBytes) //rewrite the asset
- if err != nil {
- return err
- }
-
- // Get collection name for this organization
- ownersCollection, err := getCollectionName(ctx)
- if err != nil {
- return fmt.Errorf("failed to infer private collection name for the org: %v", err)
- }
-
- // Delete the asset appraised value from this organization's private data collection
- err = ctx.GetStub().DelPrivateData(ownersCollection, assetTransferInput.ID)
- if err != nil {
- return err
- }
-
- // Delete the transfer agreement from the asset collection
- transferAgreeKey, err := ctx.GetStub().CreateCompositeKey(transferAgreementObjectType, []string{assetTransferInput.ID})
- if err != nil {
- return fmt.Errorf("failed to create composite key: %v", err)
- }
-
- err = ctx.GetStub().DelPrivateData(assetCollection, transferAgreeKey)
- if err != nil {
- return err
- }
-
- return nil
-
-}
-
-// verifyAgreement is an internal helper function used by TransferAsset to verify
-// that the transfer is being initiated by the owner and that the buyer has agreed
-// to the same appraisal value as the owner
-func (s *SmartContract) verifyAgreement(ctx contractapi.TransactionContextInterface, assetID string, owner string, buyerMSP string) error {
-
- // Check 1: verify that the transfer is being initiatied by the owner
-
- // Get ID of submitting client identity
- clientID, err := submittingClientIdentity(ctx)
- if err != nil {
- return err
- }
-
- if clientID != owner {
- return fmt.Errorf("error: submitting client identity does not own asset")
- }
-
- // Check 2: verify that the buyer has agreed to the appraised value
-
- // Get collection names
- collectionOwner, err := getCollectionName(ctx) // get owner collection from caller identity
- if err != nil {
- return fmt.Errorf("failed to infer private collection name for the org: %v", err)
- }
-
- collectionBuyer := buyerMSP + "PrivateCollection" // get buyers collection
-
- // Get hash of owners agreed to value
- ownerAppraisedValueHash, err := ctx.GetStub().GetPrivateDataHash(collectionOwner, assetID)
- if err != nil {
- return fmt.Errorf("failed to get hash of appraised value from owners collection %v: %v", collectionOwner, err)
- }
- if ownerAppraisedValueHash == nil {
- return fmt.Errorf("hash of appraised value for %v does not exist in collection %v", assetID, collectionOwner)
- }
-
- // Get hash of buyers agreed to value
- buyerAppraisedValueHash, err := ctx.GetStub().GetPrivateDataHash(collectionBuyer, assetID)
- if err != nil {
- return fmt.Errorf("failed to get hash of appraised value from buyer collection %v: %v", collectionBuyer, err)
- }
- if buyerAppraisedValueHash == nil {
- return fmt.Errorf("hash of appraised value for %v does not exist in collection %v. AgreeToTransfer must be called by the buyer first", assetID, collectionBuyer)
- }
-
- // Verify that the two hashes match
- if !bytes.Equal(ownerAppraisedValueHash, buyerAppraisedValueHash) {
- return fmt.Errorf("hash for appraised value for owner %x does not value for seller %x", ownerAppraisedValueHash, buyerAppraisedValueHash)
- }
-
- return nil
-}
-
-// DeleteAsset can be used by the owner of the asset to delete the asset
-func (s *SmartContract) DeleteAsset(ctx contractapi.TransactionContextInterface) error {
-
- transientMap, err := ctx.GetStub().GetTransient()
- if err != nil {
- return fmt.Errorf("Error getting transient: %v", err)
- }
-
- // Asset properties are private, therefore they get passed in transient field
- transientDeleteJSON, ok := transientMap["asset_delete"]
- if !ok {
- return fmt.Errorf("asset to delete not found in the transient map")
- }
-
- type assetDelete struct {
- ID string `json:"assetID"`
- }
-
- var assetDeleteInput assetDelete
- err = json.Unmarshal(transientDeleteJSON, &assetDeleteInput)
- if err != nil {
- return fmt.Errorf("failed to unmarshal JSON: %v", err)
- }
-
- if len(assetDeleteInput.ID) == 0 {
- return fmt.Errorf("assetID field must be a non-empty string")
- }
-
- // Verify that the client is submitting request to peer in their organization
- err = verifyClientOrgMatchesPeerOrg(ctx)
- if err != nil {
- return fmt.Errorf("DeleteAsset cannot be performed: Error %v", err)
- }
-
- log.Printf("Deleting Asset: %v", assetDeleteInput.ID)
- valAsbytes, err := ctx.GetStub().GetPrivateData(assetCollection, assetDeleteInput.ID) //get the asset from chaincode state
- if err != nil {
- return fmt.Errorf("failed to read asset: %v", err)
- }
- if valAsbytes == nil {
- return fmt.Errorf("asset not found: %v", assetDeleteInput.ID)
- }
-
- ownerCollection, err := getCollectionName(ctx) // Get owners collection
- if err != nil {
- return fmt.Errorf("failed to infer private collection name for the org: %v", err)
- }
-
- // Check the asset is in the caller org's private collection
- valAsbytes, err = ctx.GetStub().GetPrivateData(ownerCollection, assetDeleteInput.ID)
- if err != nil {
- return fmt.Errorf("failed to read asset from owner's Collection: %v", err)
- }
- if valAsbytes == nil {
- return fmt.Errorf("asset not found in owner's private Collection %v: %v", ownerCollection, assetDeleteInput.ID)
- }
-
- // delete the asset from state
- err = ctx.GetStub().DelPrivateData(assetCollection, assetDeleteInput.ID)
- if err != nil {
- return fmt.Errorf("failed to delete state: %v", err)
- }
-
- // Finally, delete private details of asset
- err = ctx.GetStub().DelPrivateData(ownerCollection, assetDeleteInput.ID)
- if err != nil {
- return err
- }
-
- return nil
-
-}
-
-// PurgeAsset can be used by the owner of the asset to delete the asset
-// Trigger removal of the asset
-func (s *SmartContract) PurgeAsset(ctx contractapi.TransactionContextInterface) error {
-
- transientMap, err := ctx.GetStub().GetTransient()
- if err != nil {
- return fmt.Errorf("Error getting transient: %v", err)
- }
-
- // Asset properties are private, therefore they get passed in transient field
- transientDeleteJSON, ok := transientMap["asset_purge"]
- if !ok {
- return fmt.Errorf("asset to purge not found in the transient map")
- }
-
- type assetPurge struct {
- ID string `json:"assetID"`
- }
-
- var assetPurgeInput assetPurge
- err = json.Unmarshal(transientDeleteJSON, &assetPurgeInput)
- if err != nil {
- return fmt.Errorf("failed to unmarshal JSON: %v", err)
- }
-
- if len(assetPurgeInput.ID) == 0 {
- return fmt.Errorf("assetID field must be a non-empty string")
- }
-
- // Verify that the client is submitting request to peer in their organization
- err = verifyClientOrgMatchesPeerOrg(ctx)
- if err != nil {
- return fmt.Errorf("PurgeAsset cannot be performed: Error %v", err)
- }
-
- log.Printf("Purging Asset: %v", assetPurgeInput.ID)
-
- // Note that there is no check here to see if the id exist; it might have been 'deleted' already
- // so a check here is pointless. We would need to call purge irrespective of the result
- // A delete can be called before purge, but is not essential
-
- ownerCollection, err := getCollectionName(ctx) // Get owners collection
- if err != nil {
- return fmt.Errorf("failed to infer private collection name for the org: %v", err)
- }
-
- // delete the asset from state
- err = ctx.GetStub().PurgePrivateData(assetCollection, assetPurgeInput.ID)
- if err != nil {
- return fmt.Errorf("failed to purge state from asset collection: %v", err)
- }
-
- // Finally, delete private details of asset
- err = ctx.GetStub().PurgePrivateData(ownerCollection, assetPurgeInput.ID)
- if err != nil {
- return fmt.Errorf("failed to purge state from owner collection: %v", err)
- }
-
- return nil
-
-}
-
-// DeleteTranferAgreement can be used by the buyer to withdraw a proposal from
-// the asset collection and from his own collection.
-func (s *SmartContract) DeleteTranferAgreement(ctx contractapi.TransactionContextInterface) error {
-
- transientMap, err := ctx.GetStub().GetTransient()
- if err != nil {
- return fmt.Errorf("error getting transient: %v", err)
- }
-
- // Asset properties are private, therefore they get passed in transient field
- transientDeleteJSON, ok := transientMap["agreement_delete"]
- if !ok {
- return fmt.Errorf("asset to delete not found in the transient map")
- }
-
- type assetDelete struct {
- ID string `json:"assetID"`
- }
-
- var assetDeleteInput assetDelete
- err = json.Unmarshal(transientDeleteJSON, &assetDeleteInput)
- if err != nil {
- return fmt.Errorf("failed to unmarshal JSON: %v", err)
- }
-
- if len(assetDeleteInput.ID) == 0 {
- return fmt.Errorf("transient input ID field must be a non-empty string")
- }
-
- // Verify that the client is submitting request to peer in their organization
- err = verifyClientOrgMatchesPeerOrg(ctx)
- if err != nil {
- return fmt.Errorf("DeleteTranferAgreement cannot be performed: Error %v", err)
- }
- // Delete private details of agreement
- orgCollection, err := getCollectionName(ctx) // Get proposers collection.
- if err != nil {
- return fmt.Errorf("failed to infer private collection name for the org: %v", err)
- }
- tranferAgreeKey, err := ctx.GetStub().CreateCompositeKey(transferAgreementObjectType, []string{assetDeleteInput.
- ID}) // Create composite key
- if err != nil {
- return fmt.Errorf("failed to create composite key: %v", err)
- }
-
- valAsbytes, err := ctx.GetStub().GetPrivateData(assetCollection, tranferAgreeKey) //get the transfer_agreement
- if err != nil {
- return fmt.Errorf("failed to read transfer_agreement: %v", err)
- }
- if valAsbytes == nil {
- return fmt.Errorf("asset's transfer_agreement does not exist: %v", assetDeleteInput.ID)
- }
-
- log.Printf("Deleting TranferAgreement: %v", assetDeleteInput.ID)
- err = ctx.GetStub().DelPrivateData(orgCollection, assetDeleteInput.ID) // Delete the asset
- if err != nil {
- return err
- }
-
- // Delete transfer agreement record
- err = ctx.GetStub().DelPrivateData(assetCollection, tranferAgreeKey) // remove agreement from state
- if err != nil {
- return err
- }
-
- return nil
-
-}
-
-// getCollectionName is an internal helper function to get collection of submitting client identity.
-func getCollectionName(ctx contractapi.TransactionContextInterface) (string, error) {
-
- // Get the MSP ID of submitting client identity
- clientMSPID, err := ctx.GetClientIdentity().GetMSPID()
- if err != nil {
- return "", fmt.Errorf("failed to get verified MSPID: %v", err)
- }
-
- // Create the collection name
- orgCollection := clientMSPID + "PrivateCollection"
-
- return orgCollection, nil
-}
-
-// verifyClientOrgMatchesPeerOrg is an internal function used verify client org id and matches peer org id.
-func verifyClientOrgMatchesPeerOrg(ctx contractapi.TransactionContextInterface) error {
- clientMSPID, err := ctx.GetClientIdentity().GetMSPID()
- if err != nil {
- return fmt.Errorf("failed getting the client's MSPID: %v", err)
- }
- peerMSPID, err := shim.GetMSPID()
- if err != nil {
- return fmt.Errorf("failed getting the peer's MSPID: %v", err)
- }
-
- if clientMSPID != peerMSPID {
- return fmt.Errorf("client from org %v is not authorized to read or write private data from an org %v peer", clientMSPID, peerMSPID)
- }
-
- return nil
-}
-
-func submittingClientIdentity(ctx contractapi.TransactionContextInterface) (string, error) {
- b64ID, err := ctx.GetClientIdentity().GetID()
- if err != nil {
- return "", fmt.Errorf("Failed to read clientID: %v", err)
- }
- decodeID, err := base64.StdEncoding.DecodeString(b64ID)
- if err != nil {
- return "", fmt.Errorf("failed to base64 decode clientID: %v", err)
- }
- return string(decodeID), nil
-}
diff --git a/asset-transfer-private-data/chaincode-go/chaincode/asset_transfer_test.go b/asset-transfer-private-data/chaincode-go/chaincode/asset_transfer_test.go
deleted file mode 100644
index 6eaf338d..00000000
--- a/asset-transfer-private-data/chaincode-go/chaincode/asset_transfer_test.go
+++ /dev/null
@@ -1,445 +0,0 @@
-/*
-Copyright IBM Corp. All Rights Reserved.
-
-SPDX-License-Identifier: Apache-2.0
-*/
-package chaincode_test
-
-import (
- "encoding/base64"
- "encoding/json"
- "os"
- "testing"
-
- "github.com/hyperledger/fabric-chaincode-go/v2/pkg/cid"
- "github.com/hyperledger/fabric-chaincode-go/v2/shim"
- "github.com/hyperledger/fabric-contract-api-go/v2/contractapi"
-
- "github.com/hyperledger/fabric-samples/asset-transfer-private-data/chaincode-go/chaincode"
- "github.com/hyperledger/fabric-samples/asset-transfer-private-data/chaincode-go/chaincode/mocks"
- "github.com/stretchr/testify/require"
-)
-
-/*
-These unit tests use mocks to simulate chaincode-api & fabric interactions
-The mocks are generated using counterfeiter directives in the comments (starting with "go:generate counterfeiter")
-All files in mocks/* are generated by running following, in the directory with your directive:
- `go generate`
-*/
-
-//go:generate counterfeiter -o mocks/transaction.go -fake-name TransactionContext . transactionContext
-type transactionContext interface {
- contractapi.TransactionContextInterface
-}
-
-//go:generate counterfeiter -o mocks/chaincodestub.go -fake-name ChaincodeStub . chaincodeStub
-type chaincodeStub interface {
- shim.ChaincodeStubInterface
-}
-
-//go:generate counterfeiter -o mocks/statequeryiterator.go -fake-name StateQueryIterator . stateQueryIterator
-type stateQueryIterator interface {
- shim.StateQueryIteratorInterface
-}
-
-//go:generate counterfeiter -o mocks/clientIdentity.go -fake-name ClientIdentity . clientIdentity
-type clientIdentity interface {
- cid.ClientIdentity
-}
-
-const assetCollectionName = "assetCollection"
-const transferAgreementObjectType = "transferAgreement"
-const myOrg1Msp = "Org1Testmsp"
-const myOrg1Clientid = "myOrg1Userid"
-const myOrg1PrivCollection = "Org1TestmspPrivateCollection"
-const myOrg2Msp = "Org2Testmsp"
-const myOrg2Clientid = "myOrg2Userid"
-const myOrg2PrivCollection = "Org2TestmspPrivateCollection"
-
-type assetTransientInput struct {
- Type string `json:"objectType"`
- ID string `json:"assetID"`
- Color string `json:"color"`
- Size int `json:"size"`
- AppraisedValue int `json:"appraisedValue"`
-}
-
-type assetTransferTransientInput struct {
- ID string `json:"assetID"`
- BuyerMSP string `json:"buyerMSP"`
-}
-
-func TestCreateAssetBadInput(t *testing.T) {
- transactionContext, chaincodeStub := prepMocksAsOrg1()
- assetTransferCC := chaincode.SmartContract{}
-
- // No transient map
- err := assetTransferCC.CreateAsset(transactionContext)
- require.EqualError(t, err, "asset not found in the transient map input")
-
- // transient map with incomplete asset data
- assetPropMap := map[string][]byte{
- "asset_properties": []byte("ill formatted property"),
- }
- chaincodeStub.GetTransientReturns(assetPropMap, nil)
- err = assetTransferCC.CreateAsset(transactionContext)
- require.Error(t, err, "Expected error: transient map with incomplete asset data")
- require.Contains(t, err.Error(), "failed to unmarshal JSON")
-
- testAsset := &assetTransientInput{
- Type: "testfulasset",
- }
- setReturnAssetPropsInTransientMap(t, chaincodeStub, testAsset)
- err = assetTransferCC.CreateAsset(transactionContext)
- require.EqualError(t, err, "assetID field must be a non-empty string")
-
- testAsset = &assetTransientInput{
- ID: "id1",
- Color: "gray",
- }
- setReturnAssetPropsInTransientMap(t, chaincodeStub, testAsset)
- err = assetTransferCC.CreateAsset(transactionContext)
- require.EqualError(t, err, "objectType field must be a non-empty string")
-
- // case when asset exists, GetPrivateData returns a valid data from ledger
- testAsset = &assetTransientInput{
- ID: "id1",
- Type: "testfulasset",
- Color: "gray",
- Size: 7,
- AppraisedValue: 500,
- }
- setReturnAssetPropsInTransientMap(t, chaincodeStub, testAsset)
- chaincodeStub.GetPrivateDataReturns([]byte{}, nil)
- err = assetTransferCC.CreateAsset(transactionContext)
- require.EqualError(t, err, "this asset already exists: id1")
-}
-
-func TestCreateAssetSuccessful(t *testing.T) {
- transactionContext, chaincodeStub := prepMocksAsOrg1()
- assetTransferCC := chaincode.SmartContract{}
- testAsset := &assetTransientInput{
- ID: "id1",
- Type: "testfulasset",
- Color: "gray",
- Size: 7,
- AppraisedValue: 500,
- }
- setReturnAssetPropsInTransientMap(t, chaincodeStub, testAsset)
- err := assetTransferCC.CreateAsset(transactionContext)
- require.NoError(t, err)
- // Validate PutPrivateData calls
- calledCollection, calledId, _ := chaincodeStub.PutPrivateDataArgsForCall(0)
- require.Equal(t, assetCollectionName, calledCollection)
- require.Equal(t, "id1", calledId)
-
- expectedPrivateDetails := &chaincode.AssetPrivateDetails{
- ID: "id1",
- AppraisedValue: 500,
- }
- assetBytes, err := json.Marshal(expectedPrivateDetails)
- calledCollection, calledId, calledAssetBytes := chaincodeStub.PutPrivateDataArgsForCall(1)
- require.Equal(t, myOrg1PrivCollection, calledCollection)
- require.Equal(t, "id1", calledId)
- require.Equal(t, assetBytes, calledAssetBytes)
-}
-
-func TestAgreeToTransferBadInput(t *testing.T) {
- transactionContext, chaincodeStub := prepMocksAsOrg1()
- assetTransferCC := chaincode.SmartContract{}
-
- assetPrivDetail := &chaincode.AssetPrivateDetails{
- ID: "id1",
- // no AppraisedValue
- }
- setReturnAssetPrivateDetailsInTransientMap(t, chaincodeStub, assetPrivDetail)
- origAsset := chaincode.Asset{
- ID: "id1",
- Type: "testfulasset",
- Color: "gray",
- Size: 7,
- Owner: myOrg1Clientid,
- }
- setReturnPrivateDataInStub(t, chaincodeStub, &origAsset)
-
- err := assetTransferCC.AgreeToTransfer(transactionContext)
- require.EqualError(t, err, "appraisedValue field must be a positive integer")
-
- assetPrivDetail = &chaincode.AssetPrivateDetails{
- // no ID
- AppraisedValue: 500,
- }
- setReturnAssetPrivateDetailsInTransientMap(t, chaincodeStub, assetPrivDetail)
- err = assetTransferCC.AgreeToTransfer(transactionContext)
- require.EqualError(t, err, "assetID field must be a non-empty string")
-
- assetPrivDetail = &chaincode.AssetPrivateDetails{
- ID: "id1",
- AppraisedValue: 500,
- }
- setReturnAssetPrivateDetailsInTransientMap(t, chaincodeStub, assetPrivDetail)
- // asset does not exist
- setReturnPrivateDataInStub(t, chaincodeStub, nil)
- err = assetTransferCC.AgreeToTransfer(transactionContext)
- require.EqualError(t, err, "id1 does not exist")
-}
-
-func TestAgreeToTransferSuccessful(t *testing.T) {
- transactionContext, chaincodeStub := prepMocksAsOrg1()
- assetTransferCC := chaincode.SmartContract{}
- assetPrivDetail := &chaincode.AssetPrivateDetails{
- ID: "id1",
- AppraisedValue: 500,
- }
- setReturnAssetPrivateDetailsInTransientMap(t, chaincodeStub, assetPrivDetail)
- origAsset := chaincode.Asset{
- ID: "id1",
- Type: "testfulasset",
- Color: "gray",
- Size: 7,
- Owner: myOrg1Clientid,
- }
- setReturnPrivateDataInStub(t, chaincodeStub, &origAsset)
- chaincodeStub.CreateCompositeKeyReturns(transferAgreementObjectType+"id1", nil)
- err := assetTransferCC.AgreeToTransfer(transactionContext)
- require.NoError(t, err)
-
- expectedDataBytes, err := json.Marshal(assetPrivDetail)
- calledCollection, calledId, calledWithDataBytes := chaincodeStub.PutPrivateDataArgsForCall(0)
- require.Equal(t, myOrg1PrivCollection, calledCollection)
- require.Equal(t, "id1", calledId)
- require.Equal(t, expectedDataBytes, calledWithDataBytes)
-
- calledCollection, calledId, calledWithDataBytes = chaincodeStub.PutPrivateDataArgsForCall(1)
- require.Equal(t, assetCollectionName, calledCollection)
- require.Equal(t, transferAgreementObjectType+"id1", calledId)
- require.Equal(t, []byte(myOrg1Clientid), calledWithDataBytes)
-}
-func TestTransferAssetBadInput(t *testing.T) {
- transactionContext, chaincodeStub := prepMocksAsOrg1()
- assetTransferCC := chaincode.SmartContract{}
-
- assetNewOwner := &assetTransferTransientInput{
- ID: "id1",
- BuyerMSP: "",
- }
- setReturnAssetOwnerInTransientMap(t, chaincodeStub, assetNewOwner)
- setReturnPrivateDataInStub(t, chaincodeStub, &chaincode.Asset{})
- err := assetTransferCC.TransferAsset(transactionContext)
- require.EqualError(t, err, "buyerMSP field must be a non-empty string")
-
- assetNewOwner = &assetTransferTransientInput{
- ID: "id1",
- BuyerMSP: myOrg2Msp,
- }
- setReturnAssetOwnerInTransientMap(t, chaincodeStub, assetNewOwner)
- // asset does not exist
- setReturnPrivateDataInStub(t, chaincodeStub, nil)
- err = assetTransferCC.TransferAsset(transactionContext)
- require.EqualError(t, err, "id1 does not exist")
-}
-
-func TestTransferAssetSuccessful(t *testing.T) {
- transactionContext, chaincodeStub := prepMocksAsOrg1()
- assetTransferCC := chaincode.SmartContract{}
- assetNewOwner := &assetTransferTransientInput{
- ID: "id1",
- BuyerMSP: myOrg2Msp,
- }
- setReturnAssetOwnerInTransientMap(t, chaincodeStub, assetNewOwner)
- origAsset := chaincode.Asset{
- ID: "id1",
- Type: "testfulasset",
- Color: "gray",
- Size: 7,
- Owner: myOrg1Clientid,
- }
- setReturnPrivateDataInStub(t, chaincodeStub, &origAsset)
- // to ensure we pass data hash verification
- chaincodeStub.GetPrivateDataHashReturns([]byte("datahash"), nil)
- // to ensure that ReadTransferAgreement call returns org2 client ID
- chaincodeStub.GetPrivateDataReturnsOnCall(1, []byte(myOrg2Clientid), nil)
- chaincodeStub.CreateCompositeKeyReturns(transferAgreementObjectType+"id1", nil)
-
- err := assetTransferCC.TransferAsset(transactionContext)
- require.NoError(t, err)
- // Validate PutPrivateData calls
- expectedNewAsset := origAsset
- expectedNewAsset.Owner = myOrg2Clientid
- expectedNewAssetBytes, err := json.Marshal(expectedNewAsset)
- require.NoError(t, err)
- calledCollection, calledId, calledWithAssetBytes := chaincodeStub.PutPrivateDataArgsForCall(0)
- require.Equal(t, assetCollectionName, calledCollection)
- require.Equal(t, "id1", calledId)
- require.Equal(t, expectedNewAssetBytes, calledWithAssetBytes)
- calledCollection, calledId = chaincodeStub.DelPrivateDataArgsForCall(0)
- require.Equal(t, myOrg1PrivCollection, calledCollection)
- require.Equal(t, "id1", calledId)
-
- calledCollection, calledId = chaincodeStub.DelPrivateDataArgsForCall(1)
- require.Equal(t, assetCollectionName, calledCollection)
- require.Equal(t, transferAgreementObjectType+"id1", calledId)
-
-}
-
-func TestTransferAssetByNonOwner(t *testing.T) {
- transactionContext, chaincodeStub := prepMocksAsOrg1()
- assetTransferCC := chaincode.SmartContract{}
- assetNewOwner := &assetTransferTransientInput{
- ID: "id1",
- BuyerMSP: myOrg1Msp,
- }
- setReturnAssetOwnerInTransientMap(t, chaincodeStub, assetNewOwner)
- // Try to transfer asset owned by Org2
- org2Asset := chaincode.Asset{
- ID: "id1",
- Type: "testfulasset",
- Color: "gray",
- Size: 7,
- Owner: myOrg2Clientid,
- }
- setReturnPrivateDataInStub(t, chaincodeStub, &org2Asset)
- err := assetTransferCC.TransferAsset(transactionContext)
- require.EqualError(t, err, "failed transfer verification: error: submitting client identity does not own asset")
-}
-
-func TestTransferAssetWithoutAnAgreement(t *testing.T) {
- transactionContext, chaincodeStub := prepMocksAsOrg1()
- assetTransferCC := chaincode.SmartContract{}
- assetNewOwner := &assetTransferTransientInput{
- ID: "id1",
- BuyerMSP: myOrg1Msp,
- }
- setReturnAssetOwnerInTransientMap(t, chaincodeStub, assetNewOwner)
- orgAsset := chaincode.Asset{
- ID: "id1",
- Type: "testfulasset",
- Color: "gray",
- Size: 7,
- Owner: myOrg1Clientid,
- }
- setReturnPrivateDataInStub(t, chaincodeStub, &orgAsset)
- // to ensure we pass data hash verification
- chaincodeStub.GetPrivateDataHashReturns([]byte("datahash"), nil)
- chaincodeStub.CreateCompositeKeyReturns(transferAgreementObjectType+"id1", nil)
- // ReadTransferAgreement call returns no buyer client ID
- chaincodeStub.GetPrivateDataReturnsOnCall(1, []byte{}, nil)
-
- err := assetTransferCC.TransferAsset(transactionContext)
- require.EqualError(t, err, "BuyerID not found in TransferAgreement for id1")
-}
-
-func TestTransferAssetNonMatchingAppraisalValue(t *testing.T) {
- transactionContext, chaincodeStub := prepMocksAsOrg1()
- assetTransferCC := chaincode.SmartContract{}
- assetNewOwner := &assetTransferTransientInput{
- ID: "id1",
- BuyerMSP: myOrg2Msp,
- }
- setReturnAssetOwnerInTransientMap(t, chaincodeStub, assetNewOwner)
-
- orgAsset := chaincode.Asset{
- ID: "id1",
- Type: "testfulasset",
- Color: "gray",
- Size: 7,
- Owner: myOrg1Clientid,
- }
- setReturnPrivateDataInStub(t, chaincodeStub, &orgAsset)
- chaincodeStub.CreateCompositeKeyReturns(transferAgreementObjectType+"id1", nil)
- // data hash different in each collection
- chaincodeStub.GetPrivateDataHashReturnsOnCall(0, []byte("datahash1"), nil)
- chaincodeStub.GetPrivateDataHashReturnsOnCall(1, []byte("datahash2"), nil)
-
- err := assetTransferCC.TransferAsset(transactionContext)
- require.Error(t, err, "Expected failed hash verification")
- require.Contains(t, err.Error(), "failed transfer verification: hash for appraised value")
-}
-
-func prepMocksAsOrg1() (*mocks.TransactionContext, *mocks.ChaincodeStub) {
- return prepMocks(myOrg1Msp, myOrg1Clientid)
-}
-func prepMocksAsOrg2() (*mocks.TransactionContext, *mocks.ChaincodeStub) {
- return prepMocks(myOrg2Msp, myOrg2Clientid)
-}
-func prepMocks(orgMSP, clientId string) (*mocks.TransactionContext, *mocks.ChaincodeStub) {
- chaincodeStub := &mocks.ChaincodeStub{}
- transactionContext := &mocks.TransactionContext{}
- transactionContext.GetStubReturns(chaincodeStub)
-
- clientIdentity := &mocks.ClientIdentity{}
- clientIdentity.GetMSPIDReturns(orgMSP, nil)
- clientIdentity.GetIDReturns(base64.StdEncoding.EncodeToString([]byte(clientId)), nil)
- // set matching msp ID using peer shim env variable
- os.Setenv("CORE_PEER_LOCALMSPID", orgMSP)
- transactionContext.GetClientIdentityReturns(clientIdentity)
- return transactionContext, chaincodeStub
-}
-
-func setReturnAssetPrivateDetailsInTransientMap(t *testing.T, chaincodeStub *mocks.ChaincodeStub, assetPrivDetail *chaincode.AssetPrivateDetails) []byte {
- assetOwnerBytes := []byte{}
- if assetPrivDetail != nil {
- var err error
- assetOwnerBytes, err = json.Marshal(assetPrivDetail)
- require.NoError(t, err)
- }
- assetPropMap := map[string][]byte{
- "asset_value": assetOwnerBytes,
- }
- chaincodeStub.GetTransientReturns(assetPropMap, nil)
- return assetOwnerBytes
-}
-
-func setReturnAssetOwnerInTransientMap(t *testing.T, chaincodeStub *mocks.ChaincodeStub, assetOwner *assetTransferTransientInput) []byte {
- assetOwnerBytes := []byte{}
- if assetOwner != nil {
- var err error
- assetOwnerBytes, err = json.Marshal(assetOwner)
- require.NoError(t, err)
- }
- assetPropMap := map[string][]byte{
- "asset_owner": assetOwnerBytes,
- }
- chaincodeStub.GetTransientReturns(assetPropMap, nil)
- return assetOwnerBytes
-}
-
-func setReturnAssetPropsInTransientMap(t *testing.T, chaincodeStub *mocks.ChaincodeStub, testAsset *assetTransientInput) []byte {
- assetBytes := []byte{}
- if testAsset != nil {
- var err error
- assetBytes, err = json.Marshal(testAsset)
- require.NoError(t, err)
- }
- assetPropMap := map[string][]byte{
- "asset_properties": assetBytes,
- }
- chaincodeStub.GetTransientReturns(assetPropMap, nil)
- return assetBytes
-}
-
-func setReturnPrivateDataInStub(t *testing.T, chaincodeStub *mocks.ChaincodeStub, testAsset *chaincode.Asset) []byte {
- if testAsset == nil {
- chaincodeStub.GetPrivateDataReturns(nil, nil)
- return nil
- } else {
- var err error
- assetBytes, err := json.Marshal(testAsset)
- require.NoError(t, err)
- chaincodeStub.GetPrivateDataReturns(assetBytes, nil)
- return assetBytes
- }
-}
-
-func setReturnAssetPrivateDetailsInStub(t *testing.T, chaincodeStub *mocks.ChaincodeStub, testAsset *chaincode.AssetPrivateDetails) []byte {
- if testAsset == nil {
- chaincodeStub.GetPrivateDataReturns(nil, nil)
- return nil
- } else {
- var err error
- assetBytes, err := json.Marshal(testAsset)
- require.NoError(t, err)
- chaincodeStub.GetPrivateDataReturns(assetBytes, nil)
- return assetBytes
- }
-}
diff --git a/asset-transfer-private-data/chaincode-go/chaincode/mocks/chaincodestub.go b/asset-transfer-private-data/chaincode-go/chaincode/mocks/chaincodestub.go
deleted file mode 100644
index 06248e33..00000000
--- a/asset-transfer-private-data/chaincode-go/chaincode/mocks/chaincodestub.go
+++ /dev/null
@@ -1,2991 +0,0 @@
-// Code generated by counterfeiter. DO NOT EDIT.
-package mocks
-
-import (
- "sync"
-
- "github.com/hyperledger/fabric-chaincode-go/v2/shim"
- "github.com/hyperledger/fabric-protos-go-apiv2/peer"
- "google.golang.org/protobuf/types/known/timestamppb"
-)
-
-type ChaincodeStub struct {
- CreateCompositeKeyStub func(string, []string) (string, error)
- createCompositeKeyMutex sync.RWMutex
- createCompositeKeyArgsForCall []struct {
- arg1 string
- arg2 []string
- }
- createCompositeKeyReturns struct {
- result1 string
- result2 error
- }
- createCompositeKeyReturnsOnCall map[int]struct {
- result1 string
- result2 error
- }
- DelPrivateDataStub func(string, string) error
- delPrivateDataMutex sync.RWMutex
- delPrivateDataArgsForCall []struct {
- arg1 string
- arg2 string
- }
- delPrivateDataReturns struct {
- result1 error
- }
- delPrivateDataReturnsOnCall map[int]struct {
- result1 error
- }
- DelStateStub func(string) error
- delStateMutex sync.RWMutex
- delStateArgsForCall []struct {
- arg1 string
- }
- delStateReturns struct {
- result1 error
- }
- delStateReturnsOnCall map[int]struct {
- result1 error
- }
- GetArgsStub func() [][]byte
- getArgsMutex sync.RWMutex
- getArgsArgsForCall []struct {
- }
- getArgsReturns struct {
- result1 [][]byte
- }
- getArgsReturnsOnCall map[int]struct {
- result1 [][]byte
- }
- GetArgsSliceStub func() ([]byte, error)
- getArgsSliceMutex sync.RWMutex
- getArgsSliceArgsForCall []struct {
- }
- getArgsSliceReturns struct {
- result1 []byte
- result2 error
- }
- getArgsSliceReturnsOnCall map[int]struct {
- result1 []byte
- result2 error
- }
- GetBindingStub func() ([]byte, error)
- getBindingMutex sync.RWMutex
- getBindingArgsForCall []struct {
- }
- getBindingReturns struct {
- result1 []byte
- result2 error
- }
- getBindingReturnsOnCall map[int]struct {
- result1 []byte
- result2 error
- }
- GetChannelIDStub func() string
- getChannelIDMutex sync.RWMutex
- getChannelIDArgsForCall []struct {
- }
- getChannelIDReturns struct {
- result1 string
- }
- getChannelIDReturnsOnCall map[int]struct {
- result1 string
- }
- GetCreatorStub func() ([]byte, error)
- getCreatorMutex sync.RWMutex
- getCreatorArgsForCall []struct {
- }
- getCreatorReturns struct {
- result1 []byte
- result2 error
- }
- getCreatorReturnsOnCall map[int]struct {
- result1 []byte
- result2 error
- }
- GetDecorationsStub func() map[string][]byte
- getDecorationsMutex sync.RWMutex
- getDecorationsArgsForCall []struct {
- }
- getDecorationsReturns struct {
- result1 map[string][]byte
- }
- getDecorationsReturnsOnCall map[int]struct {
- result1 map[string][]byte
- }
- GetFunctionAndParametersStub func() (string, []string)
- getFunctionAndParametersMutex sync.RWMutex
- getFunctionAndParametersArgsForCall []struct {
- }
- getFunctionAndParametersReturns struct {
- result1 string
- result2 []string
- }
- getFunctionAndParametersReturnsOnCall map[int]struct {
- result1 string
- result2 []string
- }
- GetHistoryForKeyStub func(string) (shim.HistoryQueryIteratorInterface, error)
- getHistoryForKeyMutex sync.RWMutex
- getHistoryForKeyArgsForCall []struct {
- arg1 string
- }
- getHistoryForKeyReturns struct {
- result1 shim.HistoryQueryIteratorInterface
- result2 error
- }
- getHistoryForKeyReturnsOnCall map[int]struct {
- result1 shim.HistoryQueryIteratorInterface
- result2 error
- }
- GetPrivateDataStub func(string, string) ([]byte, error)
- getPrivateDataMutex sync.RWMutex
- getPrivateDataArgsForCall []struct {
- arg1 string
- arg2 string
- }
- getPrivateDataReturns struct {
- result1 []byte
- result2 error
- }
- getPrivateDataReturnsOnCall map[int]struct {
- result1 []byte
- result2 error
- }
- GetPrivateDataByPartialCompositeKeyStub func(string, string, []string) (shim.StateQueryIteratorInterface, error)
- getPrivateDataByPartialCompositeKeyMutex sync.RWMutex
- getPrivateDataByPartialCompositeKeyArgsForCall []struct {
- arg1 string
- arg2 string
- arg3 []string
- }
- getPrivateDataByPartialCompositeKeyReturns struct {
- result1 shim.StateQueryIteratorInterface
- result2 error
- }
- getPrivateDataByPartialCompositeKeyReturnsOnCall map[int]struct {
- result1 shim.StateQueryIteratorInterface
- result2 error
- }
- GetPrivateDataByRangeStub func(string, string, string) (shim.StateQueryIteratorInterface, error)
- getPrivateDataByRangeMutex sync.RWMutex
- getPrivateDataByRangeArgsForCall []struct {
- arg1 string
- arg2 string
- arg3 string
- }
- getPrivateDataByRangeReturns struct {
- result1 shim.StateQueryIteratorInterface
- result2 error
- }
- getPrivateDataByRangeReturnsOnCall map[int]struct {
- result1 shim.StateQueryIteratorInterface
- result2 error
- }
- GetPrivateDataHashStub func(string, string) ([]byte, error)
- getPrivateDataHashMutex sync.RWMutex
- getPrivateDataHashArgsForCall []struct {
- arg1 string
- arg2 string
- }
- getPrivateDataHashReturns struct {
- result1 []byte
- result2 error
- }
- getPrivateDataHashReturnsOnCall map[int]struct {
- result1 []byte
- result2 error
- }
- GetPrivateDataQueryResultStub func(string, string) (shim.StateQueryIteratorInterface, error)
- getPrivateDataQueryResultMutex sync.RWMutex
- getPrivateDataQueryResultArgsForCall []struct {
- arg1 string
- arg2 string
- }
- getPrivateDataQueryResultReturns struct {
- result1 shim.StateQueryIteratorInterface
- result2 error
- }
- getPrivateDataQueryResultReturnsOnCall map[int]struct {
- result1 shim.StateQueryIteratorInterface
- result2 error
- }
- GetPrivateDataValidationParameterStub func(string, string) ([]byte, error)
- getPrivateDataValidationParameterMutex sync.RWMutex
- getPrivateDataValidationParameterArgsForCall []struct {
- arg1 string
- arg2 string
- }
- getPrivateDataValidationParameterReturns struct {
- result1 []byte
- result2 error
- }
- getPrivateDataValidationParameterReturnsOnCall map[int]struct {
- result1 []byte
- result2 error
- }
- GetQueryResultStub func(string) (shim.StateQueryIteratorInterface, error)
- getQueryResultMutex sync.RWMutex
- getQueryResultArgsForCall []struct {
- arg1 string
- }
- getQueryResultReturns struct {
- result1 shim.StateQueryIteratorInterface
- result2 error
- }
- getQueryResultReturnsOnCall map[int]struct {
- result1 shim.StateQueryIteratorInterface
- result2 error
- }
- GetQueryResultWithPaginationStub func(string, int32, string) (shim.StateQueryIteratorInterface, *peer.QueryResponseMetadata, error)
- getQueryResultWithPaginationMutex sync.RWMutex
- getQueryResultWithPaginationArgsForCall []struct {
- arg1 string
- arg2 int32
- arg3 string
- }
- getQueryResultWithPaginationReturns struct {
- result1 shim.StateQueryIteratorInterface
- result2 *peer.QueryResponseMetadata
- result3 error
- }
- getQueryResultWithPaginationReturnsOnCall map[int]struct {
- result1 shim.StateQueryIteratorInterface
- result2 *peer.QueryResponseMetadata
- result3 error
- }
- GetSignedProposalStub func() (*peer.SignedProposal, error)
- getSignedProposalMutex sync.RWMutex
- getSignedProposalArgsForCall []struct {
- }
- getSignedProposalReturns struct {
- result1 *peer.SignedProposal
- result2 error
- }
- getSignedProposalReturnsOnCall map[int]struct {
- result1 *peer.SignedProposal
- result2 error
- }
- GetStateStub func(string) ([]byte, error)
- getStateMutex sync.RWMutex
- getStateArgsForCall []struct {
- arg1 string
- }
- getStateReturns struct {
- result1 []byte
- result2 error
- }
- getStateReturnsOnCall map[int]struct {
- result1 []byte
- result2 error
- }
- GetStateByPartialCompositeKeyStub func(string, []string) (shim.StateQueryIteratorInterface, error)
- getStateByPartialCompositeKeyMutex sync.RWMutex
- getStateByPartialCompositeKeyArgsForCall []struct {
- arg1 string
- arg2 []string
- }
- getStateByPartialCompositeKeyReturns struct {
- result1 shim.StateQueryIteratorInterface
- result2 error
- }
- getStateByPartialCompositeKeyReturnsOnCall map[int]struct {
- result1 shim.StateQueryIteratorInterface
- result2 error
- }
- GetStateByPartialCompositeKeyWithPaginationStub func(string, []string, int32, string) (shim.StateQueryIteratorInterface, *peer.QueryResponseMetadata, error)
- getStateByPartialCompositeKeyWithPaginationMutex sync.RWMutex
- getStateByPartialCompositeKeyWithPaginationArgsForCall []struct {
- arg1 string
- arg2 []string
- arg3 int32
- arg4 string
- }
- getStateByPartialCompositeKeyWithPaginationReturns struct {
- result1 shim.StateQueryIteratorInterface
- result2 *peer.QueryResponseMetadata
- result3 error
- }
- getStateByPartialCompositeKeyWithPaginationReturnsOnCall map[int]struct {
- result1 shim.StateQueryIteratorInterface
- result2 *peer.QueryResponseMetadata
- result3 error
- }
- GetStateByRangeStub func(string, string) (shim.StateQueryIteratorInterface, error)
- getStateByRangeMutex sync.RWMutex
- getStateByRangeArgsForCall []struct {
- arg1 string
- arg2 string
- }
- getStateByRangeReturns struct {
- result1 shim.StateQueryIteratorInterface
- result2 error
- }
- getStateByRangeReturnsOnCall map[int]struct {
- result1 shim.StateQueryIteratorInterface
- result2 error
- }
- GetStateByRangeWithPaginationStub func(string, string, int32, string) (shim.StateQueryIteratorInterface, *peer.QueryResponseMetadata, error)
- getStateByRangeWithPaginationMutex sync.RWMutex
- getStateByRangeWithPaginationArgsForCall []struct {
- arg1 string
- arg2 string
- arg3 int32
- arg4 string
- }
- getStateByRangeWithPaginationReturns struct {
- result1 shim.StateQueryIteratorInterface
- result2 *peer.QueryResponseMetadata
- result3 error
- }
- getStateByRangeWithPaginationReturnsOnCall map[int]struct {
- result1 shim.StateQueryIteratorInterface
- result2 *peer.QueryResponseMetadata
- result3 error
- }
- GetStateValidationParameterStub func(string) ([]byte, error)
- getStateValidationParameterMutex sync.RWMutex
- getStateValidationParameterArgsForCall []struct {
- arg1 string
- }
- getStateValidationParameterReturns struct {
- result1 []byte
- result2 error
- }
- getStateValidationParameterReturnsOnCall map[int]struct {
- result1 []byte
- result2 error
- }
- GetStringArgsStub func() []string
- getStringArgsMutex sync.RWMutex
- getStringArgsArgsForCall []struct {
- }
- getStringArgsReturns struct {
- result1 []string
- }
- getStringArgsReturnsOnCall map[int]struct {
- result1 []string
- }
- GetTransientStub func() (map[string][]byte, error)
- getTransientMutex sync.RWMutex
- getTransientArgsForCall []struct {
- }
- getTransientReturns struct {
- result1 map[string][]byte
- result2 error
- }
- getTransientReturnsOnCall map[int]struct {
- result1 map[string][]byte
- result2 error
- }
- GetTxIDStub func() string
- getTxIDMutex sync.RWMutex
- getTxIDArgsForCall []struct {
- }
- getTxIDReturns struct {
- result1 string
- }
- getTxIDReturnsOnCall map[int]struct {
- result1 string
- }
- GetTxTimestampStub func() (*timestamppb.Timestamp, error)
- getTxTimestampMutex sync.RWMutex
- getTxTimestampArgsForCall []struct {
- }
- getTxTimestampReturns struct {
- result1 *timestamppb.Timestamp
- result2 error
- }
- getTxTimestampReturnsOnCall map[int]struct {
- result1 *timestamppb.Timestamp
- result2 error
- }
- InvokeChaincodeStub func(string, [][]byte, string) *peer.Response
- invokeChaincodeMutex sync.RWMutex
- invokeChaincodeArgsForCall []struct {
- arg1 string
- arg2 [][]byte
- arg3 string
- }
- invokeChaincodeReturns struct {
- result1 *peer.Response
- }
- invokeChaincodeReturnsOnCall map[int]struct {
- result1 *peer.Response
- }
- PurgePrivateDataStub func(string, string) error
- purgePrivateDataMutex sync.RWMutex
- purgePrivateDataArgsForCall []struct {
- arg1 string
- arg2 string
- }
- purgePrivateDataReturns struct {
- result1 error
- }
- purgePrivateDataReturnsOnCall map[int]struct {
- result1 error
- }
- PutPrivateDataStub func(string, string, []byte) error
- putPrivateDataMutex sync.RWMutex
- putPrivateDataArgsForCall []struct {
- arg1 string
- arg2 string
- arg3 []byte
- }
- putPrivateDataReturns struct {
- result1 error
- }
- putPrivateDataReturnsOnCall map[int]struct {
- result1 error
- }
- PutStateStub func(string, []byte) error
- putStateMutex sync.RWMutex
- putStateArgsForCall []struct {
- arg1 string
- arg2 []byte
- }
- putStateReturns struct {
- result1 error
- }
- putStateReturnsOnCall map[int]struct {
- result1 error
- }
- SetEventStub func(string, []byte) error
- setEventMutex sync.RWMutex
- setEventArgsForCall []struct {
- arg1 string
- arg2 []byte
- }
- setEventReturns struct {
- result1 error
- }
- setEventReturnsOnCall map[int]struct {
- result1 error
- }
- SetPrivateDataValidationParameterStub func(string, string, []byte) error
- setPrivateDataValidationParameterMutex sync.RWMutex
- setPrivateDataValidationParameterArgsForCall []struct {
- arg1 string
- arg2 string
- arg3 []byte
- }
- setPrivateDataValidationParameterReturns struct {
- result1 error
- }
- setPrivateDataValidationParameterReturnsOnCall map[int]struct {
- result1 error
- }
- SetStateValidationParameterStub func(string, []byte) error
- setStateValidationParameterMutex sync.RWMutex
- setStateValidationParameterArgsForCall []struct {
- arg1 string
- arg2 []byte
- }
- setStateValidationParameterReturns struct {
- result1 error
- }
- setStateValidationParameterReturnsOnCall map[int]struct {
- result1 error
- }
- SplitCompositeKeyStub func(string) (string, []string, error)
- splitCompositeKeyMutex sync.RWMutex
- splitCompositeKeyArgsForCall []struct {
- arg1 string
- }
- splitCompositeKeyReturns struct {
- result1 string
- result2 []string
- result3 error
- }
- splitCompositeKeyReturnsOnCall map[int]struct {
- result1 string
- result2 []string
- result3 error
- }
- invocations map[string][][]interface{}
- invocationsMutex sync.RWMutex
-}
-
-func (fake *ChaincodeStub) CreateCompositeKey(arg1 string, arg2 []string) (string, error) {
- var arg2Copy []string
- if arg2 != nil {
- arg2Copy = make([]string, len(arg2))
- copy(arg2Copy, arg2)
- }
- fake.createCompositeKeyMutex.Lock()
- ret, specificReturn := fake.createCompositeKeyReturnsOnCall[len(fake.createCompositeKeyArgsForCall)]
- fake.createCompositeKeyArgsForCall = append(fake.createCompositeKeyArgsForCall, struct {
- arg1 string
- arg2 []string
- }{arg1, arg2Copy})
- stub := fake.CreateCompositeKeyStub
- fakeReturns := fake.createCompositeKeyReturns
- fake.recordInvocation("CreateCompositeKey", []interface{}{arg1, arg2Copy})
- fake.createCompositeKeyMutex.Unlock()
- if stub != nil {
- return stub(arg1, arg2)
- }
- if specificReturn {
- return ret.result1, ret.result2
- }
- return fakeReturns.result1, fakeReturns.result2
-}
-
-func (fake *ChaincodeStub) CreateCompositeKeyCallCount() int {
- fake.createCompositeKeyMutex.RLock()
- defer fake.createCompositeKeyMutex.RUnlock()
- return len(fake.createCompositeKeyArgsForCall)
-}
-
-func (fake *ChaincodeStub) CreateCompositeKeyCalls(stub func(string, []string) (string, error)) {
- fake.createCompositeKeyMutex.Lock()
- defer fake.createCompositeKeyMutex.Unlock()
- fake.CreateCompositeKeyStub = stub
-}
-
-func (fake *ChaincodeStub) CreateCompositeKeyArgsForCall(i int) (string, []string) {
- fake.createCompositeKeyMutex.RLock()
- defer fake.createCompositeKeyMutex.RUnlock()
- argsForCall := fake.createCompositeKeyArgsForCall[i]
- return argsForCall.arg1, argsForCall.arg2
-}
-
-func (fake *ChaincodeStub) CreateCompositeKeyReturns(result1 string, result2 error) {
- fake.createCompositeKeyMutex.Lock()
- defer fake.createCompositeKeyMutex.Unlock()
- fake.CreateCompositeKeyStub = nil
- fake.createCompositeKeyReturns = struct {
- result1 string
- result2 error
- }{result1, result2}
-}
-
-func (fake *ChaincodeStub) CreateCompositeKeyReturnsOnCall(i int, result1 string, result2 error) {
- fake.createCompositeKeyMutex.Lock()
- defer fake.createCompositeKeyMutex.Unlock()
- fake.CreateCompositeKeyStub = nil
- if fake.createCompositeKeyReturnsOnCall == nil {
- fake.createCompositeKeyReturnsOnCall = make(map[int]struct {
- result1 string
- result2 error
- })
- }
- fake.createCompositeKeyReturnsOnCall[i] = struct {
- result1 string
- result2 error
- }{result1, result2}
-}
-
-func (fake *ChaincodeStub) DelPrivateData(arg1 string, arg2 string) error {
- fake.delPrivateDataMutex.Lock()
- ret, specificReturn := fake.delPrivateDataReturnsOnCall[len(fake.delPrivateDataArgsForCall)]
- fake.delPrivateDataArgsForCall = append(fake.delPrivateDataArgsForCall, struct {
- arg1 string
- arg2 string
- }{arg1, arg2})
- stub := fake.DelPrivateDataStub
- fakeReturns := fake.delPrivateDataReturns
- fake.recordInvocation("DelPrivateData", []interface{}{arg1, arg2})
- fake.delPrivateDataMutex.Unlock()
- if stub != nil {
- return stub(arg1, arg2)
- }
- if specificReturn {
- return ret.result1
- }
- return fakeReturns.result1
-}
-
-func (fake *ChaincodeStub) DelPrivateDataCallCount() int {
- fake.delPrivateDataMutex.RLock()
- defer fake.delPrivateDataMutex.RUnlock()
- return len(fake.delPrivateDataArgsForCall)
-}
-
-func (fake *ChaincodeStub) DelPrivateDataCalls(stub func(string, string) error) {
- fake.delPrivateDataMutex.Lock()
- defer fake.delPrivateDataMutex.Unlock()
- fake.DelPrivateDataStub = stub
-}
-
-func (fake *ChaincodeStub) DelPrivateDataArgsForCall(i int) (string, string) {
- fake.delPrivateDataMutex.RLock()
- defer fake.delPrivateDataMutex.RUnlock()
- argsForCall := fake.delPrivateDataArgsForCall[i]
- return argsForCall.arg1, argsForCall.arg2
-}
-
-func (fake *ChaincodeStub) DelPrivateDataReturns(result1 error) {
- fake.delPrivateDataMutex.Lock()
- defer fake.delPrivateDataMutex.Unlock()
- fake.DelPrivateDataStub = nil
- fake.delPrivateDataReturns = struct {
- result1 error
- }{result1}
-}
-
-func (fake *ChaincodeStub) DelPrivateDataReturnsOnCall(i int, result1 error) {
- fake.delPrivateDataMutex.Lock()
- defer fake.delPrivateDataMutex.Unlock()
- fake.DelPrivateDataStub = nil
- if fake.delPrivateDataReturnsOnCall == nil {
- fake.delPrivateDataReturnsOnCall = make(map[int]struct {
- result1 error
- })
- }
- fake.delPrivateDataReturnsOnCall[i] = struct {
- result1 error
- }{result1}
-}
-
-func (fake *ChaincodeStub) DelState(arg1 string) error {
- fake.delStateMutex.Lock()
- ret, specificReturn := fake.delStateReturnsOnCall[len(fake.delStateArgsForCall)]
- fake.delStateArgsForCall = append(fake.delStateArgsForCall, struct {
- arg1 string
- }{arg1})
- stub := fake.DelStateStub
- fakeReturns := fake.delStateReturns
- fake.recordInvocation("DelState", []interface{}{arg1})
- fake.delStateMutex.Unlock()
- if stub != nil {
- return stub(arg1)
- }
- if specificReturn {
- return ret.result1
- }
- return fakeReturns.result1
-}
-
-func (fake *ChaincodeStub) DelStateCallCount() int {
- fake.delStateMutex.RLock()
- defer fake.delStateMutex.RUnlock()
- return len(fake.delStateArgsForCall)
-}
-
-func (fake *ChaincodeStub) DelStateCalls(stub func(string) error) {
- fake.delStateMutex.Lock()
- defer fake.delStateMutex.Unlock()
- fake.DelStateStub = stub
-}
-
-func (fake *ChaincodeStub) DelStateArgsForCall(i int) string {
- fake.delStateMutex.RLock()
- defer fake.delStateMutex.RUnlock()
- argsForCall := fake.delStateArgsForCall[i]
- return argsForCall.arg1
-}
-
-func (fake *ChaincodeStub) DelStateReturns(result1 error) {
- fake.delStateMutex.Lock()
- defer fake.delStateMutex.Unlock()
- fake.DelStateStub = nil
- fake.delStateReturns = struct {
- result1 error
- }{result1}
-}
-
-func (fake *ChaincodeStub) DelStateReturnsOnCall(i int, result1 error) {
- fake.delStateMutex.Lock()
- defer fake.delStateMutex.Unlock()
- fake.DelStateStub = nil
- if fake.delStateReturnsOnCall == nil {
- fake.delStateReturnsOnCall = make(map[int]struct {
- result1 error
- })
- }
- fake.delStateReturnsOnCall[i] = struct {
- result1 error
- }{result1}
-}
-
-func (fake *ChaincodeStub) GetArgs() [][]byte {
- fake.getArgsMutex.Lock()
- ret, specificReturn := fake.getArgsReturnsOnCall[len(fake.getArgsArgsForCall)]
- fake.getArgsArgsForCall = append(fake.getArgsArgsForCall, struct {
- }{})
- stub := fake.GetArgsStub
- fakeReturns := fake.getArgsReturns
- fake.recordInvocation("GetArgs", []interface{}{})
- fake.getArgsMutex.Unlock()
- if stub != nil {
- return stub()
- }
- if specificReturn {
- return ret.result1
- }
- return fakeReturns.result1
-}
-
-func (fake *ChaincodeStub) GetArgsCallCount() int {
- fake.getArgsMutex.RLock()
- defer fake.getArgsMutex.RUnlock()
- return len(fake.getArgsArgsForCall)
-}
-
-func (fake *ChaincodeStub) GetArgsCalls(stub func() [][]byte) {
- fake.getArgsMutex.Lock()
- defer fake.getArgsMutex.Unlock()
- fake.GetArgsStub = stub
-}
-
-func (fake *ChaincodeStub) GetArgsReturns(result1 [][]byte) {
- fake.getArgsMutex.Lock()
- defer fake.getArgsMutex.Unlock()
- fake.GetArgsStub = nil
- fake.getArgsReturns = struct {
- result1 [][]byte
- }{result1}
-}
-
-func (fake *ChaincodeStub) GetArgsReturnsOnCall(i int, result1 [][]byte) {
- fake.getArgsMutex.Lock()
- defer fake.getArgsMutex.Unlock()
- fake.GetArgsStub = nil
- if fake.getArgsReturnsOnCall == nil {
- fake.getArgsReturnsOnCall = make(map[int]struct {
- result1 [][]byte
- })
- }
- fake.getArgsReturnsOnCall[i] = struct {
- result1 [][]byte
- }{result1}
-}
-
-func (fake *ChaincodeStub) GetArgsSlice() ([]byte, error) {
- fake.getArgsSliceMutex.Lock()
- ret, specificReturn := fake.getArgsSliceReturnsOnCall[len(fake.getArgsSliceArgsForCall)]
- fake.getArgsSliceArgsForCall = append(fake.getArgsSliceArgsForCall, struct {
- }{})
- stub := fake.GetArgsSliceStub
- fakeReturns := fake.getArgsSliceReturns
- fake.recordInvocation("GetArgsSlice", []interface{}{})
- fake.getArgsSliceMutex.Unlock()
- if stub != nil {
- return stub()
- }
- if specificReturn {
- return ret.result1, ret.result2
- }
- return fakeReturns.result1, fakeReturns.result2
-}
-
-func (fake *ChaincodeStub) GetArgsSliceCallCount() int {
- fake.getArgsSliceMutex.RLock()
- defer fake.getArgsSliceMutex.RUnlock()
- return len(fake.getArgsSliceArgsForCall)
-}
-
-func (fake *ChaincodeStub) GetArgsSliceCalls(stub func() ([]byte, error)) {
- fake.getArgsSliceMutex.Lock()
- defer fake.getArgsSliceMutex.Unlock()
- fake.GetArgsSliceStub = stub
-}
-
-func (fake *ChaincodeStub) GetArgsSliceReturns(result1 []byte, result2 error) {
- fake.getArgsSliceMutex.Lock()
- defer fake.getArgsSliceMutex.Unlock()
- fake.GetArgsSliceStub = nil
- fake.getArgsSliceReturns = struct {
- result1 []byte
- result2 error
- }{result1, result2}
-}
-
-func (fake *ChaincodeStub) GetArgsSliceReturnsOnCall(i int, result1 []byte, result2 error) {
- fake.getArgsSliceMutex.Lock()
- defer fake.getArgsSliceMutex.Unlock()
- fake.GetArgsSliceStub = nil
- if fake.getArgsSliceReturnsOnCall == nil {
- fake.getArgsSliceReturnsOnCall = make(map[int]struct {
- result1 []byte
- result2 error
- })
- }
- fake.getArgsSliceReturnsOnCall[i] = struct {
- result1 []byte
- result2 error
- }{result1, result2}
-}
-
-func (fake *ChaincodeStub) GetBinding() ([]byte, error) {
- fake.getBindingMutex.Lock()
- ret, specificReturn := fake.getBindingReturnsOnCall[len(fake.getBindingArgsForCall)]
- fake.getBindingArgsForCall = append(fake.getBindingArgsForCall, struct {
- }{})
- stub := fake.GetBindingStub
- fakeReturns := fake.getBindingReturns
- fake.recordInvocation("GetBinding", []interface{}{})
- fake.getBindingMutex.Unlock()
- if stub != nil {
- return stub()
- }
- if specificReturn {
- return ret.result1, ret.result2
- }
- return fakeReturns.result1, fakeReturns.result2
-}
-
-func (fake *ChaincodeStub) GetBindingCallCount() int {
- fake.getBindingMutex.RLock()
- defer fake.getBindingMutex.RUnlock()
- return len(fake.getBindingArgsForCall)
-}
-
-func (fake *ChaincodeStub) GetBindingCalls(stub func() ([]byte, error)) {
- fake.getBindingMutex.Lock()
- defer fake.getBindingMutex.Unlock()
- fake.GetBindingStub = stub
-}
-
-func (fake *ChaincodeStub) GetBindingReturns(result1 []byte, result2 error) {
- fake.getBindingMutex.Lock()
- defer fake.getBindingMutex.Unlock()
- fake.GetBindingStub = nil
- fake.getBindingReturns = struct {
- result1 []byte
- result2 error
- }{result1, result2}
-}
-
-func (fake *ChaincodeStub) GetBindingReturnsOnCall(i int, result1 []byte, result2 error) {
- fake.getBindingMutex.Lock()
- defer fake.getBindingMutex.Unlock()
- fake.GetBindingStub = nil
- if fake.getBindingReturnsOnCall == nil {
- fake.getBindingReturnsOnCall = make(map[int]struct {
- result1 []byte
- result2 error
- })
- }
- fake.getBindingReturnsOnCall[i] = struct {
- result1 []byte
- result2 error
- }{result1, result2}
-}
-
-func (fake *ChaincodeStub) GetChannelID() string {
- fake.getChannelIDMutex.Lock()
- ret, specificReturn := fake.getChannelIDReturnsOnCall[len(fake.getChannelIDArgsForCall)]
- fake.getChannelIDArgsForCall = append(fake.getChannelIDArgsForCall, struct {
- }{})
- stub := fake.GetChannelIDStub
- fakeReturns := fake.getChannelIDReturns
- fake.recordInvocation("GetChannelID", []interface{}{})
- fake.getChannelIDMutex.Unlock()
- if stub != nil {
- return stub()
- }
- if specificReturn {
- return ret.result1
- }
- return fakeReturns.result1
-}
-
-func (fake *ChaincodeStub) GetChannelIDCallCount() int {
- fake.getChannelIDMutex.RLock()
- defer fake.getChannelIDMutex.RUnlock()
- return len(fake.getChannelIDArgsForCall)
-}
-
-func (fake *ChaincodeStub) GetChannelIDCalls(stub func() string) {
- fake.getChannelIDMutex.Lock()
- defer fake.getChannelIDMutex.Unlock()
- fake.GetChannelIDStub = stub
-}
-
-func (fake *ChaincodeStub) GetChannelIDReturns(result1 string) {
- fake.getChannelIDMutex.Lock()
- defer fake.getChannelIDMutex.Unlock()
- fake.GetChannelIDStub = nil
- fake.getChannelIDReturns = struct {
- result1 string
- }{result1}
-}
-
-func (fake *ChaincodeStub) GetChannelIDReturnsOnCall(i int, result1 string) {
- fake.getChannelIDMutex.Lock()
- defer fake.getChannelIDMutex.Unlock()
- fake.GetChannelIDStub = nil
- if fake.getChannelIDReturnsOnCall == nil {
- fake.getChannelIDReturnsOnCall = make(map[int]struct {
- result1 string
- })
- }
- fake.getChannelIDReturnsOnCall[i] = struct {
- result1 string
- }{result1}
-}
-
-func (fake *ChaincodeStub) GetCreator() ([]byte, error) {
- fake.getCreatorMutex.Lock()
- ret, specificReturn := fake.getCreatorReturnsOnCall[len(fake.getCreatorArgsForCall)]
- fake.getCreatorArgsForCall = append(fake.getCreatorArgsForCall, struct {
- }{})
- stub := fake.GetCreatorStub
- fakeReturns := fake.getCreatorReturns
- fake.recordInvocation("GetCreator", []interface{}{})
- fake.getCreatorMutex.Unlock()
- if stub != nil {
- return stub()
- }
- if specificReturn {
- return ret.result1, ret.result2
- }
- return fakeReturns.result1, fakeReturns.result2
-}
-
-func (fake *ChaincodeStub) GetCreatorCallCount() int {
- fake.getCreatorMutex.RLock()
- defer fake.getCreatorMutex.RUnlock()
- return len(fake.getCreatorArgsForCall)
-}
-
-func (fake *ChaincodeStub) GetCreatorCalls(stub func() ([]byte, error)) {
- fake.getCreatorMutex.Lock()
- defer fake.getCreatorMutex.Unlock()
- fake.GetCreatorStub = stub
-}
-
-func (fake *ChaincodeStub) GetCreatorReturns(result1 []byte, result2 error) {
- fake.getCreatorMutex.Lock()
- defer fake.getCreatorMutex.Unlock()
- fake.GetCreatorStub = nil
- fake.getCreatorReturns = struct {
- result1 []byte
- result2 error
- }{result1, result2}
-}
-
-func (fake *ChaincodeStub) GetCreatorReturnsOnCall(i int, result1 []byte, result2 error) {
- fake.getCreatorMutex.Lock()
- defer fake.getCreatorMutex.Unlock()
- fake.GetCreatorStub = nil
- if fake.getCreatorReturnsOnCall == nil {
- fake.getCreatorReturnsOnCall = make(map[int]struct {
- result1 []byte
- result2 error
- })
- }
- fake.getCreatorReturnsOnCall[i] = struct {
- result1 []byte
- result2 error
- }{result1, result2}
-}
-
-func (fake *ChaincodeStub) GetDecorations() map[string][]byte {
- fake.getDecorationsMutex.Lock()
- ret, specificReturn := fake.getDecorationsReturnsOnCall[len(fake.getDecorationsArgsForCall)]
- fake.getDecorationsArgsForCall = append(fake.getDecorationsArgsForCall, struct {
- }{})
- stub := fake.GetDecorationsStub
- fakeReturns := fake.getDecorationsReturns
- fake.recordInvocation("GetDecorations", []interface{}{})
- fake.getDecorationsMutex.Unlock()
- if stub != nil {
- return stub()
- }
- if specificReturn {
- return ret.result1
- }
- return fakeReturns.result1
-}
-
-func (fake *ChaincodeStub) GetDecorationsCallCount() int {
- fake.getDecorationsMutex.RLock()
- defer fake.getDecorationsMutex.RUnlock()
- return len(fake.getDecorationsArgsForCall)
-}
-
-func (fake *ChaincodeStub) GetDecorationsCalls(stub func() map[string][]byte) {
- fake.getDecorationsMutex.Lock()
- defer fake.getDecorationsMutex.Unlock()
- fake.GetDecorationsStub = stub
-}
-
-func (fake *ChaincodeStub) GetDecorationsReturns(result1 map[string][]byte) {
- fake.getDecorationsMutex.Lock()
- defer fake.getDecorationsMutex.Unlock()
- fake.GetDecorationsStub = nil
- fake.getDecorationsReturns = struct {
- result1 map[string][]byte
- }{result1}
-}
-
-func (fake *ChaincodeStub) GetDecorationsReturnsOnCall(i int, result1 map[string][]byte) {
- fake.getDecorationsMutex.Lock()
- defer fake.getDecorationsMutex.Unlock()
- fake.GetDecorationsStub = nil
- if fake.getDecorationsReturnsOnCall == nil {
- fake.getDecorationsReturnsOnCall = make(map[int]struct {
- result1 map[string][]byte
- })
- }
- fake.getDecorationsReturnsOnCall[i] = struct {
- result1 map[string][]byte
- }{result1}
-}
-
-func (fake *ChaincodeStub) GetFunctionAndParameters() (string, []string) {
- fake.getFunctionAndParametersMutex.Lock()
- ret, specificReturn := fake.getFunctionAndParametersReturnsOnCall[len(fake.getFunctionAndParametersArgsForCall)]
- fake.getFunctionAndParametersArgsForCall = append(fake.getFunctionAndParametersArgsForCall, struct {
- }{})
- stub := fake.GetFunctionAndParametersStub
- fakeReturns := fake.getFunctionAndParametersReturns
- fake.recordInvocation("GetFunctionAndParameters", []interface{}{})
- fake.getFunctionAndParametersMutex.Unlock()
- if stub != nil {
- return stub()
- }
- if specificReturn {
- return ret.result1, ret.result2
- }
- return fakeReturns.result1, fakeReturns.result2
-}
-
-func (fake *ChaincodeStub) GetFunctionAndParametersCallCount() int {
- fake.getFunctionAndParametersMutex.RLock()
- defer fake.getFunctionAndParametersMutex.RUnlock()
- return len(fake.getFunctionAndParametersArgsForCall)
-}
-
-func (fake *ChaincodeStub) GetFunctionAndParametersCalls(stub func() (string, []string)) {
- fake.getFunctionAndParametersMutex.Lock()
- defer fake.getFunctionAndParametersMutex.Unlock()
- fake.GetFunctionAndParametersStub = stub
-}
-
-func (fake *ChaincodeStub) GetFunctionAndParametersReturns(result1 string, result2 []string) {
- fake.getFunctionAndParametersMutex.Lock()
- defer fake.getFunctionAndParametersMutex.Unlock()
- fake.GetFunctionAndParametersStub = nil
- fake.getFunctionAndParametersReturns = struct {
- result1 string
- result2 []string
- }{result1, result2}
-}
-
-func (fake *ChaincodeStub) GetFunctionAndParametersReturnsOnCall(i int, result1 string, result2 []string) {
- fake.getFunctionAndParametersMutex.Lock()
- defer fake.getFunctionAndParametersMutex.Unlock()
- fake.GetFunctionAndParametersStub = nil
- if fake.getFunctionAndParametersReturnsOnCall == nil {
- fake.getFunctionAndParametersReturnsOnCall = make(map[int]struct {
- result1 string
- result2 []string
- })
- }
- fake.getFunctionAndParametersReturnsOnCall[i] = struct {
- result1 string
- result2 []string
- }{result1, result2}
-}
-
-func (fake *ChaincodeStub) GetHistoryForKey(arg1 string) (shim.HistoryQueryIteratorInterface, error) {
- fake.getHistoryForKeyMutex.Lock()
- ret, specificReturn := fake.getHistoryForKeyReturnsOnCall[len(fake.getHistoryForKeyArgsForCall)]
- fake.getHistoryForKeyArgsForCall = append(fake.getHistoryForKeyArgsForCall, struct {
- arg1 string
- }{arg1})
- stub := fake.GetHistoryForKeyStub
- fakeReturns := fake.getHistoryForKeyReturns
- fake.recordInvocation("GetHistoryForKey", []interface{}{arg1})
- fake.getHistoryForKeyMutex.Unlock()
- if stub != nil {
- return stub(arg1)
- }
- if specificReturn {
- return ret.result1, ret.result2
- }
- return fakeReturns.result1, fakeReturns.result2
-}
-
-func (fake *ChaincodeStub) GetHistoryForKeyCallCount() int {
- fake.getHistoryForKeyMutex.RLock()
- defer fake.getHistoryForKeyMutex.RUnlock()
- return len(fake.getHistoryForKeyArgsForCall)
-}
-
-func (fake *ChaincodeStub) GetHistoryForKeyCalls(stub func(string) (shim.HistoryQueryIteratorInterface, error)) {
- fake.getHistoryForKeyMutex.Lock()
- defer fake.getHistoryForKeyMutex.Unlock()
- fake.GetHistoryForKeyStub = stub
-}
-
-func (fake *ChaincodeStub) GetHistoryForKeyArgsForCall(i int) string {
- fake.getHistoryForKeyMutex.RLock()
- defer fake.getHistoryForKeyMutex.RUnlock()
- argsForCall := fake.getHistoryForKeyArgsForCall[i]
- return argsForCall.arg1
-}
-
-func (fake *ChaincodeStub) GetHistoryForKeyReturns(result1 shim.HistoryQueryIteratorInterface, result2 error) {
- fake.getHistoryForKeyMutex.Lock()
- defer fake.getHistoryForKeyMutex.Unlock()
- fake.GetHistoryForKeyStub = nil
- fake.getHistoryForKeyReturns = struct {
- result1 shim.HistoryQueryIteratorInterface
- result2 error
- }{result1, result2}
-}
-
-func (fake *ChaincodeStub) GetHistoryForKeyReturnsOnCall(i int, result1 shim.HistoryQueryIteratorInterface, result2 error) {
- fake.getHistoryForKeyMutex.Lock()
- defer fake.getHistoryForKeyMutex.Unlock()
- fake.GetHistoryForKeyStub = nil
- if fake.getHistoryForKeyReturnsOnCall == nil {
- fake.getHistoryForKeyReturnsOnCall = make(map[int]struct {
- result1 shim.HistoryQueryIteratorInterface
- result2 error
- })
- }
- fake.getHistoryForKeyReturnsOnCall[i] = struct {
- result1 shim.HistoryQueryIteratorInterface
- result2 error
- }{result1, result2}
-}
-
-func (fake *ChaincodeStub) GetPrivateData(arg1 string, arg2 string) ([]byte, error) {
- fake.getPrivateDataMutex.Lock()
- ret, specificReturn := fake.getPrivateDataReturnsOnCall[len(fake.getPrivateDataArgsForCall)]
- fake.getPrivateDataArgsForCall = append(fake.getPrivateDataArgsForCall, struct {
- arg1 string
- arg2 string
- }{arg1, arg2})
- stub := fake.GetPrivateDataStub
- fakeReturns := fake.getPrivateDataReturns
- fake.recordInvocation("GetPrivateData", []interface{}{arg1, arg2})
- fake.getPrivateDataMutex.Unlock()
- if stub != nil {
- return stub(arg1, arg2)
- }
- if specificReturn {
- return ret.result1, ret.result2
- }
- return fakeReturns.result1, fakeReturns.result2
-}
-
-func (fake *ChaincodeStub) GetPrivateDataCallCount() int {
- fake.getPrivateDataMutex.RLock()
- defer fake.getPrivateDataMutex.RUnlock()
- return len(fake.getPrivateDataArgsForCall)
-}
-
-func (fake *ChaincodeStub) GetPrivateDataCalls(stub func(string, string) ([]byte, error)) {
- fake.getPrivateDataMutex.Lock()
- defer fake.getPrivateDataMutex.Unlock()
- fake.GetPrivateDataStub = stub
-}
-
-func (fake *ChaincodeStub) GetPrivateDataArgsForCall(i int) (string, string) {
- fake.getPrivateDataMutex.RLock()
- defer fake.getPrivateDataMutex.RUnlock()
- argsForCall := fake.getPrivateDataArgsForCall[i]
- return argsForCall.arg1, argsForCall.arg2
-}
-
-func (fake *ChaincodeStub) GetPrivateDataReturns(result1 []byte, result2 error) {
- fake.getPrivateDataMutex.Lock()
- defer fake.getPrivateDataMutex.Unlock()
- fake.GetPrivateDataStub = nil
- fake.getPrivateDataReturns = struct {
- result1 []byte
- result2 error
- }{result1, result2}
-}
-
-func (fake *ChaincodeStub) GetPrivateDataReturnsOnCall(i int, result1 []byte, result2 error) {
- fake.getPrivateDataMutex.Lock()
- defer fake.getPrivateDataMutex.Unlock()
- fake.GetPrivateDataStub = nil
- if fake.getPrivateDataReturnsOnCall == nil {
- fake.getPrivateDataReturnsOnCall = make(map[int]struct {
- result1 []byte
- result2 error
- })
- }
- fake.getPrivateDataReturnsOnCall[i] = struct {
- result1 []byte
- result2 error
- }{result1, result2}
-}
-
-func (fake *ChaincodeStub) GetPrivateDataByPartialCompositeKey(arg1 string, arg2 string, arg3 []string) (shim.StateQueryIteratorInterface, error) {
- var arg3Copy []string
- if arg3 != nil {
- arg3Copy = make([]string, len(arg3))
- copy(arg3Copy, arg3)
- }
- fake.getPrivateDataByPartialCompositeKeyMutex.Lock()
- ret, specificReturn := fake.getPrivateDataByPartialCompositeKeyReturnsOnCall[len(fake.getPrivateDataByPartialCompositeKeyArgsForCall)]
- fake.getPrivateDataByPartialCompositeKeyArgsForCall = append(fake.getPrivateDataByPartialCompositeKeyArgsForCall, struct {
- arg1 string
- arg2 string
- arg3 []string
- }{arg1, arg2, arg3Copy})
- stub := fake.GetPrivateDataByPartialCompositeKeyStub
- fakeReturns := fake.getPrivateDataByPartialCompositeKeyReturns
- fake.recordInvocation("GetPrivateDataByPartialCompositeKey", []interface{}{arg1, arg2, arg3Copy})
- fake.getPrivateDataByPartialCompositeKeyMutex.Unlock()
- if stub != nil {
- return stub(arg1, arg2, arg3)
- }
- if specificReturn {
- return ret.result1, ret.result2
- }
- return fakeReturns.result1, fakeReturns.result2
-}
-
-func (fake *ChaincodeStub) GetPrivateDataByPartialCompositeKeyCallCount() int {
- fake.getPrivateDataByPartialCompositeKeyMutex.RLock()
- defer fake.getPrivateDataByPartialCompositeKeyMutex.RUnlock()
- return len(fake.getPrivateDataByPartialCompositeKeyArgsForCall)
-}
-
-func (fake *ChaincodeStub) GetPrivateDataByPartialCompositeKeyCalls(stub func(string, string, []string) (shim.StateQueryIteratorInterface, error)) {
- fake.getPrivateDataByPartialCompositeKeyMutex.Lock()
- defer fake.getPrivateDataByPartialCompositeKeyMutex.Unlock()
- fake.GetPrivateDataByPartialCompositeKeyStub = stub
-}
-
-func (fake *ChaincodeStub) GetPrivateDataByPartialCompositeKeyArgsForCall(i int) (string, string, []string) {
- fake.getPrivateDataByPartialCompositeKeyMutex.RLock()
- defer fake.getPrivateDataByPartialCompositeKeyMutex.RUnlock()
- argsForCall := fake.getPrivateDataByPartialCompositeKeyArgsForCall[i]
- return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
-}
-
-func (fake *ChaincodeStub) GetPrivateDataByPartialCompositeKeyReturns(result1 shim.StateQueryIteratorInterface, result2 error) {
- fake.getPrivateDataByPartialCompositeKeyMutex.Lock()
- defer fake.getPrivateDataByPartialCompositeKeyMutex.Unlock()
- fake.GetPrivateDataByPartialCompositeKeyStub = nil
- fake.getPrivateDataByPartialCompositeKeyReturns = struct {
- result1 shim.StateQueryIteratorInterface
- result2 error
- }{result1, result2}
-}
-
-func (fake *ChaincodeStub) GetPrivateDataByPartialCompositeKeyReturnsOnCall(i int, result1 shim.StateQueryIteratorInterface, result2 error) {
- fake.getPrivateDataByPartialCompositeKeyMutex.Lock()
- defer fake.getPrivateDataByPartialCompositeKeyMutex.Unlock()
- fake.GetPrivateDataByPartialCompositeKeyStub = nil
- if fake.getPrivateDataByPartialCompositeKeyReturnsOnCall == nil {
- fake.getPrivateDataByPartialCompositeKeyReturnsOnCall = make(map[int]struct {
- result1 shim.StateQueryIteratorInterface
- result2 error
- })
- }
- fake.getPrivateDataByPartialCompositeKeyReturnsOnCall[i] = struct {
- result1 shim.StateQueryIteratorInterface
- result2 error
- }{result1, result2}
-}
-
-func (fake *ChaincodeStub) GetPrivateDataByRange(arg1 string, arg2 string, arg3 string) (shim.StateQueryIteratorInterface, error) {
- fake.getPrivateDataByRangeMutex.Lock()
- ret, specificReturn := fake.getPrivateDataByRangeReturnsOnCall[len(fake.getPrivateDataByRangeArgsForCall)]
- fake.getPrivateDataByRangeArgsForCall = append(fake.getPrivateDataByRangeArgsForCall, struct {
- arg1 string
- arg2 string
- arg3 string
- }{arg1, arg2, arg3})
- stub := fake.GetPrivateDataByRangeStub
- fakeReturns := fake.getPrivateDataByRangeReturns
- fake.recordInvocation("GetPrivateDataByRange", []interface{}{arg1, arg2, arg3})
- fake.getPrivateDataByRangeMutex.Unlock()
- if stub != nil {
- return stub(arg1, arg2, arg3)
- }
- if specificReturn {
- return ret.result1, ret.result2
- }
- return fakeReturns.result1, fakeReturns.result2
-}
-
-func (fake *ChaincodeStub) GetPrivateDataByRangeCallCount() int {
- fake.getPrivateDataByRangeMutex.RLock()
- defer fake.getPrivateDataByRangeMutex.RUnlock()
- return len(fake.getPrivateDataByRangeArgsForCall)
-}
-
-func (fake *ChaincodeStub) GetPrivateDataByRangeCalls(stub func(string, string, string) (shim.StateQueryIteratorInterface, error)) {
- fake.getPrivateDataByRangeMutex.Lock()
- defer fake.getPrivateDataByRangeMutex.Unlock()
- fake.GetPrivateDataByRangeStub = stub
-}
-
-func (fake *ChaincodeStub) GetPrivateDataByRangeArgsForCall(i int) (string, string, string) {
- fake.getPrivateDataByRangeMutex.RLock()
- defer fake.getPrivateDataByRangeMutex.RUnlock()
- argsForCall := fake.getPrivateDataByRangeArgsForCall[i]
- return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
-}
-
-func (fake *ChaincodeStub) GetPrivateDataByRangeReturns(result1 shim.StateQueryIteratorInterface, result2 error) {
- fake.getPrivateDataByRangeMutex.Lock()
- defer fake.getPrivateDataByRangeMutex.Unlock()
- fake.GetPrivateDataByRangeStub = nil
- fake.getPrivateDataByRangeReturns = struct {
- result1 shim.StateQueryIteratorInterface
- result2 error
- }{result1, result2}
-}
-
-func (fake *ChaincodeStub) GetPrivateDataByRangeReturnsOnCall(i int, result1 shim.StateQueryIteratorInterface, result2 error) {
- fake.getPrivateDataByRangeMutex.Lock()
- defer fake.getPrivateDataByRangeMutex.Unlock()
- fake.GetPrivateDataByRangeStub = nil
- if fake.getPrivateDataByRangeReturnsOnCall == nil {
- fake.getPrivateDataByRangeReturnsOnCall = make(map[int]struct {
- result1 shim.StateQueryIteratorInterface
- result2 error
- })
- }
- fake.getPrivateDataByRangeReturnsOnCall[i] = struct {
- result1 shim.StateQueryIteratorInterface
- result2 error
- }{result1, result2}
-}
-
-func (fake *ChaincodeStub) GetPrivateDataHash(arg1 string, arg2 string) ([]byte, error) {
- fake.getPrivateDataHashMutex.Lock()
- ret, specificReturn := fake.getPrivateDataHashReturnsOnCall[len(fake.getPrivateDataHashArgsForCall)]
- fake.getPrivateDataHashArgsForCall = append(fake.getPrivateDataHashArgsForCall, struct {
- arg1 string
- arg2 string
- }{arg1, arg2})
- stub := fake.GetPrivateDataHashStub
- fakeReturns := fake.getPrivateDataHashReturns
- fake.recordInvocation("GetPrivateDataHash", []interface{}{arg1, arg2})
- fake.getPrivateDataHashMutex.Unlock()
- if stub != nil {
- return stub(arg1, arg2)
- }
- if specificReturn {
- return ret.result1, ret.result2
- }
- return fakeReturns.result1, fakeReturns.result2
-}
-
-func (fake *ChaincodeStub) GetPrivateDataHashCallCount() int {
- fake.getPrivateDataHashMutex.RLock()
- defer fake.getPrivateDataHashMutex.RUnlock()
- return len(fake.getPrivateDataHashArgsForCall)
-}
-
-func (fake *ChaincodeStub) GetPrivateDataHashCalls(stub func(string, string) ([]byte, error)) {
- fake.getPrivateDataHashMutex.Lock()
- defer fake.getPrivateDataHashMutex.Unlock()
- fake.GetPrivateDataHashStub = stub
-}
-
-func (fake *ChaincodeStub) GetPrivateDataHashArgsForCall(i int) (string, string) {
- fake.getPrivateDataHashMutex.RLock()
- defer fake.getPrivateDataHashMutex.RUnlock()
- argsForCall := fake.getPrivateDataHashArgsForCall[i]
- return argsForCall.arg1, argsForCall.arg2
-}
-
-func (fake *ChaincodeStub) GetPrivateDataHashReturns(result1 []byte, result2 error) {
- fake.getPrivateDataHashMutex.Lock()
- defer fake.getPrivateDataHashMutex.Unlock()
- fake.GetPrivateDataHashStub = nil
- fake.getPrivateDataHashReturns = struct {
- result1 []byte
- result2 error
- }{result1, result2}
-}
-
-func (fake *ChaincodeStub) GetPrivateDataHashReturnsOnCall(i int, result1 []byte, result2 error) {
- fake.getPrivateDataHashMutex.Lock()
- defer fake.getPrivateDataHashMutex.Unlock()
- fake.GetPrivateDataHashStub = nil
- if fake.getPrivateDataHashReturnsOnCall == nil {
- fake.getPrivateDataHashReturnsOnCall = make(map[int]struct {
- result1 []byte
- result2 error
- })
- }
- fake.getPrivateDataHashReturnsOnCall[i] = struct {
- result1 []byte
- result2 error
- }{result1, result2}
-}
-
-func (fake *ChaincodeStub) GetPrivateDataQueryResult(arg1 string, arg2 string) (shim.StateQueryIteratorInterface, error) {
- fake.getPrivateDataQueryResultMutex.Lock()
- ret, specificReturn := fake.getPrivateDataQueryResultReturnsOnCall[len(fake.getPrivateDataQueryResultArgsForCall)]
- fake.getPrivateDataQueryResultArgsForCall = append(fake.getPrivateDataQueryResultArgsForCall, struct {
- arg1 string
- arg2 string
- }{arg1, arg2})
- stub := fake.GetPrivateDataQueryResultStub
- fakeReturns := fake.getPrivateDataQueryResultReturns
- fake.recordInvocation("GetPrivateDataQueryResult", []interface{}{arg1, arg2})
- fake.getPrivateDataQueryResultMutex.Unlock()
- if stub != nil {
- return stub(arg1, arg2)
- }
- if specificReturn {
- return ret.result1, ret.result2
- }
- return fakeReturns.result1, fakeReturns.result2
-}
-
-func (fake *ChaincodeStub) GetPrivateDataQueryResultCallCount() int {
- fake.getPrivateDataQueryResultMutex.RLock()
- defer fake.getPrivateDataQueryResultMutex.RUnlock()
- return len(fake.getPrivateDataQueryResultArgsForCall)
-}
-
-func (fake *ChaincodeStub) GetPrivateDataQueryResultCalls(stub func(string, string) (shim.StateQueryIteratorInterface, error)) {
- fake.getPrivateDataQueryResultMutex.Lock()
- defer fake.getPrivateDataQueryResultMutex.Unlock()
- fake.GetPrivateDataQueryResultStub = stub
-}
-
-func (fake *ChaincodeStub) GetPrivateDataQueryResultArgsForCall(i int) (string, string) {
- fake.getPrivateDataQueryResultMutex.RLock()
- defer fake.getPrivateDataQueryResultMutex.RUnlock()
- argsForCall := fake.getPrivateDataQueryResultArgsForCall[i]
- return argsForCall.arg1, argsForCall.arg2
-}
-
-func (fake *ChaincodeStub) GetPrivateDataQueryResultReturns(result1 shim.StateQueryIteratorInterface, result2 error) {
- fake.getPrivateDataQueryResultMutex.Lock()
- defer fake.getPrivateDataQueryResultMutex.Unlock()
- fake.GetPrivateDataQueryResultStub = nil
- fake.getPrivateDataQueryResultReturns = struct {
- result1 shim.StateQueryIteratorInterface
- result2 error
- }{result1, result2}
-}
-
-func (fake *ChaincodeStub) GetPrivateDataQueryResultReturnsOnCall(i int, result1 shim.StateQueryIteratorInterface, result2 error) {
- fake.getPrivateDataQueryResultMutex.Lock()
- defer fake.getPrivateDataQueryResultMutex.Unlock()
- fake.GetPrivateDataQueryResultStub = nil
- if fake.getPrivateDataQueryResultReturnsOnCall == nil {
- fake.getPrivateDataQueryResultReturnsOnCall = make(map[int]struct {
- result1 shim.StateQueryIteratorInterface
- result2 error
- })
- }
- fake.getPrivateDataQueryResultReturnsOnCall[i] = struct {
- result1 shim.StateQueryIteratorInterface
- result2 error
- }{result1, result2}
-}
-
-func (fake *ChaincodeStub) GetPrivateDataValidationParameter(arg1 string, arg2 string) ([]byte, error) {
- fake.getPrivateDataValidationParameterMutex.Lock()
- ret, specificReturn := fake.getPrivateDataValidationParameterReturnsOnCall[len(fake.getPrivateDataValidationParameterArgsForCall)]
- fake.getPrivateDataValidationParameterArgsForCall = append(fake.getPrivateDataValidationParameterArgsForCall, struct {
- arg1 string
- arg2 string
- }{arg1, arg2})
- stub := fake.GetPrivateDataValidationParameterStub
- fakeReturns := fake.getPrivateDataValidationParameterReturns
- fake.recordInvocation("GetPrivateDataValidationParameter", []interface{}{arg1, arg2})
- fake.getPrivateDataValidationParameterMutex.Unlock()
- if stub != nil {
- return stub(arg1, arg2)
- }
- if specificReturn {
- return ret.result1, ret.result2
- }
- return fakeReturns.result1, fakeReturns.result2
-}
-
-func (fake *ChaincodeStub) GetPrivateDataValidationParameterCallCount() int {
- fake.getPrivateDataValidationParameterMutex.RLock()
- defer fake.getPrivateDataValidationParameterMutex.RUnlock()
- return len(fake.getPrivateDataValidationParameterArgsForCall)
-}
-
-func (fake *ChaincodeStub) GetPrivateDataValidationParameterCalls(stub func(string, string) ([]byte, error)) {
- fake.getPrivateDataValidationParameterMutex.Lock()
- defer fake.getPrivateDataValidationParameterMutex.Unlock()
- fake.GetPrivateDataValidationParameterStub = stub
-}
-
-func (fake *ChaincodeStub) GetPrivateDataValidationParameterArgsForCall(i int) (string, string) {
- fake.getPrivateDataValidationParameterMutex.RLock()
- defer fake.getPrivateDataValidationParameterMutex.RUnlock()
- argsForCall := fake.getPrivateDataValidationParameterArgsForCall[i]
- return argsForCall.arg1, argsForCall.arg2
-}
-
-func (fake *ChaincodeStub) GetPrivateDataValidationParameterReturns(result1 []byte, result2 error) {
- fake.getPrivateDataValidationParameterMutex.Lock()
- defer fake.getPrivateDataValidationParameterMutex.Unlock()
- fake.GetPrivateDataValidationParameterStub = nil
- fake.getPrivateDataValidationParameterReturns = struct {
- result1 []byte
- result2 error
- }{result1, result2}
-}
-
-func (fake *ChaincodeStub) GetPrivateDataValidationParameterReturnsOnCall(i int, result1 []byte, result2 error) {
- fake.getPrivateDataValidationParameterMutex.Lock()
- defer fake.getPrivateDataValidationParameterMutex.Unlock()
- fake.GetPrivateDataValidationParameterStub = nil
- if fake.getPrivateDataValidationParameterReturnsOnCall == nil {
- fake.getPrivateDataValidationParameterReturnsOnCall = make(map[int]struct {
- result1 []byte
- result2 error
- })
- }
- fake.getPrivateDataValidationParameterReturnsOnCall[i] = struct {
- result1 []byte
- result2 error
- }{result1, result2}
-}
-
-func (fake *ChaincodeStub) GetQueryResult(arg1 string) (shim.StateQueryIteratorInterface, error) {
- fake.getQueryResultMutex.Lock()
- ret, specificReturn := fake.getQueryResultReturnsOnCall[len(fake.getQueryResultArgsForCall)]
- fake.getQueryResultArgsForCall = append(fake.getQueryResultArgsForCall, struct {
- arg1 string
- }{arg1})
- stub := fake.GetQueryResultStub
- fakeReturns := fake.getQueryResultReturns
- fake.recordInvocation("GetQueryResult", []interface{}{arg1})
- fake.getQueryResultMutex.Unlock()
- if stub != nil {
- return stub(arg1)
- }
- if specificReturn {
- return ret.result1, ret.result2
- }
- return fakeReturns.result1, fakeReturns.result2
-}
-
-func (fake *ChaincodeStub) GetQueryResultCallCount() int {
- fake.getQueryResultMutex.RLock()
- defer fake.getQueryResultMutex.RUnlock()
- return len(fake.getQueryResultArgsForCall)
-}
-
-func (fake *ChaincodeStub) GetQueryResultCalls(stub func(string) (shim.StateQueryIteratorInterface, error)) {
- fake.getQueryResultMutex.Lock()
- defer fake.getQueryResultMutex.Unlock()
- fake.GetQueryResultStub = stub
-}
-
-func (fake *ChaincodeStub) GetQueryResultArgsForCall(i int) string {
- fake.getQueryResultMutex.RLock()
- defer fake.getQueryResultMutex.RUnlock()
- argsForCall := fake.getQueryResultArgsForCall[i]
- return argsForCall.arg1
-}
-
-func (fake *ChaincodeStub) GetQueryResultReturns(result1 shim.StateQueryIteratorInterface, result2 error) {
- fake.getQueryResultMutex.Lock()
- defer fake.getQueryResultMutex.Unlock()
- fake.GetQueryResultStub = nil
- fake.getQueryResultReturns = struct {
- result1 shim.StateQueryIteratorInterface
- result2 error
- }{result1, result2}
-}
-
-func (fake *ChaincodeStub) GetQueryResultReturnsOnCall(i int, result1 shim.StateQueryIteratorInterface, result2 error) {
- fake.getQueryResultMutex.Lock()
- defer fake.getQueryResultMutex.Unlock()
- fake.GetQueryResultStub = nil
- if fake.getQueryResultReturnsOnCall == nil {
- fake.getQueryResultReturnsOnCall = make(map[int]struct {
- result1 shim.StateQueryIteratorInterface
- result2 error
- })
- }
- fake.getQueryResultReturnsOnCall[i] = struct {
- result1 shim.StateQueryIteratorInterface
- result2 error
- }{result1, result2}
-}
-
-func (fake *ChaincodeStub) GetQueryResultWithPagination(arg1 string, arg2 int32, arg3 string) (shim.StateQueryIteratorInterface, *peer.QueryResponseMetadata, error) {
- fake.getQueryResultWithPaginationMutex.Lock()
- ret, specificReturn := fake.getQueryResultWithPaginationReturnsOnCall[len(fake.getQueryResultWithPaginationArgsForCall)]
- fake.getQueryResultWithPaginationArgsForCall = append(fake.getQueryResultWithPaginationArgsForCall, struct {
- arg1 string
- arg2 int32
- arg3 string
- }{arg1, arg2, arg3})
- stub := fake.GetQueryResultWithPaginationStub
- fakeReturns := fake.getQueryResultWithPaginationReturns
- fake.recordInvocation("GetQueryResultWithPagination", []interface{}{arg1, arg2, arg3})
- fake.getQueryResultWithPaginationMutex.Unlock()
- if stub != nil {
- return stub(arg1, arg2, arg3)
- }
- if specificReturn {
- return ret.result1, ret.result2, ret.result3
- }
- return fakeReturns.result1, fakeReturns.result2, fakeReturns.result3
-}
-
-func (fake *ChaincodeStub) GetQueryResultWithPaginationCallCount() int {
- fake.getQueryResultWithPaginationMutex.RLock()
- defer fake.getQueryResultWithPaginationMutex.RUnlock()
- return len(fake.getQueryResultWithPaginationArgsForCall)
-}
-
-func (fake *ChaincodeStub) GetQueryResultWithPaginationCalls(stub func(string, int32, string) (shim.StateQueryIteratorInterface, *peer.QueryResponseMetadata, error)) {
- fake.getQueryResultWithPaginationMutex.Lock()
- defer fake.getQueryResultWithPaginationMutex.Unlock()
- fake.GetQueryResultWithPaginationStub = stub
-}
-
-func (fake *ChaincodeStub) GetQueryResultWithPaginationArgsForCall(i int) (string, int32, string) {
- fake.getQueryResultWithPaginationMutex.RLock()
- defer fake.getQueryResultWithPaginationMutex.RUnlock()
- argsForCall := fake.getQueryResultWithPaginationArgsForCall[i]
- return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
-}
-
-func (fake *ChaincodeStub) GetQueryResultWithPaginationReturns(result1 shim.StateQueryIteratorInterface, result2 *peer.QueryResponseMetadata, result3 error) {
- fake.getQueryResultWithPaginationMutex.Lock()
- defer fake.getQueryResultWithPaginationMutex.Unlock()
- fake.GetQueryResultWithPaginationStub = nil
- fake.getQueryResultWithPaginationReturns = struct {
- result1 shim.StateQueryIteratorInterface
- result2 *peer.QueryResponseMetadata
- result3 error
- }{result1, result2, result3}
-}
-
-func (fake *ChaincodeStub) GetQueryResultWithPaginationReturnsOnCall(i int, result1 shim.StateQueryIteratorInterface, result2 *peer.QueryResponseMetadata, result3 error) {
- fake.getQueryResultWithPaginationMutex.Lock()
- defer fake.getQueryResultWithPaginationMutex.Unlock()
- fake.GetQueryResultWithPaginationStub = nil
- if fake.getQueryResultWithPaginationReturnsOnCall == nil {
- fake.getQueryResultWithPaginationReturnsOnCall = make(map[int]struct {
- result1 shim.StateQueryIteratorInterface
- result2 *peer.QueryResponseMetadata
- result3 error
- })
- }
- fake.getQueryResultWithPaginationReturnsOnCall[i] = struct {
- result1 shim.StateQueryIteratorInterface
- result2 *peer.QueryResponseMetadata
- result3 error
- }{result1, result2, result3}
-}
-
-func (fake *ChaincodeStub) GetSignedProposal() (*peer.SignedProposal, error) {
- fake.getSignedProposalMutex.Lock()
- ret, specificReturn := fake.getSignedProposalReturnsOnCall[len(fake.getSignedProposalArgsForCall)]
- fake.getSignedProposalArgsForCall = append(fake.getSignedProposalArgsForCall, struct {
- }{})
- stub := fake.GetSignedProposalStub
- fakeReturns := fake.getSignedProposalReturns
- fake.recordInvocation("GetSignedProposal", []interface{}{})
- fake.getSignedProposalMutex.Unlock()
- if stub != nil {
- return stub()
- }
- if specificReturn {
- return ret.result1, ret.result2
- }
- return fakeReturns.result1, fakeReturns.result2
-}
-
-func (fake *ChaincodeStub) GetSignedProposalCallCount() int {
- fake.getSignedProposalMutex.RLock()
- defer fake.getSignedProposalMutex.RUnlock()
- return len(fake.getSignedProposalArgsForCall)
-}
-
-func (fake *ChaincodeStub) GetSignedProposalCalls(stub func() (*peer.SignedProposal, error)) {
- fake.getSignedProposalMutex.Lock()
- defer fake.getSignedProposalMutex.Unlock()
- fake.GetSignedProposalStub = stub
-}
-
-func (fake *ChaincodeStub) GetSignedProposalReturns(result1 *peer.SignedProposal, result2 error) {
- fake.getSignedProposalMutex.Lock()
- defer fake.getSignedProposalMutex.Unlock()
- fake.GetSignedProposalStub = nil
- fake.getSignedProposalReturns = struct {
- result1 *peer.SignedProposal
- result2 error
- }{result1, result2}
-}
-
-func (fake *ChaincodeStub) GetSignedProposalReturnsOnCall(i int, result1 *peer.SignedProposal, result2 error) {
- fake.getSignedProposalMutex.Lock()
- defer fake.getSignedProposalMutex.Unlock()
- fake.GetSignedProposalStub = nil
- if fake.getSignedProposalReturnsOnCall == nil {
- fake.getSignedProposalReturnsOnCall = make(map[int]struct {
- result1 *peer.SignedProposal
- result2 error
- })
- }
- fake.getSignedProposalReturnsOnCall[i] = struct {
- result1 *peer.SignedProposal
- result2 error
- }{result1, result2}
-}
-
-func (fake *ChaincodeStub) GetState(arg1 string) ([]byte, error) {
- fake.getStateMutex.Lock()
- ret, specificReturn := fake.getStateReturnsOnCall[len(fake.getStateArgsForCall)]
- fake.getStateArgsForCall = append(fake.getStateArgsForCall, struct {
- arg1 string
- }{arg1})
- stub := fake.GetStateStub
- fakeReturns := fake.getStateReturns
- fake.recordInvocation("GetState", []interface{}{arg1})
- fake.getStateMutex.Unlock()
- if stub != nil {
- return stub(arg1)
- }
- if specificReturn {
- return ret.result1, ret.result2
- }
- return fakeReturns.result1, fakeReturns.result2
-}
-
-func (fake *ChaincodeStub) GetStateCallCount() int {
- fake.getStateMutex.RLock()
- defer fake.getStateMutex.RUnlock()
- return len(fake.getStateArgsForCall)
-}
-
-func (fake *ChaincodeStub) GetStateCalls(stub func(string) ([]byte, error)) {
- fake.getStateMutex.Lock()
- defer fake.getStateMutex.Unlock()
- fake.GetStateStub = stub
-}
-
-func (fake *ChaincodeStub) GetStateArgsForCall(i int) string {
- fake.getStateMutex.RLock()
- defer fake.getStateMutex.RUnlock()
- argsForCall := fake.getStateArgsForCall[i]
- return argsForCall.arg1
-}
-
-func (fake *ChaincodeStub) GetStateReturns(result1 []byte, result2 error) {
- fake.getStateMutex.Lock()
- defer fake.getStateMutex.Unlock()
- fake.GetStateStub = nil
- fake.getStateReturns = struct {
- result1 []byte
- result2 error
- }{result1, result2}
-}
-
-func (fake *ChaincodeStub) GetStateReturnsOnCall(i int, result1 []byte, result2 error) {
- fake.getStateMutex.Lock()
- defer fake.getStateMutex.Unlock()
- fake.GetStateStub = nil
- if fake.getStateReturnsOnCall == nil {
- fake.getStateReturnsOnCall = make(map[int]struct {
- result1 []byte
- result2 error
- })
- }
- fake.getStateReturnsOnCall[i] = struct {
- result1 []byte
- result2 error
- }{result1, result2}
-}
-
-func (fake *ChaincodeStub) GetStateByPartialCompositeKey(arg1 string, arg2 []string) (shim.StateQueryIteratorInterface, error) {
- var arg2Copy []string
- if arg2 != nil {
- arg2Copy = make([]string, len(arg2))
- copy(arg2Copy, arg2)
- }
- fake.getStateByPartialCompositeKeyMutex.Lock()
- ret, specificReturn := fake.getStateByPartialCompositeKeyReturnsOnCall[len(fake.getStateByPartialCompositeKeyArgsForCall)]
- fake.getStateByPartialCompositeKeyArgsForCall = append(fake.getStateByPartialCompositeKeyArgsForCall, struct {
- arg1 string
- arg2 []string
- }{arg1, arg2Copy})
- stub := fake.GetStateByPartialCompositeKeyStub
- fakeReturns := fake.getStateByPartialCompositeKeyReturns
- fake.recordInvocation("GetStateByPartialCompositeKey", []interface{}{arg1, arg2Copy})
- fake.getStateByPartialCompositeKeyMutex.Unlock()
- if stub != nil {
- return stub(arg1, arg2)
- }
- if specificReturn {
- return ret.result1, ret.result2
- }
- return fakeReturns.result1, fakeReturns.result2
-}
-
-func (fake *ChaincodeStub) GetStateByPartialCompositeKeyCallCount() int {
- fake.getStateByPartialCompositeKeyMutex.RLock()
- defer fake.getStateByPartialCompositeKeyMutex.RUnlock()
- return len(fake.getStateByPartialCompositeKeyArgsForCall)
-}
-
-func (fake *ChaincodeStub) GetStateByPartialCompositeKeyCalls(stub func(string, []string) (shim.StateQueryIteratorInterface, error)) {
- fake.getStateByPartialCompositeKeyMutex.Lock()
- defer fake.getStateByPartialCompositeKeyMutex.Unlock()
- fake.GetStateByPartialCompositeKeyStub = stub
-}
-
-func (fake *ChaincodeStub) GetStateByPartialCompositeKeyArgsForCall(i int) (string, []string) {
- fake.getStateByPartialCompositeKeyMutex.RLock()
- defer fake.getStateByPartialCompositeKeyMutex.RUnlock()
- argsForCall := fake.getStateByPartialCompositeKeyArgsForCall[i]
- return argsForCall.arg1, argsForCall.arg2
-}
-
-func (fake *ChaincodeStub) GetStateByPartialCompositeKeyReturns(result1 shim.StateQueryIteratorInterface, result2 error) {
- fake.getStateByPartialCompositeKeyMutex.Lock()
- defer fake.getStateByPartialCompositeKeyMutex.Unlock()
- fake.GetStateByPartialCompositeKeyStub = nil
- fake.getStateByPartialCompositeKeyReturns = struct {
- result1 shim.StateQueryIteratorInterface
- result2 error
- }{result1, result2}
-}
-
-func (fake *ChaincodeStub) GetStateByPartialCompositeKeyReturnsOnCall(i int, result1 shim.StateQueryIteratorInterface, result2 error) {
- fake.getStateByPartialCompositeKeyMutex.Lock()
- defer fake.getStateByPartialCompositeKeyMutex.Unlock()
- fake.GetStateByPartialCompositeKeyStub = nil
- if fake.getStateByPartialCompositeKeyReturnsOnCall == nil {
- fake.getStateByPartialCompositeKeyReturnsOnCall = make(map[int]struct {
- result1 shim.StateQueryIteratorInterface
- result2 error
- })
- }
- fake.getStateByPartialCompositeKeyReturnsOnCall[i] = struct {
- result1 shim.StateQueryIteratorInterface
- result2 error
- }{result1, result2}
-}
-
-func (fake *ChaincodeStub) GetStateByPartialCompositeKeyWithPagination(arg1 string, arg2 []string, arg3 int32, arg4 string) (shim.StateQueryIteratorInterface, *peer.QueryResponseMetadata, error) {
- var arg2Copy []string
- if arg2 != nil {
- arg2Copy = make([]string, len(arg2))
- copy(arg2Copy, arg2)
- }
- fake.getStateByPartialCompositeKeyWithPaginationMutex.Lock()
- ret, specificReturn := fake.getStateByPartialCompositeKeyWithPaginationReturnsOnCall[len(fake.getStateByPartialCompositeKeyWithPaginationArgsForCall)]
- fake.getStateByPartialCompositeKeyWithPaginationArgsForCall = append(fake.getStateByPartialCompositeKeyWithPaginationArgsForCall, struct {
- arg1 string
- arg2 []string
- arg3 int32
- arg4 string
- }{arg1, arg2Copy, arg3, arg4})
- stub := fake.GetStateByPartialCompositeKeyWithPaginationStub
- fakeReturns := fake.getStateByPartialCompositeKeyWithPaginationReturns
- fake.recordInvocation("GetStateByPartialCompositeKeyWithPagination", []interface{}{arg1, arg2Copy, arg3, arg4})
- fake.getStateByPartialCompositeKeyWithPaginationMutex.Unlock()
- if stub != nil {
- return stub(arg1, arg2, arg3, arg4)
- }
- if specificReturn {
- return ret.result1, ret.result2, ret.result3
- }
- return fakeReturns.result1, fakeReturns.result2, fakeReturns.result3
-}
-
-func (fake *ChaincodeStub) GetStateByPartialCompositeKeyWithPaginationCallCount() int {
- fake.getStateByPartialCompositeKeyWithPaginationMutex.RLock()
- defer fake.getStateByPartialCompositeKeyWithPaginationMutex.RUnlock()
- return len(fake.getStateByPartialCompositeKeyWithPaginationArgsForCall)
-}
-
-func (fake *ChaincodeStub) GetStateByPartialCompositeKeyWithPaginationCalls(stub func(string, []string, int32, string) (shim.StateQueryIteratorInterface, *peer.QueryResponseMetadata, error)) {
- fake.getStateByPartialCompositeKeyWithPaginationMutex.Lock()
- defer fake.getStateByPartialCompositeKeyWithPaginationMutex.Unlock()
- fake.GetStateByPartialCompositeKeyWithPaginationStub = stub
-}
-
-func (fake *ChaincodeStub) GetStateByPartialCompositeKeyWithPaginationArgsForCall(i int) (string, []string, int32, string) {
- fake.getStateByPartialCompositeKeyWithPaginationMutex.RLock()
- defer fake.getStateByPartialCompositeKeyWithPaginationMutex.RUnlock()
- argsForCall := fake.getStateByPartialCompositeKeyWithPaginationArgsForCall[i]
- return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3, argsForCall.arg4
-}
-
-func (fake *ChaincodeStub) GetStateByPartialCompositeKeyWithPaginationReturns(result1 shim.StateQueryIteratorInterface, result2 *peer.QueryResponseMetadata, result3 error) {
- fake.getStateByPartialCompositeKeyWithPaginationMutex.Lock()
- defer fake.getStateByPartialCompositeKeyWithPaginationMutex.Unlock()
- fake.GetStateByPartialCompositeKeyWithPaginationStub = nil
- fake.getStateByPartialCompositeKeyWithPaginationReturns = struct {
- result1 shim.StateQueryIteratorInterface
- result2 *peer.QueryResponseMetadata
- result3 error
- }{result1, result2, result3}
-}
-
-func (fake *ChaincodeStub) GetStateByPartialCompositeKeyWithPaginationReturnsOnCall(i int, result1 shim.StateQueryIteratorInterface, result2 *peer.QueryResponseMetadata, result3 error) {
- fake.getStateByPartialCompositeKeyWithPaginationMutex.Lock()
- defer fake.getStateByPartialCompositeKeyWithPaginationMutex.Unlock()
- fake.GetStateByPartialCompositeKeyWithPaginationStub = nil
- if fake.getStateByPartialCompositeKeyWithPaginationReturnsOnCall == nil {
- fake.getStateByPartialCompositeKeyWithPaginationReturnsOnCall = make(map[int]struct {
- result1 shim.StateQueryIteratorInterface
- result2 *peer.QueryResponseMetadata
- result3 error
- })
- }
- fake.getStateByPartialCompositeKeyWithPaginationReturnsOnCall[i] = struct {
- result1 shim.StateQueryIteratorInterface
- result2 *peer.QueryResponseMetadata
- result3 error
- }{result1, result2, result3}
-}
-
-func (fake *ChaincodeStub) GetStateByRange(arg1 string, arg2 string) (shim.StateQueryIteratorInterface, error) {
- fake.getStateByRangeMutex.Lock()
- ret, specificReturn := fake.getStateByRangeReturnsOnCall[len(fake.getStateByRangeArgsForCall)]
- fake.getStateByRangeArgsForCall = append(fake.getStateByRangeArgsForCall, struct {
- arg1 string
- arg2 string
- }{arg1, arg2})
- stub := fake.GetStateByRangeStub
- fakeReturns := fake.getStateByRangeReturns
- fake.recordInvocation("GetStateByRange", []interface{}{arg1, arg2})
- fake.getStateByRangeMutex.Unlock()
- if stub != nil {
- return stub(arg1, arg2)
- }
- if specificReturn {
- return ret.result1, ret.result2
- }
- return fakeReturns.result1, fakeReturns.result2
-}
-
-func (fake *ChaincodeStub) GetStateByRangeCallCount() int {
- fake.getStateByRangeMutex.RLock()
- defer fake.getStateByRangeMutex.RUnlock()
- return len(fake.getStateByRangeArgsForCall)
-}
-
-func (fake *ChaincodeStub) GetStateByRangeCalls(stub func(string, string) (shim.StateQueryIteratorInterface, error)) {
- fake.getStateByRangeMutex.Lock()
- defer fake.getStateByRangeMutex.Unlock()
- fake.GetStateByRangeStub = stub
-}
-
-func (fake *ChaincodeStub) GetStateByRangeArgsForCall(i int) (string, string) {
- fake.getStateByRangeMutex.RLock()
- defer fake.getStateByRangeMutex.RUnlock()
- argsForCall := fake.getStateByRangeArgsForCall[i]
- return argsForCall.arg1, argsForCall.arg2
-}
-
-func (fake *ChaincodeStub) GetStateByRangeReturns(result1 shim.StateQueryIteratorInterface, result2 error) {
- fake.getStateByRangeMutex.Lock()
- defer fake.getStateByRangeMutex.Unlock()
- fake.GetStateByRangeStub = nil
- fake.getStateByRangeReturns = struct {
- result1 shim.StateQueryIteratorInterface
- result2 error
- }{result1, result2}
-}
-
-func (fake *ChaincodeStub) GetStateByRangeReturnsOnCall(i int, result1 shim.StateQueryIteratorInterface, result2 error) {
- fake.getStateByRangeMutex.Lock()
- defer fake.getStateByRangeMutex.Unlock()
- fake.GetStateByRangeStub = nil
- if fake.getStateByRangeReturnsOnCall == nil {
- fake.getStateByRangeReturnsOnCall = make(map[int]struct {
- result1 shim.StateQueryIteratorInterface
- result2 error
- })
- }
- fake.getStateByRangeReturnsOnCall[i] = struct {
- result1 shim.StateQueryIteratorInterface
- result2 error
- }{result1, result2}
-}
-
-func (fake *ChaincodeStub) GetStateByRangeWithPagination(arg1 string, arg2 string, arg3 int32, arg4 string) (shim.StateQueryIteratorInterface, *peer.QueryResponseMetadata, error) {
- fake.getStateByRangeWithPaginationMutex.Lock()
- ret, specificReturn := fake.getStateByRangeWithPaginationReturnsOnCall[len(fake.getStateByRangeWithPaginationArgsForCall)]
- fake.getStateByRangeWithPaginationArgsForCall = append(fake.getStateByRangeWithPaginationArgsForCall, struct {
- arg1 string
- arg2 string
- arg3 int32
- arg4 string
- }{arg1, arg2, arg3, arg4})
- stub := fake.GetStateByRangeWithPaginationStub
- fakeReturns := fake.getStateByRangeWithPaginationReturns
- fake.recordInvocation("GetStateByRangeWithPagination", []interface{}{arg1, arg2, arg3, arg4})
- fake.getStateByRangeWithPaginationMutex.Unlock()
- if stub != nil {
- return stub(arg1, arg2, arg3, arg4)
- }
- if specificReturn {
- return ret.result1, ret.result2, ret.result3
- }
- return fakeReturns.result1, fakeReturns.result2, fakeReturns.result3
-}
-
-func (fake *ChaincodeStub) GetStateByRangeWithPaginationCallCount() int {
- fake.getStateByRangeWithPaginationMutex.RLock()
- defer fake.getStateByRangeWithPaginationMutex.RUnlock()
- return len(fake.getStateByRangeWithPaginationArgsForCall)
-}
-
-func (fake *ChaincodeStub) GetStateByRangeWithPaginationCalls(stub func(string, string, int32, string) (shim.StateQueryIteratorInterface, *peer.QueryResponseMetadata, error)) {
- fake.getStateByRangeWithPaginationMutex.Lock()
- defer fake.getStateByRangeWithPaginationMutex.Unlock()
- fake.GetStateByRangeWithPaginationStub = stub
-}
-
-func (fake *ChaincodeStub) GetStateByRangeWithPaginationArgsForCall(i int) (string, string, int32, string) {
- fake.getStateByRangeWithPaginationMutex.RLock()
- defer fake.getStateByRangeWithPaginationMutex.RUnlock()
- argsForCall := fake.getStateByRangeWithPaginationArgsForCall[i]
- return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3, argsForCall.arg4
-}
-
-func (fake *ChaincodeStub) GetStateByRangeWithPaginationReturns(result1 shim.StateQueryIteratorInterface, result2 *peer.QueryResponseMetadata, result3 error) {
- fake.getStateByRangeWithPaginationMutex.Lock()
- defer fake.getStateByRangeWithPaginationMutex.Unlock()
- fake.GetStateByRangeWithPaginationStub = nil
- fake.getStateByRangeWithPaginationReturns = struct {
- result1 shim.StateQueryIteratorInterface
- result2 *peer.QueryResponseMetadata
- result3 error
- }{result1, result2, result3}
-}
-
-func (fake *ChaincodeStub) GetStateByRangeWithPaginationReturnsOnCall(i int, result1 shim.StateQueryIteratorInterface, result2 *peer.QueryResponseMetadata, result3 error) {
- fake.getStateByRangeWithPaginationMutex.Lock()
- defer fake.getStateByRangeWithPaginationMutex.Unlock()
- fake.GetStateByRangeWithPaginationStub = nil
- if fake.getStateByRangeWithPaginationReturnsOnCall == nil {
- fake.getStateByRangeWithPaginationReturnsOnCall = make(map[int]struct {
- result1 shim.StateQueryIteratorInterface
- result2 *peer.QueryResponseMetadata
- result3 error
- })
- }
- fake.getStateByRangeWithPaginationReturnsOnCall[i] = struct {
- result1 shim.StateQueryIteratorInterface
- result2 *peer.QueryResponseMetadata
- result3 error
- }{result1, result2, result3}
-}
-
-func (fake *ChaincodeStub) GetStateValidationParameter(arg1 string) ([]byte, error) {
- fake.getStateValidationParameterMutex.Lock()
- ret, specificReturn := fake.getStateValidationParameterReturnsOnCall[len(fake.getStateValidationParameterArgsForCall)]
- fake.getStateValidationParameterArgsForCall = append(fake.getStateValidationParameterArgsForCall, struct {
- arg1 string
- }{arg1})
- stub := fake.GetStateValidationParameterStub
- fakeReturns := fake.getStateValidationParameterReturns
- fake.recordInvocation("GetStateValidationParameter", []interface{}{arg1})
- fake.getStateValidationParameterMutex.Unlock()
- if stub != nil {
- return stub(arg1)
- }
- if specificReturn {
- return ret.result1, ret.result2
- }
- return fakeReturns.result1, fakeReturns.result2
-}
-
-func (fake *ChaincodeStub) GetStateValidationParameterCallCount() int {
- fake.getStateValidationParameterMutex.RLock()
- defer fake.getStateValidationParameterMutex.RUnlock()
- return len(fake.getStateValidationParameterArgsForCall)
-}
-
-func (fake *ChaincodeStub) GetStateValidationParameterCalls(stub func(string) ([]byte, error)) {
- fake.getStateValidationParameterMutex.Lock()
- defer fake.getStateValidationParameterMutex.Unlock()
- fake.GetStateValidationParameterStub = stub
-}
-
-func (fake *ChaincodeStub) GetStateValidationParameterArgsForCall(i int) string {
- fake.getStateValidationParameterMutex.RLock()
- defer fake.getStateValidationParameterMutex.RUnlock()
- argsForCall := fake.getStateValidationParameterArgsForCall[i]
- return argsForCall.arg1
-}
-
-func (fake *ChaincodeStub) GetStateValidationParameterReturns(result1 []byte, result2 error) {
- fake.getStateValidationParameterMutex.Lock()
- defer fake.getStateValidationParameterMutex.Unlock()
- fake.GetStateValidationParameterStub = nil
- fake.getStateValidationParameterReturns = struct {
- result1 []byte
- result2 error
- }{result1, result2}
-}
-
-func (fake *ChaincodeStub) GetStateValidationParameterReturnsOnCall(i int, result1 []byte, result2 error) {
- fake.getStateValidationParameterMutex.Lock()
- defer fake.getStateValidationParameterMutex.Unlock()
- fake.GetStateValidationParameterStub = nil
- if fake.getStateValidationParameterReturnsOnCall == nil {
- fake.getStateValidationParameterReturnsOnCall = make(map[int]struct {
- result1 []byte
- result2 error
- })
- }
- fake.getStateValidationParameterReturnsOnCall[i] = struct {
- result1 []byte
- result2 error
- }{result1, result2}
-}
-
-func (fake *ChaincodeStub) GetStringArgs() []string {
- fake.getStringArgsMutex.Lock()
- ret, specificReturn := fake.getStringArgsReturnsOnCall[len(fake.getStringArgsArgsForCall)]
- fake.getStringArgsArgsForCall = append(fake.getStringArgsArgsForCall, struct {
- }{})
- stub := fake.GetStringArgsStub
- fakeReturns := fake.getStringArgsReturns
- fake.recordInvocation("GetStringArgs", []interface{}{})
- fake.getStringArgsMutex.Unlock()
- if stub != nil {
- return stub()
- }
- if specificReturn {
- return ret.result1
- }
- return fakeReturns.result1
-}
-
-func (fake *ChaincodeStub) GetStringArgsCallCount() int {
- fake.getStringArgsMutex.RLock()
- defer fake.getStringArgsMutex.RUnlock()
- return len(fake.getStringArgsArgsForCall)
-}
-
-func (fake *ChaincodeStub) GetStringArgsCalls(stub func() []string) {
- fake.getStringArgsMutex.Lock()
- defer fake.getStringArgsMutex.Unlock()
- fake.GetStringArgsStub = stub
-}
-
-func (fake *ChaincodeStub) GetStringArgsReturns(result1 []string) {
- fake.getStringArgsMutex.Lock()
- defer fake.getStringArgsMutex.Unlock()
- fake.GetStringArgsStub = nil
- fake.getStringArgsReturns = struct {
- result1 []string
- }{result1}
-}
-
-func (fake *ChaincodeStub) GetStringArgsReturnsOnCall(i int, result1 []string) {
- fake.getStringArgsMutex.Lock()
- defer fake.getStringArgsMutex.Unlock()
- fake.GetStringArgsStub = nil
- if fake.getStringArgsReturnsOnCall == nil {
- fake.getStringArgsReturnsOnCall = make(map[int]struct {
- result1 []string
- })
- }
- fake.getStringArgsReturnsOnCall[i] = struct {
- result1 []string
- }{result1}
-}
-
-func (fake *ChaincodeStub) GetTransient() (map[string][]byte, error) {
- fake.getTransientMutex.Lock()
- ret, specificReturn := fake.getTransientReturnsOnCall[len(fake.getTransientArgsForCall)]
- fake.getTransientArgsForCall = append(fake.getTransientArgsForCall, struct {
- }{})
- stub := fake.GetTransientStub
- fakeReturns := fake.getTransientReturns
- fake.recordInvocation("GetTransient", []interface{}{})
- fake.getTransientMutex.Unlock()
- if stub != nil {
- return stub()
- }
- if specificReturn {
- return ret.result1, ret.result2
- }
- return fakeReturns.result1, fakeReturns.result2
-}
-
-func (fake *ChaincodeStub) GetTransientCallCount() int {
- fake.getTransientMutex.RLock()
- defer fake.getTransientMutex.RUnlock()
- return len(fake.getTransientArgsForCall)
-}
-
-func (fake *ChaincodeStub) GetTransientCalls(stub func() (map[string][]byte, error)) {
- fake.getTransientMutex.Lock()
- defer fake.getTransientMutex.Unlock()
- fake.GetTransientStub = stub
-}
-
-func (fake *ChaincodeStub) GetTransientReturns(result1 map[string][]byte, result2 error) {
- fake.getTransientMutex.Lock()
- defer fake.getTransientMutex.Unlock()
- fake.GetTransientStub = nil
- fake.getTransientReturns = struct {
- result1 map[string][]byte
- result2 error
- }{result1, result2}
-}
-
-func (fake *ChaincodeStub) GetTransientReturnsOnCall(i int, result1 map[string][]byte, result2 error) {
- fake.getTransientMutex.Lock()
- defer fake.getTransientMutex.Unlock()
- fake.GetTransientStub = nil
- if fake.getTransientReturnsOnCall == nil {
- fake.getTransientReturnsOnCall = make(map[int]struct {
- result1 map[string][]byte
- result2 error
- })
- }
- fake.getTransientReturnsOnCall[i] = struct {
- result1 map[string][]byte
- result2 error
- }{result1, result2}
-}
-
-func (fake *ChaincodeStub) GetTxID() string {
- fake.getTxIDMutex.Lock()
- ret, specificReturn := fake.getTxIDReturnsOnCall[len(fake.getTxIDArgsForCall)]
- fake.getTxIDArgsForCall = append(fake.getTxIDArgsForCall, struct {
- }{})
- stub := fake.GetTxIDStub
- fakeReturns := fake.getTxIDReturns
- fake.recordInvocation("GetTxID", []interface{}{})
- fake.getTxIDMutex.Unlock()
- if stub != nil {
- return stub()
- }
- if specificReturn {
- return ret.result1
- }
- return fakeReturns.result1
-}
-
-func (fake *ChaincodeStub) GetTxIDCallCount() int {
- fake.getTxIDMutex.RLock()
- defer fake.getTxIDMutex.RUnlock()
- return len(fake.getTxIDArgsForCall)
-}
-
-func (fake *ChaincodeStub) GetTxIDCalls(stub func() string) {
- fake.getTxIDMutex.Lock()
- defer fake.getTxIDMutex.Unlock()
- fake.GetTxIDStub = stub
-}
-
-func (fake *ChaincodeStub) GetTxIDReturns(result1 string) {
- fake.getTxIDMutex.Lock()
- defer fake.getTxIDMutex.Unlock()
- fake.GetTxIDStub = nil
- fake.getTxIDReturns = struct {
- result1 string
- }{result1}
-}
-
-func (fake *ChaincodeStub) GetTxIDReturnsOnCall(i int, result1 string) {
- fake.getTxIDMutex.Lock()
- defer fake.getTxIDMutex.Unlock()
- fake.GetTxIDStub = nil
- if fake.getTxIDReturnsOnCall == nil {
- fake.getTxIDReturnsOnCall = make(map[int]struct {
- result1 string
- })
- }
- fake.getTxIDReturnsOnCall[i] = struct {
- result1 string
- }{result1}
-}
-
-func (fake *ChaincodeStub) GetTxTimestamp() (*timestamppb.Timestamp, error) {
- fake.getTxTimestampMutex.Lock()
- ret, specificReturn := fake.getTxTimestampReturnsOnCall[len(fake.getTxTimestampArgsForCall)]
- fake.getTxTimestampArgsForCall = append(fake.getTxTimestampArgsForCall, struct {
- }{})
- stub := fake.GetTxTimestampStub
- fakeReturns := fake.getTxTimestampReturns
- fake.recordInvocation("GetTxTimestamp", []interface{}{})
- fake.getTxTimestampMutex.Unlock()
- if stub != nil {
- return stub()
- }
- if specificReturn {
- return ret.result1, ret.result2
- }
- return fakeReturns.result1, fakeReturns.result2
-}
-
-func (fake *ChaincodeStub) GetTxTimestampCallCount() int {
- fake.getTxTimestampMutex.RLock()
- defer fake.getTxTimestampMutex.RUnlock()
- return len(fake.getTxTimestampArgsForCall)
-}
-
-func (fake *ChaincodeStub) GetTxTimestampCalls(stub func() (*timestamppb.Timestamp, error)) {
- fake.getTxTimestampMutex.Lock()
- defer fake.getTxTimestampMutex.Unlock()
- fake.GetTxTimestampStub = stub
-}
-
-func (fake *ChaincodeStub) GetTxTimestampReturns(result1 *timestamppb.Timestamp, result2 error) {
- fake.getTxTimestampMutex.Lock()
- defer fake.getTxTimestampMutex.Unlock()
- fake.GetTxTimestampStub = nil
- fake.getTxTimestampReturns = struct {
- result1 *timestamppb.Timestamp
- result2 error
- }{result1, result2}
-}
-
-func (fake *ChaincodeStub) GetTxTimestampReturnsOnCall(i int, result1 *timestamppb.Timestamp, result2 error) {
- fake.getTxTimestampMutex.Lock()
- defer fake.getTxTimestampMutex.Unlock()
- fake.GetTxTimestampStub = nil
- if fake.getTxTimestampReturnsOnCall == nil {
- fake.getTxTimestampReturnsOnCall = make(map[int]struct {
- result1 *timestamppb.Timestamp
- result2 error
- })
- }
- fake.getTxTimestampReturnsOnCall[i] = struct {
- result1 *timestamppb.Timestamp
- result2 error
- }{result1, result2}
-}
-
-func (fake *ChaincodeStub) InvokeChaincode(arg1 string, arg2 [][]byte, arg3 string) *peer.Response {
- var arg2Copy [][]byte
- if arg2 != nil {
- arg2Copy = make([][]byte, len(arg2))
- copy(arg2Copy, arg2)
- }
- fake.invokeChaincodeMutex.Lock()
- ret, specificReturn := fake.invokeChaincodeReturnsOnCall[len(fake.invokeChaincodeArgsForCall)]
- fake.invokeChaincodeArgsForCall = append(fake.invokeChaincodeArgsForCall, struct {
- arg1 string
- arg2 [][]byte
- arg3 string
- }{arg1, arg2Copy, arg3})
- stub := fake.InvokeChaincodeStub
- fakeReturns := fake.invokeChaincodeReturns
- fake.recordInvocation("InvokeChaincode", []interface{}{arg1, arg2Copy, arg3})
- fake.invokeChaincodeMutex.Unlock()
- if stub != nil {
- return stub(arg1, arg2, arg3)
- }
- if specificReturn {
- return ret.result1
- }
- return fakeReturns.result1
-}
-
-func (fake *ChaincodeStub) InvokeChaincodeCallCount() int {
- fake.invokeChaincodeMutex.RLock()
- defer fake.invokeChaincodeMutex.RUnlock()
- return len(fake.invokeChaincodeArgsForCall)
-}
-
-func (fake *ChaincodeStub) InvokeChaincodeCalls(stub func(string, [][]byte, string) *peer.Response) {
- fake.invokeChaincodeMutex.Lock()
- defer fake.invokeChaincodeMutex.Unlock()
- fake.InvokeChaincodeStub = stub
-}
-
-func (fake *ChaincodeStub) InvokeChaincodeArgsForCall(i int) (string, [][]byte, string) {
- fake.invokeChaincodeMutex.RLock()
- defer fake.invokeChaincodeMutex.RUnlock()
- argsForCall := fake.invokeChaincodeArgsForCall[i]
- return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
-}
-
-func (fake *ChaincodeStub) InvokeChaincodeReturns(result1 *peer.Response) {
- fake.invokeChaincodeMutex.Lock()
- defer fake.invokeChaincodeMutex.Unlock()
- fake.InvokeChaincodeStub = nil
- fake.invokeChaincodeReturns = struct {
- result1 *peer.Response
- }{result1}
-}
-
-func (fake *ChaincodeStub) InvokeChaincodeReturnsOnCall(i int, result1 *peer.Response) {
- fake.invokeChaincodeMutex.Lock()
- defer fake.invokeChaincodeMutex.Unlock()
- fake.InvokeChaincodeStub = nil
- if fake.invokeChaincodeReturnsOnCall == nil {
- fake.invokeChaincodeReturnsOnCall = make(map[int]struct {
- result1 *peer.Response
- })
- }
- fake.invokeChaincodeReturnsOnCall[i] = struct {
- result1 *peer.Response
- }{result1}
-}
-
-func (fake *ChaincodeStub) PurgePrivateData(arg1 string, arg2 string) error {
- fake.purgePrivateDataMutex.Lock()
- ret, specificReturn := fake.purgePrivateDataReturnsOnCall[len(fake.purgePrivateDataArgsForCall)]
- fake.purgePrivateDataArgsForCall = append(fake.purgePrivateDataArgsForCall, struct {
- arg1 string
- arg2 string
- }{arg1, arg2})
- stub := fake.PurgePrivateDataStub
- fakeReturns := fake.purgePrivateDataReturns
- fake.recordInvocation("PurgePrivateData", []interface{}{arg1, arg2})
- fake.purgePrivateDataMutex.Unlock()
- if stub != nil {
- return stub(arg1, arg2)
- }
- if specificReturn {
- return ret.result1
- }
- return fakeReturns.result1
-}
-
-func (fake *ChaincodeStub) PurgePrivateDataCallCount() int {
- fake.purgePrivateDataMutex.RLock()
- defer fake.purgePrivateDataMutex.RUnlock()
- return len(fake.purgePrivateDataArgsForCall)
-}
-
-func (fake *ChaincodeStub) PurgePrivateDataCalls(stub func(string, string) error) {
- fake.purgePrivateDataMutex.Lock()
- defer fake.purgePrivateDataMutex.Unlock()
- fake.PurgePrivateDataStub = stub
-}
-
-func (fake *ChaincodeStub) PurgePrivateDataArgsForCall(i int) (string, string) {
- fake.purgePrivateDataMutex.RLock()
- defer fake.purgePrivateDataMutex.RUnlock()
- argsForCall := fake.purgePrivateDataArgsForCall[i]
- return argsForCall.arg1, argsForCall.arg2
-}
-
-func (fake *ChaincodeStub) PurgePrivateDataReturns(result1 error) {
- fake.purgePrivateDataMutex.Lock()
- defer fake.purgePrivateDataMutex.Unlock()
- fake.PurgePrivateDataStub = nil
- fake.purgePrivateDataReturns = struct {
- result1 error
- }{result1}
-}
-
-func (fake *ChaincodeStub) PurgePrivateDataReturnsOnCall(i int, result1 error) {
- fake.purgePrivateDataMutex.Lock()
- defer fake.purgePrivateDataMutex.Unlock()
- fake.PurgePrivateDataStub = nil
- if fake.purgePrivateDataReturnsOnCall == nil {
- fake.purgePrivateDataReturnsOnCall = make(map[int]struct {
- result1 error
- })
- }
- fake.purgePrivateDataReturnsOnCall[i] = struct {
- result1 error
- }{result1}
-}
-
-func (fake *ChaincodeStub) PutPrivateData(arg1 string, arg2 string, arg3 []byte) error {
- var arg3Copy []byte
- if arg3 != nil {
- arg3Copy = make([]byte, len(arg3))
- copy(arg3Copy, arg3)
- }
- fake.putPrivateDataMutex.Lock()
- ret, specificReturn := fake.putPrivateDataReturnsOnCall[len(fake.putPrivateDataArgsForCall)]
- fake.putPrivateDataArgsForCall = append(fake.putPrivateDataArgsForCall, struct {
- arg1 string
- arg2 string
- arg3 []byte
- }{arg1, arg2, arg3Copy})
- stub := fake.PutPrivateDataStub
- fakeReturns := fake.putPrivateDataReturns
- fake.recordInvocation("PutPrivateData", []interface{}{arg1, arg2, arg3Copy})
- fake.putPrivateDataMutex.Unlock()
- if stub != nil {
- return stub(arg1, arg2, arg3)
- }
- if specificReturn {
- return ret.result1
- }
- return fakeReturns.result1
-}
-
-func (fake *ChaincodeStub) PutPrivateDataCallCount() int {
- fake.putPrivateDataMutex.RLock()
- defer fake.putPrivateDataMutex.RUnlock()
- return len(fake.putPrivateDataArgsForCall)
-}
-
-func (fake *ChaincodeStub) PutPrivateDataCalls(stub func(string, string, []byte) error) {
- fake.putPrivateDataMutex.Lock()
- defer fake.putPrivateDataMutex.Unlock()
- fake.PutPrivateDataStub = stub
-}
-
-func (fake *ChaincodeStub) PutPrivateDataArgsForCall(i int) (string, string, []byte) {
- fake.putPrivateDataMutex.RLock()
- defer fake.putPrivateDataMutex.RUnlock()
- argsForCall := fake.putPrivateDataArgsForCall[i]
- return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
-}
-
-func (fake *ChaincodeStub) PutPrivateDataReturns(result1 error) {
- fake.putPrivateDataMutex.Lock()
- defer fake.putPrivateDataMutex.Unlock()
- fake.PutPrivateDataStub = nil
- fake.putPrivateDataReturns = struct {
- result1 error
- }{result1}
-}
-
-func (fake *ChaincodeStub) PutPrivateDataReturnsOnCall(i int, result1 error) {
- fake.putPrivateDataMutex.Lock()
- defer fake.putPrivateDataMutex.Unlock()
- fake.PutPrivateDataStub = nil
- if fake.putPrivateDataReturnsOnCall == nil {
- fake.putPrivateDataReturnsOnCall = make(map[int]struct {
- result1 error
- })
- }
- fake.putPrivateDataReturnsOnCall[i] = struct {
- result1 error
- }{result1}
-}
-
-func (fake *ChaincodeStub) PutState(arg1 string, arg2 []byte) error {
- var arg2Copy []byte
- if arg2 != nil {
- arg2Copy = make([]byte, len(arg2))
- copy(arg2Copy, arg2)
- }
- fake.putStateMutex.Lock()
- ret, specificReturn := fake.putStateReturnsOnCall[len(fake.putStateArgsForCall)]
- fake.putStateArgsForCall = append(fake.putStateArgsForCall, struct {
- arg1 string
- arg2 []byte
- }{arg1, arg2Copy})
- stub := fake.PutStateStub
- fakeReturns := fake.putStateReturns
- fake.recordInvocation("PutState", []interface{}{arg1, arg2Copy})
- fake.putStateMutex.Unlock()
- if stub != nil {
- return stub(arg1, arg2)
- }
- if specificReturn {
- return ret.result1
- }
- return fakeReturns.result1
-}
-
-func (fake *ChaincodeStub) PutStateCallCount() int {
- fake.putStateMutex.RLock()
- defer fake.putStateMutex.RUnlock()
- return len(fake.putStateArgsForCall)
-}
-
-func (fake *ChaincodeStub) PutStateCalls(stub func(string, []byte) error) {
- fake.putStateMutex.Lock()
- defer fake.putStateMutex.Unlock()
- fake.PutStateStub = stub
-}
-
-func (fake *ChaincodeStub) PutStateArgsForCall(i int) (string, []byte) {
- fake.putStateMutex.RLock()
- defer fake.putStateMutex.RUnlock()
- argsForCall := fake.putStateArgsForCall[i]
- return argsForCall.arg1, argsForCall.arg2
-}
-
-func (fake *ChaincodeStub) PutStateReturns(result1 error) {
- fake.putStateMutex.Lock()
- defer fake.putStateMutex.Unlock()
- fake.PutStateStub = nil
- fake.putStateReturns = struct {
- result1 error
- }{result1}
-}
-
-func (fake *ChaincodeStub) PutStateReturnsOnCall(i int, result1 error) {
- fake.putStateMutex.Lock()
- defer fake.putStateMutex.Unlock()
- fake.PutStateStub = nil
- if fake.putStateReturnsOnCall == nil {
- fake.putStateReturnsOnCall = make(map[int]struct {
- result1 error
- })
- }
- fake.putStateReturnsOnCall[i] = struct {
- result1 error
- }{result1}
-}
-
-func (fake *ChaincodeStub) SetEvent(arg1 string, arg2 []byte) error {
- var arg2Copy []byte
- if arg2 != nil {
- arg2Copy = make([]byte, len(arg2))
- copy(arg2Copy, arg2)
- }
- fake.setEventMutex.Lock()
- ret, specificReturn := fake.setEventReturnsOnCall[len(fake.setEventArgsForCall)]
- fake.setEventArgsForCall = append(fake.setEventArgsForCall, struct {
- arg1 string
- arg2 []byte
- }{arg1, arg2Copy})
- stub := fake.SetEventStub
- fakeReturns := fake.setEventReturns
- fake.recordInvocation("SetEvent", []interface{}{arg1, arg2Copy})
- fake.setEventMutex.Unlock()
- if stub != nil {
- return stub(arg1, arg2)
- }
- if specificReturn {
- return ret.result1
- }
- return fakeReturns.result1
-}
-
-func (fake *ChaincodeStub) SetEventCallCount() int {
- fake.setEventMutex.RLock()
- defer fake.setEventMutex.RUnlock()
- return len(fake.setEventArgsForCall)
-}
-
-func (fake *ChaincodeStub) SetEventCalls(stub func(string, []byte) error) {
- fake.setEventMutex.Lock()
- defer fake.setEventMutex.Unlock()
- fake.SetEventStub = stub
-}
-
-func (fake *ChaincodeStub) SetEventArgsForCall(i int) (string, []byte) {
- fake.setEventMutex.RLock()
- defer fake.setEventMutex.RUnlock()
- argsForCall := fake.setEventArgsForCall[i]
- return argsForCall.arg1, argsForCall.arg2
-}
-
-func (fake *ChaincodeStub) SetEventReturns(result1 error) {
- fake.setEventMutex.Lock()
- defer fake.setEventMutex.Unlock()
- fake.SetEventStub = nil
- fake.setEventReturns = struct {
- result1 error
- }{result1}
-}
-
-func (fake *ChaincodeStub) SetEventReturnsOnCall(i int, result1 error) {
- fake.setEventMutex.Lock()
- defer fake.setEventMutex.Unlock()
- fake.SetEventStub = nil
- if fake.setEventReturnsOnCall == nil {
- fake.setEventReturnsOnCall = make(map[int]struct {
- result1 error
- })
- }
- fake.setEventReturnsOnCall[i] = struct {
- result1 error
- }{result1}
-}
-
-func (fake *ChaincodeStub) SetPrivateDataValidationParameter(arg1 string, arg2 string, arg3 []byte) error {
- var arg3Copy []byte
- if arg3 != nil {
- arg3Copy = make([]byte, len(arg3))
- copy(arg3Copy, arg3)
- }
- fake.setPrivateDataValidationParameterMutex.Lock()
- ret, specificReturn := fake.setPrivateDataValidationParameterReturnsOnCall[len(fake.setPrivateDataValidationParameterArgsForCall)]
- fake.setPrivateDataValidationParameterArgsForCall = append(fake.setPrivateDataValidationParameterArgsForCall, struct {
- arg1 string
- arg2 string
- arg3 []byte
- }{arg1, arg2, arg3Copy})
- stub := fake.SetPrivateDataValidationParameterStub
- fakeReturns := fake.setPrivateDataValidationParameterReturns
- fake.recordInvocation("SetPrivateDataValidationParameter", []interface{}{arg1, arg2, arg3Copy})
- fake.setPrivateDataValidationParameterMutex.Unlock()
- if stub != nil {
- return stub(arg1, arg2, arg3)
- }
- if specificReturn {
- return ret.result1
- }
- return fakeReturns.result1
-}
-
-func (fake *ChaincodeStub) SetPrivateDataValidationParameterCallCount() int {
- fake.setPrivateDataValidationParameterMutex.RLock()
- defer fake.setPrivateDataValidationParameterMutex.RUnlock()
- return len(fake.setPrivateDataValidationParameterArgsForCall)
-}
-
-func (fake *ChaincodeStub) SetPrivateDataValidationParameterCalls(stub func(string, string, []byte) error) {
- fake.setPrivateDataValidationParameterMutex.Lock()
- defer fake.setPrivateDataValidationParameterMutex.Unlock()
- fake.SetPrivateDataValidationParameterStub = stub
-}
-
-func (fake *ChaincodeStub) SetPrivateDataValidationParameterArgsForCall(i int) (string, string, []byte) {
- fake.setPrivateDataValidationParameterMutex.RLock()
- defer fake.setPrivateDataValidationParameterMutex.RUnlock()
- argsForCall := fake.setPrivateDataValidationParameterArgsForCall[i]
- return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
-}
-
-func (fake *ChaincodeStub) SetPrivateDataValidationParameterReturns(result1 error) {
- fake.setPrivateDataValidationParameterMutex.Lock()
- defer fake.setPrivateDataValidationParameterMutex.Unlock()
- fake.SetPrivateDataValidationParameterStub = nil
- fake.setPrivateDataValidationParameterReturns = struct {
- result1 error
- }{result1}
-}
-
-func (fake *ChaincodeStub) SetPrivateDataValidationParameterReturnsOnCall(i int, result1 error) {
- fake.setPrivateDataValidationParameterMutex.Lock()
- defer fake.setPrivateDataValidationParameterMutex.Unlock()
- fake.SetPrivateDataValidationParameterStub = nil
- if fake.setPrivateDataValidationParameterReturnsOnCall == nil {
- fake.setPrivateDataValidationParameterReturnsOnCall = make(map[int]struct {
- result1 error
- })
- }
- fake.setPrivateDataValidationParameterReturnsOnCall[i] = struct {
- result1 error
- }{result1}
-}
-
-func (fake *ChaincodeStub) SetStateValidationParameter(arg1 string, arg2 []byte) error {
- var arg2Copy []byte
- if arg2 != nil {
- arg2Copy = make([]byte, len(arg2))
- copy(arg2Copy, arg2)
- }
- fake.setStateValidationParameterMutex.Lock()
- ret, specificReturn := fake.setStateValidationParameterReturnsOnCall[len(fake.setStateValidationParameterArgsForCall)]
- fake.setStateValidationParameterArgsForCall = append(fake.setStateValidationParameterArgsForCall, struct {
- arg1 string
- arg2 []byte
- }{arg1, arg2Copy})
- stub := fake.SetStateValidationParameterStub
- fakeReturns := fake.setStateValidationParameterReturns
- fake.recordInvocation("SetStateValidationParameter", []interface{}{arg1, arg2Copy})
- fake.setStateValidationParameterMutex.Unlock()
- if stub != nil {
- return stub(arg1, arg2)
- }
- if specificReturn {
- return ret.result1
- }
- return fakeReturns.result1
-}
-
-func (fake *ChaincodeStub) SetStateValidationParameterCallCount() int {
- fake.setStateValidationParameterMutex.RLock()
- defer fake.setStateValidationParameterMutex.RUnlock()
- return len(fake.setStateValidationParameterArgsForCall)
-}
-
-func (fake *ChaincodeStub) SetStateValidationParameterCalls(stub func(string, []byte) error) {
- fake.setStateValidationParameterMutex.Lock()
- defer fake.setStateValidationParameterMutex.Unlock()
- fake.SetStateValidationParameterStub = stub
-}
-
-func (fake *ChaincodeStub) SetStateValidationParameterArgsForCall(i int) (string, []byte) {
- fake.setStateValidationParameterMutex.RLock()
- defer fake.setStateValidationParameterMutex.RUnlock()
- argsForCall := fake.setStateValidationParameterArgsForCall[i]
- return argsForCall.arg1, argsForCall.arg2
-}
-
-func (fake *ChaincodeStub) SetStateValidationParameterReturns(result1 error) {
- fake.setStateValidationParameterMutex.Lock()
- defer fake.setStateValidationParameterMutex.Unlock()
- fake.SetStateValidationParameterStub = nil
- fake.setStateValidationParameterReturns = struct {
- result1 error
- }{result1}
-}
-
-func (fake *ChaincodeStub) SetStateValidationParameterReturnsOnCall(i int, result1 error) {
- fake.setStateValidationParameterMutex.Lock()
- defer fake.setStateValidationParameterMutex.Unlock()
- fake.SetStateValidationParameterStub = nil
- if fake.setStateValidationParameterReturnsOnCall == nil {
- fake.setStateValidationParameterReturnsOnCall = make(map[int]struct {
- result1 error
- })
- }
- fake.setStateValidationParameterReturnsOnCall[i] = struct {
- result1 error
- }{result1}
-}
-
-func (fake *ChaincodeStub) SplitCompositeKey(arg1 string) (string, []string, error) {
- fake.splitCompositeKeyMutex.Lock()
- ret, specificReturn := fake.splitCompositeKeyReturnsOnCall[len(fake.splitCompositeKeyArgsForCall)]
- fake.splitCompositeKeyArgsForCall = append(fake.splitCompositeKeyArgsForCall, struct {
- arg1 string
- }{arg1})
- stub := fake.SplitCompositeKeyStub
- fakeReturns := fake.splitCompositeKeyReturns
- fake.recordInvocation("SplitCompositeKey", []interface{}{arg1})
- fake.splitCompositeKeyMutex.Unlock()
- if stub != nil {
- return stub(arg1)
- }
- if specificReturn {
- return ret.result1, ret.result2, ret.result3
- }
- return fakeReturns.result1, fakeReturns.result2, fakeReturns.result3
-}
-
-func (fake *ChaincodeStub) SplitCompositeKeyCallCount() int {
- fake.splitCompositeKeyMutex.RLock()
- defer fake.splitCompositeKeyMutex.RUnlock()
- return len(fake.splitCompositeKeyArgsForCall)
-}
-
-func (fake *ChaincodeStub) SplitCompositeKeyCalls(stub func(string) (string, []string, error)) {
- fake.splitCompositeKeyMutex.Lock()
- defer fake.splitCompositeKeyMutex.Unlock()
- fake.SplitCompositeKeyStub = stub
-}
-
-func (fake *ChaincodeStub) SplitCompositeKeyArgsForCall(i int) string {
- fake.splitCompositeKeyMutex.RLock()
- defer fake.splitCompositeKeyMutex.RUnlock()
- argsForCall := fake.splitCompositeKeyArgsForCall[i]
- return argsForCall.arg1
-}
-
-func (fake *ChaincodeStub) SplitCompositeKeyReturns(result1 string, result2 []string, result3 error) {
- fake.splitCompositeKeyMutex.Lock()
- defer fake.splitCompositeKeyMutex.Unlock()
- fake.SplitCompositeKeyStub = nil
- fake.splitCompositeKeyReturns = struct {
- result1 string
- result2 []string
- result3 error
- }{result1, result2, result3}
-}
-
-func (fake *ChaincodeStub) SplitCompositeKeyReturnsOnCall(i int, result1 string, result2 []string, result3 error) {
- fake.splitCompositeKeyMutex.Lock()
- defer fake.splitCompositeKeyMutex.Unlock()
- fake.SplitCompositeKeyStub = nil
- if fake.splitCompositeKeyReturnsOnCall == nil {
- fake.splitCompositeKeyReturnsOnCall = make(map[int]struct {
- result1 string
- result2 []string
- result3 error
- })
- }
- fake.splitCompositeKeyReturnsOnCall[i] = struct {
- result1 string
- result2 []string
- result3 error
- }{result1, result2, result3}
-}
-
-func (fake *ChaincodeStub) Invocations() map[string][][]interface{} {
- fake.invocationsMutex.RLock()
- defer fake.invocationsMutex.RUnlock()
- fake.createCompositeKeyMutex.RLock()
- defer fake.createCompositeKeyMutex.RUnlock()
- fake.delPrivateDataMutex.RLock()
- defer fake.delPrivateDataMutex.RUnlock()
- fake.delStateMutex.RLock()
- defer fake.delStateMutex.RUnlock()
- fake.getArgsMutex.RLock()
- defer fake.getArgsMutex.RUnlock()
- fake.getArgsSliceMutex.RLock()
- defer fake.getArgsSliceMutex.RUnlock()
- fake.getBindingMutex.RLock()
- defer fake.getBindingMutex.RUnlock()
- fake.getChannelIDMutex.RLock()
- defer fake.getChannelIDMutex.RUnlock()
- fake.getCreatorMutex.RLock()
- defer fake.getCreatorMutex.RUnlock()
- fake.getDecorationsMutex.RLock()
- defer fake.getDecorationsMutex.RUnlock()
- fake.getFunctionAndParametersMutex.RLock()
- defer fake.getFunctionAndParametersMutex.RUnlock()
- fake.getHistoryForKeyMutex.RLock()
- defer fake.getHistoryForKeyMutex.RUnlock()
- fake.getPrivateDataMutex.RLock()
- defer fake.getPrivateDataMutex.RUnlock()
- fake.getPrivateDataByPartialCompositeKeyMutex.RLock()
- defer fake.getPrivateDataByPartialCompositeKeyMutex.RUnlock()
- fake.getPrivateDataByRangeMutex.RLock()
- defer fake.getPrivateDataByRangeMutex.RUnlock()
- fake.getPrivateDataHashMutex.RLock()
- defer fake.getPrivateDataHashMutex.RUnlock()
- fake.getPrivateDataQueryResultMutex.RLock()
- defer fake.getPrivateDataQueryResultMutex.RUnlock()
- fake.getPrivateDataValidationParameterMutex.RLock()
- defer fake.getPrivateDataValidationParameterMutex.RUnlock()
- fake.getQueryResultMutex.RLock()
- defer fake.getQueryResultMutex.RUnlock()
- fake.getQueryResultWithPaginationMutex.RLock()
- defer fake.getQueryResultWithPaginationMutex.RUnlock()
- fake.getSignedProposalMutex.RLock()
- defer fake.getSignedProposalMutex.RUnlock()
- fake.getStateMutex.RLock()
- defer fake.getStateMutex.RUnlock()
- fake.getStateByPartialCompositeKeyMutex.RLock()
- defer fake.getStateByPartialCompositeKeyMutex.RUnlock()
- fake.getStateByPartialCompositeKeyWithPaginationMutex.RLock()
- defer fake.getStateByPartialCompositeKeyWithPaginationMutex.RUnlock()
- fake.getStateByRangeMutex.RLock()
- defer fake.getStateByRangeMutex.RUnlock()
- fake.getStateByRangeWithPaginationMutex.RLock()
- defer fake.getStateByRangeWithPaginationMutex.RUnlock()
- fake.getStateValidationParameterMutex.RLock()
- defer fake.getStateValidationParameterMutex.RUnlock()
- fake.getStringArgsMutex.RLock()
- defer fake.getStringArgsMutex.RUnlock()
- fake.getTransientMutex.RLock()
- defer fake.getTransientMutex.RUnlock()
- fake.getTxIDMutex.RLock()
- defer fake.getTxIDMutex.RUnlock()
- fake.getTxTimestampMutex.RLock()
- defer fake.getTxTimestampMutex.RUnlock()
- fake.invokeChaincodeMutex.RLock()
- defer fake.invokeChaincodeMutex.RUnlock()
- fake.purgePrivateDataMutex.RLock()
- defer fake.purgePrivateDataMutex.RUnlock()
- fake.putPrivateDataMutex.RLock()
- defer fake.putPrivateDataMutex.RUnlock()
- fake.putStateMutex.RLock()
- defer fake.putStateMutex.RUnlock()
- fake.setEventMutex.RLock()
- defer fake.setEventMutex.RUnlock()
- fake.setPrivateDataValidationParameterMutex.RLock()
- defer fake.setPrivateDataValidationParameterMutex.RUnlock()
- fake.setStateValidationParameterMutex.RLock()
- defer fake.setStateValidationParameterMutex.RUnlock()
- fake.splitCompositeKeyMutex.RLock()
- defer fake.splitCompositeKeyMutex.RUnlock()
- copiedInvocations := map[string][][]interface{}{}
- for key, value := range fake.invocations {
- copiedInvocations[key] = value
- }
- return copiedInvocations
-}
-
-func (fake *ChaincodeStub) recordInvocation(key string, args []interface{}) {
- fake.invocationsMutex.Lock()
- defer fake.invocationsMutex.Unlock()
- if fake.invocations == nil {
- fake.invocations = map[string][][]interface{}{}
- }
- if fake.invocations[key] == nil {
- fake.invocations[key] = [][]interface{}{}
- }
- fake.invocations[key] = append(fake.invocations[key], args)
-}
diff --git a/asset-transfer-private-data/chaincode-go/chaincode/mocks/clientIdentity.go b/asset-transfer-private-data/chaincode-go/chaincode/mocks/clientIdentity.go
deleted file mode 100644
index 79bf75dd..00000000
--- a/asset-transfer-private-data/chaincode-go/chaincode/mocks/clientIdentity.go
+++ /dev/null
@@ -1,404 +0,0 @@
-// Code generated by counterfeiter. DO NOT EDIT.
-package mocks
-
-import (
- "crypto/x509"
- "sync"
-)
-
-type ClientIdentity struct {
- AssertAttributeValueStub func(string, string) error
- assertAttributeValueMutex sync.RWMutex
- assertAttributeValueArgsForCall []struct {
- arg1 string
- arg2 string
- }
- assertAttributeValueReturns struct {
- result1 error
- }
- assertAttributeValueReturnsOnCall map[int]struct {
- result1 error
- }
- GetAttributeValueStub func(string) (string, bool, error)
- getAttributeValueMutex sync.RWMutex
- getAttributeValueArgsForCall []struct {
- arg1 string
- }
- getAttributeValueReturns struct {
- result1 string
- result2 bool
- result3 error
- }
- getAttributeValueReturnsOnCall map[int]struct {
- result1 string
- result2 bool
- result3 error
- }
- GetIDStub func() (string, error)
- getIDMutex sync.RWMutex
- getIDArgsForCall []struct {
- }
- getIDReturns struct {
- result1 string
- result2 error
- }
- getIDReturnsOnCall map[int]struct {
- result1 string
- result2 error
- }
- GetMSPIDStub func() (string, error)
- getMSPIDMutex sync.RWMutex
- getMSPIDArgsForCall []struct {
- }
- getMSPIDReturns struct {
- result1 string
- result2 error
- }
- getMSPIDReturnsOnCall map[int]struct {
- result1 string
- result2 error
- }
- GetX509CertificateStub func() (*x509.Certificate, error)
- getX509CertificateMutex sync.RWMutex
- getX509CertificateArgsForCall []struct {
- }
- getX509CertificateReturns struct {
- result1 *x509.Certificate
- result2 error
- }
- getX509CertificateReturnsOnCall map[int]struct {
- result1 *x509.Certificate
- result2 error
- }
- invocations map[string][][]interface{}
- invocationsMutex sync.RWMutex
-}
-
-func (fake *ClientIdentity) AssertAttributeValue(arg1 string, arg2 string) error {
- fake.assertAttributeValueMutex.Lock()
- ret, specificReturn := fake.assertAttributeValueReturnsOnCall[len(fake.assertAttributeValueArgsForCall)]
- fake.assertAttributeValueArgsForCall = append(fake.assertAttributeValueArgsForCall, struct {
- arg1 string
- arg2 string
- }{arg1, arg2})
- stub := fake.AssertAttributeValueStub
- fakeReturns := fake.assertAttributeValueReturns
- fake.recordInvocation("AssertAttributeValue", []interface{}{arg1, arg2})
- fake.assertAttributeValueMutex.Unlock()
- if stub != nil {
- return stub(arg1, arg2)
- }
- if specificReturn {
- return ret.result1
- }
- return fakeReturns.result1
-}
-
-func (fake *ClientIdentity) AssertAttributeValueCallCount() int {
- fake.assertAttributeValueMutex.RLock()
- defer fake.assertAttributeValueMutex.RUnlock()
- return len(fake.assertAttributeValueArgsForCall)
-}
-
-func (fake *ClientIdentity) AssertAttributeValueCalls(stub func(string, string) error) {
- fake.assertAttributeValueMutex.Lock()
- defer fake.assertAttributeValueMutex.Unlock()
- fake.AssertAttributeValueStub = stub
-}
-
-func (fake *ClientIdentity) AssertAttributeValueArgsForCall(i int) (string, string) {
- fake.assertAttributeValueMutex.RLock()
- defer fake.assertAttributeValueMutex.RUnlock()
- argsForCall := fake.assertAttributeValueArgsForCall[i]
- return argsForCall.arg1, argsForCall.arg2
-}
-
-func (fake *ClientIdentity) AssertAttributeValueReturns(result1 error) {
- fake.assertAttributeValueMutex.Lock()
- defer fake.assertAttributeValueMutex.Unlock()
- fake.AssertAttributeValueStub = nil
- fake.assertAttributeValueReturns = struct {
- result1 error
- }{result1}
-}
-
-func (fake *ClientIdentity) AssertAttributeValueReturnsOnCall(i int, result1 error) {
- fake.assertAttributeValueMutex.Lock()
- defer fake.assertAttributeValueMutex.Unlock()
- fake.AssertAttributeValueStub = nil
- if fake.assertAttributeValueReturnsOnCall == nil {
- fake.assertAttributeValueReturnsOnCall = make(map[int]struct {
- result1 error
- })
- }
- fake.assertAttributeValueReturnsOnCall[i] = struct {
- result1 error
- }{result1}
-}
-
-func (fake *ClientIdentity) GetAttributeValue(arg1 string) (string, bool, error) {
- fake.getAttributeValueMutex.Lock()
- ret, specificReturn := fake.getAttributeValueReturnsOnCall[len(fake.getAttributeValueArgsForCall)]
- fake.getAttributeValueArgsForCall = append(fake.getAttributeValueArgsForCall, struct {
- arg1 string
- }{arg1})
- stub := fake.GetAttributeValueStub
- fakeReturns := fake.getAttributeValueReturns
- fake.recordInvocation("GetAttributeValue", []interface{}{arg1})
- fake.getAttributeValueMutex.Unlock()
- if stub != nil {
- return stub(arg1)
- }
- if specificReturn {
- return ret.result1, ret.result2, ret.result3
- }
- return fakeReturns.result1, fakeReturns.result2, fakeReturns.result3
-}
-
-func (fake *ClientIdentity) GetAttributeValueCallCount() int {
- fake.getAttributeValueMutex.RLock()
- defer fake.getAttributeValueMutex.RUnlock()
- return len(fake.getAttributeValueArgsForCall)
-}
-
-func (fake *ClientIdentity) GetAttributeValueCalls(stub func(string) (string, bool, error)) {
- fake.getAttributeValueMutex.Lock()
- defer fake.getAttributeValueMutex.Unlock()
- fake.GetAttributeValueStub = stub
-}
-
-func (fake *ClientIdentity) GetAttributeValueArgsForCall(i int) string {
- fake.getAttributeValueMutex.RLock()
- defer fake.getAttributeValueMutex.RUnlock()
- argsForCall := fake.getAttributeValueArgsForCall[i]
- return argsForCall.arg1
-}
-
-func (fake *ClientIdentity) GetAttributeValueReturns(result1 string, result2 bool, result3 error) {
- fake.getAttributeValueMutex.Lock()
- defer fake.getAttributeValueMutex.Unlock()
- fake.GetAttributeValueStub = nil
- fake.getAttributeValueReturns = struct {
- result1 string
- result2 bool
- result3 error
- }{result1, result2, result3}
-}
-
-func (fake *ClientIdentity) GetAttributeValueReturnsOnCall(i int, result1 string, result2 bool, result3 error) {
- fake.getAttributeValueMutex.Lock()
- defer fake.getAttributeValueMutex.Unlock()
- fake.GetAttributeValueStub = nil
- if fake.getAttributeValueReturnsOnCall == nil {
- fake.getAttributeValueReturnsOnCall = make(map[int]struct {
- result1 string
- result2 bool
- result3 error
- })
- }
- fake.getAttributeValueReturnsOnCall[i] = struct {
- result1 string
- result2 bool
- result3 error
- }{result1, result2, result3}
-}
-
-func (fake *ClientIdentity) GetID() (string, error) {
- fake.getIDMutex.Lock()
- ret, specificReturn := fake.getIDReturnsOnCall[len(fake.getIDArgsForCall)]
- fake.getIDArgsForCall = append(fake.getIDArgsForCall, struct {
- }{})
- stub := fake.GetIDStub
- fakeReturns := fake.getIDReturns
- fake.recordInvocation("GetID", []interface{}{})
- fake.getIDMutex.Unlock()
- if stub != nil {
- return stub()
- }
- if specificReturn {
- return ret.result1, ret.result2
- }
- return fakeReturns.result1, fakeReturns.result2
-}
-
-func (fake *ClientIdentity) GetIDCallCount() int {
- fake.getIDMutex.RLock()
- defer fake.getIDMutex.RUnlock()
- return len(fake.getIDArgsForCall)
-}
-
-func (fake *ClientIdentity) GetIDCalls(stub func() (string, error)) {
- fake.getIDMutex.Lock()
- defer fake.getIDMutex.Unlock()
- fake.GetIDStub = stub
-}
-
-func (fake *ClientIdentity) GetIDReturns(result1 string, result2 error) {
- fake.getIDMutex.Lock()
- defer fake.getIDMutex.Unlock()
- fake.GetIDStub = nil
- fake.getIDReturns = struct {
- result1 string
- result2 error
- }{result1, result2}
-}
-
-func (fake *ClientIdentity) GetIDReturnsOnCall(i int, result1 string, result2 error) {
- fake.getIDMutex.Lock()
- defer fake.getIDMutex.Unlock()
- fake.GetIDStub = nil
- if fake.getIDReturnsOnCall == nil {
- fake.getIDReturnsOnCall = make(map[int]struct {
- result1 string
- result2 error
- })
- }
- fake.getIDReturnsOnCall[i] = struct {
- result1 string
- result2 error
- }{result1, result2}
-}
-
-func (fake *ClientIdentity) GetMSPID() (string, error) {
- fake.getMSPIDMutex.Lock()
- ret, specificReturn := fake.getMSPIDReturnsOnCall[len(fake.getMSPIDArgsForCall)]
- fake.getMSPIDArgsForCall = append(fake.getMSPIDArgsForCall, struct {
- }{})
- stub := fake.GetMSPIDStub
- fakeReturns := fake.getMSPIDReturns
- fake.recordInvocation("GetMSPID", []interface{}{})
- fake.getMSPIDMutex.Unlock()
- if stub != nil {
- return stub()
- }
- if specificReturn {
- return ret.result1, ret.result2
- }
- return fakeReturns.result1, fakeReturns.result2
-}
-
-func (fake *ClientIdentity) GetMSPIDCallCount() int {
- fake.getMSPIDMutex.RLock()
- defer fake.getMSPIDMutex.RUnlock()
- return len(fake.getMSPIDArgsForCall)
-}
-
-func (fake *ClientIdentity) GetMSPIDCalls(stub func() (string, error)) {
- fake.getMSPIDMutex.Lock()
- defer fake.getMSPIDMutex.Unlock()
- fake.GetMSPIDStub = stub
-}
-
-func (fake *ClientIdentity) GetMSPIDReturns(result1 string, result2 error) {
- fake.getMSPIDMutex.Lock()
- defer fake.getMSPIDMutex.Unlock()
- fake.GetMSPIDStub = nil
- fake.getMSPIDReturns = struct {
- result1 string
- result2 error
- }{result1, result2}
-}
-
-func (fake *ClientIdentity) GetMSPIDReturnsOnCall(i int, result1 string, result2 error) {
- fake.getMSPIDMutex.Lock()
- defer fake.getMSPIDMutex.Unlock()
- fake.GetMSPIDStub = nil
- if fake.getMSPIDReturnsOnCall == nil {
- fake.getMSPIDReturnsOnCall = make(map[int]struct {
- result1 string
- result2 error
- })
- }
- fake.getMSPIDReturnsOnCall[i] = struct {
- result1 string
- result2 error
- }{result1, result2}
-}
-
-func (fake *ClientIdentity) GetX509Certificate() (*x509.Certificate, error) {
- fake.getX509CertificateMutex.Lock()
- ret, specificReturn := fake.getX509CertificateReturnsOnCall[len(fake.getX509CertificateArgsForCall)]
- fake.getX509CertificateArgsForCall = append(fake.getX509CertificateArgsForCall, struct {
- }{})
- stub := fake.GetX509CertificateStub
- fakeReturns := fake.getX509CertificateReturns
- fake.recordInvocation("GetX509Certificate", []interface{}{})
- fake.getX509CertificateMutex.Unlock()
- if stub != nil {
- return stub()
- }
- if specificReturn {
- return ret.result1, ret.result2
- }
- return fakeReturns.result1, fakeReturns.result2
-}
-
-func (fake *ClientIdentity) GetX509CertificateCallCount() int {
- fake.getX509CertificateMutex.RLock()
- defer fake.getX509CertificateMutex.RUnlock()
- return len(fake.getX509CertificateArgsForCall)
-}
-
-func (fake *ClientIdentity) GetX509CertificateCalls(stub func() (*x509.Certificate, error)) {
- fake.getX509CertificateMutex.Lock()
- defer fake.getX509CertificateMutex.Unlock()
- fake.GetX509CertificateStub = stub
-}
-
-func (fake *ClientIdentity) GetX509CertificateReturns(result1 *x509.Certificate, result2 error) {
- fake.getX509CertificateMutex.Lock()
- defer fake.getX509CertificateMutex.Unlock()
- fake.GetX509CertificateStub = nil
- fake.getX509CertificateReturns = struct {
- result1 *x509.Certificate
- result2 error
- }{result1, result2}
-}
-
-func (fake *ClientIdentity) GetX509CertificateReturnsOnCall(i int, result1 *x509.Certificate, result2 error) {
- fake.getX509CertificateMutex.Lock()
- defer fake.getX509CertificateMutex.Unlock()
- fake.GetX509CertificateStub = nil
- if fake.getX509CertificateReturnsOnCall == nil {
- fake.getX509CertificateReturnsOnCall = make(map[int]struct {
- result1 *x509.Certificate
- result2 error
- })
- }
- fake.getX509CertificateReturnsOnCall[i] = struct {
- result1 *x509.Certificate
- result2 error
- }{result1, result2}
-}
-
-func (fake *ClientIdentity) Invocations() map[string][][]interface{} {
- fake.invocationsMutex.RLock()
- defer fake.invocationsMutex.RUnlock()
- fake.assertAttributeValueMutex.RLock()
- defer fake.assertAttributeValueMutex.RUnlock()
- fake.getAttributeValueMutex.RLock()
- defer fake.getAttributeValueMutex.RUnlock()
- fake.getIDMutex.RLock()
- defer fake.getIDMutex.RUnlock()
- fake.getMSPIDMutex.RLock()
- defer fake.getMSPIDMutex.RUnlock()
- fake.getX509CertificateMutex.RLock()
- defer fake.getX509CertificateMutex.RUnlock()
- copiedInvocations := map[string][][]interface{}{}
- for key, value := range fake.invocations {
- copiedInvocations[key] = value
- }
- return copiedInvocations
-}
-
-func (fake *ClientIdentity) recordInvocation(key string, args []interface{}) {
- fake.invocationsMutex.Lock()
- defer fake.invocationsMutex.Unlock()
- if fake.invocations == nil {
- fake.invocations = map[string][][]interface{}{}
- }
- if fake.invocations[key] == nil {
- fake.invocations[key] = [][]interface{}{}
- }
- fake.invocations[key] = append(fake.invocations[key], args)
-}
diff --git a/asset-transfer-private-data/chaincode-go/chaincode/mocks/statequeryiterator.go b/asset-transfer-private-data/chaincode-go/chaincode/mocks/statequeryiterator.go
deleted file mode 100644
index 76cdcaa1..00000000
--- a/asset-transfer-private-data/chaincode-go/chaincode/mocks/statequeryiterator.go
+++ /dev/null
@@ -1,235 +0,0 @@
-// Code generated by counterfeiter. DO NOT EDIT.
-package mocks
-
-import (
- "sync"
-
- "github.com/hyperledger/fabric-protos-go-apiv2/ledger/queryresult"
-)
-
-type StateQueryIterator struct {
- CloseStub func() error
- closeMutex sync.RWMutex
- closeArgsForCall []struct {
- }
- closeReturns struct {
- result1 error
- }
- closeReturnsOnCall map[int]struct {
- result1 error
- }
- HasNextStub func() bool
- hasNextMutex sync.RWMutex
- hasNextArgsForCall []struct {
- }
- hasNextReturns struct {
- result1 bool
- }
- hasNextReturnsOnCall map[int]struct {
- result1 bool
- }
- NextStub func() (*queryresult.KV, error)
- nextMutex sync.RWMutex
- nextArgsForCall []struct {
- }
- nextReturns struct {
- result1 *queryresult.KV
- result2 error
- }
- nextReturnsOnCall map[int]struct {
- result1 *queryresult.KV
- result2 error
- }
- invocations map[string][][]interface{}
- invocationsMutex sync.RWMutex
-}
-
-func (fake *StateQueryIterator) Close() error {
- fake.closeMutex.Lock()
- ret, specificReturn := fake.closeReturnsOnCall[len(fake.closeArgsForCall)]
- fake.closeArgsForCall = append(fake.closeArgsForCall, struct {
- }{})
- stub := fake.CloseStub
- fakeReturns := fake.closeReturns
- fake.recordInvocation("Close", []interface{}{})
- fake.closeMutex.Unlock()
- if stub != nil {
- return stub()
- }
- if specificReturn {
- return ret.result1
- }
- return fakeReturns.result1
-}
-
-func (fake *StateQueryIterator) CloseCallCount() int {
- fake.closeMutex.RLock()
- defer fake.closeMutex.RUnlock()
- return len(fake.closeArgsForCall)
-}
-
-func (fake *StateQueryIterator) CloseCalls(stub func() error) {
- fake.closeMutex.Lock()
- defer fake.closeMutex.Unlock()
- fake.CloseStub = stub
-}
-
-func (fake *StateQueryIterator) CloseReturns(result1 error) {
- fake.closeMutex.Lock()
- defer fake.closeMutex.Unlock()
- fake.CloseStub = nil
- fake.closeReturns = struct {
- result1 error
- }{result1}
-}
-
-func (fake *StateQueryIterator) CloseReturnsOnCall(i int, result1 error) {
- fake.closeMutex.Lock()
- defer fake.closeMutex.Unlock()
- fake.CloseStub = nil
- if fake.closeReturnsOnCall == nil {
- fake.closeReturnsOnCall = make(map[int]struct {
- result1 error
- })
- }
- fake.closeReturnsOnCall[i] = struct {
- result1 error
- }{result1}
-}
-
-func (fake *StateQueryIterator) HasNext() bool {
- fake.hasNextMutex.Lock()
- ret, specificReturn := fake.hasNextReturnsOnCall[len(fake.hasNextArgsForCall)]
- fake.hasNextArgsForCall = append(fake.hasNextArgsForCall, struct {
- }{})
- stub := fake.HasNextStub
- fakeReturns := fake.hasNextReturns
- fake.recordInvocation("HasNext", []interface{}{})
- fake.hasNextMutex.Unlock()
- if stub != nil {
- return stub()
- }
- if specificReturn {
- return ret.result1
- }
- return fakeReturns.result1
-}
-
-func (fake *StateQueryIterator) HasNextCallCount() int {
- fake.hasNextMutex.RLock()
- defer fake.hasNextMutex.RUnlock()
- return len(fake.hasNextArgsForCall)
-}
-
-func (fake *StateQueryIterator) HasNextCalls(stub func() bool) {
- fake.hasNextMutex.Lock()
- defer fake.hasNextMutex.Unlock()
- fake.HasNextStub = stub
-}
-
-func (fake *StateQueryIterator) HasNextReturns(result1 bool) {
- fake.hasNextMutex.Lock()
- defer fake.hasNextMutex.Unlock()
- fake.HasNextStub = nil
- fake.hasNextReturns = struct {
- result1 bool
- }{result1}
-}
-
-func (fake *StateQueryIterator) HasNextReturnsOnCall(i int, result1 bool) {
- fake.hasNextMutex.Lock()
- defer fake.hasNextMutex.Unlock()
- fake.HasNextStub = nil
- if fake.hasNextReturnsOnCall == nil {
- fake.hasNextReturnsOnCall = make(map[int]struct {
- result1 bool
- })
- }
- fake.hasNextReturnsOnCall[i] = struct {
- result1 bool
- }{result1}
-}
-
-func (fake *StateQueryIterator) Next() (*queryresult.KV, error) {
- fake.nextMutex.Lock()
- ret, specificReturn := fake.nextReturnsOnCall[len(fake.nextArgsForCall)]
- fake.nextArgsForCall = append(fake.nextArgsForCall, struct {
- }{})
- stub := fake.NextStub
- fakeReturns := fake.nextReturns
- fake.recordInvocation("Next", []interface{}{})
- fake.nextMutex.Unlock()
- if stub != nil {
- return stub()
- }
- if specificReturn {
- return ret.result1, ret.result2
- }
- return fakeReturns.result1, fakeReturns.result2
-}
-
-func (fake *StateQueryIterator) NextCallCount() int {
- fake.nextMutex.RLock()
- defer fake.nextMutex.RUnlock()
- return len(fake.nextArgsForCall)
-}
-
-func (fake *StateQueryIterator) NextCalls(stub func() (*queryresult.KV, error)) {
- fake.nextMutex.Lock()
- defer fake.nextMutex.Unlock()
- fake.NextStub = stub
-}
-
-func (fake *StateQueryIterator) NextReturns(result1 *queryresult.KV, result2 error) {
- fake.nextMutex.Lock()
- defer fake.nextMutex.Unlock()
- fake.NextStub = nil
- fake.nextReturns = struct {
- result1 *queryresult.KV
- result2 error
- }{result1, result2}
-}
-
-func (fake *StateQueryIterator) NextReturnsOnCall(i int, result1 *queryresult.KV, result2 error) {
- fake.nextMutex.Lock()
- defer fake.nextMutex.Unlock()
- fake.NextStub = nil
- if fake.nextReturnsOnCall == nil {
- fake.nextReturnsOnCall = make(map[int]struct {
- result1 *queryresult.KV
- result2 error
- })
- }
- fake.nextReturnsOnCall[i] = struct {
- result1 *queryresult.KV
- result2 error
- }{result1, result2}
-}
-
-func (fake *StateQueryIterator) Invocations() map[string][][]interface{} {
- fake.invocationsMutex.RLock()
- defer fake.invocationsMutex.RUnlock()
- fake.closeMutex.RLock()
- defer fake.closeMutex.RUnlock()
- fake.hasNextMutex.RLock()
- defer fake.hasNextMutex.RUnlock()
- fake.nextMutex.RLock()
- defer fake.nextMutex.RUnlock()
- copiedInvocations := map[string][][]interface{}{}
- for key, value := range fake.invocations {
- copiedInvocations[key] = value
- }
- return copiedInvocations
-}
-
-func (fake *StateQueryIterator) recordInvocation(key string, args []interface{}) {
- fake.invocationsMutex.Lock()
- defer fake.invocationsMutex.Unlock()
- if fake.invocations == nil {
- fake.invocations = map[string][][]interface{}{}
- }
- if fake.invocations[key] == nil {
- fake.invocations[key] = [][]interface{}{}
- }
- fake.invocations[key] = append(fake.invocations[key], args)
-}
diff --git a/asset-transfer-private-data/chaincode-go/chaincode/mocks/transaction.go b/asset-transfer-private-data/chaincode-go/chaincode/mocks/transaction.go
deleted file mode 100644
index 5e98d069..00000000
--- a/asset-transfer-private-data/chaincode-go/chaincode/mocks/transaction.go
+++ /dev/null
@@ -1,166 +0,0 @@
-// Code generated by counterfeiter. DO NOT EDIT.
-package mocks
-
-import (
- "sync"
-
- "github.com/hyperledger/fabric-chaincode-go/v2/pkg/cid"
- "github.com/hyperledger/fabric-chaincode-go/v2/shim"
-)
-
-type TransactionContext struct {
- GetClientIdentityStub func() cid.ClientIdentity
- getClientIdentityMutex sync.RWMutex
- getClientIdentityArgsForCall []struct {
- }
- getClientIdentityReturns struct {
- result1 cid.ClientIdentity
- }
- getClientIdentityReturnsOnCall map[int]struct {
- result1 cid.ClientIdentity
- }
- GetStubStub func() shim.ChaincodeStubInterface
- getStubMutex sync.RWMutex
- getStubArgsForCall []struct {
- }
- getStubReturns struct {
- result1 shim.ChaincodeStubInterface
- }
- getStubReturnsOnCall map[int]struct {
- result1 shim.ChaincodeStubInterface
- }
- invocations map[string][][]interface{}
- invocationsMutex sync.RWMutex
-}
-
-func (fake *TransactionContext) GetClientIdentity() cid.ClientIdentity {
- fake.getClientIdentityMutex.Lock()
- ret, specificReturn := fake.getClientIdentityReturnsOnCall[len(fake.getClientIdentityArgsForCall)]
- fake.getClientIdentityArgsForCall = append(fake.getClientIdentityArgsForCall, struct {
- }{})
- stub := fake.GetClientIdentityStub
- fakeReturns := fake.getClientIdentityReturns
- fake.recordInvocation("GetClientIdentity", []interface{}{})
- fake.getClientIdentityMutex.Unlock()
- if stub != nil {
- return stub()
- }
- if specificReturn {
- return ret.result1
- }
- return fakeReturns.result1
-}
-
-func (fake *TransactionContext) GetClientIdentityCallCount() int {
- fake.getClientIdentityMutex.RLock()
- defer fake.getClientIdentityMutex.RUnlock()
- return len(fake.getClientIdentityArgsForCall)
-}
-
-func (fake *TransactionContext) GetClientIdentityCalls(stub func() cid.ClientIdentity) {
- fake.getClientIdentityMutex.Lock()
- defer fake.getClientIdentityMutex.Unlock()
- fake.GetClientIdentityStub = stub
-}
-
-func (fake *TransactionContext) GetClientIdentityReturns(result1 cid.ClientIdentity) {
- fake.getClientIdentityMutex.Lock()
- defer fake.getClientIdentityMutex.Unlock()
- fake.GetClientIdentityStub = nil
- fake.getClientIdentityReturns = struct {
- result1 cid.ClientIdentity
- }{result1}
-}
-
-func (fake *TransactionContext) GetClientIdentityReturnsOnCall(i int, result1 cid.ClientIdentity) {
- fake.getClientIdentityMutex.Lock()
- defer fake.getClientIdentityMutex.Unlock()
- fake.GetClientIdentityStub = nil
- if fake.getClientIdentityReturnsOnCall == nil {
- fake.getClientIdentityReturnsOnCall = make(map[int]struct {
- result1 cid.ClientIdentity
- })
- }
- fake.getClientIdentityReturnsOnCall[i] = struct {
- result1 cid.ClientIdentity
- }{result1}
-}
-
-func (fake *TransactionContext) GetStub() shim.ChaincodeStubInterface {
- fake.getStubMutex.Lock()
- ret, specificReturn := fake.getStubReturnsOnCall[len(fake.getStubArgsForCall)]
- fake.getStubArgsForCall = append(fake.getStubArgsForCall, struct {
- }{})
- stub := fake.GetStubStub
- fakeReturns := fake.getStubReturns
- fake.recordInvocation("GetStub", []interface{}{})
- fake.getStubMutex.Unlock()
- if stub != nil {
- return stub()
- }
- if specificReturn {
- return ret.result1
- }
- return fakeReturns.result1
-}
-
-func (fake *TransactionContext) GetStubCallCount() int {
- fake.getStubMutex.RLock()
- defer fake.getStubMutex.RUnlock()
- return len(fake.getStubArgsForCall)
-}
-
-func (fake *TransactionContext) GetStubCalls(stub func() shim.ChaincodeStubInterface) {
- fake.getStubMutex.Lock()
- defer fake.getStubMutex.Unlock()
- fake.GetStubStub = stub
-}
-
-func (fake *TransactionContext) GetStubReturns(result1 shim.ChaincodeStubInterface) {
- fake.getStubMutex.Lock()
- defer fake.getStubMutex.Unlock()
- fake.GetStubStub = nil
- fake.getStubReturns = struct {
- result1 shim.ChaincodeStubInterface
- }{result1}
-}
-
-func (fake *TransactionContext) GetStubReturnsOnCall(i int, result1 shim.ChaincodeStubInterface) {
- fake.getStubMutex.Lock()
- defer fake.getStubMutex.Unlock()
- fake.GetStubStub = nil
- if fake.getStubReturnsOnCall == nil {
- fake.getStubReturnsOnCall = make(map[int]struct {
- result1 shim.ChaincodeStubInterface
- })
- }
- fake.getStubReturnsOnCall[i] = struct {
- result1 shim.ChaincodeStubInterface
- }{result1}
-}
-
-func (fake *TransactionContext) Invocations() map[string][][]interface{} {
- fake.invocationsMutex.RLock()
- defer fake.invocationsMutex.RUnlock()
- fake.getClientIdentityMutex.RLock()
- defer fake.getClientIdentityMutex.RUnlock()
- fake.getStubMutex.RLock()
- defer fake.getStubMutex.RUnlock()
- copiedInvocations := map[string][][]interface{}{}
- for key, value := range fake.invocations {
- copiedInvocations[key] = value
- }
- return copiedInvocations
-}
-
-func (fake *TransactionContext) recordInvocation(key string, args []interface{}) {
- fake.invocationsMutex.Lock()
- defer fake.invocationsMutex.Unlock()
- if fake.invocations == nil {
- fake.invocations = map[string][][]interface{}{}
- }
- if fake.invocations[key] == nil {
- fake.invocations[key] = [][]interface{}{}
- }
- fake.invocations[key] = append(fake.invocations[key], args)
-}
diff --git a/asset-transfer-private-data/chaincode-go/collections_config.json b/asset-transfer-private-data/chaincode-go/collections_config.json
deleted file mode 100644
index 993bbd31..00000000
--- a/asset-transfer-private-data/chaincode-go/collections_config.json
+++ /dev/null
@@ -1,38 +0,0 @@
-[
- {
- "name": "assetCollection",
- "policy": "OR('Org1MSP.member', 'Org2MSP.member')",
- "requiredPeerCount": 1,
- "maxPeerCount": 1,
- "blockToLive":1000000,
- "memberOnlyRead": true,
- "memberOnlyWrite": true,
- "endorsementPolicy": {
- "signaturePolicy":"OR('Org1MSP.member','Org2MSP.member')"
- }
-},
- {
- "name": "Org1MSPPrivateCollection",
- "policy": "OR('Org1MSP.member')",
- "requiredPeerCount": 0,
- "maxPeerCount": 1,
- "blockToLive":3,
- "memberOnlyRead": true,
- "memberOnlyWrite": false,
- "endorsementPolicy": {
- "signaturePolicy": "OR('Org1MSP.member')"
- }
- },
- {
- "name": "Org2MSPPrivateCollection",
- "policy": "OR('Org2MSP.member')",
- "requiredPeerCount": 0,
- "maxPeerCount": 1,
- "blockToLive":3,
- "memberOnlyRead": true,
- "memberOnlyWrite": false,
- "endorsementPolicy": {
- "signaturePolicy": "OR('Org2MSP.member')"
- }
- }
-]
diff --git a/asset-transfer-private-data/chaincode-go/go.mod b/asset-transfer-private-data/chaincode-go/go.mod
deleted file mode 100644
index 15836147..00000000
--- a/asset-transfer-private-data/chaincode-go/go.mod
+++ /dev/null
@@ -1,31 +0,0 @@
-module github.com/hyperledger/fabric-samples/asset-transfer-private-data/chaincode-go
-
-go 1.22.0
-
-require (
- github.com/hyperledger/fabric-chaincode-go/v2 v2.0.0
- github.com/hyperledger/fabric-contract-api-go/v2 v2.2.0
- github.com/hyperledger/fabric-protos-go-apiv2 v0.3.4
- github.com/stretchr/testify v1.10.0
- google.golang.org/protobuf v1.36.1
-)
-
-require (
- github.com/davecgh/go-spew v1.1.1 // indirect
- github.com/go-openapi/jsonpointer v0.21.0 // indirect
- github.com/go-openapi/jsonreference v0.21.0 // indirect
- github.com/go-openapi/spec v0.21.0 // indirect
- github.com/go-openapi/swag v0.23.0 // indirect
- github.com/josharian/intern v1.0.0 // indirect
- github.com/mailru/easyjson v0.7.7 // indirect
- github.com/pmezard/go-difflib v1.0.0 // indirect
- github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect
- github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
- github.com/xeipuuv/gojsonschema v1.2.0 // indirect
- golang.org/x/net v0.28.0 // indirect
- golang.org/x/sys v0.24.0 // indirect
- golang.org/x/text v0.17.0 // indirect
- google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f // indirect
- google.golang.org/grpc v1.67.0 // indirect
- gopkg.in/yaml.v3 v3.0.1 // indirect
-)
diff --git a/asset-transfer-private-data/chaincode-go/go.sum b/asset-transfer-private-data/chaincode-go/go.sum
deleted file mode 100644
index fa4d3b24..00000000
--- a/asset-transfer-private-data/chaincode-go/go.sum
+++ /dev/null
@@ -1,61 +0,0 @@
-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/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1rr/O9oNQ=
-github.com/go-openapi/jsonpointer v0.21.0/go.mod h1:IUyH9l/+uyhIYQ/PXVA41Rexl+kOkAPDdXEYns6fzUY=
-github.com/go-openapi/jsonreference v0.21.0 h1:Rs+Y7hSXT83Jacb7kFyjn4ijOuVGSvOdF2+tg1TRrwQ=
-github.com/go-openapi/jsonreference v0.21.0/go.mod h1:LmZmgsrTkVg9LG4EaHeY8cBDslNPMo06cago5JNLkm4=
-github.com/go-openapi/spec v0.21.0 h1:LTVzPc3p/RzRnkQqLRndbAzjY0d0BCL72A6j3CdL9ZY=
-github.com/go-openapi/spec v0.21.0/go.mod h1:78u6VdPw81XU44qEWGhtr982gJ5BWg2c0I5XwVMotYk=
-github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+GrE=
-github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ=
-github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
-github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
-github.com/hyperledger/fabric-chaincode-go/v2 v2.0.0 h1:IhkHfrl5X/fVnmB6pWeCYCdIJRi9bxj+WTnVN8DtW3c=
-github.com/hyperledger/fabric-chaincode-go/v2 v2.0.0/go.mod h1:PHHaFffjw7p7n9bmCfcm7RqDqYdivNEsJdiNIKZo5Lk=
-github.com/hyperledger/fabric-contract-api-go/v2 v2.2.0 h1:rmUoBmciB0GL/miqcbJmJbgp5QTWoJUrZo+CNxrNLF4=
-github.com/hyperledger/fabric-contract-api-go/v2 v2.2.0/go.mod h1:FeWeO/jwGjiME7ak3GufqKIcwkejtzrDG4QxbfKydWs=
-github.com/hyperledger/fabric-protos-go-apiv2 v0.3.4 h1:YJrd+gMaeY0/vsN0aS0QkEKTivGoUnSRIXxGJ7KI+Pc=
-github.com/hyperledger/fabric-protos-go-apiv2 v0.3.4/go.mod h1:bau/6AJhvEcu9GKKYHlDXAxXKzYNfhP6xu2GXuxEcFk=
-github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
-github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
-github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
-github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
-github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
-github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
-github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=
-github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
-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/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8=
-github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4=
-github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
-github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY=
-github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
-github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
-github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
-github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
-github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=
-github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb h1:zGWFAtiMcyryUHoUjUJX0/lt1H2+i2Ka2n+D3DImSNo=
-github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=
-github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHovont7NscjpAxXsDA8S8BMYve8Y5+7cuRE7R0=
-github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ=
-github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74=
-github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y=
-golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE=
-golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg=
-golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg=
-golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
-golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc=
-golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
-google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f h1:BWUVssLB0HVOSY78gIdvk1dTVYtT1y8SBWtPYuTJ/6w=
-google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM=
-google.golang.org/grpc v1.67.0 h1:IdH9y6PF5MPSdAntIcpjQ+tXO41pcQsfZV2RxtQgVcw=
-google.golang.org/grpc v1.67.0/go.mod h1:1gLDyUQU7CTLJI90u3nXZ9ekeghjeM7pTDZlqFNg2AA=
-google.golang.org/protobuf v1.36.1 h1:yBPeRvTftaleIgM3PZ/WBIZ7XM/eEYAaEyCwvyjq/gk=
-google.golang.org/protobuf v1.36.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
-gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
-gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
-gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
-gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
-gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
diff --git a/asset-transfer-private-data/chaincode-go/main.go b/asset-transfer-private-data/chaincode-go/main.go
deleted file mode 100644
index 8f4032c7..00000000
--- a/asset-transfer-private-data/chaincode-go/main.go
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
-SPDX-License-Identifier: Apache-2.0
-*/
-
-package main
-
-import (
- "log"
-
- "github.com/hyperledger/fabric-contract-api-go/v2/contractapi"
- "github.com/hyperledger/fabric-samples/asset-transfer-private-data/chaincode-go/chaincode"
-)
-
-func main() {
- assetChaincode, err := contractapi.NewChaincode(&chaincode.SmartContract{})
- if err != nil {
- log.Panicf("Error creating asset-transfer-private-data chaincode: %v", err)
- }
-
- if err := assetChaincode.Start(); err != nil {
- log.Panicf("Error starting asset-transfer-private-data chaincode: %v", err)
- }
-}
diff --git a/asset-transfer-private-data/chaincode-java/.gitattributes b/asset-transfer-private-data/chaincode-java/.gitattributes
deleted file mode 100644
index 00a51aff..00000000
--- a/asset-transfer-private-data/chaincode-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-private-data/chaincode-java/META-INF/statedb/couchdb/collections/assetCollection/indexes/indexOwner.json b/asset-transfer-private-data/chaincode-java/META-INF/statedb/couchdb/collections/assetCollection/indexes/indexOwner.json
deleted file mode 100644
index 2e2a5c6d..00000000
--- a/asset-transfer-private-data/chaincode-java/META-INF/statedb/couchdb/collections/assetCollection/indexes/indexOwner.json
+++ /dev/null
@@ -1,11 +0,0 @@
-{
- "index": {
- "fields": [
- "objectType",
- "owner"
- ]
- },
- "ddoc": "indexOwnerDoc",
- "name": "indexOwner",
- "type": "json"
-}
diff --git a/asset-transfer-private-data/chaincode-java/build.gradle b/asset-transfer-private-data/chaincode-java/build.gradle
deleted file mode 100644
index ec6a602c..00000000
--- a/asset-transfer-private-data/chaincode-java/build.gradle
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * SPDX-License-Identifier: Apache-2.0
- */
-
-plugins {
- id 'com.gradleup.shadow' version '8.3.5'
- id 'application'
- id 'checkstyle'
- id 'jacoco'
-}
-
-group 'org.hyperledger.fabric.samples'
-version '1.0-SNAPSHOT'
-
-dependencies {
-
- implementation 'org.hyperledger.fabric-chaincode-java:fabric-chaincode-shim:2.5.+'
- implementation 'org.json:json:+'
-
- testImplementation 'org.junit.jupiter:junit-jupiter:5.10.2'
- testImplementation 'org.assertj:assertj-core:3.25.3'
- testImplementation 'org.mockito:mockito-core:5.12.0'
-}
-
-repositories {
- mavenCentral()
- maven {
- url 'https://jitpack.io'
- }
-}
-
-java {
- toolchain {
- languageVersion = JavaLanguageVersion.of(11)
- }
-}
-
-application {
- mainClass = 'org.hyperledger.fabric.contract.ContractRouter'
-}
-
-checkstyle {
- toolVersion '8.21'
- configFile file("config/checkstyle/checkstyle.xml")
-}
-
-checkstyleMain {
- source ='src/main/java'
-}
-
-checkstyleTest {
- source ='src/test/java'
-}
-
-jacocoTestReport {
- dependsOn test
-}
-
-test {
- useJUnitPlatform()
- testLogging {
- events "passed", "skipped", "failed"
- }
-}
-
-mainClassName = 'org.hyperledger.fabric.contract.ContractRouter'
-
-shadowJar {
- archiveBaseName = 'chaincode'
- archiveVersion = ''
- archiveClassifier = ''
- mergeServiceFiles()
-
- manifest {
- attributes 'Main-Class': 'org.hyperledger.fabric.contract.ContractRouter'
- }
-}
-
-installDist.dependsOn check
diff --git a/asset-transfer-private-data/chaincode-java/collections_config.json b/asset-transfer-private-data/chaincode-java/collections_config.json
deleted file mode 100644
index 6d67f3c3..00000000
--- a/asset-transfer-private-data/chaincode-java/collections_config.json
+++ /dev/null
@@ -1,38 +0,0 @@
-[
- {
- "name": "assetCollection",
- "policy": "OR('Org1MSP.member', 'Org2MSP.member')",
- "requiredPeerCount": 1,
- "maxPeerCount": 1,
- "blockToLive":1000000,
- "memberOnlyRead": true,
- "memberOnlyWrite": true,
- "endorsementPolicy": {
- "signaturePolicy":"OR('Org1MSP.member','Org2MSP.member')"
- }
-},
- {
- "name": "Org1MSPPrivateCollection",
- "policy": "OR('Org1MSP.member')",
- "requiredPeerCount": 0,
- "maxPeerCount": 1,
- "blockToLive":3,
- "memberOnlyRead": true,
- "memberOnlyWrite": false,
- "endorsementPolicy": {
- "signaturePolicy": "OR('Org1MSP.member')"
- }
- },
- {
- "name": "Org2MSPPrivateCollection",
- "policy": "OR('Org2MSP.member')",
- "requiredPeerCount": 0,
- "maxPeerCount": 1,
- "blockToLive":3,
- "memberOnlyRead": true,
- "memberOnlyWrite": false,
- "endorsementPolicy": {
- "signaturePolicy": "OR('Org2MSP.member')"
- }
- }
-]
diff --git a/asset-transfer-private-data/chaincode-java/config/checkstyle/checkstyle.xml b/asset-transfer-private-data/chaincode-java/config/checkstyle/checkstyle.xml
deleted file mode 100644
index acd5df44..00000000
--- a/asset-transfer-private-data/chaincode-java/config/checkstyle/checkstyle.xml
+++ /dev/null
@@ -1,171 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/asset-transfer-private-data/chaincode-java/config/checkstyle/suppressions.xml b/asset-transfer-private-data/chaincode-java/config/checkstyle/suppressions.xml
deleted file mode 100644
index 33dda041..00000000
--- a/asset-transfer-private-data/chaincode-java/config/checkstyle/suppressions.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
diff --git a/asset-transfer-private-data/chaincode-java/gradle/wrapper/gradle-wrapper.jar b/asset-transfer-private-data/chaincode-java/gradle/wrapper/gradle-wrapper.jar
deleted file mode 100644
index d64cd491..00000000
Binary files a/asset-transfer-private-data/chaincode-java/gradle/wrapper/gradle-wrapper.jar and /dev/null differ
diff --git a/asset-transfer-private-data/chaincode-java/gradle/wrapper/gradle-wrapper.properties b/asset-transfer-private-data/chaincode-java/gradle/wrapper/gradle-wrapper.properties
deleted file mode 100644
index e2847c82..00000000
--- a/asset-transfer-private-data/chaincode-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.11.1-bin.zip
-networkTimeout=10000
-validateDistributionUrl=true
-zipStoreBase=GRADLE_USER_HOME
-zipStorePath=wrapper/dists
diff --git a/asset-transfer-private-data/chaincode-java/gradlew b/asset-transfer-private-data/chaincode-java/gradlew
deleted file mode 100755
index 1aa94a42..00000000
--- a/asset-transfer-private-data/chaincode-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=SC2039,SC3045
- MAX_FD=$( ulimit -H -n ) ||
- warn "Could not query maximum file descriptor limit"
- esac
- case $MAX_FD in #(
- '' | soft) :;; #(
- *)
- # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
- # shellcheck disable=SC2039,SC3045
- ulimit -n "$MAX_FD" ||
- warn "Could not set maximum file descriptor limit to $MAX_FD"
- esac
-fi
-
-# Collect all arguments for the java command, stacking in reverse order:
-# * args from the command line
-# * the main class name
-# * -classpath
-# * -D...appname settings
-# * --module-path (only if needed)
-# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
-
-# For Cygwin or MSYS, switch paths to Windows format before running java
-if "$cygwin" || "$msys" ; then
- APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
- CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
-
- JAVACMD=$( cygpath --unix "$JAVACMD" )
-
- # Now convert the arguments - kludge to limit ourselves to /bin/sh
- for arg do
- if
- case $arg in #(
- -*) false ;; # don't mess with options #(
- /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
- [ -e "$t" ] ;; #(
- *) false ;;
- esac
- then
- arg=$( cygpath --path --ignore --mixed "$arg" )
- fi
- # Roll the args list around exactly as many times as the number of
- # args, so each arg winds up back in the position where it started, but
- # possibly modified.
- #
- # NB: a `for` loop captures its iteration list before it begins, so
- # changing the positional parameters here affects neither the number of
- # iterations, nor the values presented in `arg`.
- shift # remove old arg
- set -- "$@" "$arg" # push replacement arg
- done
-fi
-
-
-# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
-
-# Collect all arguments for the java command:
-# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
-# and any embedded shellness will be escaped.
-# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
-# treated as '${Hostname}' itself on the command line.
-
-set -- \
- "-Dorg.gradle.appname=$APP_BASE_NAME" \
- -classpath "$CLASSPATH" \
- org.gradle.wrapper.GradleWrapperMain \
- "$@"
-
-# Stop when "xargs" is not available.
-if ! command -v xargs >/dev/null 2>&1
-then
- die "xargs is not available"
-fi
-
-# Use "xargs" to parse quoted args.
-#
-# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
-#
-# In Bash we could simply go:
-#
-# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
-# set -- "${ARGS[@]}" "$@"
-#
-# but POSIX shell has neither arrays nor command substitution, so instead we
-# post-process each arg (as a line of input to sed) to backslash-escape any
-# character that might be a shell metacharacter, then use eval to reverse
-# that process (while maintaining the separation between arguments), and wrap
-# the whole thing up as a single "set" statement.
-#
-# This will of course break if any of these variables contains a newline or
-# an unmatched quote.
-#
-
-eval "set -- $(
- printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
- xargs -n1 |
- sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
- tr '\n' ' '
- )" '"$@"'
-
-exec "$JAVACMD" "$@"
diff --git a/asset-transfer-private-data/chaincode-java/gradlew.bat b/asset-transfer-private-data/chaincode-java/gradlew.bat
deleted file mode 100644
index 25da30db..00000000
--- a/asset-transfer-private-data/chaincode-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. 1>&2
-echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
-echo. 1>&2
-echo Please set the JAVA_HOME variable in your environment to match the 1>&2
-echo location of your Java installation. 1>&2
-
-goto fail
-
-:findJavaFromJavaHome
-set JAVA_HOME=%JAVA_HOME:"=%
-set JAVA_EXE=%JAVA_HOME%/bin/java.exe
-
-if exist "%JAVA_EXE%" goto execute
-
-echo. 1>&2
-echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
-echo. 1>&2
-echo Please set the JAVA_HOME variable in your environment to match the 1>&2
-echo location of your Java installation. 1>&2
-
-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-private-data/chaincode-java/settings.gradle b/asset-transfer-private-data/chaincode-java/settings.gradle
deleted file mode 100644
index 59cbbbca..00000000
--- a/asset-transfer-private-data/chaincode-java/settings.gradle
+++ /dev/null
@@ -1,5 +0,0 @@
-/*
- * SPDX-License-Identifier: Apache-2.0
- */
-
-rootProject.name = 'private'
diff --git a/asset-transfer-private-data/chaincode-java/src/main/java/org/hyperledger/fabric/samples/privatedata/Asset.java b/asset-transfer-private-data/chaincode-java/src/main/java/org/hyperledger/fabric/samples/privatedata/Asset.java
deleted file mode 100644
index 11b29101..00000000
--- a/asset-transfer-private-data/chaincode-java/src/main/java/org/hyperledger/fabric/samples/privatedata/Asset.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * SPDX-License-Identifier: Apache-2.0
- */
-
-package org.hyperledger.fabric.samples.privatedata;
-
-import java.util.Objects;
-
-import static java.nio.charset.StandardCharsets.UTF_8;
-
-import org.hyperledger.fabric.contract.annotation.DataType;
-import org.hyperledger.fabric.contract.annotation.Property;
-
-import org.hyperledger.fabric.shim.ChaincodeException;
-import org.json.JSONObject;
-
-@DataType()
-public final class Asset {
-
- @Property()
- private final String assetID;
-
- @Property()
- private final String objectType;
-
- @Property()
- private final String color;
-
- @Property()
- private final int size;
-
- @Property()
- private String owner;
-
- public String getAssetID() {
- return assetID;
- }
-
- public String getColor() {
- return color;
- }
-
- public int getSize() {
- return size;
- }
-
- public String getOwner() {
- return owner;
- }
-
- public String getObjectType() {
- return objectType;
- }
-
- public void setOwner(final String newowner) {
- owner = newowner;
- }
-
- public Asset(final String type,
- final String assetID, final String color,
- final int size, final String owner) {
- this.objectType = type;
- this.assetID = assetID;
- this.color = color;
- this.size = size;
- this.owner = owner;
- }
-
- public byte[] serialize() {
- String jsonStr = new JSONObject(this).toString();
- return jsonStr.getBytes(UTF_8);
- }
-
- public static Asset deserialize(final byte[] assetJSON) {
- return deserialize(new String(assetJSON, UTF_8));
- }
-
- public static Asset deserialize(final String assetJSON) {
- try {
- JSONObject json = new JSONObject(assetJSON);
- final String id = json.getString("assetID");
- final String type = json.getString("objectType");
- final String color = json.getString("color");
- final String owner = json.getString("owner");
- final int size = json.getInt("size");
- return new Asset(type, id, color, size, owner);
- } catch (Exception e) {
- throw new ChaincodeException("Deserialize error: " + e.getMessage(), "DATA_ERROR");
- }
- }
-
- @Override
- public boolean equals(final Object obj) {
- if (this == obj) {
- return true;
- }
-
- if ((obj == null) || (getClass() != obj.getClass())) {
- return false;
- }
-
- Asset other = (Asset) obj;
-
- return Objects.deepEquals(
- new String[]{getAssetID(), getColor(), getOwner()},
- new String[]{other.getAssetID(), other.getColor(), other.getOwner()})
- &&
- Objects.deepEquals(
- new int[]{getSize()},
- new int[]{other.getSize()});
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(getObjectType(), getAssetID(), getColor(), getSize(), getOwner());
- }
-
- @Override
- public String toString() {
- return this.getClass().getSimpleName() + "@" + Integer.toHexString(hashCode())
- + " [assetID=" + assetID + ", type=" + objectType + ", color="
- + color + ", size=" + size + ", owner=" + owner + "]";
- }
-
-
-}
diff --git a/asset-transfer-private-data/chaincode-java/src/main/java/org/hyperledger/fabric/samples/privatedata/AssetPrivateDetails.java b/asset-transfer-private-data/chaincode-java/src/main/java/org/hyperledger/fabric/samples/privatedata/AssetPrivateDetails.java
deleted file mode 100644
index da1c6e24..00000000
--- a/asset-transfer-private-data/chaincode-java/src/main/java/org/hyperledger/fabric/samples/privatedata/AssetPrivateDetails.java
+++ /dev/null
@@ -1,51 +0,0 @@
-package org.hyperledger.fabric.samples.privatedata;
-
-import org.hyperledger.fabric.contract.annotation.DataType;
-import org.hyperledger.fabric.contract.annotation.Property;
-
-import org.hyperledger.fabric.shim.ChaincodeException;
-import org.json.JSONObject;
-
-import static java.nio.charset.StandardCharsets.UTF_8;
-
-@DataType()
-public final class AssetPrivateDetails {
-
- @Property()
- private final String assetID;
-
- @Property()
- private int appraisedValue;
-
- public String getAssetID() {
- return assetID;
- }
-
- public int getAppraisedValue() {
- return appraisedValue;
- }
-
- public AssetPrivateDetails(final String assetID,
- final int appraisedValue) {
- this.assetID = assetID;
- this.appraisedValue = appraisedValue;
- }
-
- public byte[] serialize() {
- String jsonStr = new JSONObject(this).toString();
- return jsonStr.getBytes(UTF_8);
- }
-
- public static AssetPrivateDetails deserialize(final byte[] assetJSON) {
- try {
- JSONObject json = new JSONObject(new String(assetJSON, UTF_8));
- final String id = json.getString("assetID");
- final int appraisedValue = json.getInt("appraisedValue");
- return new AssetPrivateDetails(id, appraisedValue);
- } catch (Exception e) {
- throw new ChaincodeException("Deserialize error: " + e.getMessage(), "DATA_ERROR");
- }
- }
-
-
-}
diff --git a/asset-transfer-private-data/chaincode-java/src/main/java/org/hyperledger/fabric/samples/privatedata/AssetTransfer.java b/asset-transfer-private-data/chaincode-java/src/main/java/org/hyperledger/fabric/samples/privatedata/AssetTransfer.java
deleted file mode 100644
index 3bc17862..00000000
--- a/asset-transfer-private-data/chaincode-java/src/main/java/org/hyperledger/fabric/samples/privatedata/AssetTransfer.java
+++ /dev/null
@@ -1,643 +0,0 @@
-/*
- * SPDX-License-Identifier: Apache-2.0
- */
-
-package org.hyperledger.fabric.samples.privatedata;
-
-import static java.nio.charset.StandardCharsets.UTF_8;
-
-import org.hyperledger.fabric.contract.Context;
-import org.hyperledger.fabric.contract.ContractInterface;
-import org.hyperledger.fabric.contract.annotation.Contact;
-import org.hyperledger.fabric.contract.annotation.Contract;
-import org.hyperledger.fabric.contract.annotation.Default;
-import org.hyperledger.fabric.contract.annotation.Info;
-import org.hyperledger.fabric.contract.annotation.License;
-import org.hyperledger.fabric.contract.annotation.Transaction;
-import org.hyperledger.fabric.shim.ChaincodeException;
-import org.hyperledger.fabric.shim.ChaincodeStub;
-import org.hyperledger.fabric.shim.ledger.CompositeKey;
-
-import org.hyperledger.fabric.shim.ledger.KeyValue;
-import org.hyperledger.fabric.shim.ledger.QueryResultsIterator;
-import org.json.JSONObject;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
-
-/**
- * Main Chaincode class. A ContractInterface gets converted to Chaincode internally.
- * @see org.hyperledger.fabric.shim.Chaincode
- *
- * Each chaincode transaction function must take, Context as first parameter.
- * Unless specified otherwise via annotation (@Contract or @Transaction), the contract name
- * is the class name (without package)
- * and the transaction name is the method name.
- *
- * To create fabric test-network
- * cd fabric-samples/test-network
- * ./network.sh up createChannel -ca -s couchdb
- * To deploy this chaincode to test-network, use the collection config as described in
- * See
- * Change both -ccs sequence & -ccv version args for iterative deployment
- * ./network.sh deployCC -ccn private -ccp ../asset-transfer-private-data/chaincode-java/ -ccl java -ccep "OR('Org1MSP.peer','Org2MSP.peer')" -cccg ../asset-transfer-private-data/chaincode-go/collections_config.json -ccs 1 -ccv 1
- */
-@Contract(
- name = "private",
- info = @Info(
- title = "Asset Transfer Private Data",
- description = "The hyperlegendary asset transfer private data",
- version = "0.0.1-SNAPSHOT",
- license = @License(
- name = "Apache 2.0 License",
- url = "http://www.apache.org/licenses/LICENSE-2.0.html"),
- contact = @Contact(
- email = "a.transfer@example.com",
- name = "Private Transfer",
- url = "https://hyperledger.example.com")))
-@Default
-public final class AssetTransfer implements ContractInterface {
-
- static final String ASSET_COLLECTION_NAME = "assetCollection";
- static final String AGREEMENT_KEYPREFIX = "transferAgreement";
-
- private enum AssetTransferErrors {
- INCOMPLETE_INPUT,
- INVALID_ACCESS,
- ASSET_NOT_FOUND,
- ASSET_ALREADY_EXISTS
- }
-
- /**
- * Retrieves the asset public details with the specified ID from the AssetCollection.
- *
- * @param ctx the transaction context
- * @param assetID the ID of the asset
- * @return the asset found on the ledger if there was one
- */
- @Transaction(intent = Transaction.TYPE.EVALUATE)
- public Asset ReadAsset(final Context ctx, final String assetID) {
- ChaincodeStub stub = ctx.getStub();
- System.out.printf("ReadAsset: collection %s, ID %s\n", ASSET_COLLECTION_NAME, assetID);
- byte[] assetJSON = stub.getPrivateData(ASSET_COLLECTION_NAME, assetID);
-
- if (assetJSON == null || assetJSON.length == 0) {
- System.out.printf("Asset not found: ID %s\n", assetID);
- return null;
- }
-
- Asset asset = Asset.deserialize(assetJSON);
- return asset;
- }
-
- /**
- * Retrieves the asset's AssetPrivateDetails details with the specified ID from the Collection.
- *
- * @param ctx the transaction context
- * @param collection the org's collection containing asset private details
- * @param assetID the ID of the asset
- * @return the AssetPrivateDetails from the collection, if there was one
- */
- @Transaction(intent = Transaction.TYPE.EVALUATE)
- public AssetPrivateDetails ReadAssetPrivateDetails(final Context ctx, final String collection, final String assetID) {
- ChaincodeStub stub = ctx.getStub();
- System.out.printf("ReadAssetPrivateDetails: collection %s, ID %s\n", collection, assetID);
- byte[] assetPrvJSON = stub.getPrivateData(collection, assetID);
-
- if (assetPrvJSON == null || assetPrvJSON.length == 0) {
- String errorMessage = String.format("AssetPrivateDetails %s does not exist in collection %s", assetID, collection);
- System.out.println(errorMessage);
- return null;
- }
-
- AssetPrivateDetails assetpd = AssetPrivateDetails.deserialize(assetPrvJSON);
- return assetpd;
- }
-
- /**
- * ReadTransferAgreement gets the buyer's identity from the transfer agreement from collection
- *
- * @param ctx the transaction context
- * @param assetID the ID of the asset
- * @return the AssetPrivateDetails from the collection, if there was one
- */
- @Transaction(intent = Transaction.TYPE.EVALUATE)
- public TransferAgreement ReadTransferAgreement(final Context ctx, final String assetID) {
- ChaincodeStub stub = ctx.getStub();
-
- CompositeKey aggKey = stub.createCompositeKey(AGREEMENT_KEYPREFIX, assetID);
- System.out.printf("ReadTransferAgreement Get: collection %s, ID %s, Key %s\n", ASSET_COLLECTION_NAME, assetID, aggKey);
- byte[] buyerIdentity = stub.getPrivateData(ASSET_COLLECTION_NAME, aggKey.toString());
-
- if (buyerIdentity == null || buyerIdentity.length == 0) {
- String errorMessage = String.format("BuyerIdentity for asset %s does not exist in TransferAgreement ", assetID);
- System.out.println(errorMessage);
- return null;
- }
-
- return new TransferAgreement(assetID, new String(buyerIdentity, UTF_8));
- }
-
- /**
- * GetAssetByRange performs a range query based on the start and end keys provided. Range
- * queries can be used to read data from private data collections, but can not be used in
- * a transaction that also writes to private collection, since transaction may not get endorsed
- * on some peers that do not have the collection.
- *
- * @param ctx the transaction context
- * @param startKey for ID range of the asset
- * @param endKey for ID range of the asset
- * @return the asset found on the ledger if there was one
- */
- @Transaction(intent = Transaction.TYPE.EVALUATE)
- public Asset[] GetAssetByRange(final Context ctx, final String startKey, final String endKey) throws Exception {
- ChaincodeStub stub = ctx.getStub();
- System.out.printf("GetAssetByRange: start %s, end %s\n", startKey, endKey);
-
- List queryResults = new ArrayList<>();
- // retrieve asset with keys between startKey (inclusive) and endKey(exclusive) in lexical order.
- try (QueryResultsIterator results = stub.getPrivateDataByRange(ASSET_COLLECTION_NAME, startKey, endKey)) {
- for (KeyValue result : results) {
- if (result.getStringValue() == null || result.getStringValue().length() == 0) {
- System.err.printf("Invalid Asset json: %s\n", result.getStringValue());
- continue;
- }
- Asset asset = Asset.deserialize(result.getStringValue());
- queryResults.add(asset);
- System.out.println("QueryResult: " + asset.toString());
- }
- }
- return queryResults.toArray(new Asset[0]);
- }
-
- // =======Rich queries =========================================================================
- // Two examples of rich queries are provided below (parameterized query and ad hoc query).
- // Rich queries pass a query string to the state database.
- // Rich queries are only supported by state database implementations
- // that support rich query (e.g. CouchDB).
- // The query string is in the syntax of the underlying state database.
- // With rich queries there is no guarantee that the result set hasn't changed between
- // endorsement time and commit time, aka 'phantom reads'.
- // Therefore, rich queries should not be used in update transactions, unless the
- // application handles the possibility of result set changes between endorsement and commit time.
- // Rich queries can be used for point-in-time queries against a peer.
- // ============================================================================================
-
- /**
- * QueryAssetByOwner queries for assets based on assetType, owner.
- * This is an example of a parameterized query where the query logic is baked into the chaincode,
- * and accepting a single query parameter (owner).
- *
- * @param ctx the transaction context
- * @param assetType type to query for
- * @param owner asset owner to query for
- * @return the asset found on the ledger if there was one
- */
- @Transaction(intent = Transaction.TYPE.EVALUATE)
- public Asset[] QueryAssetByOwner(final Context ctx, final String assetType, final String owner) throws Exception {
- String queryString = String.format("{\"selector\":{\"objectType\":\"%s\",\"owner\":\"%s\"}}", assetType, owner);
- return getQueryResult(ctx, queryString);
- }
-
- /**
- * QueryAssets uses a query string to perform a query for assets.
- * Query string matching state database syntax is passed in and executed as is.
- * Supports ad hoc queries that can be defined at runtime by the client.
- *
- * @param ctx the transaction context
- * @param queryString query string matching state database syntax
- * @return the asset found on the ledger if there was one
- */
- @Transaction(intent = Transaction.TYPE.EVALUATE)
- public Asset[] QueryAssets(final Context ctx, final String queryString) throws Exception {
- return getQueryResult(ctx, queryString);
- }
-
- private Asset[] getQueryResult(final Context ctx, final String queryString) throws Exception {
- ChaincodeStub stub = ctx.getStub();
- System.out.printf("QueryAssets: %s\n", queryString);
-
- List queryResults = new ArrayList();
- // retrieve asset with keys between startKey (inclusive) and endKey(exclusive) in lexical order.
- try (QueryResultsIterator results = stub.getPrivateDataQueryResult(ASSET_COLLECTION_NAME, queryString)) {
- for (KeyValue result : results) {
- if (result.getStringValue() == null || result.getStringValue().length() == 0) {
- System.err.printf("Invalid Asset json: %s\n", result.getStringValue());
- continue;
- }
- Asset asset = Asset.deserialize(result.getStringValue());
- queryResults.add(asset);
- System.out.println("QueryResult: " + asset.toString());
- }
- }
- return queryResults.toArray(new Asset[0]);
- }
-
-
- /**
- * Creates a new asset on the ledger from asset properties passed in as transient map.
- * Asset owner will be inferred from the ClientId via stub api
- *
- * @param ctx the transaction context
- * Transient map with asset_properties key with asset json as value
- * @return the created asset
- */
- @Transaction(intent = Transaction.TYPE.SUBMIT)
- public Asset CreateAsset(final Context ctx) {
- ChaincodeStub stub = ctx.getStub();
- Map transientMap = ctx.getStub().getTransient();
- if (!transientMap.containsKey("asset_properties")) {
- String errorMessage = String.format("CreateAsset call must specify asset_properties in Transient map input");
- System.err.println(errorMessage);
- throw new ChaincodeException(errorMessage, AssetTransferErrors.INCOMPLETE_INPUT.toString());
- }
-
- byte[] transientAssetJSON = transientMap.get("asset_properties");
- final String assetID;
- final String type;
- final String color;
- int appraisedValue = 0;
- int size = 0;
- try {
- JSONObject json = new JSONObject(new String(transientAssetJSON, UTF_8));
- Map tMap = json.toMap();
-
- type = (String) tMap.get("objectType");
- assetID = (String) tMap.get("assetID");
- color = (String) tMap.get("color");
- if (tMap.containsKey("size")) {
- size = (Integer) tMap.get("size");
- }
- if (tMap.containsKey("appraisedValue")) {
- appraisedValue = (Integer) tMap.get("appraisedValue");
- }
- } catch (Exception err) {
- String errorMessage = String.format("TransientMap deserialized error: %s ", err);
- System.err.println(errorMessage);
- throw new ChaincodeException(errorMessage, AssetTransferErrors.INCOMPLETE_INPUT.toString());
- }
-
- //input validations
- String errorMessage = null;
- if (assetID.equals("")) {
- errorMessage = String.format("Empty input in Transient map: assetID");
- }
- if (type.equals("")) {
- errorMessage = String.format("Empty input in Transient map: objectType");
- }
- if (color.equals("")) {
- errorMessage = String.format("Empty input in Transient map: color");
- }
- if (size <= 0) {
- errorMessage = String.format("Empty input in Transient map: size");
- }
- if (appraisedValue <= 0) {
- errorMessage = String.format("Empty input in Transient map: appraisedValue");
- }
-
- if (errorMessage != null) {
- System.err.println(errorMessage);
- throw new ChaincodeException(errorMessage, AssetTransferErrors.INCOMPLETE_INPUT.toString());
- }
-
- Asset asset = new Asset(type, assetID, color, size, "");
- // Check if asset already exists
- byte[] assetJSON = ctx.getStub().getPrivateData(ASSET_COLLECTION_NAME, assetID);
- if (assetJSON != null && assetJSON.length > 0) {
- errorMessage = String.format("Asset %s already exists", assetID);
- System.err.println(errorMessage);
- throw new ChaincodeException(errorMessage, AssetTransferErrors.ASSET_ALREADY_EXISTS.toString());
- }
-
- // Get ID of submitting client identity
- String clientID = ctx.getClientIdentity().getId();
-
- // Verify that the client is submitting request to peer in their organization
- // This is to ensure that a client from another org doesn't attempt to read or
- // write private data from this peer.
- verifyClientOrgMatchesPeerOrg(ctx);
-
- // Make submitting client the owner
- asset.setOwner(clientID);
- System.out.printf("CreateAsset Put: collection %s, ID %s\n", ASSET_COLLECTION_NAME, assetID);
- System.out.printf("Put: collection %s, ID %s\n", ASSET_COLLECTION_NAME, new String(asset.serialize()));
- stub.putPrivateData(ASSET_COLLECTION_NAME, assetID, asset.serialize());
-
- // Get collection name for this organization.
- String orgCollectionName = getCollectionName(ctx);
-
- // Save AssetPrivateDetails to org collection
- AssetPrivateDetails assetPriv = new AssetPrivateDetails(assetID, appraisedValue);
- System.out.printf("Put AssetPrivateDetails: collection %s, ID %s\n", orgCollectionName, assetID);
- stub.putPrivateData(orgCollectionName, assetID, assetPriv.serialize());
-
- return asset;
- }
-
- /**
- * AgreeToTransfer is used by the potential buyer of the asset to agree to the
- * asset value. The agreed to appraisal value is stored in the buying orgs
- * org specifc collection, while the buyer client ID is stored in the asset collection
- * using a composite key
- * Uses transient map with key asset_value
- *
- * @param ctx the transaction context
- */
- @Transaction(intent = Transaction.TYPE.SUBMIT)
- public void AgreeToTransfer(final Context ctx) {
- ChaincodeStub stub = ctx.getStub();
- Map transientMap = ctx.getStub().getTransient();
- if (!transientMap.containsKey("asset_value")) {
- String errorMessage = String.format("AgreeToTransfer call must specify \"asset_value\" in Transient map input");
- System.err.println(errorMessage);
- throw new ChaincodeException(errorMessage, AssetTransferErrors.INCOMPLETE_INPUT.toString());
- }
-
- byte[] transientAssetJSON = transientMap.get("asset_value");
- AssetPrivateDetails assetPriv;
- String assetID;
- try {
- JSONObject json = new JSONObject(new String(transientAssetJSON, UTF_8));
- assetID = json.getString("assetID");
- final int appraisedValue = json.getInt("appraisedValue");
-
- assetPriv = new AssetPrivateDetails(assetID, appraisedValue);
- } catch (Exception err) {
- String errorMessage = String.format("TransientMap deserialized error %s ", err);
- System.err.println(errorMessage);
- throw new ChaincodeException(errorMessage, AssetTransferErrors.INCOMPLETE_INPUT.toString());
- }
-
- if (assetID.equals("")) {
- String errorMessage = String.format("Invalid input in Transient map: assetID");
- System.err.println(errorMessage);
- throw new ChaincodeException(errorMessage, AssetTransferErrors.INCOMPLETE_INPUT.toString());
- }
- if (assetPriv.getAppraisedValue() <= 0) { // appraisedValue field must be a positive integer
- String errorMessage = String.format("Input must be positive integer: appraisedValue");
- System.err.println(errorMessage);
- throw new ChaincodeException(errorMessage, AssetTransferErrors.INCOMPLETE_INPUT.toString());
- }
- System.out.printf("AgreeToTransfer: verify asset %s exists\n", assetID);
- Asset existing = ReadAsset(ctx, assetID);
- if (existing == null) {
- String errorMessage = String.format("Asset does not exist in the collection: ", assetID);
- System.err.println(errorMessage);
- throw new ChaincodeException(errorMessage, AssetTransferErrors.INCOMPLETE_INPUT.toString());
- }
- // Get collection name for this organization.
- String orgCollectionName = getCollectionName(ctx);
-
- verifyClientOrgMatchesPeerOrg(ctx);
-
- // Save AssetPrivateDetails to org collection
- System.out.printf("Put AssetPrivateDetails: collection %s, ID %s\n", orgCollectionName, assetID);
- stub.putPrivateData(orgCollectionName, assetID, assetPriv.serialize());
-
- String clientID = ctx.getClientIdentity().getId();
- // Write the AgreeToTransfer key in assetCollection
- CompositeKey aggKey = stub.createCompositeKey(AGREEMENT_KEYPREFIX, assetID);
- System.out.printf("AgreeToTransfer Put: collection %s, ID %s, Key %s\n", ASSET_COLLECTION_NAME, assetID, aggKey);
- stub.putPrivateData(ASSET_COLLECTION_NAME, aggKey.toString(), clientID);
- }
-
- /**
- * TransferAsset transfers the asset to the new owner by setting a new owner ID based on
- * AgreeToTransfer data
- *
- * @param ctx the transaction context
- * @return none
- */
- @Transaction(intent = Transaction.TYPE.SUBMIT)
- public void TransferAsset(final Context ctx) {
- ChaincodeStub stub = ctx.getStub();
- Map transientMap = ctx.getStub().getTransient();
- if (!transientMap.containsKey("asset_owner")) {
- String errorMessage = "TransferAsset call must specify \"asset_owner\" in Transient map input";
- System.err.println(errorMessage);
- throw new ChaincodeException(errorMessage, AssetTransferErrors.INCOMPLETE_INPUT.toString());
- }
-
- byte[] transientAssetJSON = transientMap.get("asset_owner");
- final String assetID;
- final String buyerMSP;
- try {
- JSONObject json = new JSONObject(new String(transientAssetJSON, UTF_8));
- assetID = json.getString("assetID");
- buyerMSP = json.getString("buyerMSP");
-
- } catch (Exception err) {
- String errorMessage = String.format("TransientMap deserialized error %s ", err);
- System.err.println(errorMessage);
- throw new ChaincodeException(errorMessage, AssetTransferErrors.INCOMPLETE_INPUT.toString());
- }
-
- if (assetID.equals("")) {
- String errorMessage = String.format("Invalid input in Transient map: " + "assetID");
- System.err.println(errorMessage);
- throw new ChaincodeException(errorMessage, AssetTransferErrors.INCOMPLETE_INPUT.toString());
- }
- if (buyerMSP.equals("")) {
- String errorMessage = String.format("Invalid input in Transient map: " + "buyerMSP");
- System.err.println(errorMessage);
- throw new ChaincodeException(errorMessage, AssetTransferErrors.INCOMPLETE_INPUT.toString());
- }
-
- System.out.printf("TransferAsset: verify asset %s exists\n", assetID);
- byte[] assetJSON = stub.getPrivateData(ASSET_COLLECTION_NAME, assetID);
-
- if (assetJSON == null || assetJSON.length == 0) {
- String errorMessage = String.format("Asset %s does not exist in the collection", assetID);
- System.err.println(errorMessage);
- throw new ChaincodeException(errorMessage, AssetTransferErrors.INCOMPLETE_INPUT.toString());
- }
-
- verifyClientOrgMatchesPeerOrg(ctx);
- Asset thisAsset = Asset.deserialize(assetJSON);
- // Verify transfer details and transfer owner
- verifyAgreement(ctx, assetID, thisAsset.getOwner(), buyerMSP);
-
- TransferAgreement transferAgreement = ReadTransferAgreement(ctx, assetID);
- if (transferAgreement == null) {
- String errorMessage = String.format("TransferAgreement does not exist for asset: %s", assetID);
- System.err.println(errorMessage);
- throw new ChaincodeException(errorMessage, AssetTransferErrors.INCOMPLETE_INPUT.toString());
- }
-
- // Transfer asset in private data collection to new owner
- String newOwner = transferAgreement.getBuyerID();
- thisAsset.setOwner(newOwner);
-
- // Save updated Asset to collection
- System.out.printf("Transfer Asset: collection %s, ID %s to owner %s\n", ASSET_COLLECTION_NAME, assetID, newOwner);
- stub.putPrivateData(ASSET_COLLECTION_NAME, assetID, thisAsset.serialize());
-
- // Delete the key from owners collection
- String ownersCollectionName = getCollectionName(ctx);
- stub.delPrivateData(ownersCollectionName, assetID);
-
- // Delete the transfer agreement from the asset collection
- CompositeKey aggKey = stub.createCompositeKey(AGREEMENT_KEYPREFIX, assetID);
- System.out.printf("AgreeToTransfer deleteKey: collection %s, ID %s, Key %s\n", ASSET_COLLECTION_NAME, assetID, aggKey);
- stub.delPrivateData(ASSET_COLLECTION_NAME, aggKey.toString());
- }
-
- /**
- * Deletes a asset & related details from the ledger.
- * Input in transient map: asset_delete
- *
- * This deletes the private data, but does not trigger an immediate cleanup
- * of the history. To specifically force removal right now use purge
- *
- * @param ctx the transaction context
- */
- @Transaction(intent = Transaction.TYPE.SUBMIT)
- public void DeleteAsset(final Context ctx) {
- ChaincodeStub stub = ctx.getStub();
- Map transientMap = ctx.getStub().getTransient();
- if (!transientMap.containsKey("asset_delete")) {
- String errorMessage = String.format("DeleteAsset call must specify 'asset_delete' in Transient map input");
- System.err.println(errorMessage);
- throw new ChaincodeException(errorMessage, AssetTransferErrors.INCOMPLETE_INPUT.toString());
- }
-
- byte[] transientAssetJSON = transientMap.get("asset_delete");
- final String assetID;
-
- try {
- JSONObject json = new JSONObject(new String(transientAssetJSON, UTF_8));
- assetID = json.getString("assetID");
-
- } catch (Exception err) {
- String errorMessage = String.format("TransientMap deserialized error: %s ", err);
- System.err.println(errorMessage);
- throw new ChaincodeException(errorMessage, AssetTransferErrors.INCOMPLETE_INPUT.toString());
- }
-
- System.out.printf("DeleteAsset: verify asset %s exists\n", assetID);
- byte[] assetJSON = stub.getPrivateData(ASSET_COLLECTION_NAME, assetID);
-
- if (assetJSON == null || assetJSON.length == 0) {
- String errorMessage = String.format("Asset %s does not exist", assetID);
- System.err.println(errorMessage);
- throw new ChaincodeException(errorMessage, AssetTransferErrors.ASSET_NOT_FOUND.toString());
- }
- String ownersCollectionName = getCollectionName(ctx);
- byte[] apdJSON = stub.getPrivateData(ownersCollectionName, assetID);
-
- if (apdJSON == null || apdJSON.length == 0) {
- String errorMessage = String.format("Failed to read asset from owner's Collection %s", ownersCollectionName);
- System.err.println(errorMessage);
- throw new ChaincodeException(errorMessage, AssetTransferErrors.ASSET_NOT_FOUND.toString());
- }
- verifyClientOrgMatchesPeerOrg(ctx);
-
- // delete the key from asset collection
- System.out.printf("DeleteAsset: collection %s, ID %s\n", ASSET_COLLECTION_NAME, assetID);
- stub.delPrivateData(ASSET_COLLECTION_NAME, assetID);
-
- // Finally, delete private details of asset
- stub.delPrivateData(ownersCollectionName, assetID);
- }
-
- /**
- * Purges the history of the asset from Private Data
- * (delete does not need to be called as well)
- * Input in transient map: asset_delete
- *
- * @param ctx the transaction context
- */
- @Transaction(intent = Transaction.TYPE.SUBMIT)
- public void PurgeAsset(final Context ctx) {
- ChaincodeStub stub = ctx.getStub();
- Map transientMap = ctx.getStub().getTransient();
- if (!transientMap.containsKey("asset_purge")) {
- String errorMessage = String.format("PurgeAsset call must specify 'asset_purge' in Transient map input");
- System.err.println(errorMessage);
- throw new ChaincodeException(errorMessage, AssetTransferErrors.INCOMPLETE_INPUT.toString());
- }
-
- byte[] transientAssetJSON = transientMap.get("asset_purge");
- final String assetID;
-
- try {
- JSONObject json = new JSONObject(new String(transientAssetJSON, UTF_8));
- assetID = json.getString("assetID");
-
- } catch (Exception err) {
- String errorMessage = String.format("TransientMap deserialized error: %s ", err);
- System.err.println(errorMessage);
- throw new ChaincodeException(errorMessage, AssetTransferErrors.INCOMPLETE_INPUT.toString());
- }
-
- // Note that there is no check here to see if the id exist; it might have been 'deleted' already
- // so a check here is pointless. We would need to call purge irrespective of the result
- // A delete can be called before purge, but is not essential
-
- String ownersCollectionName = getCollectionName(ctx);
- verifyClientOrgMatchesPeerOrg(ctx);
-
- // delete the key from asset collection
- System.out.printf("PurgeAsset: collection %s, ID %s\n", ASSET_COLLECTION_NAME, assetID);
- stub.purgePrivateData(ASSET_COLLECTION_NAME, assetID);
-
- // Finally, delete private details of asset
- System.out.printf("PurgeAsset: collection %s, ID %s\n", ownersCollectionName, assetID);
- stub.purgePrivateData(ownersCollectionName, assetID);
- }
-
-
- // Used by TransferAsset to verify that the transfer is being initiated by the owner and that
- // the buyer has agreed to the same appraisal value as the owner
- private void verifyAgreement(final Context ctx, final String assetID, final String owner, final String buyerMSP) {
- String clienID = ctx.getClientIdentity().getId();
-
- // Check 1: verify that the transfer is being initiatied by the owner
- if (!clienID.equals(owner)) {
- throw new ChaincodeException("Submitting client identity does not own the asset", AssetTransferErrors.INVALID_ACCESS.toString());
- }
-
- // Check 2: verify that the buyer has agreed to the appraised value
- String collectionOwner = getCollectionName(ctx); // get owner collection from caller identity
- String collectionBuyer = buyerMSP + "PrivateCollection";
-
- // Get hash of owners agreed to value
- byte[] ownerAppraisedValueHash = ctx.getStub().getPrivateDataHash(collectionOwner, assetID);
- if (ownerAppraisedValueHash == null) {
- throw new ChaincodeException(String.format("Hash of appraised value for %s does not exist in collection %s", assetID, collectionOwner));
- }
-
- // Get hash of buyers agreed to value
- byte[] buyerAppraisedValueHash = ctx.getStub().getPrivateDataHash(collectionBuyer, assetID);
- if (buyerAppraisedValueHash == null) {
- throw new ChaincodeException(String.format("Hash of appraised value for %s does not exist in collection %s. AgreeToTransfer must be called by the buyer first.", assetID, collectionBuyer));
- }
-
- // Verify that the two hashes match
- if (!Arrays.equals(ownerAppraisedValueHash, buyerAppraisedValueHash)) {
- throw new ChaincodeException(String.format("Hash for appraised value for owner %x does not match value for seller %x", ownerAppraisedValueHash, buyerAppraisedValueHash));
- }
- }
-
- private void verifyClientOrgMatchesPeerOrg(final Context ctx) {
- String clientMSPID = ctx.getClientIdentity().getMSPID();
- String peerMSPID = ctx.getStub().getMspId();
-
- if (!peerMSPID.equals(clientMSPID)) {
- String errorMessage = String.format("Client from org %s is not authorized to read or write private data from an org %s peer", clientMSPID, peerMSPID);
- System.err.println(errorMessage);
- throw new ChaincodeException(errorMessage, AssetTransferErrors.INVALID_ACCESS.toString());
- }
- }
-
- private String getCollectionName(final Context ctx) {
-
- // Get the MSP ID of submitting client identity
- String clientMSPID = ctx.getClientIdentity().getMSPID();
- // Create the collection name
- return clientMSPID + "PrivateCollection";
- }
-
-}
diff --git a/asset-transfer-private-data/chaincode-java/src/main/java/org/hyperledger/fabric/samples/privatedata/TransferAgreement.java b/asset-transfer-private-data/chaincode-java/src/main/java/org/hyperledger/fabric/samples/privatedata/TransferAgreement.java
deleted file mode 100644
index 2082d978..00000000
--- a/asset-transfer-private-data/chaincode-java/src/main/java/org/hyperledger/fabric/samples/privatedata/TransferAgreement.java
+++ /dev/null
@@ -1,51 +0,0 @@
-package org.hyperledger.fabric.samples.privatedata;
-
-import org.hyperledger.fabric.contract.annotation.DataType;
-import org.hyperledger.fabric.contract.annotation.Property;
-import org.hyperledger.fabric.shim.ChaincodeException;
-import org.json.JSONObject;
-
-import static java.nio.charset.StandardCharsets.UTF_8;
-
-@DataType()
-public final class TransferAgreement {
-
- @Property()
- private final String assetID;
-
-
- @Property()
- private String buyerID;
-
- public String getAssetID() {
- return assetID;
- }
-
- public String getBuyerID() {
- return buyerID;
- }
-
- public TransferAgreement(final String assetID,
- final String buyer) {
- this.assetID = assetID;
- this.buyerID = buyer;
- }
-
- public byte[] serialize() {
- String jsonStr = new JSONObject(this).toString();
- return jsonStr.getBytes(UTF_8);
- }
-
- public static TransferAgreement deserialize(final byte[] assetJSON) {
- try {
- JSONObject json = new JSONObject(new String(assetJSON, UTF_8));
- final String id = json.getString("assetID");
- final String buyerID = json.getString("buyerID");
- return new TransferAgreement(id, buyerID);
- } catch (Exception e) {
- throw new ChaincodeException("Deserialize error: " + e.getMessage(), "DATA_ERROR");
- }
- }
-
-
-}
diff --git a/asset-transfer-private-data/chaincode-java/src/test/java/org/hyperledger/fabric/samples/privatedata/AssetTransferTest.java b/asset-transfer-private-data/chaincode-java/src/test/java/org/hyperledger/fabric/samples/privatedata/AssetTransferTest.java
deleted file mode 100644
index 171efe68..00000000
--- a/asset-transfer-private-data/chaincode-java/src/test/java/org/hyperledger/fabric/samples/privatedata/AssetTransferTest.java
+++ /dev/null
@@ -1,168 +0,0 @@
-/*
- * SPDX-License-Identifier: Apache-2.0
- */
-
-package org.hyperledger.fabric.samples.privatedata;
-
-import org.hyperledger.fabric.contract.ClientIdentity;
-import org.hyperledger.fabric.contract.Context;
-import org.hyperledger.fabric.shim.ChaincodeException;
-import org.hyperledger.fabric.shim.ChaincodeStub;
-import org.hyperledger.fabric.shim.ledger.CompositeKey;
-import org.junit.jupiter.api.Nested;
-import org.junit.jupiter.api.Test;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import static java.nio.charset.StandardCharsets.UTF_8;
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.assertj.core.api.ThrowableAssert.catchThrowable;
-import static org.hyperledger.fabric.samples.privatedata.AssetTransfer.AGREEMENT_KEYPREFIX;
-import static org.hyperledger.fabric.samples.privatedata.AssetTransfer.ASSET_COLLECTION_NAME;
-import static org.mockito.ArgumentMatchers.anyString;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.verifyNoInteractions;
-import static org.mockito.Mockito.when;
-
-public final class AssetTransferTest {
-
- @Nested
- class InvokeWriteTransaction {
-
- @Test
- public void createAssetWhenAssetExists() {
- AssetTransfer contract = new AssetTransfer();
- Context ctx = mock(Context.class);
- ChaincodeStub stub = mock(ChaincodeStub.class);
- when(ctx.getStub()).thenReturn(stub);
- Map m = new HashMap<>();
- m.put("asset_properties", DATA_ASSET_1_BYTES);
- when(ctx.getStub().getTransient()).thenReturn(m);
- when(stub.getPrivateData(ASSET_COLLECTION_NAME, TEST_ASSET_1_ID))
- .thenReturn(DATA_ASSET_1_BYTES);
-
- Throwable thrown = catchThrowable(() -> {
- contract.CreateAsset(ctx);
- });
-
- assertThat(thrown).isInstanceOf(ChaincodeException.class).hasNoCause()
- .hasMessage("Asset asset1 already exists");
- assertThat(((ChaincodeException) thrown).getPayload()).isEqualTo("ASSET_ALREADY_EXISTS".getBytes());
- }
-
- @Test
- public void createAssetWhenNewAssetIsCreated() {
- AssetTransfer contract = new AssetTransfer();
- Context ctx = mock(Context.class);
- ChaincodeStub stub = mock(ChaincodeStub.class);
- when(ctx.getStub()).thenReturn(stub);
- when(stub.getMspId()).thenReturn(TEST_ORG_1_MSP);
- ClientIdentity ci = mock(ClientIdentity.class);
- when(ci.getId()).thenReturn(TEST_ORG_1_USER);
- when(ci.getMSPID()).thenReturn(TEST_ORG_1_MSP);
- when(ctx.getClientIdentity()).thenReturn(ci);
-
- Map m = new HashMap<>();
- m.put("asset_properties", DATA_ASSET_1_BYTES);
- when(ctx.getStub().getTransient()).thenReturn(m);
-
- when(stub.getPrivateData(ASSET_COLLECTION_NAME, TEST_ASSET_1_ID))
- .thenReturn(new byte[0]);
-
- Asset created = contract.CreateAsset(ctx);
- assertThat(created).isEqualTo(TEST_ASSET_1);
-
- verify(stub).putPrivateData(ASSET_COLLECTION_NAME, TEST_ASSET_1_ID, created.serialize());
- }
-
- @Test
- public void transferAssetWhenExistingAssetIsTransferred() {
- AssetTransfer contract = new AssetTransfer();
- Context ctx = mock(Context.class);
- ChaincodeStub stub = mock(ChaincodeStub.class);
- when(ctx.getStub()).thenReturn(stub);
- when(stub.getMspId()).thenReturn(TEST_ORG_1_MSP);
- ClientIdentity ci = mock(ClientIdentity.class);
- when(ci.getId()).thenReturn(TEST_ORG_1_USER);
- when(ctx.getClientIdentity()).thenReturn(ci);
- when(ci.getMSPID()).thenReturn(TEST_ORG_1_MSP);
- final String recipientOrgMsp = "TestOrg2";
- final String buyerIdentity = "TestOrg2User";
- Map m = new HashMap<>();
- m.put("asset_owner", ("{ \"buyerMSP\": \"" + recipientOrgMsp + "\", \"assetID\": \"" + TEST_ASSET_1_ID + "\" }").getBytes());
- when(ctx.getStub().getTransient()).thenReturn(m);
-
- when(stub.getPrivateDataHash(anyString(), anyString())).thenReturn("TestHashValue".getBytes());
- when(stub.getPrivateData(ASSET_COLLECTION_NAME, TEST_ASSET_1_ID))
- .thenReturn(DATA_ASSET_1_BYTES);
- CompositeKey ck = mock(CompositeKey.class);
- when(ck.toString()).thenReturn(AGREEMENT_KEYPREFIX + TEST_ASSET_1_ID);
- when(stub.createCompositeKey(AGREEMENT_KEYPREFIX, TEST_ASSET_1_ID)).thenReturn(ck);
- when(stub.getPrivateData(ASSET_COLLECTION_NAME, AGREEMENT_KEYPREFIX + TEST_ASSET_1_ID)).thenReturn(buyerIdentity.getBytes(UTF_8));
- contract.TransferAsset(ctx);
-
- Asset exptectedAfterTransfer = Asset.deserialize("{ \"objectType\": \"testasset\", \"assetID\": \"asset1\", \"color\": \"blue\", \"size\": 5, \"owner\": \"" + buyerIdentity + "\", \"appraisedValue\": 300 }");
-
- verify(stub).putPrivateData(ASSET_COLLECTION_NAME, TEST_ASSET_1_ID, exptectedAfterTransfer.serialize());
- String collectionOwner = TEST_ORG_1_MSP + "PrivateCollection";
- verify(stub).delPrivateData(collectionOwner, TEST_ASSET_1_ID);
- verify(stub).delPrivateData(ASSET_COLLECTION_NAME, AGREEMENT_KEYPREFIX + TEST_ASSET_1_ID);
- }
- }
-
- @Nested
- class QueryReadAssetTransaction {
-
- @Test
- public void whenAssetExists() {
- AssetTransfer contract = new AssetTransfer();
- Context ctx = mock(Context.class);
- ChaincodeStub stub = mock(ChaincodeStub.class);
- when(ctx.getStub()).thenReturn(stub);
- when(stub.getPrivateData(ASSET_COLLECTION_NAME, TEST_ASSET_1_ID))
- .thenReturn(DATA_ASSET_1_BYTES);
-
- Asset asset = contract.ReadAsset(ctx, TEST_ASSET_1_ID);
-
- assertThat(asset).isEqualTo(TEST_ASSET_1);
- }
-
- @Test
- public void whenAssetDoesNotExist() {
- AssetTransfer contract = new AssetTransfer();
- Context ctx = mock(Context.class);
- ChaincodeStub stub = mock(ChaincodeStub.class);
- when(ctx.getStub()).thenReturn(stub);
- when(stub.getStringState(TEST_ASSET_1_ID)).thenReturn(null);
-
- Asset asset = contract.ReadAsset(ctx, TEST_ASSET_1_ID);
- assertThat(asset).isNull();
- }
-
- @Test
- public void invokeUnknownTransaction() {
- AssetTransfer contract = new AssetTransfer();
- Context ctx = mock(Context.class);
-
- Throwable thrown = catchThrowable(() -> {
- contract.unknownTransaction(ctx);
- });
-
- assertThat(thrown).isInstanceOf(ChaincodeException.class).hasNoCause()
- .hasMessage("Undefined contract method called");
- assertThat(((ChaincodeException) thrown).getPayload()).isEqualTo(null);
-
- verifyNoInteractions(ctx);
- }
-
- }
-
- private static final String TEST_ORG_1_MSP = "TestOrg1";
- private static final String TEST_ORG_1_USER = "testOrg1User";
-
- private static final String TEST_ASSET_1_ID = "asset1";
- private static final Asset TEST_ASSET_1 = new Asset("testasset", "asset1", "blue", 5, TEST_ORG_1_USER);
- private static final byte[] DATA_ASSET_1_BYTES = "{ \"objectType\": \"testasset\", \"assetID\": \"asset1\", \"color\": \"blue\", \"size\": 5, \"owner\": \"testOrg1User\", \"appraisedValue\": 300 }".getBytes();
-}
diff --git a/asset-transfer-private-data/chaincode-java/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker b/asset-transfer-private-data/chaincode-java/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker
deleted file mode 100644
index 1f0955d4..00000000
--- a/asset-transfer-private-data/chaincode-java/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker
+++ /dev/null
@@ -1 +0,0 @@
-mock-maker-inline
diff --git a/asset-transfer-private-data/chaincode-typescript/.dockerignore b/asset-transfer-private-data/chaincode-typescript/.dockerignore
deleted file mode 100644
index b512c09d..00000000
--- a/asset-transfer-private-data/chaincode-typescript/.dockerignore
+++ /dev/null
@@ -1 +0,0 @@
-node_modules
\ No newline at end of file
diff --git a/asset-transfer-private-data/chaincode-typescript/.gitignore b/asset-transfer-private-data/chaincode-typescript/.gitignore
deleted file mode 100644
index 79bfe1a3..00000000
--- a/asset-transfer-private-data/chaincode-typescript/.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
-
-# Compiled TypeScript files
-dist
-
diff --git a/asset-transfer-private-data/chaincode-typescript/Dockerfile b/asset-transfer-private-data/chaincode-typescript/Dockerfile
deleted file mode 100644
index 98c90e77..00000000
--- a/asset-transfer-private-data/chaincode-typescript/Dockerfile
+++ /dev/null
@@ -1,36 +0,0 @@
-#
-# SPDX-License-Identifier: Apache-2.0
-#
-FROM node:16 AS builder
-
-WORKDIR /usr/src/app
-
-# Copy node.js source and build, changing owner as well
-COPY --chown=node:node . /usr/src/app
-ENV npm_config_cache=/usr/src/app
-RUN npm ci && npm run package
-
-
-FROM node:16 AS production
-ARG CC_SERVER_PORT
-
-# Setup tini to work better handle signals
-ENV TINI_VERSION v0.19.0
-ENV PLATFORM=amd64
-ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-${PLATFORM} /tini
-RUN chmod +x /tini
-
-WORKDIR /usr/src/app
-COPY --chown=node:node --from=builder /usr/src/app/dist ./dist
-COPY --chown=node:node --from=builder /usr/src/app/package.json ./
-COPY --chown=node:node --from=builder /usr/src/app/npm-shrinkwrap.json ./
-COPY --chown=node:node docker/docker-entrypoint.sh /usr/src/app/docker-entrypoint.sh
-
-RUN npm ci --omit=dev && npm cache clean --force
-
-ENV PORT $CC_SERVER_PORT
-EXPOSE $CC_SERVER_PORT
-ENV NODE_ENV=production
-
-USER node
-ENTRYPOINT [ "/tini", "--", "/usr/src/app/docker-entrypoint.sh" ]
diff --git a/asset-transfer-private-data/chaincode-typescript/Readme.md b/asset-transfer-private-data/chaincode-typescript/Readme.md
deleted file mode 100644
index 3a81fe77..00000000
--- a/asset-transfer-private-data/chaincode-typescript/Readme.md
+++ /dev/null
@@ -1,9 +0,0 @@
-## Usage
-This chaincode written for Hyperledger Fabric private data tutorial(https://hyperledger-fabric.readthedocs.io/en/latest/private_data_tutorial.html).
-
-### Deploy chaincode with:
-1. ``` cd fabric-samples/asset-transfer-private-data/chaincode-typescript/ ```
-2. ``` npm install ```
-3. ``` npm run build ```
-4. ``` cd fabric-samples/test-network/ ```
-5. ``` ./network.sh deployCC -ccn private -ccp ../asset-transfer-private-data/chaincode-typescript/ -ccl typescript -ccep "OR('Org1MSP.peer','Org2MSP.peer')" -cccg ../asset-transfer-private-data/chaincode-typescript/collections_config.json ```
\ No newline at end of file
diff --git a/asset-transfer-private-data/chaincode-typescript/collections_config.json b/asset-transfer-private-data/chaincode-typescript/collections_config.json
deleted file mode 100644
index 993bbd31..00000000
--- a/asset-transfer-private-data/chaincode-typescript/collections_config.json
+++ /dev/null
@@ -1,38 +0,0 @@
-[
- {
- "name": "assetCollection",
- "policy": "OR('Org1MSP.member', 'Org2MSP.member')",
- "requiredPeerCount": 1,
- "maxPeerCount": 1,
- "blockToLive":1000000,
- "memberOnlyRead": true,
- "memberOnlyWrite": true,
- "endorsementPolicy": {
- "signaturePolicy":"OR('Org1MSP.member','Org2MSP.member')"
- }
-},
- {
- "name": "Org1MSPPrivateCollection",
- "policy": "OR('Org1MSP.member')",
- "requiredPeerCount": 0,
- "maxPeerCount": 1,
- "blockToLive":3,
- "memberOnlyRead": true,
- "memberOnlyWrite": false,
- "endorsementPolicy": {
- "signaturePolicy": "OR('Org1MSP.member')"
- }
- },
- {
- "name": "Org2MSPPrivateCollection",
- "policy": "OR('Org2MSP.member')",
- "requiredPeerCount": 0,
- "maxPeerCount": 1,
- "blockToLive":3,
- "memberOnlyRead": true,
- "memberOnlyWrite": false,
- "endorsementPolicy": {
- "signaturePolicy": "OR('Org2MSP.member')"
- }
- }
-]
diff --git a/asset-transfer-private-data/chaincode-typescript/docker/docker-entrypoint.sh b/asset-transfer-private-data/chaincode-typescript/docker/docker-entrypoint.sh
deleted file mode 100644
index 2fd8fcf6..00000000
--- a/asset-transfer-private-data/chaincode-typescript/docker/docker-entrypoint.sh
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/usr/bin/env bash
-#
-# SPDX-License-Identifier: Apache-2.0
-#
-set -euo pipefail
-: ${CORE_PEER_TLS_ENABLED:="false"}
-: ${DEBUG:="false"}
-
-if [ "${DEBUG,,}" = "true" ]; then
- npm run start:server-debug
-elif [ "${CORE_PEER_TLS_ENABLED,,}" = "true" ]; then
- npm run start:server
-else
- npm run start:server-nontls
-fi
-
diff --git a/asset-transfer-private-data/chaincode-typescript/eslint.config.mjs b/asset-transfer-private-data/chaincode-typescript/eslint.config.mjs
deleted file mode 100644
index 9ef6b243..00000000
--- a/asset-transfer-private-data/chaincode-typescript/eslint.config.mjs
+++ /dev/null
@@ -1,13 +0,0 @@
-import js from '@eslint/js';
-import tseslint from 'typescript-eslint';
-
-export default tseslint.config(js.configs.recommended, ...tseslint.configs.strictTypeChecked, {
- languageOptions: {
- ecmaVersion: 2023,
- sourceType: 'module',
- parserOptions: {
- project: 'tsconfig.json',
- tsconfigRootDir: import.meta.dirname,
- },
- },
-});
diff --git a/asset-transfer-private-data/chaincode-typescript/npm-shrinkwrap.json b/asset-transfer-private-data/chaincode-typescript/npm-shrinkwrap.json
deleted file mode 100644
index 940936a8..00000000
--- a/asset-transfer-private-data/chaincode-typescript/npm-shrinkwrap.json
+++ /dev/null
@@ -1,2256 +0,0 @@
-{
- "name": "asset-transfer-private-data",
- "version": "1.0.0",
- "lockfileVersion": 3,
- "requires": true,
- "packages": {
- "": {
- "name": "asset-transfer-private-data",
- "version": "1.0.0",
- "license": "Apache-2.0",
- "dependencies": {
- "fabric-contract-api": "~2.5",
- "fabric-shim": "~2.5",
- "json-stringify-deterministic": "^1.0.0",
- "sort-keys-recursive": "^2.1.0"
- },
- "devDependencies": {
- "@eslint/js": "^9.3.0",
- "@tsconfig/node18": "^18.2.4",
- "@types/node": "^18.19.33",
- "eslint": "^8.57.0",
- "typescript": "~5.4.5",
- "typescript-eslint": "^7.11.0"
- },
- "engines": {
- "node": ">=18"
- }
- },
- "node_modules/@colors/colors": {
- "version": "1.6.0",
- "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.6.0.tgz",
- "integrity": "sha512-Ir+AOibqzrIsL6ajt3Rz3LskB7OiMVHqltZmspbW/TJuTVuyOMirVqAkjfY6JISiLHgyNqicAC8AyHHGzNd/dA==",
- "engines": {
- "node": ">=0.1.90"
- }
- },
- "node_modules/@dabh/diagnostics": {
- "version": "2.0.3",
- "resolved": "https://registry.npmjs.org/@dabh/diagnostics/-/diagnostics-2.0.3.tgz",
- "integrity": "sha512-hrlQOIi7hAfzsMqlGSFyVucrx38O+j6wiGOf//H2ecvIEqYN4ADBSS2iLMh5UFyDunCNniUIPk/q3riFv45xRA==",
- "dependencies": {
- "colorspace": "1.1.x",
- "enabled": "2.0.x",
- "kuler": "^2.0.0"
- }
- },
- "node_modules/@eslint-community/eslint-utils": {
- "version": "4.4.0",
- "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz",
- "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==",
- "dev": true,
- "dependencies": {
- "eslint-visitor-keys": "^3.3.0"
- },
- "engines": {
- "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
- },
- "peerDependencies": {
- "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0"
- }
- },
- "node_modules/@eslint-community/regexpp": {
- "version": "4.10.1",
- "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.10.1.tgz",
- "integrity": "sha512-Zm2NGpWELsQAD1xsJzGQpYfvICSsFkEpU0jxBjfdC6uNEWXcHnfs9hScFWtXVDVl+rBQJGrl4g1vcKIejpH9dA==",
- "dev": true,
- "engines": {
- "node": "^12.0.0 || ^14.0.0 || >=16.0.0"
- }
- },
- "node_modules/@eslint/eslintrc": {
- "version": "2.1.4",
- "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz",
- "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==",
- "dev": true,
- "dependencies": {
- "ajv": "^6.12.4",
- "debug": "^4.3.2",
- "espree": "^9.6.0",
- "globals": "^13.19.0",
- "ignore": "^5.2.0",
- "import-fresh": "^3.2.1",
- "js-yaml": "^4.1.0",
- "minimatch": "^3.1.2",
- "strip-json-comments": "^3.1.1"
- },
- "engines": {
- "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
- },
- "funding": {
- "url": "https://opencollective.com/eslint"
- }
- },
- "node_modules/@eslint/js": {
- "version": "9.4.0",
- "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.4.0.tgz",
- "integrity": "sha512-fdI7VJjP3Rvc70lC4xkFXHB0fiPeojiL1PxVG6t1ZvXQrarj893PweuBTujxDUFk0Fxj4R7PIIAZ/aiiyZPZcg==",
- "dev": true,
- "engines": {
- "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
- }
- },
- "node_modules/@fidm/asn1": {
- "version": "1.0.4",
- "resolved": "https://registry.npmjs.org/@fidm/asn1/-/asn1-1.0.4.tgz",
- "integrity": "sha512-esd1jyNvRb2HVaQGq2Gg8Z0kbQPXzV9Tq5Z14KNIov6KfFD6PTaRIO8UpcsYiTNzOqJpmyzWgVTrUwFV3UF4TQ==",
- "engines": {
- "node": ">= 8"
- }
- },
- "node_modules/@fidm/x509": {
- "version": "1.2.1",
- "resolved": "https://registry.npmjs.org/@fidm/x509/-/x509-1.2.1.tgz",
- "integrity": "sha512-nwc2iesjyc9hkuzcrMCBXQRn653XuAUKorfWM8PZyJawiy1QzLj4vahwzaI25+pfpwOLvMzbJ0uKpWLDNmo16w==",
- "dependencies": {
- "@fidm/asn1": "^1.0.4",
- "tweetnacl": "^1.0.1"
- },
- "engines": {
- "node": ">= 8"
- }
- },
- "node_modules/@grpc/grpc-js": {
- "version": "1.10.9",
- "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.10.9.tgz",
- "integrity": "sha512-5tcgUctCG0qoNyfChZifz2tJqbRbXVO9J7X6duFcOjY3HUNCxg5D0ZCK7EP9vIcZ0zRpLU9bWkyCqVCLZ46IbQ==",
- "dependencies": {
- "@grpc/proto-loader": "^0.7.13",
- "@js-sdsl/ordered-map": "^4.4.2"
- },
- "engines": {
- "node": ">=12.10.0"
- }
- },
- "node_modules/@grpc/proto-loader": {
- "version": "0.7.13",
- "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.7.13.tgz",
- "integrity": "sha512-AiXO/bfe9bmxBjxxtYxFAXGZvMaN5s8kO+jBHAJCON8rJoB5YS/D6X7ZNc6XQkuHNmyl4CYaMI1fJ/Gn27RGGw==",
- "dependencies": {
- "lodash.camelcase": "^4.3.0",
- "long": "^5.0.0",
- "protobufjs": "^7.2.5",
- "yargs": "^17.7.2"
- },
- "bin": {
- "proto-loader-gen-types": "build/bin/proto-loader-gen-types.js"
- },
- "engines": {
- "node": ">=6"
- }
- },
- "node_modules/@humanwhocodes/config-array": {
- "version": "0.11.14",
- "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz",
- "integrity": "sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==",
- "deprecated": "Use @eslint/config-array instead",
- "dev": true,
- "dependencies": {
- "@humanwhocodes/object-schema": "^2.0.2",
- "debug": "^4.3.1",
- "minimatch": "^3.0.5"
- },
- "engines": {
- "node": ">=10.10.0"
- }
- },
- "node_modules/@humanwhocodes/module-importer": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz",
- "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==",
- "dev": true,
- "engines": {
- "node": ">=12.22"
- },
- "funding": {
- "type": "github",
- "url": "https://github.com/sponsors/nzakas"
- }
- },
- "node_modules/@humanwhocodes/object-schema": {
- "version": "2.0.3",
- "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz",
- "integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==",
- "deprecated": "Use @eslint/object-schema instead",
- "dev": true
- },
- "node_modules/@hyperledger/fabric-protos": {
- "version": "0.2.1",
- "resolved": "https://registry.npmjs.org/@hyperledger/fabric-protos/-/fabric-protos-0.2.1.tgz",
- "integrity": "sha512-qjm0vIQIfCall804tWDeA8p/mUfu14sl5Sj+PbOn2yDKJq+7ThoIhNsLAqf+BCxUfqsoqQq6AojhqQeTFyOOqg==",
- "dependencies": {
- "@grpc/grpc-js": "^1.9.0",
- "google-protobuf": "^3.21.0"
- },
- "engines": {
- "node": ">=14.15.0"
- }
- },
- "node_modules/@js-sdsl/ordered-map": {
- "version": "4.4.2",
- "resolved": "https://registry.npmjs.org/@js-sdsl/ordered-map/-/ordered-map-4.4.2.tgz",
- "integrity": "sha512-iUKgm52T8HOE/makSxjqoWhe95ZJA1/G1sYsGev2JDKUSS14KAgg1LHb+Ba+IPow0xflbnSkOsZcO08C7w1gYw==",
- "funding": {
- "type": "opencollective",
- "url": "https://opencollective.com/js-sdsl"
- }
- },
- "node_modules/@nodelib/fs.scandir": {
- "version": "2.1.5",
- "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz",
- "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==",
- "dev": true,
- "dependencies": {
- "@nodelib/fs.stat": "2.0.5",
- "run-parallel": "^1.1.9"
- },
- "engines": {
- "node": ">= 8"
- }
- },
- "node_modules/@nodelib/fs.stat": {
- "version": "2.0.5",
- "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz",
- "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==",
- "dev": true,
- "engines": {
- "node": ">= 8"
- }
- },
- "node_modules/@nodelib/fs.walk": {
- "version": "1.2.8",
- "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz",
- "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==",
- "dev": true,
- "dependencies": {
- "@nodelib/fs.scandir": "2.1.5",
- "fastq": "^1.6.0"
- },
- "engines": {
- "node": ">= 8"
- }
- },
- "node_modules/@protobufjs/aspromise": {
- "version": "1.1.2",
- "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz",
- "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ=="
- },
- "node_modules/@protobufjs/base64": {
- "version": "1.1.2",
- "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz",
- "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg=="
- },
- "node_modules/@protobufjs/codegen": {
- "version": "2.0.4",
- "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz",
- "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg=="
- },
- "node_modules/@protobufjs/eventemitter": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz",
- "integrity": "sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q=="
- },
- "node_modules/@protobufjs/fetch": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz",
- "integrity": "sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==",
- "dependencies": {
- "@protobufjs/aspromise": "^1.1.1",
- "@protobufjs/inquire": "^1.1.0"
- }
- },
- "node_modules/@protobufjs/float": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz",
- "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ=="
- },
- "node_modules/@protobufjs/inquire": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz",
- "integrity": "sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q=="
- },
- "node_modules/@protobufjs/path": {
- "version": "1.1.2",
- "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz",
- "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA=="
- },
- "node_modules/@protobufjs/pool": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz",
- "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw=="
- },
- "node_modules/@protobufjs/utf8": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz",
- "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw=="
- },
- "node_modules/@tsconfig/node18": {
- "version": "18.2.4",
- "resolved": "https://registry.npmjs.org/@tsconfig/node18/-/node18-18.2.4.tgz",
- "integrity": "sha512-5xxU8vVs9/FNcvm3gE07fPbn9tl6tqGGWA9tSlwsUEkBxtRnTsNmwrV8gasZ9F/EobaSv9+nu8AxUKccw77JpQ==",
- "dev": true
- },
- "node_modules/@types/node": {
- "version": "18.19.34",
- "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.34.tgz",
- "integrity": "sha512-eXF4pfBNV5DAMKGbI02NnDtWrQ40hAN558/2vvS4gMpMIxaf6JmD7YjnZbq0Q9TDSSkKBamime8ewRoomHdt4g==",
- "dependencies": {
- "undici-types": "~5.26.4"
- }
- },
- "node_modules/@types/triple-beam": {
- "version": "1.3.5",
- "resolved": "https://registry.npmjs.org/@types/triple-beam/-/triple-beam-1.3.5.tgz",
- "integrity": "sha512-6WaYesThRMCl19iryMYP7/x2OVgCtbIVflDGFpWnb9irXI3UjYE4AzmYuiUKY1AJstGijoY+MgUszMgRxIYTYw=="
- },
- "node_modules/@typescript-eslint/eslint-plugin": {
- "version": "7.13.0",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.13.0.tgz",
- "integrity": "sha512-FX1X6AF0w8MdVFLSdqwqN/me2hyhuQg4ykN6ZpVhh1ij/80pTvDKclX1sZB9iqex8SjQfVhwMKs3JtnnMLzG9w==",
- "dev": true,
- "dependencies": {
- "@eslint-community/regexpp": "^4.10.0",
- "@typescript-eslint/scope-manager": "7.13.0",
- "@typescript-eslint/type-utils": "7.13.0",
- "@typescript-eslint/utils": "7.13.0",
- "@typescript-eslint/visitor-keys": "7.13.0",
- "graphemer": "^1.4.0",
- "ignore": "^5.3.1",
- "natural-compare": "^1.4.0",
- "ts-api-utils": "^1.3.0"
- },
- "engines": {
- "node": "^18.18.0 || >=20.0.0"
- },
- "funding": {
- "type": "opencollective",
- "url": "https://opencollective.com/typescript-eslint"
- },
- "peerDependencies": {
- "@typescript-eslint/parser": "^7.0.0",
- "eslint": "^8.56.0"
- },
- "peerDependenciesMeta": {
- "typescript": {
- "optional": true
- }
- }
- },
- "node_modules/@typescript-eslint/parser": {
- "version": "7.13.0",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.13.0.tgz",
- "integrity": "sha512-EjMfl69KOS9awXXe83iRN7oIEXy9yYdqWfqdrFAYAAr6syP8eLEFI7ZE4939antx2mNgPRW/o1ybm2SFYkbTVA==",
- "dev": true,
- "dependencies": {
- "@typescript-eslint/scope-manager": "7.13.0",
- "@typescript-eslint/types": "7.13.0",
- "@typescript-eslint/typescript-estree": "7.13.0",
- "@typescript-eslint/visitor-keys": "7.13.0",
- "debug": "^4.3.4"
- },
- "engines": {
- "node": "^18.18.0 || >=20.0.0"
- },
- "funding": {
- "type": "opencollective",
- "url": "https://opencollective.com/typescript-eslint"
- },
- "peerDependencies": {
- "eslint": "^8.56.0"
- },
- "peerDependenciesMeta": {
- "typescript": {
- "optional": true
- }
- }
- },
- "node_modules/@typescript-eslint/scope-manager": {
- "version": "7.13.0",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.13.0.tgz",
- "integrity": "sha512-ZrMCe1R6a01T94ilV13egvcnvVJ1pxShkE0+NDjDzH4nvG1wXpwsVI5bZCvE7AEDH1mXEx5tJSVR68bLgG7Dng==",
- "dev": true,
- "dependencies": {
- "@typescript-eslint/types": "7.13.0",
- "@typescript-eslint/visitor-keys": "7.13.0"
- },
- "engines": {
- "node": "^18.18.0 || >=20.0.0"
- },
- "funding": {
- "type": "opencollective",
- "url": "https://opencollective.com/typescript-eslint"
- }
- },
- "node_modules/@typescript-eslint/type-utils": {
- "version": "7.13.0",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.13.0.tgz",
- "integrity": "sha512-xMEtMzxq9eRkZy48XuxlBFzpVMDurUAfDu5Rz16GouAtXm0TaAoTFzqWUFPPuQYXI/CDaH/Bgx/fk/84t/Bc9A==",
- "dev": true,
- "dependencies": {
- "@typescript-eslint/typescript-estree": "7.13.0",
- "@typescript-eslint/utils": "7.13.0",
- "debug": "^4.3.4",
- "ts-api-utils": "^1.3.0"
- },
- "engines": {
- "node": "^18.18.0 || >=20.0.0"
- },
- "funding": {
- "type": "opencollective",
- "url": "https://opencollective.com/typescript-eslint"
- },
- "peerDependencies": {
- "eslint": "^8.56.0"
- },
- "peerDependenciesMeta": {
- "typescript": {
- "optional": true
- }
- }
- },
- "node_modules/@typescript-eslint/types": {
- "version": "7.13.0",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.13.0.tgz",
- "integrity": "sha512-QWuwm9wcGMAuTsxP+qz6LBBd3Uq8I5Nv8xb0mk54jmNoCyDspnMvVsOxI6IsMmway5d1S9Su2+sCKv1st2l6eA==",
- "dev": true,
- "engines": {
- "node": "^18.18.0 || >=20.0.0"
- },
- "funding": {
- "type": "opencollective",
- "url": "https://opencollective.com/typescript-eslint"
- }
- },
- "node_modules/@typescript-eslint/typescript-estree": {
- "version": "7.13.0",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.13.0.tgz",
- "integrity": "sha512-cAvBvUoobaoIcoqox1YatXOnSl3gx92rCZoMRPzMNisDiM12siGilSM4+dJAekuuHTibI2hVC2fYK79iSFvWjw==",
- "dev": true,
- "dependencies": {
- "@typescript-eslint/types": "7.13.0",
- "@typescript-eslint/visitor-keys": "7.13.0",
- "debug": "^4.3.4",
- "globby": "^11.1.0",
- "is-glob": "^4.0.3",
- "minimatch": "^9.0.4",
- "semver": "^7.6.0",
- "ts-api-utils": "^1.3.0"
- },
- "engines": {
- "node": "^18.18.0 || >=20.0.0"
- },
- "funding": {
- "type": "opencollective",
- "url": "https://opencollective.com/typescript-eslint"
- },
- "peerDependenciesMeta": {
- "typescript": {
- "optional": true
- }
- }
- },
- "node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz",
- "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==",
- "dev": true,
- "dependencies": {
- "balanced-match": "^1.0.0"
- }
- },
- "node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": {
- "version": "9.0.4",
- "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.4.tgz",
- "integrity": "sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw==",
- "dev": true,
- "dependencies": {
- "brace-expansion": "^2.0.1"
- },
- "engines": {
- "node": ">=16 || 14 >=14.17"
- },
- "funding": {
- "url": "https://github.com/sponsors/isaacs"
- }
- },
- "node_modules/@typescript-eslint/utils": {
- "version": "7.13.0",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.13.0.tgz",
- "integrity": "sha512-jceD8RgdKORVnB4Y6BqasfIkFhl4pajB1wVxrF4akxD2QPM8GNYjgGwEzYS+437ewlqqrg7Dw+6dhdpjMpeBFQ==",
- "dev": true,
- "dependencies": {
- "@eslint-community/eslint-utils": "^4.4.0",
- "@typescript-eslint/scope-manager": "7.13.0",
- "@typescript-eslint/types": "7.13.0",
- "@typescript-eslint/typescript-estree": "7.13.0"
- },
- "engines": {
- "node": "^18.18.0 || >=20.0.0"
- },
- "funding": {
- "type": "opencollective",
- "url": "https://opencollective.com/typescript-eslint"
- },
- "peerDependencies": {
- "eslint": "^8.56.0"
- }
- },
- "node_modules/@typescript-eslint/visitor-keys": {
- "version": "7.13.0",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.13.0.tgz",
- "integrity": "sha512-nxn+dozQx+MK61nn/JP+M4eCkHDSxSLDpgE3WcQo0+fkjEolnaB5jswvIKC4K56By8MMgIho7f1PVxERHEo8rw==",
- "dev": true,
- "dependencies": {
- "@typescript-eslint/types": "7.13.0",
- "eslint-visitor-keys": "^3.4.3"
- },
- "engines": {
- "node": "^18.18.0 || >=20.0.0"
- },
- "funding": {
- "type": "opencollective",
- "url": "https://opencollective.com/typescript-eslint"
- }
- },
- "node_modules/@ungap/structured-clone": {
- "version": "1.2.0",
- "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz",
- "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==",
- "dev": true
- },
- "node_modules/acorn": {
- "version": "8.11.3",
- "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz",
- "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==",
- "dev": true,
- "bin": {
- "acorn": "bin/acorn"
- },
- "engines": {
- "node": ">=0.4.0"
- }
- },
- "node_modules/acorn-jsx": {
- "version": "5.3.2",
- "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz",
- "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==",
- "dev": true,
- "peerDependencies": {
- "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0"
- }
- },
- "node_modules/ajv": {
- "version": "6.12.6",
- "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz",
- "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==",
- "dependencies": {
- "fast-deep-equal": "^3.1.1",
- "fast-json-stable-stringify": "^2.0.0",
- "json-schema-traverse": "^0.4.1",
- "uri-js": "^4.2.2"
- },
- "funding": {
- "type": "github",
- "url": "https://github.com/sponsors/epoberezkin"
- }
- },
- "node_modules/ansi-regex": {
- "version": "5.0.1",
- "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
- "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/ansi-styles": {
- "version": "4.3.0",
- "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
- "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
- "dependencies": {
- "color-convert": "^2.0.1"
- },
- "engines": {
- "node": ">=8"
- },
- "funding": {
- "url": "https://github.com/chalk/ansi-styles?sponsor=1"
- }
- },
- "node_modules/argparse": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
- "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==",
- "dev": true
- },
- "node_modules/array-union": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz",
- "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==",
- "dev": true,
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/async": {
- "version": "3.2.5",
- "resolved": "https://registry.npmjs.org/async/-/async-3.2.5.tgz",
- "integrity": "sha512-baNZyqaaLhyLVKm/DlvdW051MSgO6b8eVfIezl9E5PqWxFgzLm/wQntEW4zOytVburDEr0JlALEpdOFwvErLsg=="
- },
- "node_modules/balanced-match": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
- "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==",
- "dev": true
- },
- "node_modules/brace-expansion": {
- "version": "1.1.11",
- "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
- "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
- "dev": true,
- "dependencies": {
- "balanced-match": "^1.0.0",
- "concat-map": "0.0.1"
- }
- },
- "node_modules/braces": {
- "version": "3.0.3",
- "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz",
- "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==",
- "dev": true,
- "dependencies": {
- "fill-range": "^7.1.1"
- },
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/callsites": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",
- "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==",
- "dev": true,
- "engines": {
- "node": ">=6"
- }
- },
- "node_modules/chalk": {
- "version": "4.1.2",
- "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
- "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
- "dev": true,
- "dependencies": {
- "ansi-styles": "^4.1.0",
- "supports-color": "^7.1.0"
- },
- "engines": {
- "node": ">=10"
- },
- "funding": {
- "url": "https://github.com/chalk/chalk?sponsor=1"
- }
- },
- "node_modules/class-transformer": {
- "version": "0.4.0",
- "resolved": "https://registry.npmjs.org/class-transformer/-/class-transformer-0.4.0.tgz",
- "integrity": "sha512-ETWD/H2TbWbKEi7m9N4Km5+cw1hNcqJSxlSYhsLsNjQzWWiZIYA1zafxpK9PwVfaZ6AqR5rrjPVUBGESm5tQUA=="
- },
- "node_modules/cliui": {
- "version": "8.0.1",
- "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz",
- "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==",
- "dependencies": {
- "string-width": "^4.2.0",
- "strip-ansi": "^6.0.1",
- "wrap-ansi": "^7.0.0"
- },
- "engines": {
- "node": ">=12"
- }
- },
- "node_modules/color": {
- "version": "3.2.1",
- "resolved": "https://registry.npmjs.org/color/-/color-3.2.1.tgz",
- "integrity": "sha512-aBl7dZI9ENN6fUGC7mWpMTPNHmWUSNan9tuWN6ahh5ZLNk9baLJOnSMlrQkHcrfFgz2/RigjUVAjdx36VcemKA==",
- "dependencies": {
- "color-convert": "^1.9.3",
- "color-string": "^1.6.0"
- }
- },
- "node_modules/color-convert": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
- "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
- "dependencies": {
- "color-name": "~1.1.4"
- },
- "engines": {
- "node": ">=7.0.0"
- }
- },
- "node_modules/color-name": {
- "version": "1.1.4",
- "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
- "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="
- },
- "node_modules/color-string": {
- "version": "1.9.1",
- "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.9.1.tgz",
- "integrity": "sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg==",
- "dependencies": {
- "color-name": "^1.0.0",
- "simple-swizzle": "^0.2.2"
- }
- },
- "node_modules/color/node_modules/color-convert": {
- "version": "1.9.3",
- "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
- "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
- "dependencies": {
- "color-name": "1.1.3"
- }
- },
- "node_modules/color/node_modules/color-name": {
- "version": "1.1.3",
- "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
- "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw=="
- },
- "node_modules/colorspace": {
- "version": "1.1.4",
- "resolved": "https://registry.npmjs.org/colorspace/-/colorspace-1.1.4.tgz",
- "integrity": "sha512-BgvKJiuVu1igBUF2kEjRCZXol6wiiGbY5ipL/oVPwm0BL9sIpMIzM8IK7vwuxIIzOXMV3Ey5w+vxhm0rR/TN8w==",
- "dependencies": {
- "color": "^3.1.3",
- "text-hex": "1.0.x"
- }
- },
- "node_modules/concat-map": {
- "version": "0.0.1",
- "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
- "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==",
- "dev": true
- },
- "node_modules/cross-spawn": {
- "version": "7.0.3",
- "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
- "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==",
- "dev": true,
- "dependencies": {
- "path-key": "^3.1.0",
- "shebang-command": "^2.0.0",
- "which": "^2.0.1"
- },
- "engines": {
- "node": ">= 8"
- }
- },
- "node_modules/debug": {
- "version": "4.3.5",
- "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.5.tgz",
- "integrity": "sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==",
- "dev": true,
- "dependencies": {
- "ms": "2.1.2"
- },
- "engines": {
- "node": ">=6.0"
- },
- "peerDependenciesMeta": {
- "supports-color": {
- "optional": true
- }
- }
- },
- "node_modules/deep-is": {
- "version": "0.1.4",
- "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz",
- "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==",
- "dev": true
- },
- "node_modules/dir-glob": {
- "version": "3.0.1",
- "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz",
- "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==",
- "dev": true,
- "dependencies": {
- "path-type": "^4.0.0"
- },
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/doctrine": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz",
- "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==",
- "dev": true,
- "dependencies": {
- "esutils": "^2.0.2"
- },
- "engines": {
- "node": ">=6.0.0"
- }
- },
- "node_modules/emoji-regex": {
- "version": "8.0.0",
- "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
- "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="
- },
- "node_modules/enabled": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/enabled/-/enabled-2.0.0.tgz",
- "integrity": "sha512-AKrN98kuwOzMIdAizXGI86UFBoo26CL21UM763y1h/GMSJ4/OHU9k2YlsmBpyScFo/wbLzWQJBMCW4+IO3/+OQ=="
- },
- "node_modules/escalade": {
- "version": "3.1.2",
- "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz",
- "integrity": "sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==",
- "engines": {
- "node": ">=6"
- }
- },
- "node_modules/escape-string-regexp": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz",
- "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==",
- "dev": true,
- "engines": {
- "node": ">=10"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/eslint": {
- "version": "8.57.0",
- "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.0.tgz",
- "integrity": "sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==",
- "dev": true,
- "dependencies": {
- "@eslint-community/eslint-utils": "^4.2.0",
- "@eslint-community/regexpp": "^4.6.1",
- "@eslint/eslintrc": "^2.1.4",
- "@eslint/js": "8.57.0",
- "@humanwhocodes/config-array": "^0.11.14",
- "@humanwhocodes/module-importer": "^1.0.1",
- "@nodelib/fs.walk": "^1.2.8",
- "@ungap/structured-clone": "^1.2.0",
- "ajv": "^6.12.4",
- "chalk": "^4.0.0",
- "cross-spawn": "^7.0.2",
- "debug": "^4.3.2",
- "doctrine": "^3.0.0",
- "escape-string-regexp": "^4.0.0",
- "eslint-scope": "^7.2.2",
- "eslint-visitor-keys": "^3.4.3",
- "espree": "^9.6.1",
- "esquery": "^1.4.2",
- "esutils": "^2.0.2",
- "fast-deep-equal": "^3.1.3",
- "file-entry-cache": "^6.0.1",
- "find-up": "^5.0.0",
- "glob-parent": "^6.0.2",
- "globals": "^13.19.0",
- "graphemer": "^1.4.0",
- "ignore": "^5.2.0",
- "imurmurhash": "^0.1.4",
- "is-glob": "^4.0.0",
- "is-path-inside": "^3.0.3",
- "js-yaml": "^4.1.0",
- "json-stable-stringify-without-jsonify": "^1.0.1",
- "levn": "^0.4.1",
- "lodash.merge": "^4.6.2",
- "minimatch": "^3.1.2",
- "natural-compare": "^1.4.0",
- "optionator": "^0.9.3",
- "strip-ansi": "^6.0.1",
- "text-table": "^0.2.0"
- },
- "bin": {
- "eslint": "bin/eslint.js"
- },
- "engines": {
- "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
- },
- "funding": {
- "url": "https://opencollective.com/eslint"
- }
- },
- "node_modules/eslint-scope": {
- "version": "7.2.2",
- "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz",
- "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==",
- "dev": true,
- "dependencies": {
- "esrecurse": "^4.3.0",
- "estraverse": "^5.2.0"
- },
- "engines": {
- "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
- },
- "funding": {
- "url": "https://opencollective.com/eslint"
- }
- },
- "node_modules/eslint-visitor-keys": {
- "version": "3.4.3",
- "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz",
- "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==",
- "dev": true,
- "engines": {
- "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
- },
- "funding": {
- "url": "https://opencollective.com/eslint"
- }
- },
- "node_modules/eslint/node_modules/@eslint/js": {
- "version": "8.57.0",
- "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.0.tgz",
- "integrity": "sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==",
- "dev": true,
- "engines": {
- "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
- }
- },
- "node_modules/espree": {
- "version": "9.6.1",
- "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz",
- "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==",
- "dev": true,
- "dependencies": {
- "acorn": "^8.9.0",
- "acorn-jsx": "^5.3.2",
- "eslint-visitor-keys": "^3.4.1"
- },
- "engines": {
- "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
- },
- "funding": {
- "url": "https://opencollective.com/eslint"
- }
- },
- "node_modules/esquery": {
- "version": "1.5.0",
- "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz",
- "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==",
- "dev": true,
- "dependencies": {
- "estraverse": "^5.1.0"
- },
- "engines": {
- "node": ">=0.10"
- }
- },
- "node_modules/esrecurse": {
- "version": "4.3.0",
- "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz",
- "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==",
- "dev": true,
- "dependencies": {
- "estraverse": "^5.2.0"
- },
- "engines": {
- "node": ">=4.0"
- }
- },
- "node_modules/estraverse": {
- "version": "5.3.0",
- "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz",
- "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==",
- "dev": true,
- "engines": {
- "node": ">=4.0"
- }
- },
- "node_modules/esutils": {
- "version": "2.0.3",
- "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz",
- "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==",
- "dev": true,
- "engines": {
- "node": ">=0.10.0"
- }
- },
- "node_modules/fabric-contract-api": {
- "version": "2.5.6",
- "resolved": "https://registry.npmjs.org/fabric-contract-api/-/fabric-contract-api-2.5.6.tgz",
- "integrity": "sha512-AosGb8tA+Jgt+pqMEgYNB3/J/P5QuWOC7yhXbhDmAAwUzn4Sc7pdWDICH1YyrFGZNFxMGQmqJmLVWUX8BKHy0w==",
- "dependencies": {
- "class-transformer": "^0.4.0",
- "fabric-shim-api": "2.5.6",
- "fast-safe-stringify": "^2.1.1",
- "get-params": "^0.1.2",
- "reflect-metadata": "^0.1.13",
- "winston": "^3.7.2"
- },
- "engines": {
- "node": ">=18"
- }
- },
- "node_modules/fabric-shim": {
- "version": "2.5.6",
- "resolved": "https://registry.npmjs.org/fabric-shim/-/fabric-shim-2.5.6.tgz",
- "integrity": "sha512-4Y8WNFhYuQ9QYSEgPXWdlXnrXjwOlM10sQQzE4kJ7cDh8a4LX0rn44FxtxTCB18lnzrSLMZ8/8Cr5m0c9NeXWA==",
- "dependencies": {
- "@fidm/x509": "^1.2.1",
- "@grpc/grpc-js": "~1.10.9",
- "@hyperledger/fabric-protos": "~0.2.1",
- "@types/node": "^16.11.1",
- "ajv": "^6.12.2",
- "fabric-contract-api": "2.5.6",
- "fabric-shim-api": "2.5.6",
- "fast-safe-stringify": "^2.1.1",
- "long": "^5.2.3",
- "reflect-metadata": "^0.1.13",
- "winston": "^3.7.2",
- "yargs": "^17.4.0",
- "yargs-parser": "^21.0.1"
- },
- "bin": {
- "fabric-chaincode-node": "cli.js"
- },
- "engines": {
- "node": ">=18"
- }
- },
- "node_modules/fabric-shim-api": {
- "version": "2.5.6",
- "resolved": "https://registry.npmjs.org/fabric-shim-api/-/fabric-shim-api-2.5.6.tgz",
- "integrity": "sha512-1L0nO7CJ31/gEOWKWHEeCqgB5HkqPVfRbpcS7L9eTscT7tffjg2OkZISvC+a7RiqihL0iyrXNBgBg5MwlSSN9g==",
- "engines": {
- "eslint": "^6.6.0",
- "node": ">=18"
- }
- },
- "node_modules/fabric-shim/node_modules/@types/node": {
- "version": "16.18.98",
- "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.98.tgz",
- "integrity": "sha512-fpiC20NvLpTLAzo3oVBKIqBGR6Fx/8oAK/SSf7G+fydnXMY1x4x9RZ6sBXhqKlCU21g2QapUsbLlhv3+a7wS+Q=="
- },
- "node_modules/fast-deep-equal": {
- "version": "3.1.3",
- "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
- "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q=="
- },
- "node_modules/fast-glob": {
- "version": "3.3.2",
- "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz",
- "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==",
- "dev": true,
- "dependencies": {
- "@nodelib/fs.stat": "^2.0.2",
- "@nodelib/fs.walk": "^1.2.3",
- "glob-parent": "^5.1.2",
- "merge2": "^1.3.0",
- "micromatch": "^4.0.4"
- },
- "engines": {
- "node": ">=8.6.0"
- }
- },
- "node_modules/fast-glob/node_modules/glob-parent": {
- "version": "5.1.2",
- "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz",
- "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==",
- "dev": true,
- "dependencies": {
- "is-glob": "^4.0.1"
- },
- "engines": {
- "node": ">= 6"
- }
- },
- "node_modules/fast-json-stable-stringify": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz",
- "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw=="
- },
- "node_modules/fast-levenshtein": {
- "version": "2.0.6",
- "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz",
- "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==",
- "dev": true
- },
- "node_modules/fast-safe-stringify": {
- "version": "2.1.1",
- "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz",
- "integrity": "sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA=="
- },
- "node_modules/fastq": {
- "version": "1.17.1",
- "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz",
- "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==",
- "dev": true,
- "dependencies": {
- "reusify": "^1.0.4"
- }
- },
- "node_modules/fecha": {
- "version": "4.2.3",
- "resolved": "https://registry.npmjs.org/fecha/-/fecha-4.2.3.tgz",
- "integrity": "sha512-OP2IUU6HeYKJi3i0z4A19kHMQoLVs4Hc+DPqqxI2h/DPZHTm/vjsfC6P0b4jCMy14XizLBqvndQ+UilD7707Jw=="
- },
- "node_modules/file-entry-cache": {
- "version": "6.0.1",
- "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz",
- "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==",
- "dev": true,
- "dependencies": {
- "flat-cache": "^3.0.4"
- },
- "engines": {
- "node": "^10.12.0 || >=12.0.0"
- }
- },
- "node_modules/fill-range": {
- "version": "7.1.1",
- "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz",
- "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==",
- "dev": true,
- "dependencies": {
- "to-regex-range": "^5.0.1"
- },
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/find-up": {
- "version": "5.0.0",
- "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz",
- "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==",
- "dev": true,
- "dependencies": {
- "locate-path": "^6.0.0",
- "path-exists": "^4.0.0"
- },
- "engines": {
- "node": ">=10"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/flat-cache": {
- "version": "3.2.0",
- "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz",
- "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==",
- "dev": true,
- "dependencies": {
- "flatted": "^3.2.9",
- "keyv": "^4.5.3",
- "rimraf": "^3.0.2"
- },
- "engines": {
- "node": "^10.12.0 || >=12.0.0"
- }
- },
- "node_modules/flatted": {
- "version": "3.3.1",
- "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.1.tgz",
- "integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==",
- "dev": true
- },
- "node_modules/fn.name": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/fn.name/-/fn.name-1.1.0.tgz",
- "integrity": "sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw=="
- },
- "node_modules/fs.realpath": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
- "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==",
- "dev": true
- },
- "node_modules/get-caller-file": {
- "version": "2.0.5",
- "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz",
- "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==",
- "engines": {
- "node": "6.* || 8.* || >= 10.*"
- }
- },
- "node_modules/get-params": {
- "version": "0.1.2",
- "resolved": "https://registry.npmjs.org/get-params/-/get-params-0.1.2.tgz",
- "integrity": "sha512-41eOxtlGgHQRbFyA8KTH+w+32Em3cRdfBud7j67ulzmIfmaHX9doq47s0fa4P5o9H64BZX9nrYI6sJvk46Op+Q=="
- },
- "node_modules/glob": {
- "version": "7.2.3",
- "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz",
- "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==",
- "deprecated": "Glob versions prior to v9 are no longer supported",
- "dev": true,
- "dependencies": {
- "fs.realpath": "^1.0.0",
- "inflight": "^1.0.4",
- "inherits": "2",
- "minimatch": "^3.1.1",
- "once": "^1.3.0",
- "path-is-absolute": "^1.0.0"
- },
- "engines": {
- "node": "*"
- },
- "funding": {
- "url": "https://github.com/sponsors/isaacs"
- }
- },
- "node_modules/glob-parent": {
- "version": "6.0.2",
- "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz",
- "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==",
- "dev": true,
- "dependencies": {
- "is-glob": "^4.0.3"
- },
- "engines": {
- "node": ">=10.13.0"
- }
- },
- "node_modules/globals": {
- "version": "13.24.0",
- "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz",
- "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==",
- "dev": true,
- "dependencies": {
- "type-fest": "^0.20.2"
- },
- "engines": {
- "node": ">=8"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/globby": {
- "version": "11.1.0",
- "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz",
- "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==",
- "dev": true,
- "dependencies": {
- "array-union": "^2.1.0",
- "dir-glob": "^3.0.1",
- "fast-glob": "^3.2.9",
- "ignore": "^5.2.0",
- "merge2": "^1.4.1",
- "slash": "^3.0.0"
- },
- "engines": {
- "node": ">=10"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/google-protobuf": {
- "version": "3.21.2",
- "resolved": "https://registry.npmjs.org/google-protobuf/-/google-protobuf-3.21.2.tgz",
- "integrity": "sha512-3MSOYFO5U9mPGikIYCzK0SaThypfGgS6bHqrUGXG3DPHCrb+txNqeEcns1W0lkGfk0rCyNXm7xB9rMxnCiZOoA=="
- },
- "node_modules/graphemer": {
- "version": "1.4.0",
- "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz",
- "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==",
- "dev": true
- },
- "node_modules/has-flag": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
- "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
- "dev": true,
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/ignore": {
- "version": "5.3.1",
- "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz",
- "integrity": "sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==",
- "dev": true,
- "engines": {
- "node": ">= 4"
- }
- },
- "node_modules/import-fresh": {
- "version": "3.3.0",
- "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz",
- "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==",
- "dev": true,
- "dependencies": {
- "parent-module": "^1.0.0",
- "resolve-from": "^4.0.0"
- },
- "engines": {
- "node": ">=6"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/imurmurhash": {
- "version": "0.1.4",
- "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz",
- "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==",
- "dev": true,
- "engines": {
- "node": ">=0.8.19"
- }
- },
- "node_modules/inflight": {
- "version": "1.0.6",
- "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
- "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==",
- "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.",
- "dev": true,
- "dependencies": {
- "once": "^1.3.0",
- "wrappy": "1"
- }
- },
- "node_modules/inherits": {
- "version": "2.0.4",
- "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
- "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
- },
- "node_modules/is-arrayish": {
- "version": "0.3.2",
- "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz",
- "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ=="
- },
- "node_modules/is-extglob": {
- "version": "2.1.1",
- "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
- "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==",
- "dev": true,
- "engines": {
- "node": ">=0.10.0"
- }
- },
- "node_modules/is-fullwidth-code-point": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
- "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/is-glob": {
- "version": "4.0.3",
- "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz",
- "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==",
- "dev": true,
- "dependencies": {
- "is-extglob": "^2.1.1"
- },
- "engines": {
- "node": ">=0.10.0"
- }
- },
- "node_modules/is-number": {
- "version": "7.0.0",
- "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
- "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
- "dev": true,
- "engines": {
- "node": ">=0.12.0"
- }
- },
- "node_modules/is-path-inside": {
- "version": "3.0.3",
- "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz",
- "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==",
- "dev": true,
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/is-plain-obj": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz",
- "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==",
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/is-stream": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz",
- "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==",
- "engines": {
- "node": ">=8"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/isexe": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
- "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==",
- "dev": true
- },
- "node_modules/js-yaml": {
- "version": "4.1.0",
- "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz",
- "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==",
- "dev": true,
- "dependencies": {
- "argparse": "^2.0.1"
- },
- "bin": {
- "js-yaml": "bin/js-yaml.js"
- }
- },
- "node_modules/json-buffer": {
- "version": "3.0.1",
- "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz",
- "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==",
- "dev": true
- },
- "node_modules/json-schema-traverse": {
- "version": "0.4.1",
- "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz",
- "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg=="
- },
- "node_modules/json-stable-stringify-without-jsonify": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz",
- "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==",
- "dev": true
- },
- "node_modules/json-stringify-deterministic": {
- "version": "1.0.12",
- "resolved": "https://registry.npmjs.org/json-stringify-deterministic/-/json-stringify-deterministic-1.0.12.tgz",
- "integrity": "sha512-q3PN0lbUdv0pmurkBNdJH3pfFvOTL/Zp0lquqpvcjfKzt6Y0j49EPHAmVHCAS4Ceq/Y+PejWTzyiVpoY71+D6g==",
- "engines": {
- "node": ">= 4"
- }
- },
- "node_modules/keyv": {
- "version": "4.5.4",
- "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz",
- "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==",
- "dev": true,
- "dependencies": {
- "json-buffer": "3.0.1"
- }
- },
- "node_modules/kind-of": {
- "version": "6.0.3",
- "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz",
- "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==",
- "engines": {
- "node": ">=0.10.0"
- }
- },
- "node_modules/kuler": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/kuler/-/kuler-2.0.0.tgz",
- "integrity": "sha512-Xq9nH7KlWZmXAtodXDDRE7vs6DU1gTU8zYDHDiWLSip45Egwq3plLHzPn27NgvzL2r1LMPC1vdqh98sQxtqj4A=="
- },
- "node_modules/levn": {
- "version": "0.4.1",
- "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz",
- "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==",
- "dev": true,
- "dependencies": {
- "prelude-ls": "^1.2.1",
- "type-check": "~0.4.0"
- },
- "engines": {
- "node": ">= 0.8.0"
- }
- },
- "node_modules/locate-path": {
- "version": "6.0.0",
- "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz",
- "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==",
- "dev": true,
- "dependencies": {
- "p-locate": "^5.0.0"
- },
- "engines": {
- "node": ">=10"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/lodash.camelcase": {
- "version": "4.3.0",
- "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz",
- "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA=="
- },
- "node_modules/lodash.merge": {
- "version": "4.6.2",
- "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz",
- "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==",
- "dev": true
- },
- "node_modules/logform": {
- "version": "2.6.0",
- "resolved": "https://registry.npmjs.org/logform/-/logform-2.6.0.tgz",
- "integrity": "sha512-1ulHeNPp6k/LD8H91o7VYFBng5i1BDE7HoKxVbZiGFidS1Rj65qcywLxX+pVfAPoQJEjRdvKcusKwOupHCVOVQ==",
- "dependencies": {
- "@colors/colors": "1.6.0",
- "@types/triple-beam": "^1.3.2",
- "fecha": "^4.2.0",
- "ms": "^2.1.1",
- "safe-stable-stringify": "^2.3.1",
- "triple-beam": "^1.3.0"
- },
- "engines": {
- "node": ">= 12.0.0"
- }
- },
- "node_modules/long": {
- "version": "5.2.3",
- "resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz",
- "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q=="
- },
- "node_modules/merge2": {
- "version": "1.4.1",
- "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz",
- "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==",
- "dev": true,
- "engines": {
- "node": ">= 8"
- }
- },
- "node_modules/micromatch": {
- "version": "4.0.7",
- "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.7.tgz",
- "integrity": "sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==",
- "dev": true,
- "dependencies": {
- "braces": "^3.0.3",
- "picomatch": "^2.3.1"
- },
- "engines": {
- "node": ">=8.6"
- }
- },
- "node_modules/minimatch": {
- "version": "3.1.2",
- "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
- "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
- "dev": true,
- "dependencies": {
- "brace-expansion": "^1.1.7"
- },
- "engines": {
- "node": "*"
- }
- },
- "node_modules/ms": {
- "version": "2.1.2",
- "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
- "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
- },
- "node_modules/natural-compare": {
- "version": "1.4.0",
- "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz",
- "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==",
- "dev": true
- },
- "node_modules/once": {
- "version": "1.4.0",
- "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
- "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==",
- "dev": true,
- "dependencies": {
- "wrappy": "1"
- }
- },
- "node_modules/one-time": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/one-time/-/one-time-1.0.0.tgz",
- "integrity": "sha512-5DXOiRKwuSEcQ/l0kGCF6Q3jcADFv5tSmRaJck/OqkVFcOzutB134KRSfF0xDrL39MNnqxbHBbUUcjZIhTgb2g==",
- "dependencies": {
- "fn.name": "1.x.x"
- }
- },
- "node_modules/optionator": {
- "version": "0.9.4",
- "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz",
- "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==",
- "dev": true,
- "dependencies": {
- "deep-is": "^0.1.3",
- "fast-levenshtein": "^2.0.6",
- "levn": "^0.4.1",
- "prelude-ls": "^1.2.1",
- "type-check": "^0.4.0",
- "word-wrap": "^1.2.5"
- },
- "engines": {
- "node": ">= 0.8.0"
- }
- },
- "node_modules/p-limit": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz",
- "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==",
- "dev": true,
- "dependencies": {
- "yocto-queue": "^0.1.0"
- },
- "engines": {
- "node": ">=10"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/p-locate": {
- "version": "5.0.0",
- "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz",
- "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==",
- "dev": true,
- "dependencies": {
- "p-limit": "^3.0.2"
- },
- "engines": {
- "node": ">=10"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/parent-module": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz",
- "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==",
- "dev": true,
- "dependencies": {
- "callsites": "^3.0.0"
- },
- "engines": {
- "node": ">=6"
- }
- },
- "node_modules/path-exists": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz",
- "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==",
- "dev": true,
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/path-is-absolute": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
- "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==",
- "dev": true,
- "engines": {
- "node": ">=0.10.0"
- }
- },
- "node_modules/path-key": {
- "version": "3.1.1",
- "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz",
- "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==",
- "dev": true,
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/path-type": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz",
- "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==",
- "dev": true,
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/picomatch": {
- "version": "2.3.1",
- "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz",
- "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==",
- "dev": true,
- "engines": {
- "node": ">=8.6"
- },
- "funding": {
- "url": "https://github.com/sponsors/jonschlinkert"
- }
- },
- "node_modules/prelude-ls": {
- "version": "1.2.1",
- "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz",
- "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==",
- "dev": true,
- "engines": {
- "node": ">= 0.8.0"
- }
- },
- "node_modules/protobufjs": {
- "version": "7.3.2",
- "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.3.2.tgz",
- "integrity": "sha512-RXyHaACeqXeqAKGLDl68rQKbmObRsTIn4TYVUUug1KfS47YWCo5MacGITEryugIgZqORCvJWEk4l449POg5Txg==",
- "hasInstallScript": true,
- "dependencies": {
- "@protobufjs/aspromise": "^1.1.2",
- "@protobufjs/base64": "^1.1.2",
- "@protobufjs/codegen": "^2.0.4",
- "@protobufjs/eventemitter": "^1.1.0",
- "@protobufjs/fetch": "^1.1.0",
- "@protobufjs/float": "^1.0.2",
- "@protobufjs/inquire": "^1.1.0",
- "@protobufjs/path": "^1.1.2",
- "@protobufjs/pool": "^1.1.0",
- "@protobufjs/utf8": "^1.1.0",
- "@types/node": ">=13.7.0",
- "long": "^5.0.0"
- },
- "engines": {
- "node": ">=12.0.0"
- }
- },
- "node_modules/punycode": {
- "version": "2.3.1",
- "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz",
- "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==",
- "engines": {
- "node": ">=6"
- }
- },
- "node_modules/queue-microtask": {
- "version": "1.2.3",
- "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz",
- "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==",
- "dev": true,
- "funding": [
- {
- "type": "github",
- "url": "https://github.com/sponsors/feross"
- },
- {
- "type": "patreon",
- "url": "https://www.patreon.com/feross"
- },
- {
- "type": "consulting",
- "url": "https://feross.org/support"
- }
- ]
- },
- "node_modules/readable-stream": {
- "version": "3.6.2",
- "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz",
- "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==",
- "dependencies": {
- "inherits": "^2.0.3",
- "string_decoder": "^1.1.1",
- "util-deprecate": "^1.0.1"
- },
- "engines": {
- "node": ">= 6"
- }
- },
- "node_modules/reflect-metadata": {
- "version": "0.1.14",
- "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.1.14.tgz",
- "integrity": "sha512-ZhYeb6nRaXCfhnndflDK8qI6ZQ/YcWZCISRAWICW9XYqMUwjZM9Z0DveWX/ABN01oxSHwVxKQmxeYZSsm0jh5A=="
- },
- "node_modules/require-directory": {
- "version": "2.1.1",
- "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz",
- "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==",
- "engines": {
- "node": ">=0.10.0"
- }
- },
- "node_modules/resolve-from": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz",
- "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==",
- "dev": true,
- "engines": {
- "node": ">=4"
- }
- },
- "node_modules/reusify": {
- "version": "1.0.4",
- "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz",
- "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==",
- "dev": true,
- "engines": {
- "iojs": ">=1.0.0",
- "node": ">=0.10.0"
- }
- },
- "node_modules/rimraf": {
- "version": "3.0.2",
- "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz",
- "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==",
- "deprecated": "Rimraf versions prior to v4 are no longer supported",
- "dev": true,
- "dependencies": {
- "glob": "^7.1.3"
- },
- "bin": {
- "rimraf": "bin.js"
- },
- "funding": {
- "url": "https://github.com/sponsors/isaacs"
- }
- },
- "node_modules/run-parallel": {
- "version": "1.2.0",
- "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz",
- "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==",
- "dev": true,
- "funding": [
- {
- "type": "github",
- "url": "https://github.com/sponsors/feross"
- },
- {
- "type": "patreon",
- "url": "https://www.patreon.com/feross"
- },
- {
- "type": "consulting",
- "url": "https://feross.org/support"
- }
- ],
- "dependencies": {
- "queue-microtask": "^1.2.2"
- }
- },
- "node_modules/safe-buffer": {
- "version": "5.2.1",
- "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
- "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
- "funding": [
- {
- "type": "github",
- "url": "https://github.com/sponsors/feross"
- },
- {
- "type": "patreon",
- "url": "https://www.patreon.com/feross"
- },
- {
- "type": "consulting",
- "url": "https://feross.org/support"
- }
- ]
- },
- "node_modules/safe-stable-stringify": {
- "version": "2.4.3",
- "resolved": "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-2.4.3.tgz",
- "integrity": "sha512-e2bDA2WJT0wxseVd4lsDP4+3ONX6HpMXQa1ZhFQ7SU+GjvORCmShbCMltrtIDfkYhVHrOcPtj+KhmDBdPdZD1g==",
- "engines": {
- "node": ">=10"
- }
- },
- "node_modules/semver": {
- "version": "7.6.2",
- "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz",
- "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==",
- "dev": true,
- "bin": {
- "semver": "bin/semver.js"
- },
- "engines": {
- "node": ">=10"
- }
- },
- "node_modules/shebang-command": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz",
- "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==",
- "dev": true,
- "dependencies": {
- "shebang-regex": "^3.0.0"
- },
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/shebang-regex": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz",
- "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==",
- "dev": true,
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/simple-swizzle": {
- "version": "0.2.2",
- "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz",
- "integrity": "sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==",
- "dependencies": {
- "is-arrayish": "^0.3.1"
- }
- },
- "node_modules/slash": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz",
- "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==",
- "dev": true,
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/sort-keys": {
- "version": "4.2.0",
- "resolved": "https://registry.npmjs.org/sort-keys/-/sort-keys-4.2.0.tgz",
- "integrity": "sha512-aUYIEU/UviqPgc8mHR6IW1EGxkAXpeRETYcrzg8cLAvUPZcpAlleSXHV2mY7G12GphSH6Gzv+4MMVSSkbdteHg==",
- "dependencies": {
- "is-plain-obj": "^2.0.0"
- },
- "engines": {
- "node": ">=8"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/sort-keys-recursive": {
- "version": "2.1.10",
- "resolved": "https://registry.npmjs.org/sort-keys-recursive/-/sort-keys-recursive-2.1.10.tgz",
- "integrity": "sha512-yRLJbEER/PjU7hSRwXvP+NyXiORufu8rbSbp+3wFRuJZXoi/AhuKczbjuipqn7Le0SsTXK4VUeri2+Ni6WS8Hg==",
- "dependencies": {
- "kind-of": "~6.0.2",
- "sort-keys": "~4.2.0"
- },
- "engines": {
- "node": ">=4"
- }
- },
- "node_modules/stack-trace": {
- "version": "0.0.10",
- "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz",
- "integrity": "sha512-KGzahc7puUKkzyMt+IqAep+TVNbKP+k2Lmwhub39m1AsTSkaDutx56aDCo+HLDzf/D26BIHTJWNiTG1KAJiQCg==",
- "engines": {
- "node": "*"
- }
- },
- "node_modules/string_decoder": {
- "version": "1.3.0",
- "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz",
- "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==",
- "dependencies": {
- "safe-buffer": "~5.2.0"
- }
- },
- "node_modules/string-width": {
- "version": "4.2.3",
- "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
- "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
- "dependencies": {
- "emoji-regex": "^8.0.0",
- "is-fullwidth-code-point": "^3.0.0",
- "strip-ansi": "^6.0.1"
- },
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/strip-ansi": {
- "version": "6.0.1",
- "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
- "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
- "dependencies": {
- "ansi-regex": "^5.0.1"
- },
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/strip-json-comments": {
- "version": "3.1.1",
- "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz",
- "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==",
- "dev": true,
- "engines": {
- "node": ">=8"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/supports-color": {
- "version": "7.2.0",
- "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
- "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
- "dev": true,
- "dependencies": {
- "has-flag": "^4.0.0"
- },
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/text-hex": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/text-hex/-/text-hex-1.0.0.tgz",
- "integrity": "sha512-uuVGNWzgJ4yhRaNSiubPY7OjISw4sw4E5Uv0wbjp+OzcbmVU/rsT8ujgcXJhn9ypzsgr5vlzpPqP+MBBKcGvbg=="
- },
- "node_modules/text-table": {
- "version": "0.2.0",
- "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz",
- "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==",
- "dev": true
- },
- "node_modules/to-regex-range": {
- "version": "5.0.1",
- "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
- "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
- "dev": true,
- "dependencies": {
- "is-number": "^7.0.0"
- },
- "engines": {
- "node": ">=8.0"
- }
- },
- "node_modules/triple-beam": {
- "version": "1.4.1",
- "resolved": "https://registry.npmjs.org/triple-beam/-/triple-beam-1.4.1.tgz",
- "integrity": "sha512-aZbgViZrg1QNcG+LULa7nhZpJTZSLm/mXnHXnbAbjmN5aSa0y7V+wvv6+4WaBtpISJzThKy+PIPxc1Nq1EJ9mg==",
- "engines": {
- "node": ">= 14.0.0"
- }
- },
- "node_modules/ts-api-utils": {
- "version": "1.3.0",
- "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.3.0.tgz",
- "integrity": "sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ==",
- "dev": true,
- "engines": {
- "node": ">=16"
- },
- "peerDependencies": {
- "typescript": ">=4.2.0"
- }
- },
- "node_modules/tweetnacl": {
- "version": "1.0.3",
- "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz",
- "integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw=="
- },
- "node_modules/type-check": {
- "version": "0.4.0",
- "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz",
- "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==",
- "dev": true,
- "dependencies": {
- "prelude-ls": "^1.2.1"
- },
- "engines": {
- "node": ">= 0.8.0"
- }
- },
- "node_modules/type-fest": {
- "version": "0.20.2",
- "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz",
- "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==",
- "dev": true,
- "engines": {
- "node": ">=10"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/typescript": {
- "version": "5.4.5",
- "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz",
- "integrity": "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==",
- "dev": true,
- "bin": {
- "tsc": "bin/tsc",
- "tsserver": "bin/tsserver"
- },
- "engines": {
- "node": ">=14.17"
- }
- },
- "node_modules/typescript-eslint": {
- "version": "7.13.0",
- "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-7.13.0.tgz",
- "integrity": "sha512-upO0AXxyBwJ4BbiC6CRgAJKtGYha2zw4m1g7TIVPSonwYEuf7vCicw3syjS1OxdDMTz96sZIXl3Jx3vWJLLKFw==",
- "dev": true,
- "dependencies": {
- "@typescript-eslint/eslint-plugin": "7.13.0",
- "@typescript-eslint/parser": "7.13.0",
- "@typescript-eslint/utils": "7.13.0"
- },
- "engines": {
- "node": "^18.18.0 || >=20.0.0"
- },
- "funding": {
- "type": "opencollective",
- "url": "https://opencollective.com/typescript-eslint"
- },
- "peerDependencies": {
- "eslint": "^8.56.0"
- },
- "peerDependenciesMeta": {
- "typescript": {
- "optional": true
- }
- }
- },
- "node_modules/undici-types": {
- "version": "5.26.5",
- "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz",
- "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA=="
- },
- "node_modules/uri-js": {
- "version": "4.4.1",
- "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz",
- "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==",
- "dependencies": {
- "punycode": "^2.1.0"
- }
- },
- "node_modules/util-deprecate": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
- "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw=="
- },
- "node_modules/which": {
- "version": "2.0.2",
- "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
- "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
- "dev": true,
- "dependencies": {
- "isexe": "^2.0.0"
- },
- "bin": {
- "node-which": "bin/node-which"
- },
- "engines": {
- "node": ">= 8"
- }
- },
- "node_modules/winston": {
- "version": "3.13.0",
- "resolved": "https://registry.npmjs.org/winston/-/winston-3.13.0.tgz",
- "integrity": "sha512-rwidmA1w3SE4j0E5MuIufFhyJPBDG7Nu71RkZor1p2+qHvJSZ9GYDA81AyleQcZbh/+V6HjeBdfnTZJm9rSeQQ==",
- "dependencies": {
- "@colors/colors": "^1.6.0",
- "@dabh/diagnostics": "^2.0.2",
- "async": "^3.2.3",
- "is-stream": "^2.0.0",
- "logform": "^2.4.0",
- "one-time": "^1.0.0",
- "readable-stream": "^3.4.0",
- "safe-stable-stringify": "^2.3.1",
- "stack-trace": "0.0.x",
- "triple-beam": "^1.3.0",
- "winston-transport": "^4.7.0"
- },
- "engines": {
- "node": ">= 12.0.0"
- }
- },
- "node_modules/winston-transport": {
- "version": "4.7.0",
- "resolved": "https://registry.npmjs.org/winston-transport/-/winston-transport-4.7.0.tgz",
- "integrity": "sha512-ajBj65K5I7denzer2IYW6+2bNIVqLGDHqDw3Ow8Ohh+vdW+rv4MZ6eiDvHoKhfJFZ2auyN8byXieDDJ96ViONg==",
- "dependencies": {
- "logform": "^2.3.2",
- "readable-stream": "^3.6.0",
- "triple-beam": "^1.3.0"
- },
- "engines": {
- "node": ">= 12.0.0"
- }
- },
- "node_modules/word-wrap": {
- "version": "1.2.5",
- "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz",
- "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==",
- "dev": true,
- "engines": {
- "node": ">=0.10.0"
- }
- },
- "node_modules/wrap-ansi": {
- "version": "7.0.0",
- "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
- "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==",
- "dependencies": {
- "ansi-styles": "^4.0.0",
- "string-width": "^4.1.0",
- "strip-ansi": "^6.0.0"
- },
- "engines": {
- "node": ">=10"
- },
- "funding": {
- "url": "https://github.com/chalk/wrap-ansi?sponsor=1"
- }
- },
- "node_modules/wrappy": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
- "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==",
- "dev": true
- },
- "node_modules/y18n": {
- "version": "5.0.8",
- "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz",
- "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==",
- "engines": {
- "node": ">=10"
- }
- },
- "node_modules/yargs": {
- "version": "17.7.2",
- "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz",
- "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==",
- "dependencies": {
- "cliui": "^8.0.1",
- "escalade": "^3.1.1",
- "get-caller-file": "^2.0.5",
- "require-directory": "^2.1.1",
- "string-width": "^4.2.3",
- "y18n": "^5.0.5",
- "yargs-parser": "^21.1.1"
- },
- "engines": {
- "node": ">=12"
- }
- },
- "node_modules/yargs-parser": {
- "version": "21.1.1",
- "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz",
- "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==",
- "engines": {
- "node": ">=12"
- }
- },
- "node_modules/yocto-queue": {
- "version": "0.1.0",
- "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz",
- "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==",
- "dev": true,
- "engines": {
- "node": ">=10"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- }
- }
-}
diff --git a/asset-transfer-private-data/chaincode-typescript/package.json b/asset-transfer-private-data/chaincode-typescript/package.json
deleted file mode 100755
index 204a1e84..00000000
--- a/asset-transfer-private-data/chaincode-typescript/package.json
+++ /dev/null
@@ -1,41 +0,0 @@
-{
- "name": "asset-transfer-private-data",
- "version": "1.0.0",
- "description": "Asset Transfer(Private Data Tutorial) contract implemented in TypeScript.",
- "main": "dist/index.js",
- "typings": "dist/index.d.ts",
- "engines": {
- "node": ">=18"
- },
- "scripts": {
- "lint": "eslint src",
- "pretest": "npm run lint",
- "test": "",
- "start": "set -x && fabric-chaincode-node start",
- "build": "tsc",
- "build:watch": "tsc -w",
- "prepublishOnly": "npm run build",
- "docker": "docker build -f ./Dockerfile -t asset-transfer-private-data .",
- "package": "npm run build && npm shrinkwrap",
- "start:server-nontls": "set -x && fabric-chaincode-node server --chaincode-address=$CHAINCODE_SERVER_ADDRESS --chaincode-id=$CHAINCODE_ID",
- "start:server-debug": "set -x && NODE_OPTIONS='--inspect=0.0.0.0:9229' fabric-chaincode-node server --chaincode-address=$CHAINCODE_SERVER_ADDRESS --chaincode-id=$CHAINCODE_ID",
- "start:server": "set -x && fabric-chaincode-node server --chaincode-address=$CHAINCODE_SERVER_ADDRESS --chaincode-id=$CHAINCODE_ID --chaincode-tls-key-file=/hyperledger/privatekey.pem --chaincode-tls-client-cacert-file=/hyperledger/rootcert.pem --chaincode-tls-cert-file=/hyperledger/cert.pem"
- },
- "engineStrict": true,
- "author": "Hyperledger",
- "license": "Apache-2.0",
- "dependencies": {
- "fabric-contract-api": "~2.5",
- "fabric-shim": "~2.5",
- "json-stringify-deterministic": "^1.0.0",
- "sort-keys-recursive": "^2.1.0"
- },
- "devDependencies": {
- "@types/node": "^18.19.33",
- "@eslint/js": "^9.3.0",
- "@tsconfig/node18": "^18.2.4",
- "eslint": "^8.57.0",
- "typescript": "~5.4.5",
- "typescript-eslint": "^7.11.0"
- }
-}
diff --git a/asset-transfer-private-data/chaincode-typescript/src/asset.ts b/asset-transfer-private-data/chaincode-typescript/src/asset.ts
deleted file mode 100644
index 02c1347d..00000000
--- a/asset-transfer-private-data/chaincode-typescript/src/asset.ts
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- SPDX-License-Identifier: Apache-2.0
-*/
-
-import { Object, Property } from "fabric-contract-api";
-import { nonEmptyString, positiveNumber } from "./utils";
-
-@Object()
-// Asset describes main asset details that are visible to all organizations
-export class Asset {
- @Property()
- docType?: string;
-
- @Property()
- ID: string = "";
-
- @Property()
- Color: string = "";
-
- @Property()
- Size: number = 0;
-
- @Property()
- Owner: string = "";
-
- static fromBytes(bytes: Uint8Array): Asset {
- if (bytes.length === 0) {
- throw new Error("no asset data");
- }
- const json = Buffer.from(bytes).toString();
- const properties = JSON.parse(json) as Partial;
-
- const result = new Asset();
- result.docType = properties.docType;
- result.ID = nonEmptyString(properties.ID, "ID field must be a non-empty string");
- result.Color = nonEmptyString(properties.Color, "Color field must be a non-empty string");
- result.Size = positiveNumber(properties.Size, "Size field must be a positive integer");
- result.Owner = nonEmptyString(properties.Owner, "appraiseOwner field must be a non-empty string");
-
- return result;
- }
-}
diff --git a/asset-transfer-private-data/chaincode-typescript/src/assetTransfer.ts b/asset-transfer-private-data/chaincode-typescript/src/assetTransfer.ts
deleted file mode 100644
index fab116bd..00000000
--- a/asset-transfer-private-data/chaincode-typescript/src/assetTransfer.ts
+++ /dev/null
@@ -1,374 +0,0 @@
-/*
- * SPDX-License-Identifier: Apache-2.0
- */
-import { Context, Contract, Info, Transaction } from 'fabric-contract-api';
-import stringify from 'json-stringify-deterministic';
-import sortKeysRecursive from 'sort-keys-recursive';
-import { Asset } from './asset';
-import { AssetPrivateDetails } from './assetTransferDetails';
-import { TransientAssetDelete, TransientAssetOwner, TransientAssetProperties, TransientAssetPurge, TransientAssetValue } from './assetTransferTransientInput';
-import { TransferAgreement } from './transferAgreement';
-
-const assetCollection = 'assetCollection';
-const transferAgreementObjectType = 'transferAgreement';
-
-@Info({ title: 'AssetTransfer', description: 'Smart contract for trading assets' })
-export class AssetTransfer extends Contract {
-
- // CreateAsset issues a new asset to the world state with given details.
- @Transaction()
- public async CreateAsset(ctx: Context): Promise {
- const transientMap = ctx.stub.getTransient();
- const assetProperties = new TransientAssetProperties(transientMap);
-
- // Check if asset already exists
- const assetAsBytes = await ctx.stub.getPrivateData(assetCollection, assetProperties.assetID);
- if (assetAsBytes.length !== 0) {
- throw new Error('this asset already exists: ' + assetProperties.assetID);
- }
-
- // Get ID of submitting client identity
- const clientID = ctx.clientIdentity.getID();
-
- // Verify that the client is submitting request to peer in their organization
- // This is to ensure that a client from another org doesn't attempt to read or
- // write private data from this peer.
- this.verifyClientOrgMatchesPeerOrg(ctx);
-
- const asset: Asset = {
- ID: assetProperties.assetID,
- Color: assetProperties.color,
- Size: assetProperties.size,
- Owner: clientID,
- };
-
- // Save asset to private data collection
- // Typical logger, logs to stdout/file in the fabric managed docker container, running this chaincode
- // Look for container name like dev-peer0.org1.example.com-{chaincodename_version}-xyz
- await ctx.stub.putPrivateData(assetCollection, asset.ID, Buffer.from(stringify(sortKeysRecursive(asset))));
-
- // Save asset details to collection visible to owning organization
- const assetPrivateDetails: AssetPrivateDetails = {
- ID: assetProperties.assetID,
- AppraisedValue: assetProperties.appraisedValue,
- };
- // Get collection name for this organization.
- const orgCollection = this.getCollectionName(ctx);
- // Put asset appraised value into owners org specific private data collection
- console.log('Put: collection %v, ID %v', orgCollection, assetProperties.assetID);
- await ctx.stub.putPrivateData(orgCollection, asset.ID, Buffer.from(stringify(sortKeysRecursive(assetPrivateDetails))));
- }
-
- // AgreeToTransfer is used by the potential buyer of the asset to agree to the
- // asset value. The agreed to appraisal value is stored in the buying orgs
- // org specifc collection, while the buyer client ID is stored in the asset collection
- // using a composite key
- @Transaction()
- public async AgreeToTransfer(ctx: Context): Promise {
- // Get ID of submitting client identity
- const clientID = ctx.clientIdentity.getID();
- // Value is private, therefore it gets passed in transient field
- const transientMap = ctx.stub.getTransient();
- const assetValue = new TransientAssetValue(transientMap);
-
- const valueJSON: AssetPrivateDetails = {
- ID: assetValue.assetID,
- AppraisedValue: assetValue.appraisedValue,
- };
- // Read asset from the private data collection
- const asset = await this.ReadAsset(ctx, valueJSON.ID);
- // Verify that the client is submitting request to peer in their organization
- this.verifyClientOrgMatchesPeerOrg(ctx);
-
- // Get collection name for this organization. Needs to be read by a member of the organization.
- const orgCollection = this.getCollectionName(ctx);
- console.log(`AgreeToTransfer Put: collection ${orgCollection}, ID ${valueJSON.ID}`);
- // Put agreed value in the org specifc private data collection
- await ctx.stub.putPrivateData(orgCollection, asset.ID, Buffer.from(stringify(sortKeysRecursive(valueJSON))));
- // Create agreeement that indicates which identity has agreed to purchase
- // In a more realistic transfer scenario, a transfer agreement would be secured to ensure that it cannot
- // be overwritten by another channel member
- const transferAgreeKey = ctx.stub.createCompositeKey(transferAgreementObjectType, [valueJSON.ID]);
- console.log(`AgreeToTransfer Put: collection ${assetCollection}, ID ${valueJSON.ID}, Key ${transferAgreeKey}`);
- await ctx.stub.putPrivateData(assetCollection, transferAgreeKey, new Uint8Array(Buffer.from(clientID)));
- }
-
- @Transaction()
- // TransferAsset transfers the asset to the new owner by setting a new owner ID
- public async TransferAsset(ctx: Context): Promise {
- // Asset properties are private, therefore they get passed in transient field
- const transientMap = ctx.stub.getTransient();
- const assetOwner = new TransientAssetOwner(transientMap);
-
- console.log('TransferAsset: verify asset exists ID ' + assetOwner.assetID);
- // Read asset from the private data collection
- const asset = await this.ReadAsset(ctx, assetOwner.assetID);
- // Verify that the client is submitting request to peer in their organization
- this.verifyClientOrgMatchesPeerOrg(ctx);
- // Verify transfer details and transfer owner
- await this.verifyAgreement(ctx, assetOwner.assetID, asset.Owner, assetOwner.buyerMSP);
-
- const transferAgreement = await this.ReadTransferAgreement(ctx, assetOwner.assetID);
- if (transferAgreement.BuyerID === '') {
- throw new Error('BuyerID not found in TransferAgreement for ' + assetOwner.assetID);
- }
- // Transfer asset in private data collection to new owner
- asset.Owner = transferAgreement.BuyerID;
- console.log(`TransferAsset Put: collection ${assetCollection}, ID ${assetOwner.assetID}`);
- await ctx.stub.putPrivateData(assetCollection, assetOwner.assetID, Buffer.from(stringify(sortKeysRecursive(asset)))); // rewrite the asset
-
- // Get collection name for this organization
- const ownersCollection = this.getCollectionName(ctx);
- // Delete the asset appraised value from this organization's private data collection
- await ctx.stub.deletePrivateData(ownersCollection, assetOwner.assetID);
- // Delete the transfer agreement from the asset collection
- const transferAgreeKey = ctx.stub.createCompositeKey(transferAgreementObjectType, [assetOwner.assetID]);
- await ctx.stub.deletePrivateData(assetCollection, transferAgreeKey);
- }
-
- @Transaction()
- // DeleteAsset can be used by the owner of the asset to delete the asset
- public async DeleteAsset(ctx: Context): Promise {
- // Value is private, therefore it gets passed in transient field
- const transientMap = ctx.stub.getTransient();
- const assetDelete = new TransientAssetDelete(transientMap);
-
- // Verify that the client is submitting request to peer in their organization
- this.verifyClientOrgMatchesPeerOrg(ctx);
-
- console.log('Deleting Asset: ' + assetDelete.assetID);
- // get the asset from chaincode state
- const valAsbytes = await ctx.stub.getPrivateData(assetCollection, assetDelete.assetID);
- if (valAsbytes.length === 0) {
- throw new Error('asset not found: ' + assetDelete.assetID);
- }
- const ownerCollection = this.getCollectionName(ctx);
- // Check the asset is in the caller org's private collection
- const valAsbytesPrivate = await ctx.stub.getPrivateData(ownerCollection, assetDelete.assetID);
- if (valAsbytesPrivate.length === 0) {
- throw new Error(`asset not found in owner's private Collection: ${ownerCollection} : ${assetDelete.assetID}`);
- }
- // delete the asset from state
- await ctx.stub.deletePrivateData(assetCollection, assetDelete.assetID);
- // Finally, delete private details of asset
- await ctx.stub.deletePrivateData(ownerCollection, assetDelete.assetID);
- }
-
- @Transaction()
- // PurgeAsset can be used by the owner of the asset to delete the asset
- // Trigger removal of the asset
- public async PurgeAsset(ctx: Context): Promise {
- // Value is private, therefore it gets passed in transient field
- const transientMap = ctx.stub.getTransient();
- const assetPurge = new TransientAssetPurge(transientMap);
-
- // Verify that the client is submitting request to peer in their organization
- this.verifyClientOrgMatchesPeerOrg(ctx);
-
- console.log('Purging Asset: ' + assetPurge.assetID);
- // Note that there is no check here to see if the id exist; it might have been 'deleted' already
- // so a check here is pointless. We would need to call purge irrespective of the result
- // A delete can be called before purge, but is not essential
- const ownerCollection = this.getCollectionName(ctx);
- // delete the asset from state
- await ctx.stub.purgePrivateData(assetCollection, assetPurge.assetID);
- // Finally, delete private details of asset
- await ctx.stub.purgePrivateData(ownerCollection, assetPurge.assetID);
- }
-
- @Transaction()
- // DeleteTranferAgreement can be used by the buyer to withdraw a proposal from
- // the asset collection and from his own collection.
- public async DeleteTransferAgreement(ctx: Context): Promise {
- // Value is private, therefore it gets passed in transient field
- const transientMap = ctx.stub.getTransient();
- const agreementDelete = new TransientAssetDelete(transientMap);
-
- // Verify that the client is submitting request to peer in their organization
- this.verifyClientOrgMatchesPeerOrg(ctx);
-
- // Delete private details of agreement
- // Get proposers collection.
- const orgCollection = this.getCollectionName(ctx);
- // Delete the transfer agreement from the asset collection
- const transferAgreeKey = ctx.stub.createCompositeKey(transferAgreementObjectType, [agreementDelete.assetID]);
- // get the transfer_agreement
- const valAsbytes = await ctx.stub.getPrivateData(assetCollection, transferAgreeKey);
-
- if (valAsbytes.length === 0) {
- throw new Error(`asset's transfer_agreement does not exist: ${agreementDelete.assetID}`);
- }
- // Delete the asset
- await ctx.stub.deletePrivateData(orgCollection, agreementDelete.assetID);
- // Delete transfer agreement record, remove agreement from state
- await ctx.stub.deletePrivateData(assetCollection, transferAgreeKey);
- }
-
- /*
- GETTERS
- */
-
- // ReadAsset reads the information from collection
- @Transaction()
- public async ReadAsset(ctx: Context, id: string): Promise {
- // Check if asset already exists
- const assetAsBytes = await ctx.stub.getPrivateData(assetCollection, id);
- // No Asset found, return empty response
- if (assetAsBytes.length === 0) {
- throw new Error(id + ' does not exist in collection ' + assetCollection);
- }
- return Asset.fromBytes(assetAsBytes);
- }
-
- // ReadAssetPrivateDetails reads the asset private details in organization specific collection
- @Transaction()
- public async ReadAssetPrivateDetails(ctx: Context, collection: string, id: string): Promise {
- // Check if asset already exists
- const detailBytes = await ctx.stub.getPrivateData(collection, id);
- // No Asset found, return empty response
- if (detailBytes.length === 0) {
- throw new Error(id + ' does not exist in collection ' + collection);
- }
- return AssetPrivateDetails.fromBytes(detailBytes);
- }
-
- // ReadTransferAgreement gets the buyer's identity from the transfer agreement from collection
- @Transaction()
- public async ReadTransferAgreement(ctx: Context, assetID: string): Promise {
- // composite key for TransferAgreement of this asset
- const transferAgreeKey = ctx.stub.createCompositeKey(transferAgreementObjectType, [assetID]);
- // Get the identity from collection
- const buyerIdentity = await ctx.stub.getPrivateData(assetCollection, transferAgreeKey);
-
- if (buyerIdentity.length === 0) {
- throw new Error(`TransferAgreement for ${assetID} does not exist `);
- }
-
- return {
- ID: assetID,
- BuyerID: String(buyerIdentity),
- };
- }
-
- // GetAssetByRange performs a range query based on the start and end keys provided. Range
- // queries can be used to read data from private data collections, but can not be used in
- // a transaction that also writes to private data.
- @Transaction()
- public async GetAssetByRange(ctx: Context, startKey: string, endKey: string): Promise {
- const resultsIterator = ctx.stub.getPrivateDataByRange(assetCollection, startKey, endKey);
- const results: Asset[] = [];
- for await (const res of resultsIterator) {
- const asset = Asset.fromBytes(res.value);
- results.push(asset);
- }
- return results;
- }
- /*
- HELPERS
- */
- // verifyAgreement is an internal helper function used by TransferAsset to verify
- // that the transfer is being initiated by the owner and that the buyer has agreed
- // to the same appraisal value as the owner
- public async verifyAgreement(ctx: Context, assetID: string, owner: string, buyerMSP: string): Promise {
- // Check 1: verify that the transfer is being initiatied by the owner
- // Get ID of submitting client identity
- const clientID = ctx.clientIdentity.getID();
- if (clientID !== owner) {
- throw new Error(`error: submitting client(${clientID}) identity does not own asset ${assetID}.Owner is ${owner}`);
- }
- // Check 2: verify that the buyer has agreed to the appraised value
- // Get collection names
- const collectionOwner = this.getCollectionName(ctx); // get owner collection from caller identity
-
- const collectionBuyer = buyerMSP + 'PrivateCollection'; // get buyers collection
- // Get hash of owners agreed to value
- const ownerAppraisedValueHash = await ctx.stub.getPrivateDataHash(collectionOwner, assetID);
-
- if (ownerAppraisedValueHash.length === 0) {
- throw new Error(`hash of appraised value for ${assetID} does not exist in collection ${collectionOwner}`);
- }
- // Get hash of buyers agreed to value
- const buyerAppraisedValueHash = await ctx.stub.getPrivateDataHash(collectionBuyer, assetID);
- if (buyerAppraisedValueHash.length === 0) {
- throw new Error(`hash of appraised value for ${assetID} does not exist in collection ${collectionBuyer}. AgreeToTransfer must be called by the buyer first`);
- }
- // Verify that the two hashes match
- if (ownerAppraisedValueHash.toString() !== buyerAppraisedValueHash.toString()) {
- throw new Error(`hash for appraised value for owner ${Buffer.from(ownerAppraisedValueHash).toString('hex')} does not match value for seller ${Buffer.from(buyerAppraisedValueHash).toString('hex')}`);
- }
- }
- // getCollectionName is an internal helper function to get collection of submitting client identity.
- public getCollectionName(ctx: Context): string {
- // Get the MSP ID of submitting client identity
- const clientMSPID = ctx.clientIdentity.getMSPID();
- // Create the collection name
- const orgCollection = clientMSPID + 'PrivateCollection';
-
- return orgCollection;
- }
- // Get ID of submitting client identity
- public submittingClientIdentity(ctx: Context): string {
-
- const b64ID = ctx.clientIdentity.getID();
-
- // base64.StdEncoding.DecodeString(b64ID);
- const decodeID = Buffer.from(b64ID, 'base64').toString('binary');
-
- return String(decodeID);
- }
- // verifyClientOrgMatchesPeerOrg is an internal function used verify client org id and matches peer org id.
- public verifyClientOrgMatchesPeerOrg(ctx: Context): void {
-
- const clientMSPID = ctx.clientIdentity.getMSPID();
-
- const peerMSPID = ctx.stub.getMspID();
-
- if (clientMSPID !== peerMSPID) {
- throw new Error('client from org %v is not authorized to read or write private data from an org ' + clientMSPID + ' peer ' + peerMSPID);
- }
- }
- // =======Rich queries =========================================================================
- // Two examples of rich queries are provided below (parameterized query and ad hoc query).
- // Rich queries pass a query string to the state database.
- // Rich queries are only supported by state database implementations
- // that support rich query (e.g. CouchDB).
- // The query string is in the syntax of the underlying state database.
- // With rich queries there is no guarantee that the result set hasn't changed between
- // endorsement time and commit time, aka 'phantom reads'.
- // Therefore, rich queries should not be used in update transactions, unless the
- // application handles the possibility of result set changes between endorsement and commit time.
- // Rich queries can be used for point-in-time queries against a peer.
- // ============================================================================================
-
- // ===== Example: Parameterized rich query =================================================
-
- // QueryAssetByOwner queries for assets based on assetType, owner.
- // This is an example of a parameterized query where the query logic is baked into the chaincode,
- // and accepting a single query parameter (owner).
- // Only available on state databases that support rich query (e.g. CouchDB)
- // =========================================================================================
- public async QueryAssetByOwner(ctx: Context, assetType: string, owner: string): Promise {
-
- const queryString = `{'selector':{'objectType':'${assetType}','owner':'${owner}'}}`;
-
- return await this.getQueryResultForQueryString(ctx, queryString);
- }
-
- public QueryAssets(ctx: Context, queryString: string): Promise {
- return this.getQueryResultForQueryString(ctx, queryString);
- }
-
- public async getQueryResultForQueryString(ctx: Context, queryString: string): Promise {
-
- const resultsIterator = ctx.stub.getPrivateDataQueryResult(assetCollection, queryString);
-
- const results: Asset[] = [];
-
- for await (const res of resultsIterator) {
- const asset = Asset.fromBytes(res.value);
- results.push(asset);
- }
-
- return results;
- }
-}
diff --git a/asset-transfer-private-data/chaincode-typescript/src/assetTransferDetails.ts b/asset-transfer-private-data/chaincode-typescript/src/assetTransferDetails.ts
deleted file mode 100644
index 7a63e8c7..00000000
--- a/asset-transfer-private-data/chaincode-typescript/src/assetTransferDetails.ts
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- SPDX-License-Identifier: Apache-2.0
-*/
-
-import { Object, Property } from "fabric-contract-api";
-import { nonEmptyString, positiveNumber } from "./utils";
-
-@Object()
-// AssetPrivateDetails describes details that are private to owners
-export class AssetPrivateDetails {
- @Property()
- ID: string = "";
- @Property()
- AppraisedValue: number = 0;
-
- static fromBytes(bytes: Uint8Array): AssetPrivateDetails {
- if (bytes.length === 0) {
- throw new Error("no asset private details");
- }
- const json = Buffer.from(bytes).toString();
- const properties = JSON.parse(json) as Partial;
-
- const result = new AssetPrivateDetails();
- result.ID = nonEmptyString(properties.ID, "ID field must be a non-empty string");
- result.AppraisedValue = positiveNumber(
- properties.AppraisedValue,
- "AppraisedValue field must be a positive integer"
- );
-
- return result;
- }
-}
diff --git a/asset-transfer-private-data/chaincode-typescript/src/assetTransferTransientInput.ts b/asset-transfer-private-data/chaincode-typescript/src/assetTransferTransientInput.ts
deleted file mode 100644
index 66ed44d2..00000000
--- a/asset-transfer-private-data/chaincode-typescript/src/assetTransferTransientInput.ts
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- SPDX-License-Identifier: Apache-2.0
-*/
-
-import { nonEmptyString, positiveNumber } from "./utils";
-
-export class TransientAssetProperties {
- objectType: string;
- assetID: string;
- color: string;
- size: number;
- appraisedValue: number;
-
- constructor(transientMap: Map) {
- const transient = transientMap.get("asset_properties");
- if (!transient?.length) {
- throw new Error("no asset properties");
- }
- const json = Buffer.from(transient).toString();
- const properties = JSON.parse(json) as Partial;
-
- this.objectType = nonEmptyString(properties.objectType, "objectType field must be a non-empty string");
- this.assetID = nonEmptyString(properties.assetID, "assetID field must be a non-empty string");
- this.color = nonEmptyString(properties.color, "color field must be a non-empty string");
- this.size = positiveNumber(properties.size, "size field must be a positive integer");
- this.appraisedValue = positiveNumber(
- properties.appraisedValue,
- "appraisedValue field must be a positive integer"
- );
- }
-}
-
-export class TransientAssetValue {
- assetID: string;
- appraisedValue: number;
-
- constructor(transientMap: Map) {
- const transient = transientMap.get("asset_value");
- if (!transient?.length) {
- throw new Error("no asset value");
- }
- const json = Buffer.from(transient).toString();
- const properties = JSON.parse(json) as Partial;
-
- this.assetID = nonEmptyString(properties.assetID, "assetID field must be a non-empty string");
- this.appraisedValue = positiveNumber(
- properties.appraisedValue,
- "appraisedValue field must be a positive integer"
- );
- }
-}
-
-export class TransientAssetOwner {
- assetID: string;
- buyerMSP: string;
-
- constructor(transientMap: Map) {
- const transient = transientMap.get("asset_owner");
- if (!transient?.length) {
- throw new Error("no asset owner");
- }
- const json = Buffer.from(transient).toString();
- const properties = JSON.parse(json) as Partial;
-
- this.assetID = nonEmptyString(properties.assetID, "assetID field must be a non-empty string");
- this.buyerMSP = nonEmptyString(properties.buyerMSP, "buyerMSP field must be a non-empty string");
- }
-}
-
-export class TransientAssetDelete {
- assetID: string;
-
- constructor(transientMap: Map) {
- const transient = transientMap.get("asset_delete");
- if (!transient?.length) {
- throw new Error("no asset delete");
- }
- const json = Buffer.from(transient).toString();
- const properties = JSON.parse(json) as Partial;
-
- this.assetID = nonEmptyString(properties.assetID, "assetID field must be a non-empty string");
- }
-}
-
-export class TransientAssetPurge {
- assetID: string;
-
- constructor(transientMap: Map) {
- const transient = transientMap.get("asset_purge");
- if (!transient?.length) {
- throw new Error("no asset purge");
- }
-
- const json = Buffer.from(transient).toString();
- const properties = JSON.parse(json) as Partial;
-
- this.assetID = nonEmptyString(properties.assetID, "assetID field must be a non-empty string");
- }
-}
-
-export class TransientAgreementDelete {
- assetID: string;
-
- constructor(transientMap: Map) {
- const transient = transientMap.get("agreement_delete");
- if (!transient?.length) {
- throw new Error("no agreement delete");
- }
-
- const json = Buffer.from(transient).toString();
- const properties = JSON.parse(json) as Partial;
-
- this.assetID = nonEmptyString(properties.assetID, "assetID field must be a non-empty string");
- }
-}
diff --git a/asset-transfer-private-data/chaincode-typescript/src/index.ts b/asset-transfer-private-data/chaincode-typescript/src/index.ts
deleted file mode 100644
index d5c4cc01..00000000
--- a/asset-transfer-private-data/chaincode-typescript/src/index.ts
+++ /dev/null
@@ -1,10 +0,0 @@
-/*
- * SPDX-License-Identifier: Apache-2.0
- */
-
-import { type Contract } from 'fabric-contract-api';
-import {AssetTransfer} from './assetTransfer';
-
-export {AssetTransfer} from './assetTransfer';
-
-export const contracts: typeof Contract[] = [AssetTransfer];
diff --git a/asset-transfer-private-data/chaincode-typescript/src/transferAgreement.ts b/asset-transfer-private-data/chaincode-typescript/src/transferAgreement.ts
deleted file mode 100644
index fd780746..00000000
--- a/asset-transfer-private-data/chaincode-typescript/src/transferAgreement.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-/*
- SPDX-License-Identifier: Apache-2.0
-*/
-
-import { Object, Property } from "fabric-contract-api";
-
-@Object()
-// TransferAgreement describes the buyer agreement returned by ReadTransferAgreement
-export class TransferAgreement {
- @Property()
- ID: string = "";
- @Property()
- BuyerID: string = "";
-}
diff --git a/asset-transfer-private-data/chaincode-typescript/src/utils.ts b/asset-transfer-private-data/chaincode-typescript/src/utils.ts
deleted file mode 100644
index 1763f0a9..00000000
--- a/asset-transfer-private-data/chaincode-typescript/src/utils.ts
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- SPDX-License-Identifier: Apache-2.0
-*/
-
-export function nonEmptyString(arg: unknown, errorMessage: string): string {
- if (typeof arg !== "string" || arg.length === 0) {
- throw new Error(errorMessage);
- }
-
- return arg;
-}
-
-export function positiveNumber(arg: unknown, errorMessage: string): number {
- if (typeof arg !== "number" || arg < 1) {
- throw new Error(errorMessage);
- }
-
- return arg;
-}
diff --git a/asset-transfer-private-data/chaincode-typescript/tsconfig.json b/asset-transfer-private-data/chaincode-typescript/tsconfig.json
deleted file mode 100644
index 031d7de7..00000000
--- a/asset-transfer-private-data/chaincode-typescript/tsconfig.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "$schema": "https://json.schemastore.org/tsconfig",
- "extends": "@tsconfig/node18/tsconfig.json",
- "compilerOptions": {
- "experimentalDecorators": true,
- "emitDecoratorMetadata": true,
- "declaration": true,
- "declarationMap": true,
- "sourceMap": true,
- "outDir": "dist",
- "strict": true,
- "noUnusedLocals": true,
- "noImplicitReturns": true,
- "forceConsistentCasingInFileNames": true
- },
- "include": ["src/"]
-}
diff --git a/asset-transfer-sbe/README.md b/asset-transfer-sbe/README.md
deleted file mode 100644
index 87bb99aa..00000000
--- a/asset-transfer-sbe/README.md
+++ /dev/null
@@ -1,169 +0,0 @@
-# State-based endorsement asset transfer sample
-
-Transactions that are submitted to Hyperledger Fabric networks need to be endorsed
-by peers that are joined to a channel before the transaction can be added to the
-ledger. Fabric peers endorse transactions by executing a smart contract using the
-inputs of the transaction proposal. The peers then sign the input and output
-generated by the smart contract execution. The endorsement policy specifies the
-set of organizations whose peers need to endorse a transaction before it can be
-added to the ledger.
-
-Each chaincode that is deployed to a channel has an endorsement policy that governs
-the assets managed by the chaincode smart contracts. However, you can override the
-chaincode level endorsement policy to create an endorsement policy for a specific key,
-either on the public channel ledger or in a private collection.
-State-based endorsement policies, also known as key-level endorsement policies, allow
-channel members to use different endorsement policies for assets that are managed by
-the same smart contract. For more information about endorsement policies and
-state-based endorsement, visit the
-[Endorsement Policies](https://hyperledger-fabric.readthedocs.io/en/release-2.2/endorsement-policies.html)
-topic in the Fabric documentation.
-
-The implementation provided by State Based interface creates a policy which requires signatures from all the Org principals added, and hence is equivalent to an AND policy. For other advanced State Based policy implementations which are not supported by State Based interface directly like OR or NOutOf policies, please refer to method implementations setStateBasedEndorsementNOutOf(), which can be used as an alternative for setStateBasedEndorsement() inside asset-transfer-sbe smart contracts.
-
-## About the Sample
-
-The state-based endorsement (SBE) asset transfer sample demonstrates how to use
-key-level endorsement policies to ensure that an asset only is endorsed by an
-asset owner. In the course of the tutorial, you will use the smart contract
-to complete the following transfer scenario:
-
-- Deploy the SBE smart contract to a channel that was created using the Fabric
-test network. The channel will have two members, Org1 and Org2, that will
-participate in the asset transfer. Each organization operates one peer that
-is joined to the channel.
-- Create an asset using the chaincode endorsement policy. The chaincode level
-endorsement policy requires that a majority of organizations on the channel
-endorse a transaction. This means that a transaction that creates an asset
-needs to be endorsed by peers that belong to Org1 and Org2. When the asset is
-created, the smart contract creates a state-based endorsement policy that
-specifies that only the organization that owns that asset may endorse update
-transactions. Because the asset is owned by Org1, any future updates to the asset
-need to be endorsed by the Org1 peer.
-- Update the asset by only endorsing with Org1, this will use the state-based
-endorsement policy applied to the asset when it was created by the chaincode.
-- Transfer the asset to Org2. During the execution of the transfer transaction,
-the chaincode will create a new state-based endorsement policy that reflects
-the new asset owner for the asset.
-- Update the asset once more, this time with Org2 as the owner. Because the
-state-based endorsement policy has been updated, this transaction only needs
-to be endorsed by Org2.
-
-## Deploy the smart contract
-
-We are going to run the SBE smart contract using the Fabric test network. Open a command terminal and navigate to test network directory in your local clone of the `fabric-samples`. We will operate from the `test-network` directory for the remainder of the tutorial.
-```
-cd fabric-samples/test-network
-```
-
-Run the following command to deploy the test network and create a channel named `mychannel`:
-
-```
-./network.sh up createChannel
-```
-
-You can use the test network script to deploy the smart contract to the channel that was just created. The script uses the Fabric chaincode lifecycle to deploy the smart contract to the channel. We will use the default chaincode level endorsement policy used by the Fabric chaincode lifecycle, which requires an endorsement from a majority of channel members. In our case, this will require that both Org1 and Org2 endorse a transaction (2 of 2). Deploy the smart contract to `mychannel` using the following command:
-```
-./network.sh deployCC -ccn sbe -ccp ../asset-transfer-sbe/chaincode-typescript/ -ccl typescript
-```
-
-Set the following environment variables to interact with the network as a user from Org1:
-
-```
-export PATH=${PWD}/../bin:${PWD}:$PATH
-export FABRIC_CFG_PATH=$PWD/../config/
-export CORE_PEER_TLS_ENABLED=true
-export CORE_PEER_LOCALMSPID=Org1MSP
-export CORE_PEER_MSPCONFIGPATH=${PWD}/organizations/peerOrganizations/org1.example.com/users/User1@org1.example.com/msp
-export CORE_PEER_TLS_ROOTCERT_FILE=${PWD}/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt
-export CORE_PEER_ADDRESS=localhost:7051
-```
-
-## Run the transfer scenario
-
-We can now invoke the SBE smart contract to create a new asset:
-```
-peer chaincode invoke -o localhost:7050 --waitForEvent --ordererTLSHostnameOverride orderer.example.com --tls --cafile "${PWD}/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem" -C mychannel -n sbe --peerAddresses localhost:7051 --tlsRootCertFiles "${PWD}/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt" --peerAddresses localhost:9051 --tlsRootCertFiles "${PWD}/organizations/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt" -c '{"function":"CreateAsset","Args":["asset1","100","Org1User1"]}'
-```
-The create transaction needs to target both peers from Org1 and Org2 to meet the chaincode endorsement policy. The chaincode will read the MSP ID of the client user submitting the transaction and assign that organization as the asset owner. As a result, the asset will initially be owned by Org1.
-
-You can query the asset using with the following command:
-```
-peer chaincode query -C mychannel -n sbe -c '{"Args":["ReadAsset","asset1"]}'
-```
-The result is a new asset owned by Org1, identified using the Org1 MSP ID `Org1MSP`:
-`{"ID":"asset1","Value":100,"Owner":"Org1User1","OwnerOrg":"Org1MSP"}`
-
-In addition to creating the asset, the `CreateAsset` function also sets a state-based endorsement policy for the asset. Only a peer of the asset owner, can successfully endorse an asset update. To demonstrate the key-level endorsement policy, lets try to update the asset while targeting the Org2 peer:
-```
-peer chaincode invoke -o localhost:7050 --waitForEvent --ordererTLSHostnameOverride orderer.example.com --tls --cafile "${PWD}/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem" -C mychannel -n sbe --peerAddresses localhost:9051 --tlsRootCertFiles "${PWD}/organizations/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt" -c '{"function":"UpdateAsset","Args":["asset1","200"]}'
-```
-The result is an endorsement policy failure:
-```
-Error: transaction invalidated with status (ENDORSEMENT_POLICY_FAILURE) - proposal response:
-```
-
-If we attempt to update the asset with an endorsement from the Org1 peer, the update succeeds:
-```
-peer chaincode invoke -o localhost:7050 --waitForEvent --ordererTLSHostnameOverride orderer.example.com --tls --cafile "${PWD}/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem" -C mychannel -n sbe --peerAddresses localhost:7051 --tlsRootCertFiles "${PWD}/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt" -c '{"function":"UpdateAsset","Args":["asset1","200"]}'
-```
-You can query the asset one more time to verify that the update was successful:
-```
-peer chaincode query -C mychannel -n sbe -c '{"Args":["ReadAsset","asset1"]}'
-```
-
-The asset value is now 200:
-```
-{"ID":"asset1","Value":200,"Owner":"Org1User1","OwnerOrg":"Org1MSP"}
-```
-
-Now that we have tested the asset key-level endorsement policy, we can transfer the asset to Org2. Run the following command to transfer the asset from Org1 to Org2. This time the Org2 MSP ID is provided as a transaction input. The `TransferAsset` function will update the endorsement policy to specify that only a peer of the new owner can update the asset. Note that this command targets the Org1 peer.
-
-```
-peer chaincode invoke -o localhost:7050 --waitForEvent --ordererTLSHostnameOverride orderer.example.com --tls --cafile "${PWD}/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem" -C mychannel -n sbe --peerAddresses localhost:7051 --tlsRootCertFiles "${PWD}/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt" -c '{"function":"TransferAsset","Args":["asset1","Org2User1","Org2MSP"]}'
-```
-
-We can query the asset to see that the owner has been updated from Org1 to Org2:
-```
-peer chaincode query -C mychannel -n sbe -c '{"Args":["ReadAsset","asset1"]}'
-```
-
-The owning organization is now Org2:
-```
-{"ID":"asset1","Value":200,"Owner":"Org2User1","OwnerOrg":"Org2MSP"}
-```
-
-Org2 now needs to endorse any asset updates. Run the following command to try to update the asset with an endorsement from the Org1 peer:
-```
-peer chaincode invoke -o localhost:7050 --waitForEvent --ordererTLSHostnameOverride orderer.example.com --tls --cafile "${PWD}/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem" -C mychannel -n sbe --peerAddresses localhost:7051 --tlsRootCertFiles "${PWD}/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt" -c '{"function":"UpdateAsset","Args":["asset1","300"]}'
-```
-
-The response will be an endorsement policy failure:
-```
-Error: transaction invalidated with status (ENDORSEMENT_POLICY_FAILURE) - proposal response:
-```
-
-Now try to update the asset with an endorsement from the Org2 peer:
-```
-peer chaincode invoke -o localhost:7050 --waitForEvent --ordererTLSHostnameOverride orderer.example.com --tls --cafile "${PWD}/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem" -C mychannel -n sbe --peerAddresses localhost:9051 --tlsRootCertFiles "${PWD}/organizations/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt" -c '{"function":"UpdateAsset","Args":["asset1","300"]}'
-```
-
-You can query the asset again to verify that the transaction update succeeded:
-```
-peer chaincode query -C mychannel -n sbe -c '{"Args":["ReadAsset","asset1"]}'
-```
-
-The asset value is now 300:
-```
-{"ID":"asset1","Value":300,"Owner":"Org2User1","OwnerOrg":"Org2MSP"}
-```
-
-Note that the transaction to update the asset was submitted by a user from Org1, even though the asset was owned by Org2. The transfer enabled by the SBE smart contract is a simple scenario meant only to demonstrate the use of state-based endorsement policies. The smart contract can use access control to specify that an asset can only be updated by its owner. Private data collections can also be used to ensure that transfers need to be endorsed by the owner and recipient of the transfer, instead of just the asset owner. For a more realistic example of an asset transfer scenario, see the [Secured asset transfer in Fabric](https://hyperledger-fabric.readthedocs.io/en/master/secured_asset_transfer/secured_private_asset_transfer_tutorial.html) tutorial.
-
-## 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:
-
-```
-./network.sh down
-```
diff --git a/asset-transfer-sbe/application-javascript/.eslintignore b/asset-transfer-sbe/application-javascript/.eslintignore
deleted file mode 100644
index 15958470..00000000
--- a/asset-transfer-sbe/application-javascript/.eslintignore
+++ /dev/null
@@ -1,5 +0,0 @@
-#
-# SPDX-License-Identifier: Apache-2.0
-#
-
-coverage
diff --git a/asset-transfer-sbe/application-javascript/.eslintrc.js b/asset-transfer-sbe/application-javascript/.eslintrc.js
deleted file mode 100644
index 072edaf6..00000000
--- a/asset-transfer-sbe/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-sbe/application-javascript/.gitignore b/asset-transfer-sbe/application-javascript/.gitignore
deleted file mode 100644
index 21b287f7..00000000
--- a/asset-transfer-sbe/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-sbe/application-javascript/app.js b/asset-transfer-sbe/application-javascript/app.js
deleted file mode 100644
index 134f4443..00000000
--- a/asset-transfer-sbe/application-javascript/app.js
+++ /dev/null
@@ -1,356 +0,0 @@
-/*
- * Copyright IBM Corp. All Rights Reserved.
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-
-'use strict';
-
-/**
- * A test application to show state based endorsements operations with a running
- * asset-transfer-sbe chaincode with discovery.
- * -- 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 any of the asset-transfer-sbe chaincodes deployed on the channel "mychannel"
-// with the chaincode name of "sbe". 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 sbe -ccp ../asset-transfer-sbe/chaincode-typescript/ -ccl typescript
-// - Be sure that node.js is installed
-// ===> from directory /fabric-samples/asset-transfer-sbe/application-javascript
-// node -v
-// - npm installed code dependencies
-// ===> from directory /fabric-samples/asset-transfer-sbe/application-javascript
-// npm install
-// - to run this test application
-// ===> from directory /fabric-samples/asset-transfer-sbe/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.
-//
-
-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 = 'sbe';
-
-const org1 = 'Org1MSP';
-const org2 = 'Org2MSP';
-const Org1UserId = 'appUser1';
-const Org2UserId = 'appUser2';
-
-async function initGatewayForOrg1() {
- 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, 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('\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, 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);
- }
-}
-
-function checkAsset(org, assetKey, resultBuffer, value, ownerOrg) {
- let asset;
- if (resultBuffer) {
- asset = JSON.parse(resultBuffer.toString('utf8'));
- }
-
- if (asset && value) {
- if (asset.Value === value && asset.OwnerOrg === ownerOrg) {
- console.log(`*** Result from ${org} - asset ${asset.ID} has value of ${asset.Value} and owned by ${asset.OwnerOrg}`);
- } else {
- console.log(`*** Failed from ${org} - asset ${asset.ID} has value of ${asset.Value} and owned by ${asset.OwnerOrg}`);
- }
- } else if (!asset && value === 0 ) {
- console.log(`*** Success from ${org} - asset ${assetKey} does not exist`);
- } else {
- console.log('*** Failed - asset read failed');
- }
-}
-
-async function readAssetByBothOrgs(assetKey, value, ownerOrg, contractOrg1, contractOrg2) {
- if (value) {
- console.log(`\n--> Evaluate Transaction: ReadAsset, - ${assetKey} should have a value of ${value} and owned by ${ownerOrg}`);
- } else {
- console.log(`\n--> Evaluate Transaction: ReadAsset, - ${assetKey} should not exist`);
- }
- let resultBuffer;
- resultBuffer = await contractOrg1.evaluateTransaction('ReadAsset', assetKey);
- checkAsset('Org1', assetKey, resultBuffer, value, ownerOrg);
- resultBuffer = await contractOrg2.evaluateTransaction('ReadAsset', assetKey);
- checkAsset('Org2', assetKey, resultBuffer, value, 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() {
- try {
- // use a random key so that we can run multiple times
- const assetKey = `asset-${Math.floor(Math.random() * 100) + 1}`;
-
- /** ******* 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 will require that both organization endorse.
- // The endorsement will be handled by Discovery, since the gateway was connected with discovery enabled.
- console.log(`\n--> Submit Transaction: CreateAsset, ${assetKey} as Org1 - endorsed by Org1 and Org2`);
- await contractOrg1.submitTransaction('CreateAsset', assetKey, '100', 'Tom');
- console.log('*** Result: committed, now asset will only require Org1 to endorse');
- } catch (createError) {
- console.log(`*** Failed: create - ${createError}`);
- process.exit(1);
- }
-
- await readAssetByBothOrgs(assetKey, 100, org1, contractOrg1, contractOrg2);
-
- try {
- // Since the gateway is using discovery we should limit the organizations used by
- // discovery to endorse. This way we only have to know the organization and not
- // the actual peers that may be active at any given time.
- console.log(`\n--> Submit Transaction: UpdateAsset ${assetKey}, as Org1 - endorse by Org1`);
- transaction = contractOrg1.createTransaction('UpdateAsset');
- transaction.setEndorsingOrganizations(org1);
- await transaction.submit(assetKey, '200');
- console.log('*** Result: committed');
- } catch (updateError) {
- console.log(`*** Failed: update - ${updateError}`);
- process.exit(1);
- }
-
- await readAssetByBothOrgs(assetKey, 200, org1, contractOrg1, contractOrg2);
-
- try {
- // Submit a transaction to make an update to the asset that has a key-level endorsement policy
- // set to only allow Org1 to make updates. The following example will not use the "setEndorsingOrganizations"
- // to limit the organizations that will do the endorsement, this means that it will be sent to all
- // organizations in the chaincode endorsement policy. When Org1 endorses, the transaction will be committed
- // if Org2 endorses or not.
- console.log(`\n--> Submit Transaction: UpdateAsset ${assetKey}, as Org1 - endorse by Org1 and Org2`);
- transaction = contractOrg1.createTransaction('UpdateAsset');
- await transaction.submit(assetKey, '300');
- console.log('*** Result: committed - because Org1 and Org2 both endorsed, while only the Org1 endorsement was required and checked');
- } catch (updateError) {
- console.log(`*** Failed: update - ${updateError}`);
- process.exit(1);
- }
-
- await readAssetByBothOrgs(assetKey, 300, org1, contractOrg1, contractOrg2);
-
- try {
- // Again submit the change to both Organizations by not using "setEndorsingOrganizations". Since only
- // Org1 is required to approve, the transaction will be committed.
- console.log(`\n--> Submit Transaction: UpdateAsset ${assetKey}, as Org2 - endorse by Org1 and Org2`);
- transaction = contractOrg2.createTransaction('UpdateAsset');
- await transaction.submit(assetKey, '400');
- console.log('*** Result: committed - because Org1 was on the discovery list, Org2 did not endorse');
- } catch (updateError) {
- console.log(`*** Failed: update - ${updateError}`);
- process.exit(1);
- }
-
- await readAssetByBothOrgs(assetKey, 400, org1, contractOrg1, contractOrg2);
-
- try {
- // Try to update by sending only to Org2, since the state-based-endorsement says that
- // Org1 is the only organization allowed to update, the transaction will fail.
- console.log(`\n--> Submit Transaction: UpdateAsset ${assetKey}, as Org2 - endorse by Org2`);
- transaction = contractOrg2.createTransaction('UpdateAsset');
- transaction.setEndorsingOrganizations(org2);
- await transaction.submit(assetKey, '500');
- console.log('*** Failed: committed - this should have failed to endorse and commit');
- } catch (updateError) {
- console.log(`*** Successfully caught the error: \n ${updateError}`);
- }
-
- await readAssetByBothOrgs(assetKey, 400, org1, contractOrg1, contractOrg2);
-
- try {
- // Make a change to the state-based-endorsement policy making Org2 the owner.
- console.log(`\n--> Submit Transaction: TransferAsset ${assetKey}, as Org1 - endorse by Org1`);
- transaction = contractOrg1.createTransaction('TransferAsset');
- transaction.setEndorsingOrganizations(org1);
- await transaction.submit(assetKey, 'Henry', org2);
- console.log('*** Result: committed');
- } catch (transferError) {
- console.log(`*** Failed: transfer - ${transferError}`);
- process.exit(1);
- }
-
- await readAssetByBothOrgs(assetKey, 400, org2, contractOrg1, contractOrg2);
-
- try {
- // Make sure that Org2 can now make updates, notice how the transaction has limited the
- // endorsement to only Org2.
- console.log(`\n--> Submit Transaction: UpdateAsset ${assetKey}, as Org2 - endorse by Org2`);
- transaction = contractOrg2.createTransaction('UpdateAsset');
- transaction.setEndorsingOrganizations(org2);
- await transaction.submit(assetKey, '600');
- console.log('*** Result: committed');
- } catch (updateError) {
- console.log(`*** Failed: update - ${updateError}`);
- process.exit(1);
- }
-
- await readAssetByBothOrgs(assetKey, 600, org2, contractOrg1, contractOrg2);
-
- try {
- // With Org2 now the owner and the state-based-endorsement policy only allowing organization Org2
- // to make updates, a transaction only to Org1 will fail.
- console.log(`\n--> Submit Transaction: UpdateAsset ${assetKey}, as Org1 - endorse by Org1`);
- transaction = contractOrg1.createTransaction('UpdateAsset');
- transaction.setEndorsingOrganizations(org1);
- await transaction.submit(assetKey, '700');
- console.log('*** Failed: committed - this should have failed to endorse and commit');
- } catch (updateError) {
- console.log(`*** Successfully caught the error: \n ${updateError}`);
- }
-
- await readAssetByBothOrgs(assetKey, 600, org2, contractOrg1, contractOrg2);
-
- try {
- // With Org2 the owner and the state-based-endorsement policy only allowing organization Org2
- // to make updates, a transaction to delete by Org1 will fail.
- console.log(`\n--> Submit Transaction: DeleteAsset ${assetKey}, as Org1 - endorse by Org1`);
- transaction = contractOrg1.createTransaction('DeleteAsset');
- transaction.setEndorsingOrganizations(org1);
- await transaction.submit(assetKey);
- console.log('*** Failed: committed - this should have failed to endorse and commit');
- } catch (updateError) {
- console.log(`*** Successfully caught the error: \n ${updateError}`);
- }
-
- try {
- // With Org2 the owner and the state-based-endorsement policy only allowing organization Org2
- // to make updates, a transaction to delete by Org2 will succeed.
- console.log(`\n--> Submit Transaction: DeleteAsset ${assetKey}, as Org2 - endorse by Org2`);
- transaction = contractOrg2.createTransaction('DeleteAsset');
- transaction.setEndorsingOrganizations(org2);
- await transaction.submit(assetKey);
- console.log('*** Result: committed');
- } catch (deleteError) {
- console.log(`*** Failed: delete - ${deleteError}`);
- process.exit(1);
- }
-
- // The asset should now be deleted, both orgs should not be able to read it
- try {
- await readAssetByBothOrgs(assetKey, 0, org2, contractOrg1, contractOrg2);
- } catch (readDeleteError) {
- console.log(`*** Successfully caught the error: ${readDeleteError}`);
- }
-
- } 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
- gatewayOrg1.disconnect();
- gatewayOrg2.disconnect();
- }
- } catch (error) {
- console.error(`Error in setup: ${error}`);
- if (error.stack) {
- console.error(error.stack);
- }
- process.exit(1);
- }
-}
-
-main();
diff --git a/asset-transfer-sbe/application-javascript/package.json b/asset-transfer-sbe/application-javascript/package.json
deleted file mode 100644
index 09ed4f1d..00000000
--- a/asset-transfer-sbe/application-javascript/package.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "name": "asset-transfer-sbe",
- "version": "1.0.0",
- "description": "Asset transfer state based endorsement application implemented in JavaScript",
- "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-sbe/chaincode-java/.gitattributes b/asset-transfer-sbe/chaincode-java/.gitattributes
deleted file mode 100644
index 00a51aff..00000000
--- a/asset-transfer-sbe/chaincode-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-sbe/chaincode-java/.gitignore b/asset-transfer-sbe/chaincode-java/.gitignore
deleted file mode 100644
index ae1478ca..00000000
--- a/asset-transfer-sbe/chaincode-java/.gitignore
+++ /dev/null
@@ -1,10 +0,0 @@
-#
-# SPDX-License-Identifier: Apache-2.0
-#
-
-/.classpath
-/.gradle/
-/.project
-/.settings/
-/bin/
-/build/
diff --git a/asset-transfer-sbe/chaincode-java/build.gradle b/asset-transfer-sbe/chaincode-java/build.gradle
deleted file mode 100644
index a788dfc4..00000000
--- a/asset-transfer-sbe/chaincode-java/build.gradle
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * SPDX-License-Identifier: Apache-2.0
- */
-
-plugins {
- id 'com.gradleup.shadow' version '8.3.5'
- id 'application'
- id 'checkstyle'
- id 'jacoco'
-}
-
-group 'org.hyperledger.fabric.samples'
-version '1.0-SNAPSHOT'
-
-dependencies {
- implementation 'org.hyperledger.fabric-chaincode-java:fabric-chaincode-shim:2.5.+'
- implementation 'org.hyperledger.fabric:fabric-protos:0.3.3'
- implementation 'com.owlike:genson:1.6'
-}
-
-repositories {
- mavenCentral()
- maven {
- url 'https://jitpack.io'
- }
-}
-
-java {
- toolchain {
- languageVersion = JavaLanguageVersion.of(11)
- }
-}
-
-application {
- mainClass = 'org.hyperledger.fabric.contract.ContractRouter'
-}
-
-checkstyle {
- toolVersion '8.21'
- configFile file("config/checkstyle/checkstyle.xml")
-}
-
-checkstyleMain {
- source ='src/main/java'
-}
-
-checkstyleTest {
- source ='src/test/java'
-}
-
-jacocoTestReport {
- dependsOn test
-}
-
-jacocoTestCoverageVerification {
- violationRules {
- rule {
- limit {
- minimum = 0.9
- }
- }
- }
-
- finalizedBy jacocoTestReport
-}
-
-test {
- useJUnitPlatform()
- testLogging {
- events "passed", "skipped", "failed"
- }
-}
-
-shadowJar {
- archiveBaseName = 'chaincode'
- archiveVersion = ''
- archiveClassifier = ''
- mergeServiceFiles()
-
- manifest {
- attributes 'Main-Class': 'org.hyperledger.fabric.contract.ContractRouter'
- }
-}
-
-check.dependsOn jacocoTestCoverageVerification
-installDist.dependsOn check
diff --git a/asset-transfer-sbe/chaincode-java/config/checkstyle/checkstyle.xml b/asset-transfer-sbe/chaincode-java/config/checkstyle/checkstyle.xml
deleted file mode 100644
index 797da97b..00000000
--- a/asset-transfer-sbe/chaincode-java/config/checkstyle/checkstyle.xml
+++ /dev/null
@@ -1,172 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/asset-transfer-sbe/chaincode-java/config/checkstyle/suppressions.xml b/asset-transfer-sbe/chaincode-java/config/checkstyle/suppressions.xml
deleted file mode 100644
index 8c44b0a0..00000000
--- a/asset-transfer-sbe/chaincode-java/config/checkstyle/suppressions.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
diff --git a/asset-transfer-sbe/chaincode-java/gradle/wrapper/gradle-wrapper.jar b/asset-transfer-sbe/chaincode-java/gradle/wrapper/gradle-wrapper.jar
deleted file mode 100644
index d64cd491..00000000
Binary files a/asset-transfer-sbe/chaincode-java/gradle/wrapper/gradle-wrapper.jar and /dev/null differ
diff --git a/asset-transfer-sbe/chaincode-java/gradle/wrapper/gradle-wrapper.properties b/asset-transfer-sbe/chaincode-java/gradle/wrapper/gradle-wrapper.properties
deleted file mode 100644
index e2847c82..00000000
--- a/asset-transfer-sbe/chaincode-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.11.1-bin.zip
-networkTimeout=10000
-validateDistributionUrl=true
-zipStoreBase=GRADLE_USER_HOME
-zipStorePath=wrapper/dists
diff --git a/asset-transfer-sbe/chaincode-java/gradlew b/asset-transfer-sbe/chaincode-java/gradlew
deleted file mode 100755
index 1aa94a42..00000000
--- a/asset-transfer-sbe/chaincode-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=SC2039,SC3045
- MAX_FD=$( ulimit -H -n ) ||
- warn "Could not query maximum file descriptor limit"
- esac
- case $MAX_FD in #(
- '' | soft) :;; #(
- *)
- # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
- # shellcheck disable=SC2039,SC3045
- ulimit -n "$MAX_FD" ||
- warn "Could not set maximum file descriptor limit to $MAX_FD"
- esac
-fi
-
-# Collect all arguments for the java command, stacking in reverse order:
-# * args from the command line
-# * the main class name
-# * -classpath
-# * -D...appname settings
-# * --module-path (only if needed)
-# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
-
-# For Cygwin or MSYS, switch paths to Windows format before running java
-if "$cygwin" || "$msys" ; then
- APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
- CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
-
- JAVACMD=$( cygpath --unix "$JAVACMD" )
-
- # Now convert the arguments - kludge to limit ourselves to /bin/sh
- for arg do
- if
- case $arg in #(
- -*) false ;; # don't mess with options #(
- /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
- [ -e "$t" ] ;; #(
- *) false ;;
- esac
- then
- arg=$( cygpath --path --ignore --mixed "$arg" )
- fi
- # Roll the args list around exactly as many times as the number of
- # args, so each arg winds up back in the position where it started, but
- # possibly modified.
- #
- # NB: a `for` loop captures its iteration list before it begins, so
- # changing the positional parameters here affects neither the number of
- # iterations, nor the values presented in `arg`.
- shift # remove old arg
- set -- "$@" "$arg" # push replacement arg
- done
-fi
-
-
-# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
-
-# Collect all arguments for the java command:
-# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
-# and any embedded shellness will be escaped.
-# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
-# treated as '${Hostname}' itself on the command line.
-
-set -- \
- "-Dorg.gradle.appname=$APP_BASE_NAME" \
- -classpath "$CLASSPATH" \
- org.gradle.wrapper.GradleWrapperMain \
- "$@"
-
-# Stop when "xargs" is not available.
-if ! command -v xargs >/dev/null 2>&1
-then
- die "xargs is not available"
-fi
-
-# Use "xargs" to parse quoted args.
-#
-# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
-#
-# In Bash we could simply go:
-#
-# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
-# set -- "${ARGS[@]}" "$@"
-#
-# but POSIX shell has neither arrays nor command substitution, so instead we
-# post-process each arg (as a line of input to sed) to backslash-escape any
-# character that might be a shell metacharacter, then use eval to reverse
-# that process (while maintaining the separation between arguments), and wrap
-# the whole thing up as a single "set" statement.
-#
-# This will of course break if any of these variables contains a newline or
-# an unmatched quote.
-#
-
-eval "set -- $(
- printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
- xargs -n1 |
- sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
- tr '\n' ' '
- )" '"$@"'
-
-exec "$JAVACMD" "$@"
diff --git a/asset-transfer-sbe/chaincode-java/gradlew.bat b/asset-transfer-sbe/chaincode-java/gradlew.bat
deleted file mode 100644
index 25da30db..00000000
--- a/asset-transfer-sbe/chaincode-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. 1>&2
-echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
-echo. 1>&2
-echo Please set the JAVA_HOME variable in your environment to match the 1>&2
-echo location of your Java installation. 1>&2
-
-goto fail
-
-:findJavaFromJavaHome
-set JAVA_HOME=%JAVA_HOME:"=%
-set JAVA_EXE=%JAVA_HOME%/bin/java.exe
-
-if exist "%JAVA_EXE%" goto execute
-
-echo. 1>&2
-echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
-echo. 1>&2
-echo Please set the JAVA_HOME variable in your environment to match the 1>&2
-echo location of your Java installation. 1>&2
-
-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-sbe/chaincode-java/settings.gradle b/asset-transfer-sbe/chaincode-java/settings.gradle
deleted file mode 100644
index e435c090..00000000
--- a/asset-transfer-sbe/chaincode-java/settings.gradle
+++ /dev/null
@@ -1,5 +0,0 @@
-/*
- * SPDX-License-Identifier: Apache-2.0
- */
-
-rootProject.name = 'sbe'
diff --git a/asset-transfer-sbe/chaincode-java/src/main/java/org/hyperledger/fabric/samples/sbe/Asset.java b/asset-transfer-sbe/chaincode-java/src/main/java/org/hyperledger/fabric/samples/sbe/Asset.java
deleted file mode 100644
index ca14959d..00000000
--- a/asset-transfer-sbe/chaincode-java/src/main/java/org/hyperledger/fabric/samples/sbe/Asset.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * SPDX-License-Identifier: Apache-2.0
- */
-
-package org.hyperledger.fabric.samples.sbe;
-
-import com.owlike.genson.annotation.JsonProperty;
-import org.hyperledger.fabric.contract.annotation.DataType;
-import org.hyperledger.fabric.contract.annotation.Property;
-
-import java.util.Objects;
-
-@DataType()
-public final class Asset {
-
- @Property()
- private final String ID;
-
- @Property()
- private int Value;
-
- @Property()
- private String Owner;
-
- @Property()
- private String OwnerOrg;
-
- @JsonProperty("ID")
- public String getID() {
- return ID;
- }
-
- @JsonProperty("Value")
- public int getValue() {
- return Value;
- }
-
- public void setValue(final int Value) {
- this.Value = Value;
- }
-
- @JsonProperty("Owner")
- public String getOwner() {
- return Owner;
- }
-
- public void setOwner(final String Owner) {
- this.Owner = Owner;
- }
-
- @JsonProperty("OwnerOrg")
- public String getOwnerOrg() {
- return OwnerOrg;
- }
-
- public void setOwnerOrg(final String OwnerOrg) {
- this.OwnerOrg = OwnerOrg;
- }
-
- public Asset(@JsonProperty("ID") final String ID, @JsonProperty("Value") final int Value,
- @JsonProperty("Owner") final String Owner, @JsonProperty("OwnerOrg") final String OwnerOrg) {
- this.ID = ID;
- this.Value = Value;
- this.Owner = Owner;
- this.OwnerOrg = OwnerOrg;
- }
-
- @Override
- public boolean equals(final Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
- Asset asset = (Asset) o;
- return getValue() == asset.getValue()
- &&
- getID().equals(asset.getID())
- &&
- getOwner().equals(asset.getOwner())
- &&
- getOwnerOrg().equals(asset.getOwnerOrg());
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(getID(), getValue(), getOwner(), getOwnerOrg());
- }
-
- @Override
- public String toString() {
- return "Asset{" + "ID='" + ID + '\'' + ", Value=" + Value + ", Owner='"
- + Owner + '\'' + ", OwnerOrg='" + OwnerOrg + '\'' + '}';
- }
-}
diff --git a/asset-transfer-sbe/chaincode-java/src/main/java/org/hyperledger/fabric/samples/sbe/AssetContract.java b/asset-transfer-sbe/chaincode-java/src/main/java/org/hyperledger/fabric/samples/sbe/AssetContract.java
deleted file mode 100644
index 62b286b0..00000000
--- a/asset-transfer-sbe/chaincode-java/src/main/java/org/hyperledger/fabric/samples/sbe/AssetContract.java
+++ /dev/null
@@ -1,269 +0,0 @@
-/*
- * SPDX-License-Identifier: Apache-2.0
- */
-
-package org.hyperledger.fabric.samples.sbe;
-
-import com.owlike.genson.Genson;
-import org.hyperledger.fabric.contract.Context;
-import org.hyperledger.fabric.contract.ContractInterface;
-import org.hyperledger.fabric.contract.annotation.Contract;
-import org.hyperledger.fabric.contract.annotation.Default;
-import org.hyperledger.fabric.contract.annotation.Info;
-import org.hyperledger.fabric.contract.annotation.License;
-import org.hyperledger.fabric.contract.annotation.Transaction;
-import org.hyperledger.fabric.protos.common.MSPPrincipal;
-import org.hyperledger.fabric.protos.common.MSPRole;
-import org.hyperledger.fabric.protos.common.SignaturePolicy;
-import org.hyperledger.fabric.protos.common.SignaturePolicyEnvelope;
-import org.hyperledger.fabric.shim.ChaincodeException;
-import org.hyperledger.fabric.shim.ChaincodeStub;
-import org.hyperledger.fabric.shim.ext.sbe.StateBasedEndorsement;
-import org.hyperledger.fabric.shim.ext.sbe.impl.StateBasedEndorsementFactory;
-
-import java.util.Comparator;
-import java.util.List;
-import java.util.stream.Collectors;
-import java.util.stream.IntStream;
-
-@Contract(
- name = "sbe",
- info = @Info(
- title = "Asset Contract",
- description = "Asset Transfer Smart Contract, using State Based Endorsement(SBE), implemented in Java",
- version = "0.0.1-SNAPSHOT",
- license = @License(
- name = "Apache 2.0 License",
- url = "http://www.apache.org/licenses/LICENSE-2.0.html")))
-@Default
-public final class AssetContract implements ContractInterface {
- private final Genson genson = new Genson();
-
- private enum AssetTransferErrors {
- ASSET_NOT_FOUND,
- ASSET_ALREADY_EXISTS
- }
-
- /**
- * Creates a new asset.
- * Sets the endorsement policy of the assetId Key, such that current owner Org Peer is required to endorse future updates.
- * Optionally, set the endorsement policy of the assetId Key, such that any 1(N) out of the Org's specified can endorse future updates.
- *
- * @param ctx the transaction context
- * @param assetId the id of the new asset
- * @param value the value of the new asset
- * @param owner the owner of the new asset
- * @return the created asset
- */
- @Transaction(intent = Transaction.TYPE.SUBMIT)
- public Asset CreateAsset(final Context ctx, final String assetId, final int value, final String owner) {
- ChaincodeStub stub = ctx.getStub();
-
- if (AssetExists(ctx, assetId)) {
- String errorMessage = String.format("Asset %s already exists", assetId);
- System.out.println(errorMessage);
- throw new ChaincodeException(errorMessage, AssetTransferErrors.ASSET_ALREADY_EXISTS.toString());
- }
-
- final String ownerOrg = getClientOrgId(ctx);
- Asset asset = new Asset(assetId, value, owner, ownerOrg);
- String assetJSON = genson.serialize(asset);
- stub.putStringState(assetId, assetJSON);
-
- // Set the endorsement policy of the assetId Key, such that current owner Org is required to endorse future updates
- setStateBasedEndorsement(ctx, assetId, List.of(ownerOrg));
-
- // Optionally, set the endorsement policy of the assetId Key, such that any 1 Org (N) out of the specified Orgs can endorse future updates
- // setStateBasedEndorsementNOutOf(ctx, assetId, 1, new String[]{"Org1MSP", "Org2MSP"});
-
- return asset;
- }
-
- /**
- * Retrieves an asset with the given assetId.
- *
- * @param ctx the transaction context
- * @param assetId the id of the asset
- * @return the asset found on the ledger if there was one
- */
- @Transaction(intent = Transaction.TYPE.EVALUATE)
- public String ReadAsset(final Context ctx, final String assetId) {
- ChaincodeStub stub = ctx.getStub();
- String assetJSON = stub.getStringState(assetId);
-
- if (assetJSON == null || assetJSON.isEmpty()) {
- String errorMessage = String.format("Asset %s does not exist", assetId);
- System.out.println(errorMessage);
- throw new ChaincodeException(errorMessage, AssetTransferErrors.ASSET_NOT_FOUND.toString());
- }
-
- return assetJSON;
- }
-
- /**
- * Updates the properties of an existing asset.
- * Needs an endorsement of current owner Org Peer.
- *
- * @param ctx the transaction context
- * @param assetId the id of the asset being updated
- * @param newValue the value of the asset being updated
- * @return the updated asset
- */
- @Transaction(intent = Transaction.TYPE.SUBMIT)
- public Asset UpdateAsset(final Context ctx, final String assetId, final int newValue) {
- ChaincodeStub stub = ctx.getStub();
-
- String assetString = ReadAsset(ctx, assetId);
- Asset asset = genson.deserialize(assetString, Asset.class);
- asset.setValue(newValue);
- String updatedAssetJSON = genson.serialize(asset);
- stub.putStringState(assetId, updatedAssetJSON);
-
- return asset;
- }
-
- /**
- * Deletes the given asset.
- * Needs an endorsement of current owner Org Peer.
- *
- * @param ctx the transaction context
- * @param assetId the id of the asset being deleted
- */
- @Transaction(intent = Transaction.TYPE.SUBMIT)
- public void DeleteAsset(final Context ctx, final String assetId) {
- ChaincodeStub stub = ctx.getStub();
-
- if (!AssetExists(ctx, assetId)) {
- String errorMessage = String.format("Asset %s does not exist", assetId);
- System.out.println(errorMessage);
- throw new ChaincodeException(errorMessage, AssetTransferErrors.ASSET_NOT_FOUND.toString());
- }
-
- stub.delState(assetId);
- }
-
- /**
- * Updates the owner & ownerOrg field of asset with given assetId, ownerOrg must be a valid Org MSP Id.
- * Needs an endorsement of current owner Org Peer.
- * Re-sets the endorsement policy of the assetId Key, such that new owner Org Peer is required to endorse future updates.
- *
- * @param ctx the transaction context
- * @param assetId the id of the asset being transferred
- * @param newOwner the new owner
- * @param newOwnerOrg the new owner Org MSPID
- * @return the updated asset
- */
- @Transaction(intent = Transaction.TYPE.SUBMIT)
- public Asset TransferAsset(final Context ctx, final String assetId, final String newOwner, final String newOwnerOrg) {
- ChaincodeStub stub = ctx.getStub();
-
- String assetString = ReadAsset(ctx, assetId);
- Asset asset = genson.deserialize(assetString, Asset.class);
- asset.setOwner(newOwner);
- asset.setOwnerOrg(newOwnerOrg);
- String updatedAssetJSON = genson.serialize(asset);
- stub.putStringState(assetId, updatedAssetJSON);
-
- // Re-Set the endorsement policy of the assetId Key, such that a new owner Org Peer is required to endorse future updates
- setStateBasedEndorsement(ctx, assetId, List.of(newOwnerOrg));
-
- // Optionally, set the endorsement policy of the assetId Key, such that any 1 Org (N) out of the specified Orgs can endorse future updates
- // setStateBasedEndorsementNOutOf(ctx, assetId, 1, List.of("Org1MSP", "Org2MSP"));
-
- return asset;
- }
-
- /**
- * Checks the existence of the asset.
- *
- * @param ctx the transaction context
- * @param assetId the id of the asset
- * @return boolean indicating the existence of the asset
- */
- private boolean AssetExists(final Context ctx, final String assetId) {
- ChaincodeStub stub = ctx.getStub();
- String assetJSON = stub.getStringState(assetId);
-
- return (assetJSON != null && !assetJSON.isEmpty());
- }
-
- /**
- * Retrieves the client's OrgId (MSPID)
- *
- * @param ctx the transaction context
- * @return String value of the Org MSPID
- */
- private static String getClientOrgId(final Context ctx) {
- return ctx.getClientIdentity().getMSPID();
- }
-
- /**
- * Sets an endorsement policy to the assetId Key.
- * Enforces that the owner Org must endorse future update transactions for the specified assetId Key.
- *
- * @param ctx the transaction context
- * @param assetId the id of the asset
- * @param ownerOrgs the list of Owner Org MSPID's
- */
- private static void setStateBasedEndorsement(final Context ctx, final String assetId, final List ownerOrgs) {
- StateBasedEndorsement stateBasedEndorsement = StateBasedEndorsementFactory.getInstance().newStateBasedEndorsement(null);
- stateBasedEndorsement.addOrgs(StateBasedEndorsement.RoleType.RoleTypeMember, ownerOrgs.toArray(new String[0]));
- ctx.getStub().setStateValidationParameter(assetId, stateBasedEndorsement.policy());
- }
-
- /**
- * Sets an endorsement policy to the assetId Key.
- * Enforces that a given number of Orgs (N) out of the specified Orgs must endorse future update transactions for the specified assetId Key.
- *
- * @param ctx the transaction context
- * @param assetId the id of the asset
- * @param nOrgs the number of N Orgs to endorse out of the list of Orgs provided
- * @param ownerOrgs the list of Owner Org MSPID's
- */
- private static void setStateBasedEndorsementNOutOf(final Context ctx, final String assetId, final int nOrgs, final List ownerOrgs) {
- ctx.getStub().setStateValidationParameter(assetId, policy(nOrgs, ownerOrgs));
- }
-
- /**
- * Create a policy that requires a given number (N) of Org principals signatures out of the provided list of Orgs
- *
- * @param nOrgs the number of Org principals signatures required to endorse (out of the provided list of Orgs)
- * @param mspIds the list of Owner Org MSPID's
- */
- private static byte[] policy(final int nOrgs, final List mspIds) {
- mspIds.sort(Comparator.naturalOrder());
-
- var principals = mspIds.stream()
- .map(mspId -> MSPRole.newBuilder()
- .setMspIdentifier(mspId)
- .setRole(MSPRole.MSPRoleType.MEMBER)
- .build())
- .map(role -> MSPPrincipal.newBuilder()
- .setPrincipalClassification(MSPPrincipal.Classification.ROLE)
- .setPrincipal(role.toByteString())
- .build())
- .collect(Collectors.toList());
-
- var signPolicy = IntStream.range(0, mspIds.size())
- .mapToObj(AssetContract::signedBy)
- .collect(Collectors.toList());
-
- // Create the policy such that it requires any N signature's from all the principals provided
- return SignaturePolicyEnvelope.newBuilder()
- .setVersion(0)
- .setRule(nOutOf(nOrgs, signPolicy))
- .addAllIdentities(principals)
- .build()
- .toByteArray();
- }
-
- private static SignaturePolicy signedBy(final int index) {
- return SignaturePolicy.newBuilder().setSignedBy(index).build();
- }
-
- private static SignaturePolicy nOutOf(final int n, final List policies) {
- return SignaturePolicy.newBuilder().setNOutOf(
- SignaturePolicy.NOutOf.newBuilder().setN(n).addAllRules(policies).build()
- ).build();
- }
-}
diff --git a/asset-transfer-sbe/chaincode-typescript/.gitignore b/asset-transfer-sbe/chaincode-typescript/.gitignore
deleted file mode 100644
index 2a76b3d8..00000000
--- a/asset-transfer-sbe/chaincode-typescript/.gitignore
+++ /dev/null
@@ -1,20 +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
-
-# Compiled TypeScript files
-dist
-
-# Editor Config
-.editorconfig
-
-# npm ignore
-.npmignore
diff --git a/asset-transfer-sbe/chaincode-typescript/eslint.config.mjs b/asset-transfer-sbe/chaincode-typescript/eslint.config.mjs
deleted file mode 100644
index 9ef6b243..00000000
--- a/asset-transfer-sbe/chaincode-typescript/eslint.config.mjs
+++ /dev/null
@@ -1,13 +0,0 @@
-import js from '@eslint/js';
-import tseslint from 'typescript-eslint';
-
-export default tseslint.config(js.configs.recommended, ...tseslint.configs.strictTypeChecked, {
- languageOptions: {
- ecmaVersion: 2023,
- sourceType: 'module',
- parserOptions: {
- project: 'tsconfig.json',
- tsconfigRootDir: import.meta.dirname,
- },
- },
-});
diff --git a/asset-transfer-sbe/chaincode-typescript/npm-shrinkwrap.json b/asset-transfer-sbe/chaincode-typescript/npm-shrinkwrap.json
deleted file mode 100644
index 8ddcd6ac..00000000
--- a/asset-transfer-sbe/chaincode-typescript/npm-shrinkwrap.json
+++ /dev/null
@@ -1,2205 +0,0 @@
-{
- "name": "asset-transfer-sbe",
- "version": "0.0.1",
- "lockfileVersion": 3,
- "requires": true,
- "packages": {
- "": {
- "name": "asset-transfer-sbe",
- "version": "0.0.1",
- "hasInstallScript": true,
- "license": "Apache-2.0",
- "dependencies": {
- "fabric-contract-api": "~2.5",
- "fabric-shim": "~2.5"
- },
- "devDependencies": {
- "@eslint/js": "^9.3.0",
- "@tsconfig/node18": "^18.2.4",
- "@types/node": "^18.19.33",
- "eslint": "^8.57.0",
- "typescript": "~5.4.5",
- "typescript-eslint": "^7.11.0"
- },
- "engines": {
- "node": ">=18"
- }
- },
- "node_modules/@colors/colors": {
- "version": "1.6.0",
- "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.6.0.tgz",
- "integrity": "sha512-Ir+AOibqzrIsL6ajt3Rz3LskB7OiMVHqltZmspbW/TJuTVuyOMirVqAkjfY6JISiLHgyNqicAC8AyHHGzNd/dA==",
- "engines": {
- "node": ">=0.1.90"
- }
- },
- "node_modules/@dabh/diagnostics": {
- "version": "2.0.3",
- "resolved": "https://registry.npmjs.org/@dabh/diagnostics/-/diagnostics-2.0.3.tgz",
- "integrity": "sha512-hrlQOIi7hAfzsMqlGSFyVucrx38O+j6wiGOf//H2ecvIEqYN4ADBSS2iLMh5UFyDunCNniUIPk/q3riFv45xRA==",
- "dependencies": {
- "colorspace": "1.1.x",
- "enabled": "2.0.x",
- "kuler": "^2.0.0"
- }
- },
- "node_modules/@eslint-community/eslint-utils": {
- "version": "4.4.0",
- "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz",
- "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==",
- "dev": true,
- "dependencies": {
- "eslint-visitor-keys": "^3.3.0"
- },
- "engines": {
- "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
- },
- "peerDependencies": {
- "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0"
- }
- },
- "node_modules/@eslint-community/regexpp": {
- "version": "4.10.1",
- "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.10.1.tgz",
- "integrity": "sha512-Zm2NGpWELsQAD1xsJzGQpYfvICSsFkEpU0jxBjfdC6uNEWXcHnfs9hScFWtXVDVl+rBQJGrl4g1vcKIejpH9dA==",
- "dev": true,
- "engines": {
- "node": "^12.0.0 || ^14.0.0 || >=16.0.0"
- }
- },
- "node_modules/@eslint/eslintrc": {
- "version": "2.1.4",
- "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz",
- "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==",
- "dev": true,
- "dependencies": {
- "ajv": "^6.12.4",
- "debug": "^4.3.2",
- "espree": "^9.6.0",
- "globals": "^13.19.0",
- "ignore": "^5.2.0",
- "import-fresh": "^3.2.1",
- "js-yaml": "^4.1.0",
- "minimatch": "^3.1.2",
- "strip-json-comments": "^3.1.1"
- },
- "engines": {
- "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
- },
- "funding": {
- "url": "https://opencollective.com/eslint"
- }
- },
- "node_modules/@eslint/js": {
- "version": "9.5.0",
- "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.5.0.tgz",
- "integrity": "sha512-A7+AOT2ICkodvtsWnxZP4Xxk3NbZ3VMHd8oihydLRGrJgqqdEz1qSeEgXYyT/Cu8h1TWWsQRejIx48mtjZ5y1w==",
- "dev": true,
- "engines": {
- "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
- }
- },
- "node_modules/@fidm/asn1": {
- "version": "1.0.4",
- "resolved": "https://registry.npmjs.org/@fidm/asn1/-/asn1-1.0.4.tgz",
- "integrity": "sha512-esd1jyNvRb2HVaQGq2Gg8Z0kbQPXzV9Tq5Z14KNIov6KfFD6PTaRIO8UpcsYiTNzOqJpmyzWgVTrUwFV3UF4TQ==",
- "engines": {
- "node": ">= 8"
- }
- },
- "node_modules/@fidm/x509": {
- "version": "1.2.1",
- "resolved": "https://registry.npmjs.org/@fidm/x509/-/x509-1.2.1.tgz",
- "integrity": "sha512-nwc2iesjyc9hkuzcrMCBXQRn653XuAUKorfWM8PZyJawiy1QzLj4vahwzaI25+pfpwOLvMzbJ0uKpWLDNmo16w==",
- "dependencies": {
- "@fidm/asn1": "^1.0.4",
- "tweetnacl": "^1.0.1"
- },
- "engines": {
- "node": ">= 8"
- }
- },
- "node_modules/@grpc/grpc-js": {
- "version": "1.10.9",
- "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.10.9.tgz",
- "integrity": "sha512-5tcgUctCG0qoNyfChZifz2tJqbRbXVO9J7X6duFcOjY3HUNCxg5D0ZCK7EP9vIcZ0zRpLU9bWkyCqVCLZ46IbQ==",
- "dependencies": {
- "@grpc/proto-loader": "^0.7.13",
- "@js-sdsl/ordered-map": "^4.4.2"
- },
- "engines": {
- "node": ">=12.10.0"
- }
- },
- "node_modules/@grpc/proto-loader": {
- "version": "0.7.13",
- "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.7.13.tgz",
- "integrity": "sha512-AiXO/bfe9bmxBjxxtYxFAXGZvMaN5s8kO+jBHAJCON8rJoB5YS/D6X7ZNc6XQkuHNmyl4CYaMI1fJ/Gn27RGGw==",
- "dependencies": {
- "lodash.camelcase": "^4.3.0",
- "long": "^5.0.0",
- "protobufjs": "^7.2.5",
- "yargs": "^17.7.2"
- },
- "bin": {
- "proto-loader-gen-types": "build/bin/proto-loader-gen-types.js"
- },
- "engines": {
- "node": ">=6"
- }
- },
- "node_modules/@humanwhocodes/config-array": {
- "version": "0.11.14",
- "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz",
- "integrity": "sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==",
- "deprecated": "Use @eslint/config-array instead",
- "dev": true,
- "dependencies": {
- "@humanwhocodes/object-schema": "^2.0.2",
- "debug": "^4.3.1",
- "minimatch": "^3.0.5"
- },
- "engines": {
- "node": ">=10.10.0"
- }
- },
- "node_modules/@humanwhocodes/module-importer": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz",
- "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==",
- "dev": true,
- "engines": {
- "node": ">=12.22"
- },
- "funding": {
- "type": "github",
- "url": "https://github.com/sponsors/nzakas"
- }
- },
- "node_modules/@humanwhocodes/object-schema": {
- "version": "2.0.3",
- "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz",
- "integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==",
- "deprecated": "Use @eslint/object-schema instead",
- "dev": true
- },
- "node_modules/@hyperledger/fabric-protos": {
- "version": "0.2.1",
- "resolved": "https://registry.npmjs.org/@hyperledger/fabric-protos/-/fabric-protos-0.2.1.tgz",
- "integrity": "sha512-qjm0vIQIfCall804tWDeA8p/mUfu14sl5Sj+PbOn2yDKJq+7ThoIhNsLAqf+BCxUfqsoqQq6AojhqQeTFyOOqg==",
- "dependencies": {
- "@grpc/grpc-js": "^1.9.0",
- "google-protobuf": "^3.21.0"
- },
- "engines": {
- "node": ">=14.15.0"
- }
- },
- "node_modules/@js-sdsl/ordered-map": {
- "version": "4.4.2",
- "resolved": "https://registry.npmjs.org/@js-sdsl/ordered-map/-/ordered-map-4.4.2.tgz",
- "integrity": "sha512-iUKgm52T8HOE/makSxjqoWhe95ZJA1/G1sYsGev2JDKUSS14KAgg1LHb+Ba+IPow0xflbnSkOsZcO08C7w1gYw==",
- "funding": {
- "type": "opencollective",
- "url": "https://opencollective.com/js-sdsl"
- }
- },
- "node_modules/@nodelib/fs.scandir": {
- "version": "2.1.5",
- "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz",
- "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==",
- "dev": true,
- "dependencies": {
- "@nodelib/fs.stat": "2.0.5",
- "run-parallel": "^1.1.9"
- },
- "engines": {
- "node": ">= 8"
- }
- },
- "node_modules/@nodelib/fs.stat": {
- "version": "2.0.5",
- "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz",
- "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==",
- "dev": true,
- "engines": {
- "node": ">= 8"
- }
- },
- "node_modules/@nodelib/fs.walk": {
- "version": "1.2.8",
- "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz",
- "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==",
- "dev": true,
- "dependencies": {
- "@nodelib/fs.scandir": "2.1.5",
- "fastq": "^1.6.0"
- },
- "engines": {
- "node": ">= 8"
- }
- },
- "node_modules/@protobufjs/aspromise": {
- "version": "1.1.2",
- "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz",
- "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ=="
- },
- "node_modules/@protobufjs/base64": {
- "version": "1.1.2",
- "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz",
- "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg=="
- },
- "node_modules/@protobufjs/codegen": {
- "version": "2.0.4",
- "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz",
- "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg=="
- },
- "node_modules/@protobufjs/eventemitter": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz",
- "integrity": "sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q=="
- },
- "node_modules/@protobufjs/fetch": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz",
- "integrity": "sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==",
- "dependencies": {
- "@protobufjs/aspromise": "^1.1.1",
- "@protobufjs/inquire": "^1.1.0"
- }
- },
- "node_modules/@protobufjs/float": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz",
- "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ=="
- },
- "node_modules/@protobufjs/inquire": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz",
- "integrity": "sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q=="
- },
- "node_modules/@protobufjs/path": {
- "version": "1.1.2",
- "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz",
- "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA=="
- },
- "node_modules/@protobufjs/pool": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz",
- "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw=="
- },
- "node_modules/@protobufjs/utf8": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz",
- "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw=="
- },
- "node_modules/@tsconfig/node18": {
- "version": "18.2.4",
- "resolved": "https://registry.npmjs.org/@tsconfig/node18/-/node18-18.2.4.tgz",
- "integrity": "sha512-5xxU8vVs9/FNcvm3gE07fPbn9tl6tqGGWA9tSlwsUEkBxtRnTsNmwrV8gasZ9F/EobaSv9+nu8AxUKccw77JpQ==",
- "dev": true
- },
- "node_modules/@types/node": {
- "version": "18.19.34",
- "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.34.tgz",
- "integrity": "sha512-eXF4pfBNV5DAMKGbI02NnDtWrQ40hAN558/2vvS4gMpMIxaf6JmD7YjnZbq0Q9TDSSkKBamime8ewRoomHdt4g==",
- "dependencies": {
- "undici-types": "~5.26.4"
- }
- },
- "node_modules/@types/triple-beam": {
- "version": "1.3.5",
- "resolved": "https://registry.npmjs.org/@types/triple-beam/-/triple-beam-1.3.5.tgz",
- "integrity": "sha512-6WaYesThRMCl19iryMYP7/x2OVgCtbIVflDGFpWnb9irXI3UjYE4AzmYuiUKY1AJstGijoY+MgUszMgRxIYTYw=="
- },
- "node_modules/@typescript-eslint/eslint-plugin": {
- "version": "7.13.0",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.13.0.tgz",
- "integrity": "sha512-FX1X6AF0w8MdVFLSdqwqN/me2hyhuQg4ykN6ZpVhh1ij/80pTvDKclX1sZB9iqex8SjQfVhwMKs3JtnnMLzG9w==",
- "dev": true,
- "dependencies": {
- "@eslint-community/regexpp": "^4.10.0",
- "@typescript-eslint/scope-manager": "7.13.0",
- "@typescript-eslint/type-utils": "7.13.0",
- "@typescript-eslint/utils": "7.13.0",
- "@typescript-eslint/visitor-keys": "7.13.0",
- "graphemer": "^1.4.0",
- "ignore": "^5.3.1",
- "natural-compare": "^1.4.0",
- "ts-api-utils": "^1.3.0"
- },
- "engines": {
- "node": "^18.18.0 || >=20.0.0"
- },
- "funding": {
- "type": "opencollective",
- "url": "https://opencollective.com/typescript-eslint"
- },
- "peerDependencies": {
- "@typescript-eslint/parser": "^7.0.0",
- "eslint": "^8.56.0"
- },
- "peerDependenciesMeta": {
- "typescript": {
- "optional": true
- }
- }
- },
- "node_modules/@typescript-eslint/parser": {
- "version": "7.13.0",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.13.0.tgz",
- "integrity": "sha512-EjMfl69KOS9awXXe83iRN7oIEXy9yYdqWfqdrFAYAAr6syP8eLEFI7ZE4939antx2mNgPRW/o1ybm2SFYkbTVA==",
- "dev": true,
- "dependencies": {
- "@typescript-eslint/scope-manager": "7.13.0",
- "@typescript-eslint/types": "7.13.0",
- "@typescript-eslint/typescript-estree": "7.13.0",
- "@typescript-eslint/visitor-keys": "7.13.0",
- "debug": "^4.3.4"
- },
- "engines": {
- "node": "^18.18.0 || >=20.0.0"
- },
- "funding": {
- "type": "opencollective",
- "url": "https://opencollective.com/typescript-eslint"
- },
- "peerDependencies": {
- "eslint": "^8.56.0"
- },
- "peerDependenciesMeta": {
- "typescript": {
- "optional": true
- }
- }
- },
- "node_modules/@typescript-eslint/scope-manager": {
- "version": "7.13.0",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.13.0.tgz",
- "integrity": "sha512-ZrMCe1R6a01T94ilV13egvcnvVJ1pxShkE0+NDjDzH4nvG1wXpwsVI5bZCvE7AEDH1mXEx5tJSVR68bLgG7Dng==",
- "dev": true,
- "dependencies": {
- "@typescript-eslint/types": "7.13.0",
- "@typescript-eslint/visitor-keys": "7.13.0"
- },
- "engines": {
- "node": "^18.18.0 || >=20.0.0"
- },
- "funding": {
- "type": "opencollective",
- "url": "https://opencollective.com/typescript-eslint"
- }
- },
- "node_modules/@typescript-eslint/type-utils": {
- "version": "7.13.0",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.13.0.tgz",
- "integrity": "sha512-xMEtMzxq9eRkZy48XuxlBFzpVMDurUAfDu5Rz16GouAtXm0TaAoTFzqWUFPPuQYXI/CDaH/Bgx/fk/84t/Bc9A==",
- "dev": true,
- "dependencies": {
- "@typescript-eslint/typescript-estree": "7.13.0",
- "@typescript-eslint/utils": "7.13.0",
- "debug": "^4.3.4",
- "ts-api-utils": "^1.3.0"
- },
- "engines": {
- "node": "^18.18.0 || >=20.0.0"
- },
- "funding": {
- "type": "opencollective",
- "url": "https://opencollective.com/typescript-eslint"
- },
- "peerDependencies": {
- "eslint": "^8.56.0"
- },
- "peerDependenciesMeta": {
- "typescript": {
- "optional": true
- }
- }
- },
- "node_modules/@typescript-eslint/types": {
- "version": "7.13.0",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.13.0.tgz",
- "integrity": "sha512-QWuwm9wcGMAuTsxP+qz6LBBd3Uq8I5Nv8xb0mk54jmNoCyDspnMvVsOxI6IsMmway5d1S9Su2+sCKv1st2l6eA==",
- "dev": true,
- "engines": {
- "node": "^18.18.0 || >=20.0.0"
- },
- "funding": {
- "type": "opencollective",
- "url": "https://opencollective.com/typescript-eslint"
- }
- },
- "node_modules/@typescript-eslint/typescript-estree": {
- "version": "7.13.0",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.13.0.tgz",
- "integrity": "sha512-cAvBvUoobaoIcoqox1YatXOnSl3gx92rCZoMRPzMNisDiM12siGilSM4+dJAekuuHTibI2hVC2fYK79iSFvWjw==",
- "dev": true,
- "dependencies": {
- "@typescript-eslint/types": "7.13.0",
- "@typescript-eslint/visitor-keys": "7.13.0",
- "debug": "^4.3.4",
- "globby": "^11.1.0",
- "is-glob": "^4.0.3",
- "minimatch": "^9.0.4",
- "semver": "^7.6.0",
- "ts-api-utils": "^1.3.0"
- },
- "engines": {
- "node": "^18.18.0 || >=20.0.0"
- },
- "funding": {
- "type": "opencollective",
- "url": "https://opencollective.com/typescript-eslint"
- },
- "peerDependenciesMeta": {
- "typescript": {
- "optional": true
- }
- }
- },
- "node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz",
- "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==",
- "dev": true,
- "dependencies": {
- "balanced-match": "^1.0.0"
- }
- },
- "node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": {
- "version": "9.0.4",
- "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.4.tgz",
- "integrity": "sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw==",
- "dev": true,
- "dependencies": {
- "brace-expansion": "^2.0.1"
- },
- "engines": {
- "node": ">=16 || 14 >=14.17"
- },
- "funding": {
- "url": "https://github.com/sponsors/isaacs"
- }
- },
- "node_modules/@typescript-eslint/utils": {
- "version": "7.13.0",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.13.0.tgz",
- "integrity": "sha512-jceD8RgdKORVnB4Y6BqasfIkFhl4pajB1wVxrF4akxD2QPM8GNYjgGwEzYS+437ewlqqrg7Dw+6dhdpjMpeBFQ==",
- "dev": true,
- "dependencies": {
- "@eslint-community/eslint-utils": "^4.4.0",
- "@typescript-eslint/scope-manager": "7.13.0",
- "@typescript-eslint/types": "7.13.0",
- "@typescript-eslint/typescript-estree": "7.13.0"
- },
- "engines": {
- "node": "^18.18.0 || >=20.0.0"
- },
- "funding": {
- "type": "opencollective",
- "url": "https://opencollective.com/typescript-eslint"
- },
- "peerDependencies": {
- "eslint": "^8.56.0"
- }
- },
- "node_modules/@typescript-eslint/visitor-keys": {
- "version": "7.13.0",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.13.0.tgz",
- "integrity": "sha512-nxn+dozQx+MK61nn/JP+M4eCkHDSxSLDpgE3WcQo0+fkjEolnaB5jswvIKC4K56By8MMgIho7f1PVxERHEo8rw==",
- "dev": true,
- "dependencies": {
- "@typescript-eslint/types": "7.13.0",
- "eslint-visitor-keys": "^3.4.3"
- },
- "engines": {
- "node": "^18.18.0 || >=20.0.0"
- },
- "funding": {
- "type": "opencollective",
- "url": "https://opencollective.com/typescript-eslint"
- }
- },
- "node_modules/@ungap/structured-clone": {
- "version": "1.2.0",
- "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz",
- "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==",
- "dev": true
- },
- "node_modules/acorn": {
- "version": "8.11.3",
- "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz",
- "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==",
- "dev": true,
- "bin": {
- "acorn": "bin/acorn"
- },
- "engines": {
- "node": ">=0.4.0"
- }
- },
- "node_modules/acorn-jsx": {
- "version": "5.3.2",
- "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz",
- "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==",
- "dev": true,
- "peerDependencies": {
- "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0"
- }
- },
- "node_modules/ajv": {
- "version": "6.12.6",
- "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz",
- "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==",
- "dependencies": {
- "fast-deep-equal": "^3.1.1",
- "fast-json-stable-stringify": "^2.0.0",
- "json-schema-traverse": "^0.4.1",
- "uri-js": "^4.2.2"
- },
- "funding": {
- "type": "github",
- "url": "https://github.com/sponsors/epoberezkin"
- }
- },
- "node_modules/ansi-regex": {
- "version": "5.0.1",
- "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
- "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/ansi-styles": {
- "version": "4.3.0",
- "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
- "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
- "dependencies": {
- "color-convert": "^2.0.1"
- },
- "engines": {
- "node": ">=8"
- },
- "funding": {
- "url": "https://github.com/chalk/ansi-styles?sponsor=1"
- }
- },
- "node_modules/argparse": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
- "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==",
- "dev": true
- },
- "node_modules/array-union": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz",
- "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==",
- "dev": true,
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/async": {
- "version": "3.2.5",
- "resolved": "https://registry.npmjs.org/async/-/async-3.2.5.tgz",
- "integrity": "sha512-baNZyqaaLhyLVKm/DlvdW051MSgO6b8eVfIezl9E5PqWxFgzLm/wQntEW4zOytVburDEr0JlALEpdOFwvErLsg=="
- },
- "node_modules/balanced-match": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
- "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==",
- "dev": true
- },
- "node_modules/brace-expansion": {
- "version": "1.1.11",
- "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
- "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
- "dev": true,
- "dependencies": {
- "balanced-match": "^1.0.0",
- "concat-map": "0.0.1"
- }
- },
- "node_modules/braces": {
- "version": "3.0.3",
- "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz",
- "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==",
- "dev": true,
- "dependencies": {
- "fill-range": "^7.1.1"
- },
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/callsites": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",
- "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==",
- "dev": true,
- "engines": {
- "node": ">=6"
- }
- },
- "node_modules/chalk": {
- "version": "4.1.2",
- "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
- "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
- "dev": true,
- "dependencies": {
- "ansi-styles": "^4.1.0",
- "supports-color": "^7.1.0"
- },
- "engines": {
- "node": ">=10"
- },
- "funding": {
- "url": "https://github.com/chalk/chalk?sponsor=1"
- }
- },
- "node_modules/class-transformer": {
- "version": "0.4.0",
- "resolved": "https://registry.npmjs.org/class-transformer/-/class-transformer-0.4.0.tgz",
- "integrity": "sha512-ETWD/H2TbWbKEi7m9N4Km5+cw1hNcqJSxlSYhsLsNjQzWWiZIYA1zafxpK9PwVfaZ6AqR5rrjPVUBGESm5tQUA=="
- },
- "node_modules/cliui": {
- "version": "8.0.1",
- "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz",
- "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==",
- "dependencies": {
- "string-width": "^4.2.0",
- "strip-ansi": "^6.0.1",
- "wrap-ansi": "^7.0.0"
- },
- "engines": {
- "node": ">=12"
- }
- },
- "node_modules/color": {
- "version": "3.2.1",
- "resolved": "https://registry.npmjs.org/color/-/color-3.2.1.tgz",
- "integrity": "sha512-aBl7dZI9ENN6fUGC7mWpMTPNHmWUSNan9tuWN6ahh5ZLNk9baLJOnSMlrQkHcrfFgz2/RigjUVAjdx36VcemKA==",
- "dependencies": {
- "color-convert": "^1.9.3",
- "color-string": "^1.6.0"
- }
- },
- "node_modules/color-convert": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
- "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
- "dependencies": {
- "color-name": "~1.1.4"
- },
- "engines": {
- "node": ">=7.0.0"
- }
- },
- "node_modules/color-name": {
- "version": "1.1.4",
- "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
- "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="
- },
- "node_modules/color-string": {
- "version": "1.9.1",
- "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.9.1.tgz",
- "integrity": "sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg==",
- "dependencies": {
- "color-name": "^1.0.0",
- "simple-swizzle": "^0.2.2"
- }
- },
- "node_modules/color/node_modules/color-convert": {
- "version": "1.9.3",
- "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
- "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
- "dependencies": {
- "color-name": "1.1.3"
- }
- },
- "node_modules/color/node_modules/color-name": {
- "version": "1.1.3",
- "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
- "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw=="
- },
- "node_modules/colorspace": {
- "version": "1.1.4",
- "resolved": "https://registry.npmjs.org/colorspace/-/colorspace-1.1.4.tgz",
- "integrity": "sha512-BgvKJiuVu1igBUF2kEjRCZXol6wiiGbY5ipL/oVPwm0BL9sIpMIzM8IK7vwuxIIzOXMV3Ey5w+vxhm0rR/TN8w==",
- "dependencies": {
- "color": "^3.1.3",
- "text-hex": "1.0.x"
- }
- },
- "node_modules/concat-map": {
- "version": "0.0.1",
- "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
- "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==",
- "dev": true
- },
- "node_modules/cross-spawn": {
- "version": "7.0.3",
- "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
- "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==",
- "dev": true,
- "dependencies": {
- "path-key": "^3.1.0",
- "shebang-command": "^2.0.0",
- "which": "^2.0.1"
- },
- "engines": {
- "node": ">= 8"
- }
- },
- "node_modules/debug": {
- "version": "4.3.5",
- "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.5.tgz",
- "integrity": "sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==",
- "dev": true,
- "dependencies": {
- "ms": "2.1.2"
- },
- "engines": {
- "node": ">=6.0"
- },
- "peerDependenciesMeta": {
- "supports-color": {
- "optional": true
- }
- }
- },
- "node_modules/deep-is": {
- "version": "0.1.4",
- "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz",
- "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==",
- "dev": true
- },
- "node_modules/dir-glob": {
- "version": "3.0.1",
- "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz",
- "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==",
- "dev": true,
- "dependencies": {
- "path-type": "^4.0.0"
- },
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/doctrine": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz",
- "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==",
- "dev": true,
- "dependencies": {
- "esutils": "^2.0.2"
- },
- "engines": {
- "node": ">=6.0.0"
- }
- },
- "node_modules/emoji-regex": {
- "version": "8.0.0",
- "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
- "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="
- },
- "node_modules/enabled": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/enabled/-/enabled-2.0.0.tgz",
- "integrity": "sha512-AKrN98kuwOzMIdAizXGI86UFBoo26CL21UM763y1h/GMSJ4/OHU9k2YlsmBpyScFo/wbLzWQJBMCW4+IO3/+OQ=="
- },
- "node_modules/escalade": {
- "version": "3.1.2",
- "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz",
- "integrity": "sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==",
- "engines": {
- "node": ">=6"
- }
- },
- "node_modules/escape-string-regexp": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz",
- "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==",
- "dev": true,
- "engines": {
- "node": ">=10"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/eslint": {
- "version": "8.57.0",
- "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.0.tgz",
- "integrity": "sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==",
- "dev": true,
- "dependencies": {
- "@eslint-community/eslint-utils": "^4.2.0",
- "@eslint-community/regexpp": "^4.6.1",
- "@eslint/eslintrc": "^2.1.4",
- "@eslint/js": "8.57.0",
- "@humanwhocodes/config-array": "^0.11.14",
- "@humanwhocodes/module-importer": "^1.0.1",
- "@nodelib/fs.walk": "^1.2.8",
- "@ungap/structured-clone": "^1.2.0",
- "ajv": "^6.12.4",
- "chalk": "^4.0.0",
- "cross-spawn": "^7.0.2",
- "debug": "^4.3.2",
- "doctrine": "^3.0.0",
- "escape-string-regexp": "^4.0.0",
- "eslint-scope": "^7.2.2",
- "eslint-visitor-keys": "^3.4.3",
- "espree": "^9.6.1",
- "esquery": "^1.4.2",
- "esutils": "^2.0.2",
- "fast-deep-equal": "^3.1.3",
- "file-entry-cache": "^6.0.1",
- "find-up": "^5.0.0",
- "glob-parent": "^6.0.2",
- "globals": "^13.19.0",
- "graphemer": "^1.4.0",
- "ignore": "^5.2.0",
- "imurmurhash": "^0.1.4",
- "is-glob": "^4.0.0",
- "is-path-inside": "^3.0.3",
- "js-yaml": "^4.1.0",
- "json-stable-stringify-without-jsonify": "^1.0.1",
- "levn": "^0.4.1",
- "lodash.merge": "^4.6.2",
- "minimatch": "^3.1.2",
- "natural-compare": "^1.4.0",
- "optionator": "^0.9.3",
- "strip-ansi": "^6.0.1",
- "text-table": "^0.2.0"
- },
- "bin": {
- "eslint": "bin/eslint.js"
- },
- "engines": {
- "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
- },
- "funding": {
- "url": "https://opencollective.com/eslint"
- }
- },
- "node_modules/eslint-scope": {
- "version": "7.2.2",
- "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz",
- "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==",
- "dev": true,
- "dependencies": {
- "esrecurse": "^4.3.0",
- "estraverse": "^5.2.0"
- },
- "engines": {
- "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
- },
- "funding": {
- "url": "https://opencollective.com/eslint"
- }
- },
- "node_modules/eslint-visitor-keys": {
- "version": "3.4.3",
- "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz",
- "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==",
- "dev": true,
- "engines": {
- "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
- },
- "funding": {
- "url": "https://opencollective.com/eslint"
- }
- },
- "node_modules/eslint/node_modules/@eslint/js": {
- "version": "8.57.0",
- "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.0.tgz",
- "integrity": "sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==",
- "dev": true,
- "engines": {
- "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
- }
- },
- "node_modules/espree": {
- "version": "9.6.1",
- "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz",
- "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==",
- "dev": true,
- "dependencies": {
- "acorn": "^8.9.0",
- "acorn-jsx": "^5.3.2",
- "eslint-visitor-keys": "^3.4.1"
- },
- "engines": {
- "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
- },
- "funding": {
- "url": "https://opencollective.com/eslint"
- }
- },
- "node_modules/esquery": {
- "version": "1.5.0",
- "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz",
- "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==",
- "dev": true,
- "dependencies": {
- "estraverse": "^5.1.0"
- },
- "engines": {
- "node": ">=0.10"
- }
- },
- "node_modules/esrecurse": {
- "version": "4.3.0",
- "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz",
- "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==",
- "dev": true,
- "dependencies": {
- "estraverse": "^5.2.0"
- },
- "engines": {
- "node": ">=4.0"
- }
- },
- "node_modules/estraverse": {
- "version": "5.3.0",
- "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz",
- "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==",
- "dev": true,
- "engines": {
- "node": ">=4.0"
- }
- },
- "node_modules/esutils": {
- "version": "2.0.3",
- "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz",
- "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==",
- "dev": true,
- "engines": {
- "node": ">=0.10.0"
- }
- },
- "node_modules/fabric-contract-api": {
- "version": "2.5.6",
- "resolved": "https://registry.npmjs.org/fabric-contract-api/-/fabric-contract-api-2.5.6.tgz",
- "integrity": "sha512-AosGb8tA+Jgt+pqMEgYNB3/J/P5QuWOC7yhXbhDmAAwUzn4Sc7pdWDICH1YyrFGZNFxMGQmqJmLVWUX8BKHy0w==",
- "dependencies": {
- "class-transformer": "^0.4.0",
- "fabric-shim-api": "2.5.6",
- "fast-safe-stringify": "^2.1.1",
- "get-params": "^0.1.2",
- "reflect-metadata": "^0.1.13",
- "winston": "^3.7.2"
- },
- "engines": {
- "node": ">=18"
- }
- },
- "node_modules/fabric-shim": {
- "version": "2.5.6",
- "resolved": "https://registry.npmjs.org/fabric-shim/-/fabric-shim-2.5.6.tgz",
- "integrity": "sha512-4Y8WNFhYuQ9QYSEgPXWdlXnrXjwOlM10sQQzE4kJ7cDh8a4LX0rn44FxtxTCB18lnzrSLMZ8/8Cr5m0c9NeXWA==",
- "dependencies": {
- "@fidm/x509": "^1.2.1",
- "@grpc/grpc-js": "~1.10.9",
- "@hyperledger/fabric-protos": "~0.2.1",
- "@types/node": "^16.11.1",
- "ajv": "^6.12.2",
- "fabric-contract-api": "2.5.6",
- "fabric-shim-api": "2.5.6",
- "fast-safe-stringify": "^2.1.1",
- "long": "^5.2.3",
- "reflect-metadata": "^0.1.13",
- "winston": "^3.7.2",
- "yargs": "^17.4.0",
- "yargs-parser": "^21.0.1"
- },
- "bin": {
- "fabric-chaincode-node": "cli.js"
- },
- "engines": {
- "node": ">=18"
- }
- },
- "node_modules/fabric-shim-api": {
- "version": "2.5.6",
- "resolved": "https://registry.npmjs.org/fabric-shim-api/-/fabric-shim-api-2.5.6.tgz",
- "integrity": "sha512-1L0nO7CJ31/gEOWKWHEeCqgB5HkqPVfRbpcS7L9eTscT7tffjg2OkZISvC+a7RiqihL0iyrXNBgBg5MwlSSN9g==",
- "engines": {
- "eslint": "^6.6.0",
- "node": ">=18"
- }
- },
- "node_modules/fabric-shim/node_modules/@types/node": {
- "version": "16.18.98",
- "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.98.tgz",
- "integrity": "sha512-fpiC20NvLpTLAzo3oVBKIqBGR6Fx/8oAK/SSf7G+fydnXMY1x4x9RZ6sBXhqKlCU21g2QapUsbLlhv3+a7wS+Q=="
- },
- "node_modules/fast-deep-equal": {
- "version": "3.1.3",
- "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
- "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q=="
- },
- "node_modules/fast-glob": {
- "version": "3.3.2",
- "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz",
- "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==",
- "dev": true,
- "dependencies": {
- "@nodelib/fs.stat": "^2.0.2",
- "@nodelib/fs.walk": "^1.2.3",
- "glob-parent": "^5.1.2",
- "merge2": "^1.3.0",
- "micromatch": "^4.0.4"
- },
- "engines": {
- "node": ">=8.6.0"
- }
- },
- "node_modules/fast-glob/node_modules/glob-parent": {
- "version": "5.1.2",
- "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz",
- "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==",
- "dev": true,
- "dependencies": {
- "is-glob": "^4.0.1"
- },
- "engines": {
- "node": ">= 6"
- }
- },
- "node_modules/fast-json-stable-stringify": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz",
- "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw=="
- },
- "node_modules/fast-levenshtein": {
- "version": "2.0.6",
- "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz",
- "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==",
- "dev": true
- },
- "node_modules/fast-safe-stringify": {
- "version": "2.1.1",
- "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz",
- "integrity": "sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA=="
- },
- "node_modules/fastq": {
- "version": "1.17.1",
- "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz",
- "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==",
- "dev": true,
- "dependencies": {
- "reusify": "^1.0.4"
- }
- },
- "node_modules/fecha": {
- "version": "4.2.3",
- "resolved": "https://registry.npmjs.org/fecha/-/fecha-4.2.3.tgz",
- "integrity": "sha512-OP2IUU6HeYKJi3i0z4A19kHMQoLVs4Hc+DPqqxI2h/DPZHTm/vjsfC6P0b4jCMy14XizLBqvndQ+UilD7707Jw=="
- },
- "node_modules/file-entry-cache": {
- "version": "6.0.1",
- "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz",
- "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==",
- "dev": true,
- "dependencies": {
- "flat-cache": "^3.0.4"
- },
- "engines": {
- "node": "^10.12.0 || >=12.0.0"
- }
- },
- "node_modules/fill-range": {
- "version": "7.1.1",
- "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz",
- "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==",
- "dev": true,
- "dependencies": {
- "to-regex-range": "^5.0.1"
- },
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/find-up": {
- "version": "5.0.0",
- "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz",
- "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==",
- "dev": true,
- "dependencies": {
- "locate-path": "^6.0.0",
- "path-exists": "^4.0.0"
- },
- "engines": {
- "node": ">=10"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/flat-cache": {
- "version": "3.2.0",
- "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz",
- "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==",
- "dev": true,
- "dependencies": {
- "flatted": "^3.2.9",
- "keyv": "^4.5.3",
- "rimraf": "^3.0.2"
- },
- "engines": {
- "node": "^10.12.0 || >=12.0.0"
- }
- },
- "node_modules/flatted": {
- "version": "3.3.1",
- "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.1.tgz",
- "integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==",
- "dev": true
- },
- "node_modules/fn.name": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/fn.name/-/fn.name-1.1.0.tgz",
- "integrity": "sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw=="
- },
- "node_modules/fs.realpath": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
- "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==",
- "dev": true
- },
- "node_modules/get-caller-file": {
- "version": "2.0.5",
- "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz",
- "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==",
- "engines": {
- "node": "6.* || 8.* || >= 10.*"
- }
- },
- "node_modules/get-params": {
- "version": "0.1.2",
- "resolved": "https://registry.npmjs.org/get-params/-/get-params-0.1.2.tgz",
- "integrity": "sha512-41eOxtlGgHQRbFyA8KTH+w+32Em3cRdfBud7j67ulzmIfmaHX9doq47s0fa4P5o9H64BZX9nrYI6sJvk46Op+Q=="
- },
- "node_modules/glob": {
- "version": "7.2.3",
- "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz",
- "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==",
- "deprecated": "Glob versions prior to v9 are no longer supported",
- "dev": true,
- "dependencies": {
- "fs.realpath": "^1.0.0",
- "inflight": "^1.0.4",
- "inherits": "2",
- "minimatch": "^3.1.1",
- "once": "^1.3.0",
- "path-is-absolute": "^1.0.0"
- },
- "engines": {
- "node": "*"
- },
- "funding": {
- "url": "https://github.com/sponsors/isaacs"
- }
- },
- "node_modules/glob-parent": {
- "version": "6.0.2",
- "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz",
- "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==",
- "dev": true,
- "dependencies": {
- "is-glob": "^4.0.3"
- },
- "engines": {
- "node": ">=10.13.0"
- }
- },
- "node_modules/globals": {
- "version": "13.24.0",
- "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz",
- "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==",
- "dev": true,
- "dependencies": {
- "type-fest": "^0.20.2"
- },
- "engines": {
- "node": ">=8"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/globby": {
- "version": "11.1.0",
- "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz",
- "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==",
- "dev": true,
- "dependencies": {
- "array-union": "^2.1.0",
- "dir-glob": "^3.0.1",
- "fast-glob": "^3.2.9",
- "ignore": "^5.2.0",
- "merge2": "^1.4.1",
- "slash": "^3.0.0"
- },
- "engines": {
- "node": ">=10"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/google-protobuf": {
- "version": "3.21.2",
- "resolved": "https://registry.npmjs.org/google-protobuf/-/google-protobuf-3.21.2.tgz",
- "integrity": "sha512-3MSOYFO5U9mPGikIYCzK0SaThypfGgS6bHqrUGXG3DPHCrb+txNqeEcns1W0lkGfk0rCyNXm7xB9rMxnCiZOoA=="
- },
- "node_modules/graphemer": {
- "version": "1.4.0",
- "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz",
- "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==",
- "dev": true
- },
- "node_modules/has-flag": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
- "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
- "dev": true,
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/ignore": {
- "version": "5.3.1",
- "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz",
- "integrity": "sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==",
- "dev": true,
- "engines": {
- "node": ">= 4"
- }
- },
- "node_modules/import-fresh": {
- "version": "3.3.0",
- "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz",
- "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==",
- "dev": true,
- "dependencies": {
- "parent-module": "^1.0.0",
- "resolve-from": "^4.0.0"
- },
- "engines": {
- "node": ">=6"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/imurmurhash": {
- "version": "0.1.4",
- "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz",
- "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==",
- "dev": true,
- "engines": {
- "node": ">=0.8.19"
- }
- },
- "node_modules/inflight": {
- "version": "1.0.6",
- "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
- "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==",
- "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.",
- "dev": true,
- "dependencies": {
- "once": "^1.3.0",
- "wrappy": "1"
- }
- },
- "node_modules/inherits": {
- "version": "2.0.4",
- "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
- "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
- },
- "node_modules/is-arrayish": {
- "version": "0.3.2",
- "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz",
- "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ=="
- },
- "node_modules/is-extglob": {
- "version": "2.1.1",
- "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
- "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==",
- "dev": true,
- "engines": {
- "node": ">=0.10.0"
- }
- },
- "node_modules/is-fullwidth-code-point": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
- "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/is-glob": {
- "version": "4.0.3",
- "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz",
- "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==",
- "dev": true,
- "dependencies": {
- "is-extglob": "^2.1.1"
- },
- "engines": {
- "node": ">=0.10.0"
- }
- },
- "node_modules/is-number": {
- "version": "7.0.0",
- "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
- "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
- "dev": true,
- "engines": {
- "node": ">=0.12.0"
- }
- },
- "node_modules/is-path-inside": {
- "version": "3.0.3",
- "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz",
- "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==",
- "dev": true,
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/is-stream": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz",
- "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==",
- "engines": {
- "node": ">=8"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/isexe": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
- "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==",
- "dev": true
- },
- "node_modules/js-yaml": {
- "version": "4.1.0",
- "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz",
- "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==",
- "dev": true,
- "dependencies": {
- "argparse": "^2.0.1"
- },
- "bin": {
- "js-yaml": "bin/js-yaml.js"
- }
- },
- "node_modules/json-buffer": {
- "version": "3.0.1",
- "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz",
- "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==",
- "dev": true
- },
- "node_modules/json-schema-traverse": {
- "version": "0.4.1",
- "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz",
- "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg=="
- },
- "node_modules/json-stable-stringify-without-jsonify": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz",
- "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==",
- "dev": true
- },
- "node_modules/keyv": {
- "version": "4.5.4",
- "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz",
- "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==",
- "dev": true,
- "dependencies": {
- "json-buffer": "3.0.1"
- }
- },
- "node_modules/kuler": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/kuler/-/kuler-2.0.0.tgz",
- "integrity": "sha512-Xq9nH7KlWZmXAtodXDDRE7vs6DU1gTU8zYDHDiWLSip45Egwq3plLHzPn27NgvzL2r1LMPC1vdqh98sQxtqj4A=="
- },
- "node_modules/levn": {
- "version": "0.4.1",
- "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz",
- "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==",
- "dev": true,
- "dependencies": {
- "prelude-ls": "^1.2.1",
- "type-check": "~0.4.0"
- },
- "engines": {
- "node": ">= 0.8.0"
- }
- },
- "node_modules/locate-path": {
- "version": "6.0.0",
- "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz",
- "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==",
- "dev": true,
- "dependencies": {
- "p-locate": "^5.0.0"
- },
- "engines": {
- "node": ">=10"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/lodash.camelcase": {
- "version": "4.3.0",
- "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz",
- "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA=="
- },
- "node_modules/lodash.merge": {
- "version": "4.6.2",
- "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz",
- "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==",
- "dev": true
- },
- "node_modules/logform": {
- "version": "2.6.0",
- "resolved": "https://registry.npmjs.org/logform/-/logform-2.6.0.tgz",
- "integrity": "sha512-1ulHeNPp6k/LD8H91o7VYFBng5i1BDE7HoKxVbZiGFidS1Rj65qcywLxX+pVfAPoQJEjRdvKcusKwOupHCVOVQ==",
- "dependencies": {
- "@colors/colors": "1.6.0",
- "@types/triple-beam": "^1.3.2",
- "fecha": "^4.2.0",
- "ms": "^2.1.1",
- "safe-stable-stringify": "^2.3.1",
- "triple-beam": "^1.3.0"
- },
- "engines": {
- "node": ">= 12.0.0"
- }
- },
- "node_modules/long": {
- "version": "5.2.3",
- "resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz",
- "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q=="
- },
- "node_modules/merge2": {
- "version": "1.4.1",
- "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz",
- "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==",
- "dev": true,
- "engines": {
- "node": ">= 8"
- }
- },
- "node_modules/micromatch": {
- "version": "4.0.7",
- "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.7.tgz",
- "integrity": "sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==",
- "dev": true,
- "dependencies": {
- "braces": "^3.0.3",
- "picomatch": "^2.3.1"
- },
- "engines": {
- "node": ">=8.6"
- }
- },
- "node_modules/minimatch": {
- "version": "3.1.2",
- "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
- "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
- "dev": true,
- "dependencies": {
- "brace-expansion": "^1.1.7"
- },
- "engines": {
- "node": "*"
- }
- },
- "node_modules/ms": {
- "version": "2.1.2",
- "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
- "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
- },
- "node_modules/natural-compare": {
- "version": "1.4.0",
- "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz",
- "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==",
- "dev": true
- },
- "node_modules/once": {
- "version": "1.4.0",
- "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
- "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==",
- "dev": true,
- "dependencies": {
- "wrappy": "1"
- }
- },
- "node_modules/one-time": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/one-time/-/one-time-1.0.0.tgz",
- "integrity": "sha512-5DXOiRKwuSEcQ/l0kGCF6Q3jcADFv5tSmRaJck/OqkVFcOzutB134KRSfF0xDrL39MNnqxbHBbUUcjZIhTgb2g==",
- "dependencies": {
- "fn.name": "1.x.x"
- }
- },
- "node_modules/optionator": {
- "version": "0.9.4",
- "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz",
- "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==",
- "dev": true,
- "dependencies": {
- "deep-is": "^0.1.3",
- "fast-levenshtein": "^2.0.6",
- "levn": "^0.4.1",
- "prelude-ls": "^1.2.1",
- "type-check": "^0.4.0",
- "word-wrap": "^1.2.5"
- },
- "engines": {
- "node": ">= 0.8.0"
- }
- },
- "node_modules/p-limit": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz",
- "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==",
- "dev": true,
- "dependencies": {
- "yocto-queue": "^0.1.0"
- },
- "engines": {
- "node": ">=10"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/p-locate": {
- "version": "5.0.0",
- "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz",
- "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==",
- "dev": true,
- "dependencies": {
- "p-limit": "^3.0.2"
- },
- "engines": {
- "node": ">=10"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/parent-module": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz",
- "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==",
- "dev": true,
- "dependencies": {
- "callsites": "^3.0.0"
- },
- "engines": {
- "node": ">=6"
- }
- },
- "node_modules/path-exists": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz",
- "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==",
- "dev": true,
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/path-is-absolute": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
- "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==",
- "dev": true,
- "engines": {
- "node": ">=0.10.0"
- }
- },
- "node_modules/path-key": {
- "version": "3.1.1",
- "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz",
- "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==",
- "dev": true,
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/path-type": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz",
- "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==",
- "dev": true,
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/picomatch": {
- "version": "2.3.1",
- "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz",
- "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==",
- "dev": true,
- "engines": {
- "node": ">=8.6"
- },
- "funding": {
- "url": "https://github.com/sponsors/jonschlinkert"
- }
- },
- "node_modules/prelude-ls": {
- "version": "1.2.1",
- "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz",
- "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==",
- "dev": true,
- "engines": {
- "node": ">= 0.8.0"
- }
- },
- "node_modules/protobufjs": {
- "version": "7.3.2",
- "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.3.2.tgz",
- "integrity": "sha512-RXyHaACeqXeqAKGLDl68rQKbmObRsTIn4TYVUUug1KfS47YWCo5MacGITEryugIgZqORCvJWEk4l449POg5Txg==",
- "hasInstallScript": true,
- "dependencies": {
- "@protobufjs/aspromise": "^1.1.2",
- "@protobufjs/base64": "^1.1.2",
- "@protobufjs/codegen": "^2.0.4",
- "@protobufjs/eventemitter": "^1.1.0",
- "@protobufjs/fetch": "^1.1.0",
- "@protobufjs/float": "^1.0.2",
- "@protobufjs/inquire": "^1.1.0",
- "@protobufjs/path": "^1.1.2",
- "@protobufjs/pool": "^1.1.0",
- "@protobufjs/utf8": "^1.1.0",
- "@types/node": ">=13.7.0",
- "long": "^5.0.0"
- },
- "engines": {
- "node": ">=12.0.0"
- }
- },
- "node_modules/punycode": {
- "version": "2.3.1",
- "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz",
- "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==",
- "engines": {
- "node": ">=6"
- }
- },
- "node_modules/queue-microtask": {
- "version": "1.2.3",
- "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz",
- "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==",
- "dev": true,
- "funding": [
- {
- "type": "github",
- "url": "https://github.com/sponsors/feross"
- },
- {
- "type": "patreon",
- "url": "https://www.patreon.com/feross"
- },
- {
- "type": "consulting",
- "url": "https://feross.org/support"
- }
- ]
- },
- "node_modules/readable-stream": {
- "version": "3.6.2",
- "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz",
- "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==",
- "dependencies": {
- "inherits": "^2.0.3",
- "string_decoder": "^1.1.1",
- "util-deprecate": "^1.0.1"
- },
- "engines": {
- "node": ">= 6"
- }
- },
- "node_modules/reflect-metadata": {
- "version": "0.1.14",
- "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.1.14.tgz",
- "integrity": "sha512-ZhYeb6nRaXCfhnndflDK8qI6ZQ/YcWZCISRAWICW9XYqMUwjZM9Z0DveWX/ABN01oxSHwVxKQmxeYZSsm0jh5A=="
- },
- "node_modules/require-directory": {
- "version": "2.1.1",
- "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz",
- "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==",
- "engines": {
- "node": ">=0.10.0"
- }
- },
- "node_modules/resolve-from": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz",
- "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==",
- "dev": true,
- "engines": {
- "node": ">=4"
- }
- },
- "node_modules/reusify": {
- "version": "1.0.4",
- "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz",
- "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==",
- "dev": true,
- "engines": {
- "iojs": ">=1.0.0",
- "node": ">=0.10.0"
- }
- },
- "node_modules/rimraf": {
- "version": "3.0.2",
- "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz",
- "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==",
- "deprecated": "Rimraf versions prior to v4 are no longer supported",
- "dev": true,
- "dependencies": {
- "glob": "^7.1.3"
- },
- "bin": {
- "rimraf": "bin.js"
- },
- "funding": {
- "url": "https://github.com/sponsors/isaacs"
- }
- },
- "node_modules/run-parallel": {
- "version": "1.2.0",
- "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz",
- "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==",
- "dev": true,
- "funding": [
- {
- "type": "github",
- "url": "https://github.com/sponsors/feross"
- },
- {
- "type": "patreon",
- "url": "https://www.patreon.com/feross"
- },
- {
- "type": "consulting",
- "url": "https://feross.org/support"
- }
- ],
- "dependencies": {
- "queue-microtask": "^1.2.2"
- }
- },
- "node_modules/safe-buffer": {
- "version": "5.2.1",
- "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
- "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
- "funding": [
- {
- "type": "github",
- "url": "https://github.com/sponsors/feross"
- },
- {
- "type": "patreon",
- "url": "https://www.patreon.com/feross"
- },
- {
- "type": "consulting",
- "url": "https://feross.org/support"
- }
- ]
- },
- "node_modules/safe-stable-stringify": {
- "version": "2.4.3",
- "resolved": "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-2.4.3.tgz",
- "integrity": "sha512-e2bDA2WJT0wxseVd4lsDP4+3ONX6HpMXQa1ZhFQ7SU+GjvORCmShbCMltrtIDfkYhVHrOcPtj+KhmDBdPdZD1g==",
- "engines": {
- "node": ">=10"
- }
- },
- "node_modules/semver": {
- "version": "7.6.2",
- "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz",
- "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==",
- "dev": true,
- "bin": {
- "semver": "bin/semver.js"
- },
- "engines": {
- "node": ">=10"
- }
- },
- "node_modules/shebang-command": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz",
- "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==",
- "dev": true,
- "dependencies": {
- "shebang-regex": "^3.0.0"
- },
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/shebang-regex": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz",
- "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==",
- "dev": true,
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/simple-swizzle": {
- "version": "0.2.2",
- "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz",
- "integrity": "sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==",
- "dependencies": {
- "is-arrayish": "^0.3.1"
- }
- },
- "node_modules/slash": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz",
- "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==",
- "dev": true,
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/stack-trace": {
- "version": "0.0.10",
- "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz",
- "integrity": "sha512-KGzahc7puUKkzyMt+IqAep+TVNbKP+k2Lmwhub39m1AsTSkaDutx56aDCo+HLDzf/D26BIHTJWNiTG1KAJiQCg==",
- "engines": {
- "node": "*"
- }
- },
- "node_modules/string_decoder": {
- "version": "1.3.0",
- "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz",
- "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==",
- "dependencies": {
- "safe-buffer": "~5.2.0"
- }
- },
- "node_modules/string-width": {
- "version": "4.2.3",
- "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
- "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
- "dependencies": {
- "emoji-regex": "^8.0.0",
- "is-fullwidth-code-point": "^3.0.0",
- "strip-ansi": "^6.0.1"
- },
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/strip-ansi": {
- "version": "6.0.1",
- "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
- "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
- "dependencies": {
- "ansi-regex": "^5.0.1"
- },
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/strip-json-comments": {
- "version": "3.1.1",
- "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz",
- "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==",
- "dev": true,
- "engines": {
- "node": ">=8"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/supports-color": {
- "version": "7.2.0",
- "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
- "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
- "dev": true,
- "dependencies": {
- "has-flag": "^4.0.0"
- },
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/text-hex": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/text-hex/-/text-hex-1.0.0.tgz",
- "integrity": "sha512-uuVGNWzgJ4yhRaNSiubPY7OjISw4sw4E5Uv0wbjp+OzcbmVU/rsT8ujgcXJhn9ypzsgr5vlzpPqP+MBBKcGvbg=="
- },
- "node_modules/text-table": {
- "version": "0.2.0",
- "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz",
- "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==",
- "dev": true
- },
- "node_modules/to-regex-range": {
- "version": "5.0.1",
- "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
- "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
- "dev": true,
- "dependencies": {
- "is-number": "^7.0.0"
- },
- "engines": {
- "node": ">=8.0"
- }
- },
- "node_modules/triple-beam": {
- "version": "1.4.1",
- "resolved": "https://registry.npmjs.org/triple-beam/-/triple-beam-1.4.1.tgz",
- "integrity": "sha512-aZbgViZrg1QNcG+LULa7nhZpJTZSLm/mXnHXnbAbjmN5aSa0y7V+wvv6+4WaBtpISJzThKy+PIPxc1Nq1EJ9mg==",
- "engines": {
- "node": ">= 14.0.0"
- }
- },
- "node_modules/ts-api-utils": {
- "version": "1.3.0",
- "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.3.0.tgz",
- "integrity": "sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ==",
- "dev": true,
- "engines": {
- "node": ">=16"
- },
- "peerDependencies": {
- "typescript": ">=4.2.0"
- }
- },
- "node_modules/tweetnacl": {
- "version": "1.0.3",
- "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz",
- "integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw=="
- },
- "node_modules/type-check": {
- "version": "0.4.0",
- "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz",
- "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==",
- "dev": true,
- "dependencies": {
- "prelude-ls": "^1.2.1"
- },
- "engines": {
- "node": ">= 0.8.0"
- }
- },
- "node_modules/type-fest": {
- "version": "0.20.2",
- "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz",
- "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==",
- "dev": true,
- "engines": {
- "node": ">=10"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/typescript": {
- "version": "5.4.5",
- "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz",
- "integrity": "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==",
- "dev": true,
- "bin": {
- "tsc": "bin/tsc",
- "tsserver": "bin/tsserver"
- },
- "engines": {
- "node": ">=14.17"
- }
- },
- "node_modules/typescript-eslint": {
- "version": "7.13.0",
- "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-7.13.0.tgz",
- "integrity": "sha512-upO0AXxyBwJ4BbiC6CRgAJKtGYha2zw4m1g7TIVPSonwYEuf7vCicw3syjS1OxdDMTz96sZIXl3Jx3vWJLLKFw==",
- "dev": true,
- "dependencies": {
- "@typescript-eslint/eslint-plugin": "7.13.0",
- "@typescript-eslint/parser": "7.13.0",
- "@typescript-eslint/utils": "7.13.0"
- },
- "engines": {
- "node": "^18.18.0 || >=20.0.0"
- },
- "funding": {
- "type": "opencollective",
- "url": "https://opencollective.com/typescript-eslint"
- },
- "peerDependencies": {
- "eslint": "^8.56.0"
- },
- "peerDependenciesMeta": {
- "typescript": {
- "optional": true
- }
- }
- },
- "node_modules/undici-types": {
- "version": "5.26.5",
- "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz",
- "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA=="
- },
- "node_modules/uri-js": {
- "version": "4.4.1",
- "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz",
- "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==",
- "dependencies": {
- "punycode": "^2.1.0"
- }
- },
- "node_modules/util-deprecate": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
- "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw=="
- },
- "node_modules/which": {
- "version": "2.0.2",
- "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
- "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
- "dev": true,
- "dependencies": {
- "isexe": "^2.0.0"
- },
- "bin": {
- "node-which": "bin/node-which"
- },
- "engines": {
- "node": ">= 8"
- }
- },
- "node_modules/winston": {
- "version": "3.13.0",
- "resolved": "https://registry.npmjs.org/winston/-/winston-3.13.0.tgz",
- "integrity": "sha512-rwidmA1w3SE4j0E5MuIufFhyJPBDG7Nu71RkZor1p2+qHvJSZ9GYDA81AyleQcZbh/+V6HjeBdfnTZJm9rSeQQ==",
- "dependencies": {
- "@colors/colors": "^1.6.0",
- "@dabh/diagnostics": "^2.0.2",
- "async": "^3.2.3",
- "is-stream": "^2.0.0",
- "logform": "^2.4.0",
- "one-time": "^1.0.0",
- "readable-stream": "^3.4.0",
- "safe-stable-stringify": "^2.3.1",
- "stack-trace": "0.0.x",
- "triple-beam": "^1.3.0",
- "winston-transport": "^4.7.0"
- },
- "engines": {
- "node": ">= 12.0.0"
- }
- },
- "node_modules/winston-transport": {
- "version": "4.7.0",
- "resolved": "https://registry.npmjs.org/winston-transport/-/winston-transport-4.7.0.tgz",
- "integrity": "sha512-ajBj65K5I7denzer2IYW6+2bNIVqLGDHqDw3Ow8Ohh+vdW+rv4MZ6eiDvHoKhfJFZ2auyN8byXieDDJ96ViONg==",
- "dependencies": {
- "logform": "^2.3.2",
- "readable-stream": "^3.6.0",
- "triple-beam": "^1.3.0"
- },
- "engines": {
- "node": ">= 12.0.0"
- }
- },
- "node_modules/word-wrap": {
- "version": "1.2.5",
- "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz",
- "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==",
- "dev": true,
- "engines": {
- "node": ">=0.10.0"
- }
- },
- "node_modules/wrap-ansi": {
- "version": "7.0.0",
- "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
- "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==",
- "dependencies": {
- "ansi-styles": "^4.0.0",
- "string-width": "^4.1.0",
- "strip-ansi": "^6.0.0"
- },
- "engines": {
- "node": ">=10"
- },
- "funding": {
- "url": "https://github.com/chalk/wrap-ansi?sponsor=1"
- }
- },
- "node_modules/wrappy": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
- "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==",
- "dev": true
- },
- "node_modules/y18n": {
- "version": "5.0.8",
- "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz",
- "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==",
- "engines": {
- "node": ">=10"
- }
- },
- "node_modules/yargs": {
- "version": "17.7.2",
- "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz",
- "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==",
- "dependencies": {
- "cliui": "^8.0.1",
- "escalade": "^3.1.1",
- "get-caller-file": "^2.0.5",
- "require-directory": "^2.1.1",
- "string-width": "^4.2.3",
- "y18n": "^5.0.5",
- "yargs-parser": "^21.1.1"
- },
- "engines": {
- "node": ">=12"
- }
- },
- "node_modules/yargs-parser": {
- "version": "21.1.1",
- "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz",
- "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==",
- "engines": {
- "node": ">=12"
- }
- },
- "node_modules/yocto-queue": {
- "version": "0.1.0",
- "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz",
- "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==",
- "dev": true,
- "engines": {
- "node": ">=10"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- }
- }
-}
diff --git a/asset-transfer-sbe/chaincode-typescript/package.json b/asset-transfer-sbe/chaincode-typescript/package.json
deleted file mode 100644
index 4ce6b7c3..00000000
--- a/asset-transfer-sbe/chaincode-typescript/package.json
+++ /dev/null
@@ -1,35 +0,0 @@
-{
- "name": "asset-transfer-sbe",
- "version": "0.0.1",
- "description": "Asset Transfer contract, using State Based Endorsement(SBE), implemented in TypeScript",
- "main": "dist/index.js",
- "typings": "dist/index.d.ts",
- "engines": {
- "node": ">=18"
- },
- "scripts": {
- "lint": "eslint src",
- "pretest": "npm run lint",
- "test": "echo 'No tests implemented'",
- "start": "fabric-chaincode-node start",
- "build": "tsc",
- "build:watch": "tsc -w",
- "prepublishOnly": "npm run build",
- "postinstall": "npm dedupe"
- },
- "engineStrict": true,
- "author": "Hyperledger",
- "license": "Apache-2.0",
- "dependencies": {
- "fabric-contract-api": "~2.5",
- "fabric-shim": "~2.5"
- },
- "devDependencies": {
- "@types/node": "^18.19.33",
- "@eslint/js": "^9.3.0",
- "@tsconfig/node18": "^18.2.4",
- "eslint": "^8.57.0",
- "typescript": "~5.4.5",
- "typescript-eslint": "^7.11.0"
-}
-}
diff --git a/asset-transfer-sbe/chaincode-typescript/src/asset.ts b/asset-transfer-sbe/chaincode-typescript/src/asset.ts
deleted file mode 100644
index 272d6baf..00000000
--- a/asset-transfer-sbe/chaincode-typescript/src/asset.ts
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * SPDX-License-Identifier: Apache-2.0
- */
-
-import { Object, Property } from 'fabric-contract-api';
-
-@Object()
-export class Asset {
- @Property()
- public ID: string = '';
-
- @Property()
- public Value: number = 0;
-
- @Property()
- public Owner: string = '';
-
- @Property()
- public OwnerOrg: string = '';
-}
diff --git a/asset-transfer-sbe/chaincode-typescript/src/assetContract.ts b/asset-transfer-sbe/chaincode-typescript/src/assetContract.ts
deleted file mode 100644
index 019b9b19..00000000
--- a/asset-transfer-sbe/chaincode-typescript/src/assetContract.ts
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * SPDX-License-Identifier: Apache-2.0
- */
-
-import { Context, Contract, Info, Transaction } from 'fabric-contract-api';
-import { Asset } from './asset';
-import { KeyEndorsementPolicy } from 'fabric-shim';
-
-@Info({title: 'AssetContract', description: 'Asset Transfer Smart Contract, using State Based Endorsement(SBE), implemented in TypeScript' })
-export class AssetContract extends Contract {
- // CreateAsset creates a new asset
- // CreateAsset sets the endorsement policy of the assetId Key, such that current owner Org Peer is required to endorse future updates
- @Transaction()
- public async CreateAsset(ctx: Context, assetId: string, value: number, owner: string): Promise {
- const exists = await this.AssetExists(ctx, assetId);
- if (exists) {
- throw new Error(`The asset ${assetId} already exists`);
- }
- const ownerOrg = AssetContract.getClientOrgId(ctx);
- const asset = new Asset();
- asset.ID = assetId;
- asset.Value = value;
- asset.Owner = owner;
- asset.OwnerOrg = ownerOrg;
- const buffer = Buffer.from(JSON.stringify(asset));
- // Create the asset
- await ctx.stub.putState(assetId, buffer);
-
- // Set the endorsement policy of the assetId Key, such that current owner Org is required to endorse future updates
- await AssetContract.setStateBasedEndorsement(ctx, assetId, [ownerOrg]);
-
- // Optionally, set the endorsement policy of the assetId Key, such that any 1 Org (N) out of the specified Orgs can endorse future updates
- // await AssetContract.setStateBasedEndorsementNOutOf(ctx, assetId, 1, ["Org1MSP", "Org2MSP"]);
- }
-
- // ReadAsset returns asset with given assetId
- @Transaction(false)
- public async ReadAsset(ctx: Context, assetId: string): Promise {
- const exists = await this.AssetExists(ctx, assetId);
- if (!exists) {
- throw new Error(`The asset ${assetId} does not exist`);
- }
- // Read the asset
- const assetJSON = await ctx.stub.getState(assetId);
- return assetJSON.toString();
- }
-
- // UpdateAsset updates an existing asset
- // UpdateAsset needs an endorsement of current owner Org Peer
- @Transaction()
- public async UpdateAsset(ctx: Context, assetId: string, newValue: number): Promise {
- const assetString = await this.ReadAsset(ctx, assetId);
- const asset = JSON.parse(assetString) as Asset;
- asset.Value = newValue;
- const buffer = Buffer.from(JSON.stringify(asset));
- // Update the asset
- await ctx.stub.putState(assetId, buffer);
- }
-
- // DeleteAsset deletes an given asset
- // DeleteAsset needs an endorsement of current owner Org Peer
- @Transaction()
- public async DeleteAsset(ctx: Context, assetId: string): Promise {
- const exists = await this.AssetExists(ctx, assetId);
- if (!exists) {
- throw new Error(`The asset ${assetId} does not exist`);
- }
- // Delete the asset
- await ctx.stub.deleteState(assetId);
- }
-
- // TransferAsset updates the Owner & OwnerOrg field of asset with given assetId, OwnerOrg must be a valid Org MSP Id
- // TransferAsset needs an endorsement of current owner Org Peer
- // TransferAsset re-sets the endorsement policy of the assetId Key, such that new owner Org Peer is required to endorse future updates
- @Transaction()
- public async TransferAsset(ctx: Context, assetId: string, newOwner: string, newOwnerOrg: string): Promise {
- const assetString = await this.ReadAsset(ctx, assetId);
- const asset = JSON.parse(assetString) as Asset;
- asset.Owner = newOwner;
- asset.OwnerOrg = newOwnerOrg;
- // Update the asset
- await ctx.stub.putState(assetId, Buffer.from(JSON.stringify(asset)));
- // Re-Set the endorsement policy of the assetId Key, such that a new owner Org Peer is required to endorse future updates
- await AssetContract.setStateBasedEndorsement(ctx, asset.ID, [newOwnerOrg]);
-
- // Optionally, set the endorsement policy of the assetId Key, such that any 1 Org (N) out of the specified Orgs can endorse future updates
- // await AssetContract.setStateBasedEndorsementNOutOf(ctx, assetId, 1, ["Org1MSP", "Org2MSP"]);
- }
-
- // AssetExists returns true when asset with given ID exists
- public async AssetExists(ctx: Context, assetId: string): Promise {
- const buffer = await ctx.stub.getState(assetId);
- return buffer.length > 0;
- }
-
- // getClientOrgId gets the client's OrgId (MSPID)
- private static getClientOrgId(ctx: Context): string {
- return ctx.clientIdentity.getMSPID();
- }
-
- // setStateBasedEndorsement sets an endorsement policy to the assetId Key
- // setStateBasedEndorsement enforces that the owner Org must endorse future update transactions for the specified assetId Key
- private static async setStateBasedEndorsement(ctx: Context, assetId: string, ownerOrgs: string[]): Promise {
- const ep = new KeyEndorsementPolicy();
- ep.addOrgs('MEMBER', ...ownerOrgs);
- await ctx.stub.setStateValidationParameter(assetId, ep.getPolicy());
- }
-
- // setStateBasedEndorsementNOutOf sets an endorsement policy to the assetId Key
- // setStateBasedEndorsementNOutOf enforces that a given number of Orgs (N) out of the specified Orgs must endorse future update transactions for the specified assetId Key.
- private static async setStateBasedEndorsementNOutOf(ctx: Context, assetId: string, nOrgs: number, ownerOrgs: string[]): Promise {
- const ROLE_TYPE_MEMBER = 'MEMBER';
-
- // Use the KeyEndorsementPolicy helper form the chaincode libarries
- // If you need more advanced policies, please use that helper as a reference point.
- const keyEndorsementPolicy = new KeyEndorsementPolicy();
- keyEndorsementPolicy.addOrgs(ROLE_TYPE_MEMBER, ...ownerOrgs);
-
- await ctx.stub.setStateValidationParameter(assetId, keyEndorsementPolicy.getPolicy());
- }
-}
diff --git a/asset-transfer-sbe/chaincode-typescript/src/index.ts b/asset-transfer-sbe/chaincode-typescript/src/index.ts
deleted file mode 100644
index 412fda46..00000000
--- a/asset-transfer-sbe/chaincode-typescript/src/index.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-/*
- * SPDX-License-Identifier: Apache-2.0
- */
-
-import { AssetContract } from './assetContract';
-export { AssetContract } from './assetContract';
-
-export const contracts: unknown[] = [ AssetContract ];
diff --git a/asset-transfer-sbe/chaincode-typescript/tsconfig.json b/asset-transfer-sbe/chaincode-typescript/tsconfig.json
deleted file mode 100644
index 031d7de7..00000000
--- a/asset-transfer-sbe/chaincode-typescript/tsconfig.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "$schema": "https://json.schemastore.org/tsconfig",
- "extends": "@tsconfig/node18/tsconfig.json",
- "compilerOptions": {
- "experimentalDecorators": true,
- "emitDecoratorMetadata": true,
- "declaration": true,
- "declarationMap": true,
- "sourceMap": true,
- "outDir": "dist",
- "strict": true,
- "noUnusedLocals": true,
- "noImplicitReturns": true,
- "forceConsistentCasingInFileNames": true
- },
- "include": ["src/"]
-}
diff --git a/asset-transfer-secured-agreement/README.md b/asset-transfer-secured-agreement/README.md
deleted file mode 100644
index 83e4c2fc..00000000
--- a/asset-transfer-secured-agreement/README.md
+++ /dev/null
@@ -1,61 +0,0 @@
-# Asset transfer secured agreement sample
-
-The asset transfer events sample demonstrates how to transfer a private asset between two organizations without publicly sharing data .
-
-## About the sample
-
-This sample includes smart contract and application code in multiple languages. This sample shows how Fabric features state based endorsement, private data, and access control to provide secured transactions.
-
-### Application
-
-Refer [Secured asset transfer in Fabric](https://hyperledger-fabric.readthedocs.io/en/latest/secured_asset_transfer/secured_private_asset_transfer_tutorial.html) for application details .
-
-### Smart Contract
-
-The smart contract (in folder `chaincode-go`) implements the following functions to support the application:
-
-- CreateAsset
-- ChangePublicDescription
-- AgreeToSell
-- AgreeToBuy
-- VerifyAssetProperties
-- TransferAsset
-- ReadAsset
-- GetAssetPrivateProperties
-- GetAssetSalesPrice
-- GetAssetBidPrice
-- GetAssetHashId
-- QueryAssetSaleAgreements
-- QueryAssetBuyAgreements
-- QueryAssetHistory
-
-## Running the sample
-
-Like other samples, the Fabric test network is used to deploy and run this sample. Follow these steps in order:
-
-1. Create the test network and a channel (from the `test-network` folder).
- ```
- ./network.sh up createChannel -c mychannel -ca
- ```
-
-1. Deploy the smart contract implementations.
- ```
- # To deploy the go chaincode implementation
- ./network.sh deployCC -ccn secured -ccp ../asset-transfer-secured-agreement/chaincode-go/ -ccl go -ccep "OR('Org1MSP.peer','Org2MSP.peer')"
- ```
-
-1. Run the application (from the `asset-transfer-secured-agreement` folder).
- ```
- # To run the Typescript sample application
- cd application-gateway-typescript
- npm install
- npm start
- ```
-
-## Clean up
-
-When you are finished, you can bring down the test network (from the `test-network` folder). The command will remove all the nodes of the test network, and delete any ledger data that you created.
-
-```
-./network.sh down
-```
\ No newline at end of file
diff --git a/asset-transfer-secured-agreement/application-gateway-typescript/.gitignore b/asset-transfer-secured-agreement/application-gateway-typescript/.gitignore
deleted file mode 100644
index 99e5af9f..00000000
--- a/asset-transfer-secured-agreement/application-gateway-typescript/.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/
-
-# Compiled TypeScript files
-dist
diff --git a/asset-transfer-secured-agreement/application-gateway-typescript/eslint.config.mjs b/asset-transfer-secured-agreement/application-gateway-typescript/eslint.config.mjs
deleted file mode 100644
index 9ef6b243..00000000
--- a/asset-transfer-secured-agreement/application-gateway-typescript/eslint.config.mjs
+++ /dev/null
@@ -1,13 +0,0 @@
-import js from '@eslint/js';
-import tseslint from 'typescript-eslint';
-
-export default tseslint.config(js.configs.recommended, ...tseslint.configs.strictTypeChecked, {
- languageOptions: {
- ecmaVersion: 2023,
- sourceType: 'module',
- parserOptions: {
- project: 'tsconfig.json',
- tsconfigRootDir: import.meta.dirname,
- },
- },
-});
diff --git a/asset-transfer-secured-agreement/application-gateway-typescript/package.json b/asset-transfer-secured-agreement/application-gateway-typescript/package.json
deleted file mode 100644
index adcec840..00000000
--- a/asset-transfer-secured-agreement/application-gateway-typescript/package.json
+++ /dev/null
@@ -1,33 +0,0 @@
-{
- "name": "asset-transfer-basic",
- "version": "1.0.0",
- "description": "Asset Transfer Secured Agreement Application implemented in typeScript using fabric-gateway",
- "main": "dist/index.js",
- "typings": "dist/index.d.ts",
- "engines": {
- "node": ">=18"
- },
- "scripts": {
- "build": "tsc",
- "build:watch": "tsc -w",
- "lint": "eslint src",
- "prepare": "npm run build",
- "pretest": "npm run lint",
- "start": "node dist/app.js"
- },
- "engineStrict": true,
- "author": "Hyperledger",
- "license": "Apache-2.0",
- "dependencies": {
- "@grpc/grpc-js": "^1.12.2",
- "@hyperledger/fabric-gateway": "^1.7.0"
- },
- "devDependencies": {
- "@eslint/js": "^9.3.0",
- "@tsconfig/node18": "^18.2.2",
- "@types/node": "^18.18.6",
- "eslint": "^8.57.0",
- "typescript": "~5.4",
- "typescript-eslint": "^7.13.0"
- }
-}
diff --git a/asset-transfer-secured-agreement/application-gateway-typescript/src/app.ts b/asset-transfer-secured-agreement/application-gateway-typescript/src/app.ts
deleted file mode 100644
index 14aa27ca..00000000
--- a/asset-transfer-secured-agreement/application-gateway-typescript/src/app.ts
+++ /dev/null
@@ -1,217 +0,0 @@
-/*
- * Copyright IBM Corp. All Rights Reserved.
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-
-import { connect, hash } from '@hyperledger/fabric-gateway';
-
-import { newGrpcConnection, newIdentity, newSigner, tlsCertPathOrg1, peerEndpointOrg1, peerNameOrg1, certDirectoryPathOrg1, mspIdOrg1, keyDirectoryPathOrg1, tlsCertPathOrg2, peerEndpointOrg2, peerNameOrg2, certDirectoryPathOrg2, mspIdOrg2, keyDirectoryPathOrg2 } from './connect';
-import { ContractWrapper } from './contractWrapper';
-import { RED, RESET } from './utils';
-
-const channelName = 'mychannel';
-const chaincodeName = 'secured';
-
-// Use a random key so that we can run multiple times
-const now = Date.now().toString();
-let assetKey: string;
-
-async function main(): Promise {
-
- // The gRPC client connection from org1 should be shared by all Gateway connections to this endpoint.
- const clientOrg1 = await newGrpcConnection(
- tlsCertPathOrg1,
- peerEndpointOrg1,
- peerNameOrg1
- );
-
- const gatewayOrg1 = connect({
- client: clientOrg1,
- identity: await newIdentity(certDirectoryPathOrg1, mspIdOrg1),
- signer: await newSigner(keyDirectoryPathOrg1),
- hash: hash.sha256,
- });
-
- // The gRPC client connection from org2 should be shared by all Gateway connections to this endpoint.
- const clientOrg2 = await newGrpcConnection(
- tlsCertPathOrg2,
- peerEndpointOrg2,
- peerNameOrg2
- );
-
- const gatewayOrg2 = connect({
- client: clientOrg2,
- identity: await newIdentity(certDirectoryPathOrg2, mspIdOrg2),
- signer: await newSigner(keyDirectoryPathOrg2),
- hash: hash.sha256,
- });
-
-
- try {
-
- // Get the smart contract from the network for Org1.
- const contractOrg1 = gatewayOrg1.getNetwork(channelName).getContract(chaincodeName);
- const contractWrapperOrg1 = new ContractWrapper(contractOrg1, mspIdOrg1);
-
- // Get the smart contract from the network for Org2.
- const contractOrg2 = gatewayOrg2.getNetwork(channelName).getContract(chaincodeName);
- const contractWrapperOrg2 = new ContractWrapper(contractOrg2, mspIdOrg2);
-
- // Create an asset by organization Org1, this only requires the owning organization to endorse.
- assetKey = await contractWrapperOrg1.createAsset(mspIdOrg1,
- `Asset owned by ${mspIdOrg1} is not for sale`, { ObjectType: 'asset_properties', Color: 'blue', Size: 35 });
-
- // Read the public details by org1.
- await contractWrapperOrg1.readAsset(assetKey, mspIdOrg1);
-
- // Read the public details by org2.
- await contractWrapperOrg2.readAsset(assetKey, mspIdOrg1);
-
- // Org1 should be able to read the private data details of the asset.
- await contractWrapperOrg1.getAssetPrivateProperties(assetKey, mspIdOrg1);
-
- // Org2 is not the owner and does not have the private details, read expected to fail.
- try {
- await contractWrapperOrg2.getAssetPrivateProperties(assetKey, mspIdOrg1);
- } catch (e) {
- console.log(`${RED}*** Successfully caught the failure: getAssetPrivateProperties - ${String(e)}${RESET}`);
- }
-
- // Org1 updates the assets public description.
- await contractWrapperOrg1.changePublicDescription({assetId: assetKey,
- ownerOrg: mspIdOrg1,
- publicDescription: `Asset ${assetKey} owned by ${mspIdOrg1} is for sale`});
-
- // Read the public details by org1.
- await contractWrapperOrg1.readAsset(assetKey, mspIdOrg1);
-
- // Read the public details by org2.
- await contractWrapperOrg2.readAsset(assetKey, mspIdOrg1);
-
- // 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.
- try{
- await contractWrapperOrg2.changePublicDescription({assetId: assetKey,
- ownerOrg: mspIdOrg1,
- publicDescription: `Asset ${assetKey} owned by ${mspIdOrg2} is NOT for sale`});
- } catch(e) {
- console.log(`${RED}*** Successfully caught the failure: changePublicDescription - ${String(e)}${RESET}`);
- }
-
- // Read the public details by org1.
- await contractWrapperOrg1.readAsset(assetKey, mspIdOrg1);
-
- // Read the public details by org2.
- await contractWrapperOrg2.readAsset(assetKey, mspIdOrg1);
-
- // Agree to a sell by org1.
- await contractWrapperOrg1.agreeToSell({
- assetId: assetKey,
- price: 110,
- tradeId: now,
- });
-
- // Check the private information about the asset from Org2. Org1 would have to send Org2 asset details,
- // so the hash of the details may be checked by the chaincode.
- await contractWrapperOrg2.verifyAssetProperties(assetKey, {color:'blue', size:35});
-
- // Agree to a buy by org2.
- await contractWrapperOrg2.agreeToBuy( {assetId: assetKey,
- price: 100,
- tradeId: now}, { ObjectType: 'asset_properties', Color: 'blue', Size: 35 });
-
- // Org1 should be able to read the sale price of this asset.
- await contractWrapperOrg1.getAssetSalesPrice(assetKey, mspIdOrg1);
-
- // Org2 has not set a sale price and this should fail.
- try{
- await contractWrapperOrg2.getAssetSalesPrice(assetKey, mspIdOrg1);
- } catch(e) {
- console.log(`${RED}*** Successfully caught the failure: getAssetSalesPrice - ${String(e)}${RESET}`);
- }
-
- // Org1 has not agreed to buy so this should fail.
- try{
- await contractWrapperOrg1.getAssetBidPrice(assetKey, mspIdOrg2);
- } catch(e) {
- console.log(`${RED}*** Successfully caught the failure: getAssetBidPrice - ${String(e)}${RESET}`);
- }
- // Org2 should be able to see the price it has agreed.
- await contractWrapperOrg2.getAssetBidPrice(assetKey, mspIdOrg2);
-
- // 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.
- try{
- await contractWrapperOrg1.transferAsset({ assetId: assetKey, price: 110, tradeId: now}, [ mspIdOrg1, mspIdOrg2 ], mspIdOrg1, mspIdOrg2);
- } catch(e) {
- console.log(`${RED}*** Successfully caught the failure: transferAsset - ${String(e)}${RESET}`);
- }
- // Agree to a sell by Org1, the seller will agree to the bid price of Org2.
- await contractWrapperOrg1.agreeToSell({assetId:assetKey, price:100, tradeId:now});
-
- // Read the public details by org1.
- await contractWrapperOrg1.readAsset(assetKey, mspIdOrg1);
-
- // Read the public details by org2.
- await contractWrapperOrg2.readAsset(assetKey, mspIdOrg1);
-
- // Org1 should be able to read the private data details of the asset.
- await contractWrapperOrg1.getAssetPrivateProperties(assetKey, mspIdOrg1);
-
- // Org1 should be able to read the sale price of this asset.
- await contractWrapperOrg1.getAssetSalesPrice(assetKey, mspIdOrg1);
-
- // Org2 should be able to see the price it has agreed.
- await contractWrapperOrg2.getAssetBidPrice(assetKey, mspIdOrg2);
-
- // Org2 user will try to transfer the asset to Org1.
- // This will fail as the owner is Org1.
- try{
- await contractWrapperOrg2.transferAsset({ assetId: assetKey, price: 100, tradeId: now}, [ mspIdOrg1, mspIdOrg2 ], mspIdOrg1, mspIdOrg2);
- } catch(e) {
- console.log(`${RED}*** Successfully caught the failure: transferAsset - ${String(e)}${RESET}`);
- }
-
- // Org1 will transfer the asset to Org2.
- // This will now complete as the sell price and the bid price are the same.
- await contractWrapperOrg1.transferAsset({ assetId: assetKey, price: 100, tradeId: now}, [ mspIdOrg1, mspIdOrg2 ], mspIdOrg1, mspIdOrg2);
-
- // Read the public details by org1.
- await contractWrapperOrg1.readAsset(assetKey, mspIdOrg2);
-
- // Read the public details by org2.
- await contractWrapperOrg2.readAsset(assetKey, mspIdOrg2);
-
- // Org2 should be able to read the private data details of this asset.
- await contractWrapperOrg2.getAssetPrivateProperties(assetKey, mspIdOrg2);
-
- // Org1 should not be able to read the private data details of this asset, expected to fail.
- try{
- await contractWrapperOrg1.getAssetPrivateProperties(assetKey, mspIdOrg2);
- } catch(e) {
- console.log(`${RED}*** Successfully caught the failure: getAssetPrivateProperties - ${String(e)}${RESET}`);
- }
-
- // 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.
- await contractWrapperOrg2.changePublicDescription( {assetId: assetKey, ownerOrg: mspIdOrg2, publicDescription: `Asset ${assetKey} owned by ${mspIdOrg2} is NOT for sale`});
-
- // Read the public details by org1.
- await contractWrapperOrg1.readAsset(assetKey, mspIdOrg2);
-
- // Read the public details by org2.
- await contractWrapperOrg2.readAsset(assetKey, mspIdOrg2);
-
- } finally {
- gatewayOrg1.close();
- gatewayOrg2.close();
- clientOrg1.close();
- clientOrg2.close();
- }
-}
-
-main().catch((error: unknown) => {
- console.error('******** FAILED to run the application:', error);
- process.exitCode = 1;
-});
diff --git a/asset-transfer-secured-agreement/application-gateway-typescript/src/connect.ts b/asset-transfer-secured-agreement/application-gateway-typescript/src/connect.ts
deleted file mode 100644
index b6afd2e8..00000000
--- a/asset-transfer-secured-agreement/application-gateway-typescript/src/connect.ts
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Copyright IBM Corp. All Rights Reserved.
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-
-import * as grpc from '@grpc/grpc-js';
-import { Identity, Signer, signers } from '@hyperledger/fabric-gateway';
-import * as crypto from 'crypto';
-import { promises as fs } from 'fs';
-import * as path from 'path';
-
-// MSP Id's of Organizations
-export const mspIdOrg1 = 'Org1MSP';
-export const mspIdOrg2 = 'Org2MSP';
-
-// Path to org1 crypto materials.
-export const cryptoPathOrg1 = path.resolve(__dirname, '..', '..', '..', 'test-network', 'organizations', 'peerOrganizations', 'org1.example.com');
-
-// Path to user private key directory.
-export const keyDirectoryPathOrg1 = path.resolve(cryptoPathOrg1, 'users', 'User1@org1.example.com', 'msp', 'keystore');
-
-// Path to user certificate.
-export const certDirectoryPathOrg1 = path.resolve(cryptoPathOrg1, 'users', 'User1@org1.example.com', 'msp', 'signcerts');
-
-// Path to peer tls certificate.
-export const tlsCertPathOrg1 = path.resolve(cryptoPathOrg1, 'peers', 'peer0.org1.example.com', 'tls', 'ca.crt');
-
-// Path to org2 crypto materials.
-export const cryptoPathOrg2 = path.resolve(
- __dirname,
- '..',
- '..',
- '..',
- 'test-network',
- 'organizations',
- 'peerOrganizations',
- 'org2.example.com'
-);
-
-// Path to org2 user private key directory.
-export const keyDirectoryPathOrg2 = path.resolve(
- cryptoPathOrg2,
- 'users',
- 'User1@org2.example.com',
- 'msp',
- 'keystore'
-);
-
-// Path to org2 user certificate.
-export const certDirectoryPathOrg2 = path.resolve(
- cryptoPathOrg2,
- 'users',
- 'User1@org2.example.com',
- 'msp',
- 'signcerts'
-);
-
-// Path to org2 peer tls certificate.
-export const tlsCertPathOrg2 = path.resolve(
- cryptoPathOrg2,
- 'peers',
- 'peer0.org2.example.com',
- 'tls',
- 'ca.crt'
-);
-// Gateway peer endpoint.
-export const peerEndpointOrg1 = 'localhost:7051';
-export const peerEndpointOrg2 = 'localhost:9051';
-
-// Gateway peer container name.
-export const peerNameOrg1 = 'peer0.org1.example.com';
-export const peerNameOrg2 = 'peer0.org2.example.com';
-
-// Collection Names
-export const org1PrivateCollectionName = 'Org1MSPPrivateCollection';
-export const org2PrivateCollectionName = 'Org2MSPPrivateCollection';
-
-export async function newGrpcConnection(
- tlsCertPath: string,
- peerEndpoint: string,
- peerName: string
-): Promise {
- const tlsRootCert = await fs.readFile(tlsCertPath);
- const tlsCredentials = grpc.credentials.createSsl(tlsRootCert);
- return new grpc.Client(peerEndpoint, tlsCredentials, {
- 'grpc.ssl_target_name_override': peerName,
- });
-}
-
-export async function newIdentity(certDirectoryPath: string, mspId: string): Promise {
- const certPath = await getFirstDirFileName(certDirectoryPath);
- const credentials = await fs.readFile(certPath);
- return { mspId, credentials };
-}
-
-export async function newSigner(keyDirectoryPath: string): Promise {
- const keyPath = await getFirstDirFileName(keyDirectoryPath);
- const privateKeyPem = await fs.readFile(keyPath);
- const privateKey = crypto.createPrivateKey(privateKeyPem);
- return signers.newPrivateKeySigner(privateKey);
-}
-
-async function getFirstDirFileName(dirPath: string): Promise {
- const files = await fs.readdir(dirPath);
- const file = files[0];
- if (!file) {
- throw new Error(`No files in directory: ${dirPath}`);
- }
- return path.join(dirPath, file);
-}
diff --git a/asset-transfer-secured-agreement/application-gateway-typescript/src/contractWrapper.ts b/asset-transfer-secured-agreement/application-gateway-typescript/src/contractWrapper.ts
deleted file mode 100644
index 44c5f7d2..00000000
--- a/asset-transfer-secured-agreement/application-gateway-typescript/src/contractWrapper.ts
+++ /dev/null
@@ -1,271 +0,0 @@
-/*
- * Copyright IBM Corp. All Rights Reserved.
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-import { Contract } from '@hyperledger/fabric-gateway';
-import { TextDecoder } from 'util';
-import { GREEN, parse, RED, RESET } from './utils';
-import crypto from 'crypto';
-import { mspIdOrg2 } from './connect';
-
-const randomBytes = crypto.randomBytes(256).toString('hex');
-
-interface AssetJSON {
- objectType: string;
- assetID: string;
- ownerOrg: string;
- publicDescription: string;
-}
-
-interface AssetPropertiesJSON {
- objectType: string;
- color: string;
- size: number;
- salt: string;
-}
-
-interface AssetPriceJSON {
- assetID: string;
- price: number;
- tradeID: string;
-}
-
-export interface AssetPrivateData {
- ObjectType: string;
- Color: string;
- Size: number;
-}
-
-export interface Asset {
- assetId: string;
- ownerOrg: string;
- publicDescription: string;
-}
-
-export interface AssetProperties {
- color: string;
- size: number;
-}
-
-export interface AssetPrice {
- assetId: string;
- price: number;
- tradeId: string;
-}
-
-export class ContractWrapper {
-
- readonly #contract: Contract;
- readonly #org: string;
- readonly #utf8Decoder = new TextDecoder();
- readonly #randomBytes: string = randomBytes;
- #endorsingOrgs: { [id: string]: string[] };
-
- public constructor(contract: Contract, org: string) {
- this.#contract = contract;
- this.#org = org;
- this.#endorsingOrgs = {};
- }
-
- public async createAsset(ownerOrg: string, publicDescription: string, privateData: AssetPrivateData): Promise {
- console.log(`${GREEN}--> Submit Transaction: CreateAsset as ${ownerOrg} - endorsed by Org1.${RESET}`);
- const assetPropertiesJSON: AssetPropertiesJSON = {
- objectType: 'asset_properties',
- color: privateData.Color,
- size: privateData.Size,
- salt: this.#randomBytes };
-
- const resultBytes = await this.#contract.submit('CreateAsset', {
- arguments: [publicDescription],
- transientData: { asset_properties: JSON.stringify(assetPropertiesJSON)},
- });
- const assetID = this.#utf8Decoder.decode(resultBytes);
- this.#endorsingOrgs[assetID] = [ownerOrg];
- console.log(`*** Result: committed, asset ${assetID} is owned by ${ownerOrg}`);
- return assetID;
- }
-
- public async readAsset(assetKey: string, ownerOrg: string): Promise {
- console.log(`${GREEN}--> Evaluate Transactions: ReadAsset as ${this.#org}, - ${assetKey} should be owned by ${ownerOrg}.${RESET}`);
-
- const resultBytes = await this.#contract.evaluateTransaction('ReadAsset', assetKey);
-
- const result = this.#utf8Decoder.decode(resultBytes);
- if (result.length !== 0) {
- const json = parse(result);
- if (json.ownerOrg === ownerOrg) {
- console.log(`*** Result from ${this.#org} - asset ${json.assetID} owned by ${json.ownerOrg} DESC: ${json.publicDescription}`);
- } else {
- console.log(`${RED}*** Failed owner check from ${this.#org} - asset ${json.assetID} owned by ${json.ownerOrg} DESC:${json.publicDescription}.${RESET}`);
- }
- } else {
- throw new Error('No Asset Found');
- }
- }
-
- public async getAssetPrivateProperties(assetKey: string, ownerOrg: string): Promise {
- console.log(`${GREEN}--> Evaluate Transaction: GetAssetPrivateProperties, - ${assetKey} from organization ${this.#org}.${RESET}`);
- if(this.#org !== ownerOrg) {
- console.log(`${GREEN}* Expected to fail as ${this.#org} is not the owner and does not have the private details.${RESET}`);
- }
-
- const resultBytes = await this.#contract.evaluateTransaction('GetAssetPrivateProperties', assetKey);
-
- const resultString = this.#utf8Decoder.decode(resultBytes);
- const json = parse(resultString);
- const result: AssetProperties = {
- color: json.color,
- size: json.size,
- };
- console.log('*** Result:', result);
- }
-
-
- public async changePublicDescription(asset: Asset): Promise {
- console.log(`${GREEN}--> Submit Transaction: ChangePublicDescription ${asset.assetId}, as ${this.#org} - endorse by ${this.#org}.${RESET}`);
- if (asset.ownerOrg !== this.#org) {
- console.log(`${GREEN}* Expected to fail as ${this.#org} is not the owner.${RESET}`);
- }
-
- await this.#contract.submit('ChangePublicDescription', {
- arguments:[asset.assetId, asset.publicDescription],
- endorsingOrganizations: this.#endorsingOrgs[asset.assetId]
- });
-
- console.log(`*** Result: committed, Desc: ${asset.publicDescription}`);
- }
-
- public async agreeToSell(assetPrice: AssetPrice): Promise {
-
- console.log(`${GREEN}--> Submit Transaction: AgreeToSell, ${assetPrice.assetId} as ${this.#org} - endorsed by ${this.#org}.${RESET}`);
- const assetPriceJSON: AssetPriceJSON = {
- assetID:assetPrice.assetId,
- price:assetPrice.price,
- tradeID:assetPrice.tradeId
- };
-
- await this.#contract.submit('AgreeToSell', {
- arguments:[assetPrice.assetId],
- transientData: {asset_price: JSON.stringify(assetPriceJSON)},
- endorsingOrganizations: this.#endorsingOrgs[assetPrice.assetId]
- });
-
- console.log(`*** Result: committed, ${this.#org} has agreed to sell asset ${assetPrice.assetId} for ${String(assetPrice.price)}`);
- }
-
- public async verifyAssetProperties(assetId: string, assetProperties: AssetProperties): Promise {
- console.log(`${GREEN}--> Evalute: VerifyAssetProperties, ${assetId} as ${this.#org} - endorsed by ${this.#org} and ${mspIdOrg2}.${RESET}`);
- const assetPropertiesJSON: AssetPropertiesJSON = {objectType: 'asset_properties',
- color: assetProperties.color,
- size: assetProperties.size,
- salt: this.#randomBytes };
-
- const resultBytes = await this.#contract.evaluate('VerifyAssetProperties', {
- arguments:[assetId],
- transientData: {asset_properties: JSON.stringify(assetPropertiesJSON)},
- });
-
- const resultString = this.#utf8Decoder.decode(resultBytes);
- if (resultString.length !== 0) {
- const json = parse(resultString);
- if (typeof json === 'object') {
- console.log(`*** Success VerifyAssetProperties, private information about asset ${assetId} has been verified by ${this.#org}`);
- } else {
- console.log(`*** Failed: VerifyAssetProperties, private information about asset ${assetId} has not been verified by ${this.#org}`);
- }
- } else {
- throw new Error(`Private information about asset ${assetId} has not been verified by ${this.#org}`);
- }
- }
-
- public async agreeToBuy(assetPrice: AssetPrice, privateData: AssetPrivateData): Promise {
-
- console.log(`${GREEN}--> Submit Transaction: AgreeToBuy, ${assetPrice.assetId} as ${this.#org} - endorsed by ${this.#org} and ${mspIdOrg2}.${RESET}`);
- const assetPropertiesJSON: AssetPropertiesJSON = {
- objectType: 'asset_properties',
- color: privateData.Color,
- size: privateData.Size,
- salt: this.#randomBytes };
-
- const assetPriceJSON: AssetPriceJSON = {
- assetID: assetPrice.assetId,
- price: assetPrice.price,
- tradeID: assetPrice.tradeId
- };
-
- await this.#contract.submit('AgreeToBuy', {
- arguments:[assetPrice.assetId],
- transientData: {
- asset_price: JSON.stringify(assetPriceJSON),
- asset_properties: JSON.stringify(assetPropertiesJSON)
- },
- endorsingOrganizations: this.#endorsingOrgs[assetPrice.assetId]
- });
-
- console.log(`*** Result: committed, ${this.#org} has agreed to buy asset ${assetPrice.assetId} for 100`);
-
- }
-
- public async getAssetSalesPrice(assetKey: string, ownerOrg: string): Promise {
-
- console.log(`${GREEN}--> Evaluate Transaction: GetAssetSalesPrice, - ${assetKey} from organization ${this.#org}.${RESET}`);
- if(this.#org !== ownerOrg) {
- console.log(`${GREEN}* Expected to fail as ${this.#org} has not set a sale price.${RESET}`);
- }
-
- const resultBytes = await this.#contract.evaluateTransaction('GetAssetSalesPrice', assetKey);
-
- const resultString = this.#utf8Decoder.decode(resultBytes);
- const json = parse(resultString);
-
- const result: AssetPrice = {
- assetId: json.assetID,
- price: json.price,
- tradeId: json.tradeID
- };
-
- console.log('*** Result: GetAssetSalesPrice', result);
- }
-
- public async getAssetBidPrice(assetKey: string, buyerOrgID: string): Promise {
-
- console.log(`${GREEN}--> Evaluate Transaction: GetAssetBidPrice, - ${assetKey} from organization ${this.#org}.${RESET}`);
- if(this.#org !== buyerOrgID){
- console.log(`${GREEN}* Expected to fail as ${this.#org} has not agreed to buy.${RESET}`);
- }
-
- const resultBytes = await this.#contract.evaluateTransaction('GetAssetBidPrice', assetKey);
-
- const resultString = this.#utf8Decoder.decode(resultBytes);
- const json = parse(resultString);
- const result: AssetPrice = {
- assetId: json.assetID,
- price: json.price,
- tradeId: json.tradeID,
- };
-
- console.log('*** Result: GetAssetBidPrice', result);
- }
-
- public async transferAsset(assetPrice: AssetPrice, endorsingOrganizations: string[], ownerOrgID: string, buyerOrgID: string): Promise {
-
- console.log(`${GREEN}--> Submit Transaction: TransferAsset, ${assetPrice.assetId} as ${this.#org } - endorsed by ${this.#org} and ${buyerOrgID}.${RESET}`);
-
- if (this.#org !== ownerOrgID) {
- console.log(`${GREEN}* Expected to fail as the owner is ${ownerOrgID}.${RESET}`);
- } else if (assetPrice.price === 110) {
- console.log(`${GREEN}* Expected to fail as sell price and the bid price are not the same.${RESET}`);
- }
-
- const assetPriceJSON: AssetPriceJSON = { assetID: assetPrice.assetId, price:assetPrice.price, tradeID:assetPrice.tradeId};
-
- await this.#contract.submit('TransferAsset', {
- arguments:[assetPrice.assetId, buyerOrgID],
- transientData: { asset_price: JSON.stringify(assetPriceJSON) },
- endorsingOrganizations: endorsingOrganizations
- });
-
- console.log(`${GREEN}*** Result: committed, ${this.#org} has transfered the asset ${assetPrice.assetId} to ${buyerOrgID}.${RESET}`);
- }
-}
diff --git a/asset-transfer-secured-agreement/application-gateway-typescript/src/utils.ts b/asset-transfer-secured-agreement/application-gateway-typescript/src/utils.ts
deleted file mode 100644
index 0442ff02..00000000
--- a/asset-transfer-secured-agreement/application-gateway-typescript/src/utils.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-/*
- * Copyright IBM Corp. All Rights Reserved.
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-
-export const RED = '\x1b[31m\n';
-export const GREEN = '\x1b[32m\n';
-export const RESET = '\x1b[0m';
-
-export function parse(data: string): T {
- return JSON.parse(data) as T;
-}
diff --git a/asset-transfer-secured-agreement/application-gateway-typescript/tsconfig.json b/asset-transfer-secured-agreement/application-gateway-typescript/tsconfig.json
deleted file mode 100644
index 4c20df24..00000000
--- a/asset-transfer-secured-agreement/application-gateway-typescript/tsconfig.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "extends": "@tsconfig/node18/tsconfig.json",
- "compilerOptions": {
- "outDir": "dist",
- "declaration": true,
- "declarationMap": true,
- "sourceMap": true,
- "noUnusedLocals": true,
- "noImplicitReturns": true,
- "noUncheckedIndexedAccess": true,
- "forceConsistentCasingInFileNames": true
- },
- "include": ["./src/**/*"],
- "exclude": ["./src/**/*.spec.ts"]
-}
diff --git a/asset-transfer-secured-agreement/chaincode-go/README.md b/asset-transfer-secured-agreement/chaincode-go/README.md
deleted file mode 100644
index f65f09b6..00000000
--- a/asset-transfer-secured-agreement/chaincode-go/README.md
+++ /dev/null
@@ -1 +0,0 @@
-[Secured asset transfer in Fabric Tutorial](https://hyperledger-fabric.readthedocs.io/en/latest/secured_asset_transfer/secured_private_asset_transfer_tutorial.html)
diff --git a/asset-transfer-secured-agreement/chaincode-go/asset_transfer.go b/asset-transfer-secured-agreement/chaincode-go/asset_transfer.go
deleted file mode 100644
index d7228406..00000000
--- a/asset-transfer-secured-agreement/chaincode-go/asset_transfer.go
+++ /dev/null
@@ -1,619 +0,0 @@
-/*
- SPDX-License-Identifier: Apache-2.0
-*/
-
-package main
-
-import (
- "bytes"
- "crypto/sha256"
- "encoding/hex"
- "encoding/json"
- "fmt"
- "log"
- "time"
-
- "github.com/hyperledger/fabric-chaincode-go/v2/pkg/statebased"
- "github.com/hyperledger/fabric-chaincode-go/v2/shim"
- "github.com/hyperledger/fabric-contract-api-go/v2/contractapi"
-)
-
-const (
- typeAssetForSale = "S"
- typeAssetBid = "B"
- typeAssetSaleReceipt = "SR"
- typeAssetBuyReceipt = "BR"
-)
-
-type SmartContract struct {
- contractapi.Contract
-}
-
-// Asset struct and properties must be exported (start with capitals) to work with contract api metadata
-type Asset struct {
- ObjectType string `json:"objectType"` // ObjectType is used to distinguish different object types in the same chaincode namespace
- ID string `json:"assetID"`
- OwnerOrg string `json:"ownerOrg"`
- PublicDescription string `json:"publicDescription"`
-}
-
-type receipt struct {
- price int
- timestamp time.Time
-}
-
-// CreateAsset creates an asset, sets it as owned by the client's org and returns its id
-// the id of the asset corresponds to the hash of the properties of the asset that are passed by transiet field
-func (s *SmartContract) CreateAsset(ctx contractapi.TransactionContextInterface, publicDescription string) (string, error) {
- transientMap, err := ctx.GetStub().GetTransient()
- if err != nil {
- return "", fmt.Errorf("error getting transient: %v", err)
- }
-
- // Asset properties must be retrieved from the transient field as they are private
- immutablePropertiesJSON, ok := transientMap["asset_properties"]
- if !ok {
- return "", fmt.Errorf("asset_properties key not found in the transient map")
- }
-
- // AssetID will be the hash of the asset's properties
- hash := sha256.New()
- hash.Write(immutablePropertiesJSON)
- assetID := hex.EncodeToString(hash.Sum(nil))
-
- // Get the clientOrgId from the input, will be used for implicit collection, owner, and state-based endorsement policy
- clientOrgID, err := getClientOrgID(ctx)
- if err != nil {
- return "", err
- }
-
- // In this scenario, client is only authorized to read/write private data from its own peer, therefore verify client org id matches peer org id.
- err = verifyClientOrgMatchesPeerOrg(clientOrgID)
- if err != nil {
- return "", err
- }
-
- asset := Asset{
- ObjectType: "asset",
- ID: assetID,
- OwnerOrg: clientOrgID,
- PublicDescription: publicDescription,
- }
- assetBytes, err := json.Marshal(asset)
- if err != nil {
- return "", fmt.Errorf("failed to create asset JSON: %v", err)
- }
-
- err = ctx.GetStub().PutState(assetID, assetBytes)
- if err != nil {
- return "", fmt.Errorf("failed to put asset in public data: %v", err)
- }
-
- // Set the endorsement policy such that an owner org peer is required to endorse future updates.
- // In practice, consider additional endorsers such as a trusted third party to further secure transfers.
- endorsingOrgs := []string{clientOrgID}
- err = setAssetStateBasedEndorsement(ctx, asset.ID, endorsingOrgs)
- if err != nil {
- return "", fmt.Errorf("failed setting state based endorsement for buyer and seller: %v", err)
- }
-
- // Persist private immutable asset properties to owner's private data collection
- collection := buildCollectionName(clientOrgID)
- err = ctx.GetStub().PutPrivateData(collection, assetID, immutablePropertiesJSON)
- if err != nil {
- return "", fmt.Errorf("failed to put Asset private details: %v", err)
- }
-
- return assetID, nil
-}
-
-// ChangePublicDescription updates the assets public description. Only the current owner can update the public description
-func (s *SmartContract) ChangePublicDescription(ctx contractapi.TransactionContextInterface, assetID string, newDescription string) error {
-
- clientOrgID, err := getClientOrgID(ctx)
- if err != nil {
- return err
- }
-
- asset, err := s.ReadAsset(ctx, assetID)
- if err != nil {
- return fmt.Errorf("failed to get asset: %v", err)
- }
-
- // Auth check to ensure that client's org actually owns the asset
- if clientOrgID != asset.OwnerOrg {
- return fmt.Errorf("a client from %s cannot update the description of a asset owned by %s", clientOrgID, asset.OwnerOrg)
- }
-
- asset.PublicDescription = newDescription
- updatedAssetJSON, err := json.Marshal(asset)
- if err != nil {
- return fmt.Errorf("failed to marshal asset: %v", err)
- }
-
- return ctx.GetStub().PutState(assetID, updatedAssetJSON)
-}
-
-// AgreeToSell adds seller's asking price to seller's implicit private data collection.
-func (s *SmartContract) AgreeToSell(ctx contractapi.TransactionContextInterface, assetID string) error {
- asset, err := s.ReadAsset(ctx, assetID)
- if err != nil {
- return err
- }
-
- clientOrgID, err := getClientOrgID(ctx)
- if err != nil {
- return err
- }
-
- // Verify that this client belongs to the peer's org
- err = verifyClientOrgMatchesPeerOrg(clientOrgID)
- if err != nil {
- return err
- }
-
- // Verify that this clientOrgId actually owns the asset.
- if clientOrgID != asset.OwnerOrg {
- return fmt.Errorf("a client from %s cannot sell an asset owned by %s", clientOrgID, asset.OwnerOrg)
- }
-
- return agreeToPrice(ctx, assetID, typeAssetForSale)
-}
-
-// AgreeToBuy adds buyer's bid price and asset properties to buyer's implicit private data collection
-func (s *SmartContract) AgreeToBuy(ctx contractapi.TransactionContextInterface, assetID string) error {
- transientMap, err := ctx.GetStub().GetTransient()
- if err != nil {
- return fmt.Errorf("error getting transient: %v", err)
- }
-
- clientOrgID, err := getClientOrgID(ctx)
- if err != nil {
- return err
- }
-
- // Verify that this client belongs to the peer's org
- err = verifyClientOrgMatchesPeerOrg(clientOrgID)
- if err != nil {
- return err
- }
-
- // Asset properties must be retrieved from the transient field as they are private
- immutablePropertiesJSON, ok := transientMap["asset_properties"]
- if !ok {
- return fmt.Errorf("asset_properties key not found in the transient map")
- }
-
- // Persist private immutable asset properties to seller's private data collection
- collection := buildCollectionName(clientOrgID)
- err = ctx.GetStub().PutPrivateData(collection, assetID, immutablePropertiesJSON)
- if err != nil {
- return fmt.Errorf("failed to put Asset private details: %v", err)
- }
-
- return agreeToPrice(ctx, assetID, typeAssetBid)
-}
-
-// agreeToPrice adds a bid or ask price to caller's implicit private data collection
-func agreeToPrice(ctx contractapi.TransactionContextInterface, assetID string, priceType string) error {
- // In this scenario, both buyer and seller are authoried to read/write private about transfer after seller agrees to sell.
- clientOrgID, err := getClientOrgID(ctx)
- if err != nil {
- return err
- }
-
- transMap, err := ctx.GetStub().GetTransient()
- if err != nil {
- return fmt.Errorf("error getting transient: %v", err)
- }
-
- // Asset price must be retrieved from the transient field as they are private
- price, ok := transMap["asset_price"]
- if !ok {
- return fmt.Errorf("asset_price key not found in the transient map")
- }
-
- collection := buildCollectionName(clientOrgID)
-
- // Persist the agreed to price in a collection sub-namespace based on priceType key prefix,
- // to avoid collisions between private asset properties, sell price, and buy price
- assetPriceKey, err := ctx.GetStub().CreateCompositeKey(priceType, []string{assetID})
- if err != nil {
- return fmt.Errorf("failed to create composite key: %v", err)
- }
-
- // The Price hash will be verified later, therefore always pass and persist price bytes as is,
- // so that there is no risk of nondeterministic marshaling.
- err = ctx.GetStub().PutPrivateData(collection, assetPriceKey, price)
- if err != nil {
- return fmt.Errorf("failed to put asset bid: %v", err)
- }
-
- return nil
-}
-
-// VerifyAssetProperties allows a buyer to validate the properties of
-// an asset they intend to buy against the owner's implicit private data collection
-// and verifies that the asset properties never changed from the origin of the asset by checking their hash against the assetID
-func (s *SmartContract) VerifyAssetProperties(ctx contractapi.TransactionContextInterface, assetID string) (bool, error) {
- transMap, err := ctx.GetStub().GetTransient()
- if err != nil {
- return false, fmt.Errorf("error getting transient: %v", err)
- }
-
- // Asset properties must be retrieved from the transient field as they are private
- immutablePropertiesJSON, ok := transMap["asset_properties"]
- if !ok {
- return false, fmt.Errorf("asset_properties key not found in the transient map")
- }
-
- asset, err := s.ReadAsset(ctx, assetID)
- if err != nil {
- return false, fmt.Errorf("failed to get asset: %v", err)
- }
-
- collectionOwner := buildCollectionName(asset.OwnerOrg)
- immutablePropertiesOnChainHash, err := ctx.GetStub().GetPrivateDataHash(collectionOwner, assetID)
- if err != nil {
- return false, fmt.Errorf("failed to read asset private properties hash from seller's collection: %v", err)
- }
- if immutablePropertiesOnChainHash == nil {
- return false, fmt.Errorf("asset private properties hash does not exist: %s", assetID)
- }
-
- hash := sha256.New()
- hash.Write(immutablePropertiesJSON)
- calculatedPropertiesHash := hash.Sum(nil)
-
- // verify that the hash of the passed immutable properties matches the on-chain hash
- if !bytes.Equal(immutablePropertiesOnChainHash, calculatedPropertiesHash) {
- return false, fmt.Errorf("hash %x for passed immutable properties %s does not match on-chain hash %x",
- calculatedPropertiesHash,
- immutablePropertiesJSON,
- immutablePropertiesOnChainHash,
- )
- }
-
- // verify that the hash of the passed immutable properties and on chain hash matches the assetID
- if !(hex.EncodeToString(immutablePropertiesOnChainHash) == assetID) {
- return false, fmt.Errorf("hash %x for passed immutable properties %s does match on-chain hash %x but do not match assetID %s: asset was altered from its initial form",
- calculatedPropertiesHash,
- immutablePropertiesJSON,
- immutablePropertiesOnChainHash,
- assetID)
- }
-
- return true, nil
-}
-
-// TransferAsset checks transfer conditions and then transfers asset state to buyer.
-// TransferAsset can only be called by current owner
-func (s *SmartContract) TransferAsset(ctx contractapi.TransactionContextInterface, assetID string, buyerOrgID string) error {
- clientOrgID, err := getClientOrgID(ctx)
- if err != nil {
- return err
- }
-
- transMap, err := ctx.GetStub().GetTransient()
- if err != nil {
- return fmt.Errorf("error getting transient data: %v", err)
- }
-
- priceJSON, ok := transMap["asset_price"]
- if !ok {
- return fmt.Errorf("asset_price key not found in the transient map")
- }
-
- var agreement Agreement
- err = json.Unmarshal(priceJSON, &agreement)
- if err != nil {
- return fmt.Errorf("failed to unmarshal price JSON: %v", err)
- }
-
- asset, err := s.ReadAsset(ctx, assetID)
- if err != nil {
- return fmt.Errorf("failed to get asset: %v", err)
- }
-
- err = verifyTransferConditions(ctx, asset, clientOrgID, buyerOrgID, priceJSON)
- if err != nil {
- return fmt.Errorf("failed transfer verification: %v", err)
- }
-
- err = transferAssetState(ctx, asset, clientOrgID, buyerOrgID, agreement.Price)
- if err != nil {
- return fmt.Errorf("failed asset transfer: %v", err)
- }
-
- return nil
-
-}
-
-// verifyTransferConditions checks that client org currently owns asset and that both parties have agreed on price
-func verifyTransferConditions(ctx contractapi.TransactionContextInterface,
- asset *Asset,
- clientOrgID string,
- buyerOrgID string,
- priceJSON []byte) error {
-
- // CHECK1: Auth check to ensure that client's org actually owns the asset
-
- if clientOrgID != asset.OwnerOrg {
- return fmt.Errorf("a client from %s cannot transfer a asset owned by %s", clientOrgID, asset.OwnerOrg)
- }
-
- // CHECK2: Verify that buyer and seller on-chain asset defintion hash matches
-
- collectionSeller := buildCollectionName(clientOrgID)
- collectionBuyer := buildCollectionName(buyerOrgID)
- sellerPropertiesOnChainHash, err := ctx.GetStub().GetPrivateDataHash(collectionSeller, asset.ID)
- if err != nil {
- return fmt.Errorf("failed to read asset private properties hash from seller's collection: %v", err)
- }
- if sellerPropertiesOnChainHash == nil {
- return fmt.Errorf("asset private properties hash does not exist: %s", asset.ID)
- }
- buyerPropertiesOnChainHash, err := ctx.GetStub().GetPrivateDataHash(collectionBuyer, asset.ID)
- if err != nil {
- return fmt.Errorf("failed to read asset private properties hash from seller's collection: %v", err)
- }
- if buyerPropertiesOnChainHash == nil {
- return fmt.Errorf("asset private properties hash does not exist: %s", asset.ID)
- }
-
- // verify that buyer and seller on-chain asset defintion hash matches
- if !bytes.Equal(sellerPropertiesOnChainHash, buyerPropertiesOnChainHash) {
- return fmt.Errorf("on chain hash of seller %x does not match on-chain hash of buyer %x",
- sellerPropertiesOnChainHash,
- buyerPropertiesOnChainHash,
- )
- }
-
- // CHECK3: Verify that seller and buyer agreed on the same price
-
- // Get sellers asking price
- assetForSaleKey, err := ctx.GetStub().CreateCompositeKey(typeAssetForSale, []string{asset.ID})
- if err != nil {
- return fmt.Errorf("failed to create composite key: %v", err)
- }
- sellerPriceHash, err := ctx.GetStub().GetPrivateDataHash(collectionSeller, assetForSaleKey)
- if err != nil {
- return fmt.Errorf("failed to get seller price hash: %v", err)
- }
- if sellerPriceHash == nil {
- return fmt.Errorf("seller price for %s does not exist", asset.ID)
- }
-
- // Get buyers bid price
- assetBidKey, err := ctx.GetStub().CreateCompositeKey(typeAssetBid, []string{asset.ID})
- if err != nil {
- return fmt.Errorf("failed to create composite key: %v", err)
- }
- buyerPriceHash, err := ctx.GetStub().GetPrivateDataHash(collectionBuyer, assetBidKey)
- if err != nil {
- return fmt.Errorf("failed to get buyer price hash: %v", err)
- }
- if buyerPriceHash == nil {
- return fmt.Errorf("buyer price for %s does not exist", asset.ID)
- }
-
- hash := sha256.New()
- hash.Write(priceJSON)
- calculatedPriceHash := hash.Sum(nil)
-
- // Verify that the hash of the passed price matches the on-chain sellers price hash
- if !bytes.Equal(calculatedPriceHash, sellerPriceHash) {
- return fmt.Errorf("hash %x for passed price JSON %s does not match on-chain hash %x, seller hasn't agreed to the passed trade id and price",
- calculatedPriceHash,
- priceJSON,
- sellerPriceHash,
- )
- }
-
- // Verify that the hash of the passed price matches the on-chain buyer price hash
- if !bytes.Equal(calculatedPriceHash, buyerPriceHash) {
- return fmt.Errorf("hash %x for passed price JSON %s does not match on-chain hash %x, buyer hasn't agreed to the passed trade id and price",
- calculatedPriceHash,
- priceJSON,
- buyerPriceHash,
- )
- }
-
- return nil
-}
-
-// transferAssetState performs the public and private state updates for the transferred asset
-// changes the endorsement for the transferred asset sbe to the new owner org
-func transferAssetState(ctx contractapi.TransactionContextInterface, asset *Asset, clientOrgID string, buyerOrgID string, price int) error {
-
- // Update ownership in public state
- asset.OwnerOrg = buyerOrgID
- updatedAsset, err := json.Marshal(asset)
- if err != nil {
- return err
- }
- err = ctx.GetStub().PutState(asset.ID, updatedAsset)
- if err != nil {
- return fmt.Errorf("failed to write asset for buyer: %v", err)
- }
-
- // Changes the endorsement policy to the new owner org
- endorsingOrgs := []string{buyerOrgID}
- err = setAssetStateBasedEndorsement(ctx, asset.ID, endorsingOrgs)
- if err != nil {
- return fmt.Errorf("failed setting state based endorsement for new owner: %v", err)
- }
-
- // Delete asset description from seller collection
- collectionSeller := buildCollectionName(clientOrgID)
- err = ctx.GetStub().DelPrivateData(collectionSeller, asset.ID)
- if err != nil {
- return fmt.Errorf("failed to delete Asset private details from seller: %v", err)
- }
-
- // Delete the price records for seller
- assetPriceKey, err := ctx.GetStub().CreateCompositeKey(typeAssetForSale, []string{asset.ID})
- if err != nil {
- return fmt.Errorf("failed to create composite key for seller: %v", err)
- }
- err = ctx.GetStub().DelPrivateData(collectionSeller, assetPriceKey)
- if err != nil {
- return fmt.Errorf("failed to delete asset price from implicit private data collection for seller: %v", err)
- }
-
- // Delete the price records for buyer
- collectionBuyer := buildCollectionName(buyerOrgID)
- assetPriceKey, err = ctx.GetStub().CreateCompositeKey(typeAssetBid, []string{asset.ID})
- if err != nil {
- return fmt.Errorf("failed to create composite key for buyer: %v", err)
- }
- err = ctx.GetStub().DelPrivateData(collectionBuyer, assetPriceKey)
- if err != nil {
- return fmt.Errorf("failed to delete asset price from implicit private data collection for buyer: %v", err)
- }
-
- // Keep record for a 'receipt' in both buyers and sellers private data collection to record the sale price and date.
- // Persist the agreed to price in a collection sub-namespace based on receipt key prefix.
- receiptBuyKey, err := ctx.GetStub().CreateCompositeKey(typeAssetBuyReceipt, []string{asset.ID, ctx.GetStub().GetTxID()})
- if err != nil {
- return fmt.Errorf("failed to create composite key for receipt: %v", err)
- }
-
- txTimestamp, err := ctx.GetStub().GetTxTimestamp()
- if err != nil {
- return fmt.Errorf("failed to create timestamp for receipt: %v", err)
- }
-
- assetReceipt := receipt{
- price: price,
- timestamp: txTimestamp.AsTime(),
- }
- receipt, err := json.Marshal(assetReceipt)
- if err != nil {
- return fmt.Errorf("failed to marshal receipt: %v", err)
- }
-
- err = ctx.GetStub().PutPrivateData(collectionBuyer, receiptBuyKey, receipt)
- if err != nil {
- return fmt.Errorf("failed to put private asset receipt for buyer: %v", err)
- }
-
- receiptSaleKey, err := ctx.GetStub().CreateCompositeKey(typeAssetSaleReceipt, []string{ctx.GetStub().GetTxID(), asset.ID})
- if err != nil {
- return fmt.Errorf("failed to create composite key for receipt: %v", err)
- }
-
- err = ctx.GetStub().PutPrivateData(collectionSeller, receiptSaleKey, receipt)
- if err != nil {
- return fmt.Errorf("failed to put private asset receipt for seller: %v", err)
- }
-
- return nil
-}
-
-// getClientOrgID gets the client org ID.
-func getClientOrgID(ctx contractapi.TransactionContextInterface) (string, error) {
- clientOrgID, err := ctx.GetClientIdentity().GetMSPID()
- if err != nil {
- return "", fmt.Errorf("failed getting client's orgID: %v", err)
- }
-
- return clientOrgID, nil
-}
-
-// getClientImplicitCollectionNameAndVerifyClientOrg gets the implicit collection for the client and checks that the client is from the same org as the peer
-func getClientImplicitCollectionNameAndVerifyClientOrg(ctx contractapi.TransactionContextInterface) (string, error) {
- clientOrgID, err := getClientOrgID(ctx)
- if err != nil {
- return "", err
- }
-
- err = verifyClientOrgMatchesPeerOrg(clientOrgID)
- if err != nil {
- return "", err
- }
-
- return buildCollectionName(clientOrgID), nil
-}
-
-// verifyClientOrgMatchesPeerOrg checks that the client is from the same org as the peer
-func verifyClientOrgMatchesPeerOrg(clientOrgID string) error {
- peerOrgID, err := shim.GetMSPID()
- if err != nil {
- return fmt.Errorf("failed getting peer's orgID: %v", err)
- }
-
- if clientOrgID != peerOrgID {
- return fmt.Errorf("client from org %s is not authorized to read or write private data from an org %s peer",
- clientOrgID,
- peerOrgID,
- )
- }
-
- return nil
-}
-
-// buildCollectionName returns the implicit collection name for an org
-func buildCollectionName(clientOrgID string) string {
- return fmt.Sprintf("_implicit_org_%s", clientOrgID)
-}
-
-// setAssetStateBasedEndorsement adds an endorsement policy to an asset so that the passed orgs need to agree upon transfer
-func setAssetStateBasedEndorsement(ctx contractapi.TransactionContextInterface, assetID string, orgsToEndorse []string) error {
- endorsementPolicy, err := statebased.NewStateEP(nil)
- if err != nil {
- return err
- }
- err = endorsementPolicy.AddOrgs(statebased.RoleTypePeer, orgsToEndorse...)
- if err != nil {
- return fmt.Errorf("failed to add org to endorsement policy: %v", err)
- }
- policy, err := endorsementPolicy.Policy()
- if err != nil {
- return fmt.Errorf("failed to create endorsement policy bytes from org: %v", err)
- }
- err = ctx.GetStub().SetStateValidationParameter(assetID, policy)
- if err != nil {
- return fmt.Errorf("failed to set validation parameter on asset: %v", err)
- }
-
- return nil
-}
-
-// GetAssetHashId allows a potential buyer to validate the properties of an asset against the asset Id hash on chain and returns the hash
-func (s *SmartContract) GetAssetHashId(ctx contractapi.TransactionContextInterface) (string, error) {
- transientMap, err := ctx.GetStub().GetTransient()
- if err != nil {
- return "", fmt.Errorf("error getting transient: %v", err)
- }
-
- // Asset properties must be retrieved from the transient field as they are private
- propertiesJSON, ok := transientMap["asset_properties"]
- if !ok {
- return "", fmt.Errorf("asset_properties key not found in the transient map")
- }
-
- hash := sha256.New()
- hash.Write(propertiesJSON)
- assetID := hex.EncodeToString(hash.Sum(nil))
-
- asset, err := s.ReadAsset(ctx, assetID)
- if err != nil {
- return "", fmt.Errorf("failed to get asset: %v, asset properies provided do not represent any on chain asset", err)
- }
- if asset.ID != assetID {
- return "", fmt.Errorf("Asset properies provided do not correpond to any on chain asset")
- }
- return asset.ID, nil
-}
-
-func main() {
- chaincode, err := contractapi.NewChaincode(new(SmartContract))
- if err != nil {
- log.Panicf("Error create transfer asset chaincode: %v", err)
- }
-
- if err := chaincode.Start(); err != nil {
- log.Panicf("Error starting asset chaincode: %v", err)
- }
-}
diff --git a/asset-transfer-secured-agreement/chaincode-go/asset_transfer_queries.go b/asset-transfer-secured-agreement/chaincode-go/asset_transfer_queries.go
deleted file mode 100644
index 4dc569d8..00000000
--- a/asset-transfer-secured-agreement/chaincode-go/asset_transfer_queries.go
+++ /dev/null
@@ -1,172 +0,0 @@
-/*
- SPDX-License-Identifier: Apache-2.0
-*/
-
-package main
-
-import (
- "encoding/json"
- "fmt"
- "time"
-
- "github.com/hyperledger/fabric-contract-api-go/v2/contractapi"
-)
-
-// QueryResult structure used for handling result of query
-type QueryResult struct {
- Record *Asset
- TxId string `json:"txId"`
- Timestamp time.Time `json:"timestamp"`
-}
-
-type Agreement struct {
- ID string `json:"asset_id"`
- Price int `json:"price"`
- TradeID string `json:"trade_id"`
-}
-
-// ReadAsset returns the public asset data
-func (s *SmartContract) ReadAsset(ctx contractapi.TransactionContextInterface, assetID string) (*Asset, error) {
- // Since only public data is accessed in this function, no access control is required
- assetJSON, err := ctx.GetStub().GetState(assetID)
- if err != nil {
- return nil, fmt.Errorf("failed to read from world state: %v", err)
- }
- if assetJSON == nil {
- return nil, fmt.Errorf("%s does not exist", assetID)
- }
-
- var asset *Asset
- err = json.Unmarshal(assetJSON, &asset)
- if err != nil {
- return nil, err
- }
- return asset, nil
-}
-
-// GetAssetPrivateProperties returns the immutable asset properties from owner's private data collection
-func (s *SmartContract) GetAssetPrivateProperties(ctx contractapi.TransactionContextInterface, assetID string) (string, error) {
-
- collection, err := getClientImplicitCollectionNameAndVerifyClientOrg(ctx)
- if err != nil {
- return "", err
- }
-
- immutableProperties, err := ctx.GetStub().GetPrivateData(collection, assetID)
- if err != nil {
- return "", fmt.Errorf("failed to read asset private properties from client org's collection: %v", err)
- }
- if immutableProperties == nil {
- return "", fmt.Errorf("asset private details does not exist in client org's collection: %s", assetID)
- }
-
- return string(immutableProperties), nil
-}
-
-// GetAssetSalesPrice returns the sales price
-func (s *SmartContract) GetAssetSalesPrice(ctx contractapi.TransactionContextInterface, assetID string) (string, error) {
- return getAssetPrice(ctx, assetID, typeAssetForSale)
-}
-
-// GetAssetBidPrice returns the bid price
-func (s *SmartContract) GetAssetBidPrice(ctx contractapi.TransactionContextInterface, assetID string) (string, error) {
- return getAssetPrice(ctx, assetID, typeAssetBid)
-}
-
-// getAssetPrice gets the bid or ask price from caller's implicit private data collection
-func getAssetPrice(ctx contractapi.TransactionContextInterface, assetID string, priceType string) (string, error) {
-
- collection, err := getClientImplicitCollectionNameAndVerifyClientOrg(ctx)
- if err != nil {
- return "", err
- }
-
- assetPriceKey, err := ctx.GetStub().CreateCompositeKey(priceType, []string{assetID})
- if err != nil {
- return "", fmt.Errorf("failed to create composite key: %v", err)
- }
-
- price, err := ctx.GetStub().GetPrivateData(collection, assetPriceKey)
- if err != nil {
- return "", fmt.Errorf("failed to read asset price from implicit private data collection: %v", err)
- }
- if price == nil {
- return "", fmt.Errorf("asset price does not exist: %s", assetID)
- }
-
- return string(price), nil
-}
-
-// QueryAssetSaleAgreements returns all of an organization's proposed sales
-func (s *SmartContract) QueryAssetSaleAgreements(ctx contractapi.TransactionContextInterface) ([]Agreement, error) {
- return queryAgreementsByType(ctx, typeAssetForSale)
-}
-
-// QueryAssetBuyAgreements returns all of an organization's proposed bids
-func (s *SmartContract) QueryAssetBuyAgreements(ctx contractapi.TransactionContextInterface) ([]Agreement, error) {
- return queryAgreementsByType(ctx, typeAssetBid)
-}
-
-func queryAgreementsByType(ctx contractapi.TransactionContextInterface, agreeType string) ([]Agreement, error) {
- collection, err := getClientImplicitCollectionNameAndVerifyClientOrg(ctx)
- if err != nil {
- return nil, err
- }
-
- // Query for any object type starting with `agreeType`
- agreementsIterator, err := ctx.GetStub().GetPrivateDataByPartialCompositeKey(collection, agreeType, []string{})
- if err != nil {
- return nil, fmt.Errorf("failed to read from private data collection: %v", err)
- }
- defer agreementsIterator.Close()
-
- var agreements []Agreement
- for agreementsIterator.HasNext() {
- resp, err := agreementsIterator.Next()
- if err != nil {
- return nil, err
- }
-
- var agreement Agreement
- err = json.Unmarshal(resp.Value, &agreement)
- if err != nil {
- return nil, err
- }
-
- agreements = append(agreements, agreement)
- }
-
- return agreements, nil
-}
-
-// QueryAssetHistory returns the chain of custody for a asset since issuance
-func (s *SmartContract) QueryAssetHistory(ctx contractapi.TransactionContextInterface, assetID string) ([]QueryResult, error) {
- resultsIterator, err := ctx.GetStub().GetHistoryForKey(assetID)
- if err != nil {
- return nil, err
- }
- defer resultsIterator.Close()
-
- var results []QueryResult
- for resultsIterator.HasNext() {
- response, err := resultsIterator.Next()
- if err != nil {
- return nil, err
- }
-
- var asset *Asset
- err = json.Unmarshal(response.Value, &asset)
- if err != nil {
- return nil, err
- }
-
- record := QueryResult{
- TxId: response.TxId,
- Timestamp: response.Timestamp.AsTime(),
- Record: asset,
- }
- results = append(results, record)
- }
-
- return results, nil
-}
diff --git a/asset-transfer-secured-agreement/chaincode-go/go.mod b/asset-transfer-secured-agreement/chaincode-go/go.mod
deleted file mode 100644
index 8599ebee..00000000
--- a/asset-transfer-secured-agreement/chaincode-go/go.mod
+++ /dev/null
@@ -1,28 +0,0 @@
-module github.com/hyperledger/fabric-samples/chaincode/tradingMarbles
-
-go 1.22.0
-
-require (
- github.com/hyperledger/fabric-chaincode-go/v2 v2.0.0
- github.com/hyperledger/fabric-contract-api-go/v2 v2.2.0
-)
-
-require (
- github.com/go-openapi/jsonpointer v0.21.0 // indirect
- github.com/go-openapi/jsonreference v0.21.0 // indirect
- github.com/go-openapi/spec v0.21.0 // indirect
- github.com/go-openapi/swag v0.23.0 // indirect
- github.com/hyperledger/fabric-protos-go-apiv2 v0.3.4 // indirect
- github.com/josharian/intern v1.0.0 // indirect
- github.com/mailru/easyjson v0.7.7 // indirect
- github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect
- github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
- github.com/xeipuuv/gojsonschema v1.2.0 // indirect
- golang.org/x/net v0.28.0 // indirect
- golang.org/x/sys v0.24.0 // indirect
- golang.org/x/text v0.17.0 // indirect
- google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f // indirect
- google.golang.org/grpc v1.67.0 // indirect
- google.golang.org/protobuf v1.36.1 // indirect
- gopkg.in/yaml.v3 v3.0.1 // indirect
-)
diff --git a/asset-transfer-secured-agreement/chaincode-go/go.sum b/asset-transfer-secured-agreement/chaincode-go/go.sum
deleted file mode 100644
index fa4d3b24..00000000
--- a/asset-transfer-secured-agreement/chaincode-go/go.sum
+++ /dev/null
@@ -1,61 +0,0 @@
-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/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1rr/O9oNQ=
-github.com/go-openapi/jsonpointer v0.21.0/go.mod h1:IUyH9l/+uyhIYQ/PXVA41Rexl+kOkAPDdXEYns6fzUY=
-github.com/go-openapi/jsonreference v0.21.0 h1:Rs+Y7hSXT83Jacb7kFyjn4ijOuVGSvOdF2+tg1TRrwQ=
-github.com/go-openapi/jsonreference v0.21.0/go.mod h1:LmZmgsrTkVg9LG4EaHeY8cBDslNPMo06cago5JNLkm4=
-github.com/go-openapi/spec v0.21.0 h1:LTVzPc3p/RzRnkQqLRndbAzjY0d0BCL72A6j3CdL9ZY=
-github.com/go-openapi/spec v0.21.0/go.mod h1:78u6VdPw81XU44qEWGhtr982gJ5BWg2c0I5XwVMotYk=
-github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+GrE=
-github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ=
-github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
-github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
-github.com/hyperledger/fabric-chaincode-go/v2 v2.0.0 h1:IhkHfrl5X/fVnmB6pWeCYCdIJRi9bxj+WTnVN8DtW3c=
-github.com/hyperledger/fabric-chaincode-go/v2 v2.0.0/go.mod h1:PHHaFffjw7p7n9bmCfcm7RqDqYdivNEsJdiNIKZo5Lk=
-github.com/hyperledger/fabric-contract-api-go/v2 v2.2.0 h1:rmUoBmciB0GL/miqcbJmJbgp5QTWoJUrZo+CNxrNLF4=
-github.com/hyperledger/fabric-contract-api-go/v2 v2.2.0/go.mod h1:FeWeO/jwGjiME7ak3GufqKIcwkejtzrDG4QxbfKydWs=
-github.com/hyperledger/fabric-protos-go-apiv2 v0.3.4 h1:YJrd+gMaeY0/vsN0aS0QkEKTivGoUnSRIXxGJ7KI+Pc=
-github.com/hyperledger/fabric-protos-go-apiv2 v0.3.4/go.mod h1:bau/6AJhvEcu9GKKYHlDXAxXKzYNfhP6xu2GXuxEcFk=
-github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
-github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
-github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
-github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
-github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
-github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
-github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=
-github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
-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/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8=
-github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4=
-github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
-github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY=
-github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
-github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
-github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
-github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
-github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=
-github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb h1:zGWFAtiMcyryUHoUjUJX0/lt1H2+i2Ka2n+D3DImSNo=
-github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=
-github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHovont7NscjpAxXsDA8S8BMYve8Y5+7cuRE7R0=
-github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ=
-github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74=
-github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y=
-golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE=
-golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg=
-golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg=
-golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
-golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc=
-golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
-google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f h1:BWUVssLB0HVOSY78gIdvk1dTVYtT1y8SBWtPYuTJ/6w=
-google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM=
-google.golang.org/grpc v1.67.0 h1:IdH9y6PF5MPSdAntIcpjQ+tXO41pcQsfZV2RxtQgVcw=
-google.golang.org/grpc v1.67.0/go.mod h1:1gLDyUQU7CTLJI90u3nXZ9ekeghjeM7pTDZlqFNg2AA=
-google.golang.org/protobuf v1.36.1 h1:yBPeRvTftaleIgM3PZ/WBIZ7XM/eEYAaEyCwvyjq/gk=
-google.golang.org/protobuf v1.36.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
-gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
-gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
-gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
-gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
-gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
diff --git a/auction-dutch/README.md b/auction-dutch/README.md
deleted file mode 100644
index 12d79b1a..00000000
--- a/auction-dutch/README.md
+++ /dev/null
@@ -1,615 +0,0 @@
-## Dutch auction
-
-This example allows you to run a [Dutch auction](https://en.wikipedia.org/wiki/Dutch_auction) that sells multiple items of the same good. All items are sold at the price that clears the auction. You also have the option of adding an auditor organization to the auction. If the organizations running the auction cannot agree, or encounter a technical error that prevents them from updating the auction, one of the auction participants can appeal to an auditor organization. The dutch auction smart contract provides an example of how create a complex signature policy by creating a protobuf and then using the policy for state based endorsement.
-
-This tutorial uses the example smart contract to run an auction in which a single seller wants to sell 100 tickets to multiple bidders. If you chose to add an auditor to the auction, you can appeal to the auditor to end the auction by overriding the standard auction endorsement policy.
-
-## Deploy the chaincode
-
-Change into the test network directory.
-```
-cd fabric-samples/test-network
-```
-
-If the test network is already running, run the following command to bring the network down and start from a clean initial state.
-```
-./network.sh down
-```
-
-You can then run the following command to deploy a new network.
-```
-./network.sh up createChannel -ca
-```
-
-Run the following command to deploy the dutch auction smart contract.
-```
-./network.sh deployCC -ccn auction -ccp ../auction-dutch/chaincode-go/ -ccep "OR('Org1MSP.peer','Org2MSP.peer')" -ccl go
-```
-
-Note that we deploy the smart contract with an endorsement policy of `"OR('Org1MSP.peer','Org2MSP.peer')" ` instead of using the default endorsement policy of the majority of orgs on the channel. Either Org1 or Org2 can create an auction without the endorsement of the other organization.
-
-## Add an auditor (optional)
-
-The smart contract allows you to add an auditor organization to the auction. The auditor can add bids, close the auction, or end the auction if participants cannot cooperate. In this tutorial, we will add the Org3 organization to the test network channel and install an auditor specific version of the dutch auction smart contract. This allows you to use Org3 as the auditor organization.
-
-From the `test-network` directory, issue the following commands to add Org3 to the channel:
-
-```
-cd addOrg3
-./addOrg3.sh up
-```
-
-Navigate back to the test network directory:
-```
-cd ..
-```
-
-Set the following environment to interact with the test network as Org3.
-```
-export PATH=${PWD}/../bin:$PATH
-export FABRIC_CFG_PATH=${PWD}/../config/
-export CORE_PEER_TLS_ENABLED=true
-export CORE_PEER_LOCALMSPID=Org3MSP
-export CORE_PEER_TLS_ROOTCERT_FILE=${PWD}/organizations/peerOrganizations/org3.example.com/peers/peer0.org3.example.com/tls/ca.crt
-export CORE_PEER_MSPCONFIGPATH=${PWD}/organizations/peerOrganizations/org3.example.com/users/Admin@org3.example.com/msp
-export CORE_PEER_ADDRESS=localhost:11051
-```
-
-To deploy the smart contract on the Org3 peer, we need to use the peer lifecycle chaincode commands to install the chaincode package and approve the chaincode definition as Org3. Run the following command to package the auditor version of the dutch auction smart contract:
-```
-peer lifecycle chaincode package auction.tar.gz --path ../auction-dutch/chaincode-go-auditor/ --lang golang --label auction_1
-```
-Install the chaincode package on the Org3 peer:
-```
-peer lifecycle chaincode install auction.tar.gz
-```
-
-The next step is to approve the chaincode as the Org3 admin. This requires getting the package ID of the chaincode that we just installed.
-```
-peer lifecycle chaincode queryinstalled
-```
-
-The command should return a response similar to the following:
-```
-Installed chaincodes on peer:
-Package ID: auction_1:8f0d6b6b5a616a1c2b6a9268418f2ee65718acc3c07ea12e123b189b3fb4fb14, Label: auction_1
-```
-
-Save the package ID returned by the command above as an environment variable. The package ID will not be the same for all users, so you need to complete this step using the package ID returned from your console.
-```
-export CC_PACKAGE_ID=auction_1:8f0d6b6b5a616a1c2b6a9268418f2ee65718acc3c07ea12e123b189b3fb4fb14
-```
-
-You can now approve the auction chaincode for Org3:
-```
-peer lifecycle chaincode approveformyorg -o localhost:7050 --ordererTLSHostnameOverride orderer.example.com --tls --cafile "${PWD}/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem" --channelID mychannel --name auction --version 1.0 --package-id $CC_PACKAGE_ID --sequence 1 --signature-policy "OR('Org1MSP.peer','Org2MSP.peer')"
-```
-
-The command will start the dutch auction chaincode on the Org3 peer. Note that we did not update the endorsement policy before we added the auditor organization. Only Org1 and Org2 will be able create an auction. The auditor is added the endorsement policy after the auction is created. Because the auditor does not need to create an auction or create new bids, the auditor can run a different version of the smart contract than the auction participants. The auditor version of the smart contract also adds logic to check that the request is submitted by one of the auction participants before the auditor can intervene.
-
-## Install the application dependencies
-
-We will run the dutch auction using a series of Node.js applications. Change into the `application-javascript` directory:
-```
-cd fabric-samples/auction-dutch/application-javascript
-```
-
-From this directory, run the following command to download the application dependencies if you have not done so already:
-```
-npm install
-```
-
-## Register and enroll the application identities
-
-To interact with the network, you will need to enroll the Certificate Authority administrators of Org1 and Org2. You can use the `enrollAdmin.js` program for this task. Run the following command to enroll the Org1 admin:
-```
-node enrollAdmin.js org1
-```
-You should see the logs of the admin wallet being created on your local file system. Now run the command to enroll the CA admin of Org2:
-```
-node enrollAdmin.js org2
-```
-
-We can use the CA admins of both organizations to register and enroll the identities of the seller that will create the auction and the bidders who will try to purchase the tickets. Run the following command to register and enroll the seller identity that will create the auction. The seller will belong to Org1.
-```
-node registerEnrollUser.js org1 seller
-```
-
-You should see the logs of the seller wallet being created as well. Run the following commands to register and enroll two bidders from Org1 and another three bidders from Org2:
-```
-node registerEnrollUser.js org1 bidder1
-node registerEnrollUser.js org1 bidder2
-node registerEnrollUser.js org2 bidder3
-node registerEnrollUser.js org2 bidder4
-node registerEnrollUser.js org2 bidder5
-```
-
-## Create the auction
-
-The seller from Org1 would like to create an auction to sell 100 tickets. Run the following command to use the seller wallet to run the `createAuction.js` application. The seller needs to provide an auction ID, the item to be sold, and the quantity to be sold to create the auction. The seller uses `withAuditor` to indicate that Org3 will be added as the auditor organization. If you do not want to add an auditor, you can provide a value of `noAuditor`. You will see the application query the auction after it is created.
-```
-node createAuction.js org1 seller auction1 tickets 100 withAuditor
-```
-
-Adding an auditor to the auction creates an endorsement policy with the auditor included. Without the auditor, each organization with sellers or bidders participating in the auction is added to the auction endorsement policy. For example, if the auction had two organizations participating in the auction, the auction endorsement policy would be `AND(Org1, Org2)`. However, if the selling organization decides to add an auditor, the auditor organization would be added to the endorsement policy. If the participating organizations disagree, or if a participant has a technical problem, the auditor can join any one of the participating organizations and agree to update the auction. Extending the example above, if the auction with two organizations added an auditor, the auction endorsement policy would be `OR(AND(Org1, Org2), AND(auditor, OR(Org1, Org2)))`.
-
-## Bid on the auction
-
-We can now use the bidder wallets to submit bids to the auction:
-
-### Bid as bidder1
-
-Bidder1 will create a bid to purchase 50 tickets for 80 dollars.
-```
-node bid.js org1 bidder1 auction1 50 80
-```
-
-The application will query the bid after it is created:
-```
-*** Result: Bid: {
- "objectType": "bid",
- "quantity": 50,
- "price": 80,
- "org": "Org1MSP",
- "buyer": "x509::CN=bidder1,OU=client+OU=org1+OU=department1::CN=ca.org1.example.com,O=org1.example.com,L=Durham,ST=North Carolina,C=US"
-}
-```
-
-The `bid.js` application also prints the bidID:
-```
-*** Result ***SAVE THIS VALUE*** BidID: 6630e1bb06e827a2b77023f63677fae8a0ad43126730e450d3252fa58eeb85b1
-```
-
-The BidID acts as the unique identifier for the bid. This ID allows you to query the bid using the `queryBid.js` program and add the bid to the auction. Save the bidID returned by the application as an environment variable in your terminal:
-```
-export BIDDER1_BID_ID=6630e1bb06e827a2b77023f63677fae8a0ad43126730e450d3252fa58eeb85b1
-```
-This value will be different for each transaction, so you will need to use the value returned in your terminal.
-
-Now that the bid has been created, you can submit the bid to the auction. Run the following command to submit the bid that was just created:
-```
-node submitBid.js org1 bidder1 auction1 $BIDDER1_BID_ID
-```
-
-The hash of bid is added to the list of private bids in that have been submitted to `auction1`. Storing the hash on the public auction ledger allows users to prove the accuracy of the bids they reveal once bidding is closed. The application queries the auction to verify that the bid was added:
-```
-*** Result: Auction: {
- "objectType": "auction",
- "item": "tickets",
- "seller": "x509::CN=seller,OU=client+OU=org1+OU=department1::CN=ca.org1.example.com,O=org1.example.com,L=Durham,ST=North Carolina,C=US",
- "quantity": 100,
- "organizations": [
- "Org1MSP"
- ],
- "privateBids": {
- "\u0000bid\u0000auction1\u00006630e1bb06e827a2b77023f63677fae8a0ad43126730e450d3252fa58eeb85b1\u0000": {
- "org": "Org1MSP",
- "hash": "2f7a62152627d69d73e31b62cd4731d32ecc277de0eef4d30b1235891298abf7"
- }
- },
- "revealedBids": {},
- "winners": [],
- "price": 0,
- "status": "open",
- "auditor": true
-}
-```
-
-### Bid as bidder2
-
-Let's submit another bid. Bidder2 would like to purchase 40 tickets for 50 dollars.
-```
-node bid.js org1 bidder2 auction1 40 50
-```
-
-Save the Bid ID returned by the application:
-```
-export BIDDER2_BID_ID=5796569dae2e95242eadc5cf1cf8aa24f5ae072d801e7decb2547530de5a65e8
-```
-
-Submit bidder2's bid to the auction:
-```
-node submitBid.js org1 bidder2 auction1 $BIDDER2_BID_ID
-```
-
-### Bid as bidder3 from Org2
-
-Bidder3 will bid for 30 tickets at 70 dollars:
-```
-node bid.js org2 bidder3 auction1 30 70
-```
-
-Save the Bid ID returned by the application:
-```
-export BIDDER3_BID_ID=d52ea4d9b4bc428d395db2d68323bc12cc9b5c1f8617900f459ccd41c38d3c0a
-```
-
-Add bidder3's bid to the auction:
-```
-node submitBid.js org2 bidder3 auction1 $BIDDER3_BID_ID
-```
-
-Because bidder3 belongs to Org2, submitting the bid will add Org2 to the list of participating organizations. You can see the Org2 MSP ID has been added to the list of `"organizations"` in the updated auction returned by the application:
-```
-*** Result: Auction: {
- "objectType": "auction",
- "item": "tickets",
- "seller": "x509::CN=seller,OU=client+OU=org1+OU=department1::CN=ca.org1.example.com,O=org1.example.com,L=Durham,ST=North Carolina,C=US",
- "quantity": 100,
- "organizations": [
- "Org1MSP",
- "Org2MSP"
- ],
- "privateBids": {
- "\u0000bid\u0000auction1\u00005796569dae2e95242eadc5cf1cf8aa24f5ae072d801e7decb2547530de5a65e8\u0000": {
- "org": "Org1MSP",
- "hash": "598749480aa3af816a829455e1fdac25a44f31c2ae81f911f85d004f44dbbe6c"
- },
- "\u0000bid\u0000auction1\u00006630e1bb06e827a2b77023f63677fae8a0ad43126730e450d3252fa58eeb85b1\u0000": {
- "org": "Org1MSP",
- "hash": "2f7a62152627d69d73e31b62cd4731d32ecc277de0eef4d30b1235891298abf7"
- },
- "\u0000bid\u0000auction1\u0000d52ea4d9b4bc428d395db2d68323bc12cc9b5c1f8617900f459ccd41c38d3c0a\u0000": {
- "org": "Org2MSP",
- "hash": "bf1e9fb80ea3e29780fe13b4781b6dad28fa83b4b5db68bd7e90252875d152fb"
- }
- },
- "revealedBids": {},
- "winners": [],
- "price": 0,
- "status": "open",
- "auditor": true
-}
-```
-
-Now that a bid from Org2 has been added to the auction, any updates to the auction need to be endorsed by the Org2 peer. The applications will use the `"organizations"` field to specify which organizations need to endorse submitting a new bid, revealing a bid, or updating the auction status.
-
-### Bid as bidder4
-
-Bidder4 from Org2 would like to purchase 15 tickets for 60 dollars:
-```
-node bid.js org2 bidder4 auction1 15 60
-```
-
-Save the Bid ID returned by the application:
-```
-export BIDDER4_BID_ID=c6464f984bb01e639a46e58b94c496e8bbd829b5e4fa7ffcc150d9a565d45684
-```
-
-Add bidder4's bid to the auction:
-```
-node submitBid.js org2 bidder4 auction1 $BIDDER4_BID_ID
-```
-
-### Bid as bidder5
-
-Bidder5 from Org2 will bid for 20 tickets at 60 dollars:
-```
-node bid.js org2 bidder5 auction1 20 60
-```
-
-Save the Bid ID returned by the application:
-```
-export BIDDER5_BID_ID=f4024ab09b4dacf0a636927414850dde2a2a5e8ec4601e2a0071f5c233248207
-```
-
-Add bidder5's bid to the auction:
-```
-node submitBid.js org2 bidder5 auction1 $BIDDER5_BID_ID
-```
-
-
-## Close the auction
-
-Now that all five bidders have joined the auction, the seller would like to close the auction and allow buyers to reveal their bids. The seller identity that created the auction needs to submit the transaction:
-```
-node closeAuction.js org1 seller auction1
-```
-
-The application will query the auction to allow you to verify that the auction status has changed to closed.
-
-## Reveal bids
-
-After the auction is closed, bidders can try to win the auction by revealing their bids. The transaction to reveal a bid needs to pass four checks:
-1. The auction is closed.
-2. The transaction was submitted by the identity that created the bid.
-3. The hash of the revealed bid matches the hash of the bid on the channel ledger. This confirms that the bid is the same as the bid that is stored in the private data collection.
-4. The hash of the revealed bid matches the hash that was submitted to the auction. This confirms that the bid was not altered after the auction was closed.
-
-Use the `revealBid.js` application to reveal the bid of Bidder1:
-```
-node revealBid.js org1 bidder1 auction1 $BIDDER1_BID_ID
-```
-
-The full bid details, including the quantity and price, are now visible:
-```
-*** Result: Auction: {
- "objectType": "auction",
- "item": "tickets",
- "seller": "x509::CN=seller,OU=client+OU=org1+OU=department1::CN=ca.org1.example.com,O=org1.example.com,L=Durham,ST=North Carolina,C=US",
- "quantity": 100,
- "organizations": [
- "Org1MSP",
- "Org2MSP"
- ],
- "privateBids": {
- "\u0000bid\u0000auction1\u00005796569dae2e95242eadc5cf1cf8aa24f5ae072d801e7decb2547530de5a65e8\u0000": {
- "org": "Org1MSP",
- "hash": "598749480aa3af816a829455e1fdac25a44f31c2ae81f911f85d004f44dbbe6c"
- },
- "\u0000bid\u0000auction1\u00006630e1bb06e827a2b77023f63677fae8a0ad43126730e450d3252fa58eeb85b1\u0000": {
- "org": "Org1MSP",
- "hash": "2f7a62152627d69d73e31b62cd4731d32ecc277de0eef4d30b1235891298abf7"
- },
- "\u0000bid\u0000auction1\u0000c6464f984bb01e639a46e58b94c496e8bbd829b5e4fa7ffcc150d9a565d45684\u0000": {
- "org": "Org2MSP",
- "hash": "eefcadf8e9e5cb8322a6e642ab6d5512d62e6d68f37a72b00f5b0d9e580eddb9"
- },
- "\u0000bid\u0000auction1\u0000d52ea4d9b4bc428d395db2d68323bc12cc9b5c1f8617900f459ccd41c38d3c0a\u0000": {
- "org": "Org2MSP",
- "hash": "bf1e9fb80ea3e29780fe13b4781b6dad28fa83b4b5db68bd7e90252875d152fb"
- },
- "\u0000bid\u0000auction1\u0000f4024ab09b4dacf0a636927414850dde2a2a5e8ec4601e2a0071f5c233248207\u0000": {
- "org": "Org2MSP",
- "hash": "de82232141bac06ea3818146fb650dc9930d45b9ceab506ac66942b119eec094"
- }
- },
- "revealedBids": {
- "\u0000bid\u0000auction1\u00006630e1bb06e827a2b77023f63677fae8a0ad43126730e450d3252fa58eeb85b1\u0000": {
- "objectType": "bid",
- "quantity": 50,
- "price": 80,
- "org": "Org1MSP",
- "buyer": "x509::CN=bidder1,OU=client+OU=org1+OU=department1::CN=ca.org1.example.com,O=org1.example.com,L=Durham,ST=North Carolina,C=US"
- }
- },
- "winners": [],
- "price": 0,
- "status": "closed",
- "auditor": true
-}
-```
-We will add three more bidders, the second bidder from Org1 and two bidders from Org2. Run the following commands to reveal the bidders:
-```
-node revealBid.js org1 bidder2 auction1 $BIDDER2_BID_ID
-node revealBid.js org2 bidder4 auction1 $BIDDER4_BID_ID
-node revealBid.js org2 bidder5 auction1 $BIDDER5_BID_ID
-```
-
-Let's try to end the auction using the seller identity and see what happens.
-
-```
-node endAuction.js org1 seller auction1
-```
-
-The output should look something like the following:
-
-```
---> Submit the transaction to end the auction
-2021-01-28T16:47:27.501Z - error: [DiscoveryHandler]: compareProposalResponseResults[undefined] - read/writes result sets do not match index=1
-2021-01-28T16:47:27.503Z - error: [Transaction]: Error: No valid responses from any peers. Errors:
- peer=undefined, status=grpc, message=Peer endorsements do not match
-******** FAILED to submit bid: Error: No valid responses from any peers. Errors:
- peer=undefined, status=grpc, message=Peer endorsements do not match
-```
-
-Instead of ending the auction, the transaction results in an endorsement policy failure. The end of the auction needs to be endorsed by Org2. Before endorsing the transaction, the Org2 peer queries its private data collection for any winning bids that have not yet been revealed. Because the price that would clear the auction with the currently revealed bids is lower than the bid of Bidder3, the Org2 peer refuses to endorse the transaction that would end the auction.
-
-In order to end the auction, Org1 would either need to wait for Org2 to reveal the final bid or appeal to the auditor. Depending on if you created the organization with an auditor, you can end the auction with either set of steps.
-
-## End the auction using an auditor
-
-If Org2 is unable to endorse the transaction to end the auction, Org1 can ask the auditor to intervene. The following program gets an endorsement from the Org3 auditor and Org1 to end the auction. As a result, the transaction would meet the auditor component of the state based endorsement policy.
-```
-node endAuctionwithAuditor org1 seller auction1
-```
-
-Even though Org2 has not agreed to the end of the auction, the endorsement Org1 is sufficient to end the auction if the auditor agrees. As part of ending the auction, both Org1 and the auditor need to calculate the same price and the same set of winners. Each winning bidder is listed next to the quantity that was allocated to them.
-```
-*** Result: Auction: {
- "objectType": "auction",
- "item": "tickets",
- "seller": "x509::CN=seller,OU=client+OU=org1+OU=department1::CN=ca.org1.example.com,O=org1.example.com,L=Durham,ST=North Carolina,C=US",
- "quantity": 100,
- "organizations": [
- "Org1MSP",
- "Org2MSP"
- ],
- "privateBids": {
- "\u0000bid\u0000auction1\u00005796569dae2e95242eadc5cf1cf8aa24f5ae072d801e7decb2547530de5a65e8\u0000": {
- "org": "Org1MSP",
- "hash": "598749480aa3af816a829455e1fdac25a44f31c2ae81f911f85d004f44dbbe6c"
- },
- "\u0000bid\u0000auction1\u00006630e1bb06e827a2b77023f63677fae8a0ad43126730e450d3252fa58eeb85b1\u0000": {
- "org": "Org1MSP",
- "hash": "2f7a62152627d69d73e31b62cd4731d32ecc277de0eef4d30b1235891298abf7"
- },
- "\u0000bid\u0000auction1\u0000c6464f984bb01e639a46e58b94c496e8bbd829b5e4fa7ffcc150d9a565d45684\u0000": {
- "org": "Org2MSP",
- "hash": "eefcadf8e9e5cb8322a6e642ab6d5512d62e6d68f37a72b00f5b0d9e580eddb9"
- },
- "\u0000bid\u0000auction1\u0000d52ea4d9b4bc428d395db2d68323bc12cc9b5c1f8617900f459ccd41c38d3c0a\u0000": {
- "org": "Org2MSP",
- "hash": "bf1e9fb80ea3e29780fe13b4781b6dad28fa83b4b5db68bd7e90252875d152fb"
- },
- "\u0000bid\u0000auction1\u0000f4024ab09b4dacf0a636927414850dde2a2a5e8ec4601e2a0071f5c233248207\u0000": {
- "org": "Org2MSP",
- "hash": "de82232141bac06ea3818146fb650dc9930d45b9ceab506ac66942b119eec094"
- }
- },
- "revealedBids": {
- "\u0000bid\u0000auction1\u00005796569dae2e95242eadc5cf1cf8aa24f5ae072d801e7decb2547530de5a65e8\u0000": {
- "objectType": "bid",
- "quantity": 40,
- "price": 50,
- "org": "Org1MSP",
- "buyer": "x509::CN=bidder2,OU=client+OU=org1+OU=department1::CN=ca.org1.example.com,O=org1.example.com,L=Durham,ST=North Carolina,C=US"
- },
- "\u0000bid\u0000auction1\u00006630e1bb06e827a2b77023f63677fae8a0ad43126730e450d3252fa58eeb85b1\u0000": {
- "objectType": "bid",
- "quantity": 50,
- "price": 80,
- "org": "Org1MSP",
- "buyer": "x509::CN=bidder1,OU=client+OU=org1+OU=department1::CN=ca.org1.example.com,O=org1.example.com,L=Durham,ST=North Carolina,C=US"
- },
- "\u0000bid\u0000auction1\u0000c6464f984bb01e639a46e58b94c496e8bbd829b5e4fa7ffcc150d9a565d45684\u0000": {
- "objectType": "bid",
- "quantity": 15,
- "price": 60,
- "org": "Org2MSP",
- "buyer": "x509::CN=bidder4,OU=client+OU=org2+OU=department1::CN=ca.org2.example.com,O=org2.example.com,L=Hursley,ST=Hampshire,C=UK"
- },
- "\u0000bid\u0000auction1\u0000f4024ab09b4dacf0a636927414850dde2a2a5e8ec4601e2a0071f5c233248207\u0000": {
- "objectType": "bid",
- "quantity": 20,
- "price": 60,
- "org": "Org2MSP",
- "buyer": "x509::CN=bidder5,OU=client+OU=org2+OU=department1::CN=ca.org2.example.com,O=org2.example.com,L=Hursley,ST=Hampshire,C=UK"
- }
- },
- "winners": [
- {
- "buyer": "x509::CN=bidder1,OU=client+OU=org1+OU=department1::CN=ca.org1.example.com,O=org1.example.com,L=Durham,ST=North Carolina,C=US",
- "quantity": 50
- },
- {
- "buyer": "x509::CN=bidder4,OU=client+OU=org2+OU=department1::CN=ca.org2.example.com,O=org2.example.com,L=Hursley,ST=Hampshire,C=UK",
- "quantity": 15
- },
- {
- "buyer": "x509::CN=bidder5,OU=client+OU=org2+OU=department1::CN=ca.org2.example.com,O=org2.example.com,L=Hursley,ST=Hampshire,C=UK",
- "quantity": 20
- },
- {
- "buyer": "x509::CN=bidder2,OU=client+OU=org1+OU=department1::CN=ca.org1.example.com,O=org1.example.com,L=Durham,ST=North Carolina,C=US",
- "quantity": 15
- }
- ],
- "price": 50,
- "status": "ended",
- "auditor": true
-}
-```
-
-The auction allocates tickets to the highest bids first. Because all 100 tickets are sold after allocating tickets to the bid that was submitted at 50, 50 is the `"price"` that clears the auction.
-
-## End the auction without an auditor
-
-If we did not add an auditor to the auction, we need to add the remaining bid so that Org2 will endorse ending the auction.
-```
-node revealBid.js org2 bidder3 auction1 $BIDDER3_BID_ID
-```
-
-Now that all the winning bids have been revealed, we can submit the transaction to end the auction once more.
-```
-node endAuction org1 seller auction1
-```
-
-The transaction was successfully endorsed by both Org1 and Org2, who both calculated the same price and winners of the auction. Each winning bidder is listed next to the quantity that was allocated to them.
-```
-*** Result: Auction: {
- "objectType": "auction",
- "item": "tickets",
- "seller": "x509::CN=seller,OU=client+OU=org1+OU=department1::CN=ca.org1.example.com,O=org1.example.com,L=Durham,ST=North Carolina,C=US",
- "quantity": 100,
- "organizations": [
- "Org1MSP",
- "Org2MSP"
- ],
- "privateBids": {
- "\u0000bid\u0000auction1\u0000482b2a68fbbfae329b0b4bc9d70b90f3a55fdcbae5f5274dec34d438efb6847e\u0000": {
- "org": "Org1MSP",
- "hash": "2f7a62152627d69d73e31b62cd4731d32ecc277de0eef4d30b1235891298abf7"
- },
- "\u0000bid\u0000auction1\u000048d93017ac65cff0dd23406cc29918724fd84c8e7014eee30fd492fef760e6a4\u0000": {
- "org": "Org2MSP",
- "hash": "bf1e9fb80ea3e29780fe13b4781b6dad28fa83b4b5db68bd7e90252875d152fb"
- },
- "\u0000bid\u0000auction1\u00005ba4c856224cdc8209b0e42f30a757331e3fb8a8b660b64a55e1bcf688b745ad\u0000": {
- "org": "Org1MSP",
- "hash": "598749480aa3af816a829455e1fdac25a44f31c2ae81f911f85d004f44dbbe6c"
- },
- "\u0000bid\u0000auction1\u000063c8a192dae1332ae42af890f8a966fea2ae8365ca9746447e014a7c0494d64e\u0000": {
- "org": "Org2MSP",
- "hash": "de82232141bac06ea3818146fb650dc9930d45b9ceab506ac66942b119eec094"
- },
- "\u0000bid\u0000auction1\u000066ff6d8bbe81e98654fc417915808031d49e93cd8d7475f15317d801317254fa\u0000": {
- "org": "Org2MSP",
- "hash": "eefcadf8e9e5cb8322a6e642ab6d5512d62e6d68f37a72b00f5b0d9e580eddb9"
- }
- },
- "revealedBids": {
- "\u0000bid\u0000auction1\u0000482b2a68fbbfae329b0b4bc9d70b90f3a55fdcbae5f5274dec34d438efb6847e\u0000": {
- "objectType": "bid",
- "quantity": 50,
- "price": 80,
- "org": "Org1MSP",
- "buyer": "x509::CN=bidder1,OU=client+OU=org1+OU=department1::CN=ca.org1.example.com,O=org1.example.com,L=Durham,ST=North Carolina,C=US"
- },
- "\u0000bid\u0000auction1\u000048d93017ac65cff0dd23406cc29918724fd84c8e7014eee30fd492fef760e6a4\u0000": {
- "objectType": "bid",
- "quantity": 30,
- "price": 70,
- "org": "Org2MSP",
- "buyer": "x509::CN=bidder3,OU=client+OU=org2+OU=department1::CN=ca.org2.example.com,O=org2.example.com,L=Hursley,ST=Hampshire,C=UK"
- },
- "\u0000bid\u0000auction1\u00005ba4c856224cdc8209b0e42f30a757331e3fb8a8b660b64a55e1bcf688b745ad\u0000": {
- "objectType": "bid",
- "quantity": 40,
- "price": 50,
- "org": "Org1MSP",
- "buyer": "x509::CN=bidder2,OU=client+OU=org1+OU=department1::CN=ca.org1.example.com,O=org1.example.com,L=Durham,ST=North Carolina,C=US"
- },
- "\u0000bid\u0000auction1\u000063c8a192dae1332ae42af890f8a966fea2ae8365ca9746447e014a7c0494d64e\u0000": {
- "objectType": "bid",
- "quantity": 20,
- "price": 60,
- "org": "Org2MSP",
- "buyer": "x509::CN=bidder5,OU=client+OU=org2+OU=department1::CN=ca.org2.example.com,O=org2.example.com,L=Hursley,ST=Hampshire,C=UK"
- },
- "\u0000bid\u0000auction1\u000066ff6d8bbe81e98654fc417915808031d49e93cd8d7475f15317d801317254fa\u0000": {
- "objectType": "bid",
- "quantity": 15,
- "price": 60,
- "org": "Org2MSP",
- "buyer": "x509::CN=bidder4,OU=client+OU=org2+OU=department1::CN=ca.org2.example.com,O=org2.example.com,L=Hursley,ST=Hampshire,C=UK"
- }
- },
- "winners": [
- {
- "buyer": "x509::CN=bidder1,OU=client+OU=org1+OU=department1::CN=ca.org1.example.com,O=org1.example.com,L=Durham,ST=North Carolina,C=US",
- "quantity": 50
- },
- {
- "buyer": "x509::CN=bidder3,OU=client+OU=org2+OU=department1::CN=ca.org2.example.com,O=org2.example.com,L=Hursley,ST=Hampshire,C=UK",
- "quantity": 30
- },
- {
- "buyer": "x509::CN=bidder4,OU=client+OU=org2+OU=department1::CN=ca.org2.example.com,O=org2.example.com,L=Hursley,ST=Hampshire,C=UK",
- "quantity": 15
- },
- {
- "buyer": "x509::CN=bidder5,OU=client+OU=org2+OU=department1::CN=ca.org2.example.com,O=org2.example.com,L=Hursley,ST=Hampshire,C=UK",
- "quantity": 5
- }
- ],
- "price": 60,
- "status": "ended",
- "auditor": false
-}
-```
-
-The auction allocates tickets to the highest bids first. Because all 100 tickets are sold after allocating tickets to the bids that were submitted at 60, 60 is the `"price"` that clears the auction. The first 80 tickets are allocated to Bidder1 and Bidder3. The remaining 20 tickers are allocated to Bidder4 and Bidder5. When bids are tied, the auction smart contract fills the smaller bids first. As a result, Bidder4 is awarded their full bid of 15 tickets, while Bidder5 is allocated the remaining 5 tickets.
-
-## Clean up
-
-When your are done using the auction smart contract, you can bring down the network and clean up the environment. In the `auction-dutch/application-javascript` directory, run the following command to remove the wallets used to run the applications:
-```
-rm -rf wallet
-```
-
-You can then navigate to the test network directory and bring down the network:
-````
-cd ../../test-network/
-./network.sh down
-````
diff --git a/auction-dutch/application-javascript/.eslintignore b/auction-dutch/application-javascript/.eslintignore
deleted file mode 100644
index 15958470..00000000
--- a/auction-dutch/application-javascript/.eslintignore
+++ /dev/null
@@ -1,5 +0,0 @@
-#
-# SPDX-License-Identifier: Apache-2.0
-#
-
-coverage
diff --git a/auction-dutch/application-javascript/.eslintrc.js b/auction-dutch/application-javascript/.eslintrc.js
deleted file mode 100644
index 20d4fcbd..00000000
--- a/auction-dutch/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/auction-dutch/application-javascript/bid.js b/auction-dutch/application-javascript/bid.js
deleted file mode 100644
index aff30d65..00000000
--- a/auction-dutch/application-javascript/bid.js
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Copyright IBM Corp. All Rights Reserved.
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-
-'use strict';
-
-const { Gateway, Wallets } = require('fabric-network');
-const path = require('path');
-const { buildCCPOrg1, buildCCPOrg2, buildWallet, prettyJSONString } = require('../../test-application/javascript/AppUtil.js');
-
-const myChannel = 'mychannel';
-const myChaincodeName = 'auction';
-
-async function bid (ccp, wallet, user, orgMSP, auctionID, quantity, price) {
- try {
- const gateway = new Gateway();
- // connect using Discovery enabled
-
- await gateway.connect(ccp,
- { wallet: wallet, identity: user, discovery: { enabled: true, asLocalhost: true } });
-
- const network = await gateway.getNetwork(myChannel);
- const contract = network.getContract(myChaincodeName);
-
- console.log('\n--> Evaluate Transaction: get your client ID');
- const buyer = await contract.evaluateTransaction('GetSubmittingClientIdentity');
- console.log('*** Result: Buyer ID is ' + buyer.toString());
-
- const bidData = { objectType: 'bid', quantity: parseInt(quantity), price: parseInt(price), org: orgMSP, buyer: buyer.toString() };
-
- const statefulTxn = contract.createTransaction('Bid');
- statefulTxn.setEndorsingOrganizations(orgMSP);
- const tmapData = Buffer.from(JSON.stringify(bidData));
- statefulTxn.setTransient({
- bid: tmapData
- });
-
- const bidID = statefulTxn.getTransactionId();
-
- console.log('\n--> Submit Transaction: Create the bid that is stored in your private data collection of your organization');
- await statefulTxn.submit(auctionID);
- console.log('*** Result: committed');
- console.log('*** Result ***SAVE THIS VALUE*** BidID: ' + bidID.toString());
-
- console.log('\n--> Evaluate Transaction: read the bid that was just created');
- const result = await contract.evaluateTransaction('QueryBid', auctionID, bidID);
- console.log('*** Result: Bid: ' + prettyJSONString(result.toString()));
-
- gateway.disconnect();
- } catch (error) {
- console.error(`******** FAILED to submit bid: ${error}`);
- if (error.stack) {
- console.error(error.stack);
- }
- process.exit(1);
- }
-}
-
-async function main () {
- try {
- if (process.argv[2] === undefined || process.argv[3] === undefined ||
- process.argv[4] === undefined || process.argv[5] === undefined ||
- process.argv[6] === undefined) {
- console.log('Usage: node bid.js org userID auctionID quantity price');
- process.exit(1);
- }
-
- const org = process.argv[2];
- const user = process.argv[3];
- const auctionID = process.argv[4];
- const quantity = process.argv[5];
- const price = process.argv[6];
-
- if (org === 'Org1' || org === 'org1') {
- const orgMSP = 'Org1MSP';
- const ccp = buildCCPOrg1();
- const walletPath = path.join(__dirname, 'wallet/org1');
- const wallet = await buildWallet(Wallets, walletPath);
- await bid(ccp, wallet, user, orgMSP, auctionID, quantity, price);
- } else if (org === 'Org2' || org === 'org2') {
- const orgMSP = 'Org2MSP';
- const ccp = buildCCPOrg2();
- const walletPath = path.join(__dirname, 'wallet/org2');
- const wallet = await buildWallet(Wallets, walletPath);
- await bid(ccp, wallet, user, orgMSP, auctionID, quantity, price);
- } else {
- console.log('Usage: node bid.js org userID auctionID quantity price');
- console.log('Org must be Org1 or Org2');
- }
- } catch (error) {
- console.error(`******** FAILED to run the application: ${error}`);
- process.exit(1);
- }
-}
-
-main();
diff --git a/auction-dutch/application-javascript/closeAuction.js b/auction-dutch/application-javascript/closeAuction.js
deleted file mode 100644
index 55410fb5..00000000
--- a/auction-dutch/application-javascript/closeAuction.js
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Copyright IBM Corp. All Rights Reserved.
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-
-'use strict';
-
-const { Gateway, Wallets } = require('fabric-network');
-const path = require('path');
-const { buildCCPOrg1, buildCCPOrg2, buildWallet, prettyJSONString } = require('../../test-application/javascript/AppUtil.js');
-
-const myChannel = 'mychannel';
-const myChaincodeName = 'auction';
-
-async function closeAuction (ccp, wallet, user, auctionID) {
- try {
- const gateway = new Gateway();
- // connect using Discovery enabled
-
- await gateway.connect(ccp,
- { wallet: wallet, identity: user, discovery: { enabled: true, asLocalhost: true } });
-
- const network = await gateway.getNetwork(myChannel);
- const contract = network.getContract(myChaincodeName);
-
- // Query the auction to get the list of endorsing orgs.
- // console.log('\n--> Evaluate Transaction: query the auction you want to close');
- const auctionString = await contract.evaluateTransaction('QueryAuction', auctionID);
- // console.log('*** Result: Bid: ' + prettyJSONString(auctionString.toString()));
- const auctionJSON = JSON.parse(auctionString);
-
- const statefulTxn = contract.createTransaction('CloseAuction');
-
- if (auctionJSON.organizations.length === 2) {
- statefulTxn.setEndorsingOrganizations(auctionJSON.organizations[0], auctionJSON.organizations[1]);
- } else {
- statefulTxn.setEndorsingOrganizations(auctionJSON.organizations[0]);
- }
-
- console.log('\n--> Submit Transaction: close auction');
- await statefulTxn.submit(auctionID);
- console.log('*** Result: committed');
-
- console.log('\n--> Evaluate Transaction: query the updated auction');
- const result = await contract.evaluateTransaction('QueryAuction', auctionID);
- console.log('*** Result: Auction: ' + prettyJSONString(result.toString()));
-
- gateway.disconnect();
- } catch (error) {
- console.error(`******** FAILED to submit bid: ${error}`);
- process.exit(1);
- }
-}
-
-async function main () {
- try {
- if (process.argv[2] === undefined || process.argv[3] === undefined || process.argv[4] === undefined) {
- console.log('Usage: node closeAuction.js org userID auctionID');
- process.exit(1);
- }
-
- const org = process.argv[2];
- const user = process.argv[3];
- const auctionID = process.argv[4];
-
- if (org === 'Org1' || org === 'org1') {
- const ccp = buildCCPOrg1();
- const walletPath = path.join(__dirname, 'wallet/org1');
- const wallet = await buildWallet(Wallets, walletPath);
- await closeAuction(ccp, wallet, user, auctionID);
- } else if (org === 'Org2' || org === 'org2') {
- const ccp = buildCCPOrg2();
- const walletPath = path.join(__dirname, 'wallet/org2');
- const wallet = await buildWallet(Wallets, walletPath);
- await closeAuction(ccp, wallet, user, auctionID);
- } else {
- console.log('Usage: node closeAuction.js org userID auctionID');
- console.log('Org must be Org1 or Org2');
- }
- } catch (error) {
- console.error(`******** FAILED to run the application: ${error}`);
- if (error.stack) {
- console.error(error.stack);
- }
- process.exit(1);
- }
-}
-
-main();
diff --git a/auction-dutch/application-javascript/createAuction.js b/auction-dutch/application-javascript/createAuction.js
deleted file mode 100644
index 2f46a248..00000000
--- a/auction-dutch/application-javascript/createAuction.js
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright IBM Corp. All Rights Reserved.
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-
-'use strict';
-
-const { Gateway, Wallets } = require('fabric-network');
-const path = require('path');
-const { buildCCPOrg1, buildCCPOrg2, buildWallet, prettyJSONString } = require('../../test-application/javascript/AppUtil.js');
-
-const myChannel = 'mychannel';
-const myChaincodeName = 'auction';
-
-async function createAuction (ccp, wallet, user, auctionID, item, quantity, auditor) {
- try {
- const gateway = new Gateway();
- // connect using Discovery enabled
-
- await gateway.connect(ccp,
- { wallet: wallet, identity: user, discovery: { enabled: true, asLocalhost: true } });
-
- const network = await gateway.getNetwork(myChannel);
- const contract = network.getContract(myChaincodeName);
-
- const statefulTxn = contract.createTransaction('CreateAuction');
-
- console.log('\n--> Submit Transaction: Propose a new auction');
- await statefulTxn.submit(auctionID, item, parseInt(quantity), auditor);
- console.log('*** Result: committed');
-
- console.log('\n--> Evaluate Transaction: query the auction that was just created');
- const result = await contract.evaluateTransaction('QueryAuction', auctionID);
- console.log('*** Result: Auction: ' + prettyJSONString(result.toString()));
-
- gateway.disconnect();
- } catch (error) {
- console.error(`******** FAILED to submit bid: ${error}`);
- }
-}
-
-async function main () {
- try {
- if (process.argv[2] === undefined || process.argv[3] === undefined ||
- process.argv[4] === undefined || process.argv[5] === undefined ||
- process.argv[6] === undefined) {
- console.log('Usage: node createAuction.js org userID auctionID item quantity');
- process.exit(1);
- }
-
- const org = process.argv[2];
- const user = process.argv[3];
- const auctionID = process.argv[4];
- const item = process.argv[5];
- const quantity = process.argv[6];
- const auditor = process.argv[7];
-
- if (org === 'Org1' || org === 'org1') {
- const ccp = buildCCPOrg1();
- const walletPath = path.join(__dirname, 'wallet/org1');
- const wallet = await buildWallet(Wallets, walletPath);
- await createAuction(ccp, wallet, user, auctionID, item, quantity, auditor);
- } else if (org === 'Org2' || org === 'org2') {
- const ccp = buildCCPOrg2();
- const walletPath = path.join(__dirname, 'wallet/org2');
- const wallet = await buildWallet(Wallets, walletPath);
- await createAuction(ccp, wallet, user, auctionID, item, quantity, auditor);
- } else {
- console.log('Usage: node createAuction.js org userID auctionID item quantity');
- console.log('Org must be Org1 or Org2');
- }
- } catch (error) {
- console.error(`******** FAILED to run the application: ${error}`);
- }
-}
-
-main();
diff --git a/auction-dutch/application-javascript/endAuction.js b/auction-dutch/application-javascript/endAuction.js
deleted file mode 100644
index daec75d2..00000000
--- a/auction-dutch/application-javascript/endAuction.js
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright IBM Corp. All Rights Reserved.
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-
-'use strict';
-
-const { Gateway, Wallets } = require('fabric-network');
-const path = require('path');
-const { buildCCPOrg1, buildCCPOrg2, buildWallet, prettyJSONString } = require('../../test-application/javascript/AppUtil.js');
-
-const myChannel = 'mychannel';
-const myChaincodeName = 'auction';
-
-async function endAuction (ccp, wallet, user, auctionID) {
- try {
- const gateway = new Gateway();
- // connect using Discovery enabled
-
- await gateway.connect(ccp,
- { wallet: wallet, identity: user, discovery: { enabled: true, asLocalhost: true } });
-
- const network = await gateway.getNetwork(myChannel);
- const contract = network.getContract(myChaincodeName);
-
- // Query the auction to get the list of endorsing orgs.
- // console.log('\n--> Evaluate Transaction: query the auction you want to end');
- const auctionString = await contract.evaluateTransaction('QueryAuction', auctionID);
- // console.log('*** Result: Bid: ' + prettyJSONString(auctionString.toString()));
- const auctionJSON = JSON.parse(auctionString);
-
- const statefulTxn = contract.createTransaction('EndAuction');
-
- if (auctionJSON.organizations.length === 2) {
- statefulTxn.setEndorsingOrganizations(auctionJSON.organizations[0], auctionJSON.organizations[1]);
- } else {
- statefulTxn.setEndorsingOrganizations(auctionJSON.organizations[0]);
- }
-
- console.log('\n--> Submit the transaction to end the auction');
- await statefulTxn.submit(auctionID);
- console.log('*** Result: committed');
-
- console.log('\n--> Evaluate Transaction: query the updated auction');
- const result = await contract.evaluateTransaction('QueryAuction', auctionID);
- console.log('*** Result: Auction: ' + prettyJSONString(result.toString()));
-
- gateway.disconnect();
- } catch (error) {
- console.error(`******** FAILED to submit bid: ${error}`);
- process.exit(1);
- }
-}
-
-async function main () {
- try {
- if (process.argv[2] === undefined || process.argv[3] === undefined ||
- process.argv[4] === undefined) {
- console.log('Usage: node endAuction.js org userID auctionID');
- process.exit(1);
- }
-
- const org = process.argv[2];
- const user = process.argv[3];
- const auctionID = process.argv[4];
-
- if (org === 'Org1' || org === 'org1') {
- const ccp = buildCCPOrg1();
- const walletPath = path.join(__dirname, 'wallet/org1');
- const wallet = await buildWallet(Wallets, walletPath);
- await endAuction(ccp, wallet, user, auctionID);
- } else if (org === 'Org2' || org === 'org2') {
- const ccp = buildCCPOrg2();
- const walletPath = path.join(__dirname, 'wallet/org2');
- const wallet = await buildWallet(Wallets, walletPath);
- await endAuction(ccp, wallet, user, auctionID);
- } else {
- console.log('Usage: node endAuction.js org userID auctionID');
- console.log('Org must be Org1 or Org2');
- }
- } catch (error) {
- console.error(`******** FAILED to run the application: ${error}`);
- if (error.stack) {
- console.error(error.stack);
- }
- process.exit(1);
- }
-}
-
-main();
diff --git a/auction-dutch/application-javascript/endAuctionwithAuditor.js b/auction-dutch/application-javascript/endAuctionwithAuditor.js
deleted file mode 100644
index 5e085258..00000000
--- a/auction-dutch/application-javascript/endAuctionwithAuditor.js
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright IBM Corp. All Rights Reserved.
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-
-'use strict';
-
-const { Gateway, Wallets } = require('fabric-network');
-const path = require('path');
-const { buildCCPOrg1, buildCCPOrg2, buildWallet, prettyJSONString } = require('../../test-application/javascript/AppUtil.js');
-
-const myChannel = 'mychannel';
-const myChaincodeName = 'auction';
-
-async function endAuction (ccp, wallet, org, user, auctionID) {
- try {
- const gateway = new Gateway();
- // connect using Discovery enabled
-
- await gateway.connect(ccp,
- { wallet: wallet, identity: user, discovery: { enabled: true, asLocalhost: true } });
-
- const network = await gateway.getNetwork(myChannel);
- const contract = network.getContract(myChaincodeName);
-
- const statefulTxn = contract.createTransaction('EndAuction');
-
- statefulTxn.setEndorsingOrganizations(org, 'Org3MSP');
-
- console.log('\n--> Submit the transaction to end the auction');
- await statefulTxn.submit(auctionID);
- console.log('*** Result: committed');
-
- console.log('\n--> Evaluate Transaction: query the updated auction');
- const result = await contract.evaluateTransaction('QueryAuction', auctionID);
- console.log('*** Result: Auction: ' + prettyJSONString(result.toString()));
-
- gateway.disconnect();
- } catch (error) {
- console.error(`******** FAILED to submit bid: ${error}`);
- process.exit(1);
- }
-}
-
-async function main () {
- try {
- if (process.argv[2] === undefined || process.argv[3] === undefined ||
- process.argv[4] === undefined) {
- console.log('Usage: node endAuction.js org userID auctionID');
- process.exit(1);
- }
-
- const org = process.argv[2];
- const user = process.argv[3];
- const auctionID = process.argv[4];
-
- if (org === 'Org1' || org === 'org1') {
- const orgMSP = 'Org1MSP';
- const ccp = buildCCPOrg1();
- const walletPath = path.join(__dirname, 'wallet/org1');
- const wallet = await buildWallet(Wallets, walletPath);
- await endAuction(ccp, wallet, orgMSP, user, auctionID);
- } else if (org === 'Org2' || org === 'org2') {
- const orgMSP = 'Org2MSP';
- const ccp = buildCCPOrg2();
- const walletPath = path.join(__dirname, 'wallet/org2');
- const wallet = await buildWallet(Wallets, walletPath);
- await endAuction(ccp, wallet, orgMSP, user, auctionID);
- } else {
- console.log('Usage: node endAuction.js org userID auctionID');
- console.log('Org must be Org1 or Org2');
- }
- } catch (error) {
- console.error(`******** FAILED to run the application: ${error}`);
- if (error.stack) {
- console.error(error.stack);
- }
- process.exit(1);
- }
-}
-
-main();
diff --git a/auction-dutch/application-javascript/enrollAdmin.js b/auction-dutch/application-javascript/enrollAdmin.js
deleted file mode 100644
index 90998fd8..00000000
--- a/auction-dutch/application-javascript/enrollAdmin.js
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright IBM Corp. All Rights Reserved.
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-
-'use strict';
-
-const { Wallets } = require('fabric-network');
-const FabricCAServices = require('fabric-ca-client');
-const path = require('path');
-const { buildCAClient, enrollAdmin } = require('../../test-application/javascript/CAUtil.js');
-const { buildCCPOrg1, buildCCPOrg2, buildWallet } = require('../../test-application/javascript/AppUtil.js');
-
-const mspOrg1 = 'Org1MSP';
-const mspOrg2 = 'Org2MSP';
-
-async function connectToOrg1CA () {
- console.log('\n--> Enrolling the Org1 CA admin');
- const ccpOrg1 = buildCCPOrg1();
- const caOrg1Client = buildCAClient(FabricCAServices, ccpOrg1, 'ca.org1.example.com');
-
- const walletPathOrg1 = path.join(__dirname, 'wallet/org1');
- const walletOrg1 = await buildWallet(Wallets, walletPathOrg1);
-
- await enrollAdmin(caOrg1Client, walletOrg1, mspOrg1);
-}
-
-async function connectToOrg2CA () {
- console.log('\n--> Enrolling the Org2 CA admin');
- 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);
-}
-async function main () {
- if (process.argv[2] === undefined) {
- console.log('Usage: node enrollAdmin.js Org');
- process.exit(1);
- }
-
- const org = process.argv[2];
-
- try {
- if (org === 'Org1' || org === 'org1') {
- await connectToOrg1CA();
- } else if (org === 'Org2' || org === 'org2') {
- await connectToOrg2CA();
- } else {
- console.log('Usage: node registerUser.js org userID');
- console.log('Org must be Org1 or Org2');
- }
- } catch (error) {
- console.error(`Error in enrolling admin: ${error}`);
- process.exit(1);
- }
-}
-
-main();
diff --git a/auction-dutch/application-javascript/package.json b/auction-dutch/application-javascript/package.json
deleted file mode 100644
index 33954681..00000000
--- a/auction-dutch/application-javascript/package.json
+++ /dev/null
@@ -1,26 +0,0 @@
-{
- "name": "auction",
- "version": "1.0.0",
- "description": "auction application implemented in JavaScript",
- "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.20.0",
- "eslint-config-standard": "^16.0.2",
- "eslint-plugin-import": "^2.22.1",
- "eslint-plugin-node": "^11.1.0",
- "eslint-plugin-promise": "^4.3.1"
- }
-}
diff --git a/auction-dutch/application-javascript/queryAuction.js b/auction-dutch/application-javascript/queryAuction.js
deleted file mode 100644
index 06471d5e..00000000
--- a/auction-dutch/application-javascript/queryAuction.js
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright IBM Corp. All Rights Reserved.
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-
-'use strict';
-
-const { Gateway, Wallets } = require('fabric-network');
-const path = require('path');
-const { buildCCPOrg1, buildCCPOrg2, buildWallet, prettyJSONString } = require('../../test-application/javascript/AppUtil.js');
-
-const myChannel = 'mychannel';
-const myChaincodeName = 'auction';
-
-async function queryAuction (ccp, wallet, user, auctionID) {
- try {
- const gateway = new Gateway();
- // connect using Discovery enabled
-
- await gateway.connect(ccp,
- { wallet: wallet, identity: user, discovery: { enabled: true, asLocalhost: true } });
-
- const network = await gateway.getNetwork(myChannel);
- const contract = network.getContract(myChaincodeName);
-
- console.log('\n--> Evaluate Transaction: query the auction');
- const result = await contract.evaluateTransaction('QueryAuction', auctionID);
- console.log('*** Result: Auction: ' + prettyJSONString(result.toString()));
-
- gateway.disconnect();
- } catch (error) {
- console.error(`******** FAILED to submit bid: ${error}`);
- }
-}
-
-async function main () {
- try {
- if (process.argv[2] === undefined || process.argv[3] === undefined ||
- process.argv[4] === undefined) {
- console.log('Usage: node queryAuction.js org userID auctionID');
- process.exit(1);
- }
-
- const org = process.argv[2];
- const user = process.argv[3];
- const auctionID = process.argv[4];
-
- if (org === 'Org1' || org === 'org1') {
- const ccp = buildCCPOrg1();
- const walletPath = path.join(__dirname, 'wallet/org1');
- const wallet = await buildWallet(Wallets, walletPath);
- await queryAuction(ccp, wallet, user, auctionID);
- } else if (org === 'Org2' || org === 'org2') {
- const ccp = buildCCPOrg2();
- const walletPath = path.join(__dirname, 'wallet/org2');
- const wallet = await buildWallet(Wallets, walletPath);
- await queryAuction(ccp, wallet, user, auctionID);
- } else {
- console.log('Usage: node queryAuction.js org userID auctionID');
- console.log('Org must be Org1 or Org2');
- }
- } catch (error) {
- console.error(`******** FAILED to run the application: ${error}`);
- }
-}
-
-main();
diff --git a/auction-dutch/application-javascript/queryBid.js b/auction-dutch/application-javascript/queryBid.js
deleted file mode 100644
index 1bb17e7d..00000000
--- a/auction-dutch/application-javascript/queryBid.js
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright IBM Corp. All Rights Reserved.
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-
-'use strict';
-
-const { Gateway, Wallets } = require('fabric-network');
-const path = require('path');
-const { buildCCPOrg1, buildCCPOrg2, buildWallet, prettyJSONString } = require('../../../test-application/javascript/AppUtil.js');
-
-const myChannel = 'mychannel';
-const myChaincodeName = 'auction';
-
-async function queryBid (ccp, wallet, user, auctionID, bidID) {
- try {
- const gateway = new Gateway();
- // connect using Discovery enabled
-
- await gateway.connect(ccp,
- { wallet: wallet, identity: user, discovery: { enabled: true, asLocalhost: true } });
-
- const network = await gateway.getNetwork(myChannel);
- const contract = network.getContract(myChaincodeName);
-
- console.log('\n--> Evaluate Transaction: read bid from private data store');
- const result = await contract.evaluateTransaction('QueryBid', auctionID, bidID);
- console.log('*** Result: Bid: ' + prettyJSONString(result.toString()));
-
- gateway.disconnect();
- } catch (error) {
- console.error(`******** FAILED to submit bid: ${error}`);
- }
-}
-
-async function main () {
- try {
- if (process.argv[2] === undefined || process.argv[3] === undefined ||
- process.argv[4] === undefined || process.argv[5] === undefined) {
- console.log('Usage: node bid.js org userID auctionID bidID');
- process.exit(1);
- }
-
- const org = process.argv[2];
- const user = process.argv[3];
- const auctionID = process.argv[4];
- const bidID = process.argv[5];
-
- if (org === 'Org1' || org === 'org1') {
- const ccp = buildCCPOrg1();
- const walletPath = path.join(__dirname, 'wallet/org1');
- const wallet = await buildWallet(Wallets, walletPath);
- await queryBid(ccp, wallet, user, auctionID, bidID);
- } else if (org === 'Org2' || org === 'org2') {
- const ccp = buildCCPOrg2();
- const walletPath = path.join(__dirname, 'wallet/org2');
- const wallet = await buildWallet(Wallets, walletPath);
- await queryBid(ccp, wallet, user, auctionID, bidID);
- } else {
- console.log('Usage: node bid.js org userID auctionID bidID');
- console.log('Org must be Org1 or Org2');
- }
- } catch (error) {
- console.error(`******** FAILED to run the application: ${error}`);
- }
-}
-
-main();
diff --git a/auction-dutch/application-javascript/registerEnrollUser.js b/auction-dutch/application-javascript/registerEnrollUser.js
deleted file mode 100644
index 9b7abc32..00000000
--- a/auction-dutch/application-javascript/registerEnrollUser.js
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Copyright IBM Corp. All Rights Reserved.
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-
-'use strict';
-
-const { Wallets } = require('fabric-network');
-const FabricCAServices = require('fabric-ca-client');
-const path = require('path');
-const { buildCAClient, registerAndEnrollUser } = require('../../test-application/javascript/CAUtil.js');
-const { buildCCPOrg1, buildCCPOrg2, buildWallet } = require('../../test-application/javascript/AppUtil.js');
-
-const mspOrg1 = 'Org1MSP';
-const mspOrg2 = 'Org2MSP';
-
-async function connectToOrg1CA (UserID) {
- console.log('\n--> Register and enrolling new user');
- const ccpOrg1 = buildCCPOrg1();
- const caOrg1Client = buildCAClient(FabricCAServices, ccpOrg1, 'ca.org1.example.com');
-
- const walletPathOrg1 = path.join(__dirname, 'wallet/org1');
- const walletOrg1 = await buildWallet(Wallets, walletPathOrg1);
-
- await registerAndEnrollUser(caOrg1Client, walletOrg1, mspOrg1, UserID, 'org1.department1');
-}
-
-async function connectToOrg2CA (UserID) {
- console.log('\n--> Register and enrolling new user');
- 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 registerAndEnrollUser(caOrg2Client, walletOrg2, mspOrg2, UserID, 'org2.department1');
-}
-async function main () {
- if (process.argv[2] === undefined && process.argv[3] === undefined) {
- console.log('Usage: node registerEnrollUser.js org userID');
- process.exit(1);
- }
-
- const org = process.argv[2];
- const userId = process.argv[3];
-
- try {
- if (org === 'Org1' || org === 'org1') {
- await connectToOrg1CA(userId);
- } else if (org === 'Org2' || org === 'org2') {
- await connectToOrg2CA(userId);
- } else {
- console.log('Usage: node registerEnrollUser.js org userID');
- console.log('Org must be Org1 or Org2');
- }
- } catch (error) {
- console.error(`Error in enrolling admin: ${error}`);
- process.exit(1);
- }
-}
-
-main();
diff --git a/auction-dutch/application-javascript/revealBid.js b/auction-dutch/application-javascript/revealBid.js
deleted file mode 100644
index b1fc8dc9..00000000
--- a/auction-dutch/application-javascript/revealBid.js
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Copyright IBM Corp. All Rights Reserved.
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-
-'use strict';
-
-const { Gateway, Wallets } = require('fabric-network');
-const path = require('path');
-const { buildCCPOrg1, buildCCPOrg2, buildWallet, prettyJSONString } = require('../../test-application/javascript/AppUtil.js');
-
-const myChannel = 'mychannel';
-const myChaincodeName = 'auction';
-
-async function addBid (ccp, wallet, user, auctionID, bidID) {
- try {
- const gateway = new Gateway();
- // connect using Discovery enabled
-
- await gateway.connect(ccp,
- { wallet: wallet, identity: user, discovery: { enabled: true, asLocalhost: true } });
-
- const network = await gateway.getNetwork(myChannel);
- const contract = network.getContract(myChaincodeName);
-
- console.log('\n--> Evaluate Transaction: read your bid');
- const bidString = await contract.evaluateTransaction('QueryBid', auctionID, bidID);
- const bidJSON = JSON.parse(bidString);
-
- // console.log('\n--> Evaluate Transaction: query the auction you want to join');
- const auctionString = await contract.evaluateTransaction('QueryAuction', auctionID);
- // console.log('*** Result: Bid: ' + prettyJSONString(auctionString.toString()));
- const auctionJSON = JSON.parse(auctionString);
-
- const bidData = { objectType: 'bid', quantity: parseInt(bidJSON.quantity), price: parseInt(bidJSON.price), org: bidJSON.org, buyer: bidJSON.buyer };
- console.log('*** Result: Bid: ' + JSON.stringify(bidData, null, 2));
-
- const statefulTxn = contract.createTransaction('RevealBid');
- const tmapData = Buffer.from(JSON.stringify(bidData));
- statefulTxn.setTransient({
- bid: tmapData
- });
-
- if (auctionJSON.organizations.length === 2) {
- statefulTxn.setEndorsingOrganizations(auctionJSON.organizations[0], auctionJSON.organizations[1]);
- } else {
- statefulTxn.setEndorsingOrganizations(auctionJSON.organizations[0]);
- }
-
- await statefulTxn.submit(auctionID, bidID);
-
- console.log('\n--> Evaluate Transaction: query the auction to see that our bid was added');
- const result = await contract.evaluateTransaction('QueryAuction', auctionID);
- console.log('*** Result: Auction: ' + prettyJSONString(result.toString()));
-
- gateway.disconnect();
- } catch (error) {
- console.error(`******** FAILED to submit bid: ${error}`);
- process.exit(1);
- }
-}
-
-async function main () {
- try {
- if (process.argv[2] === undefined || process.argv[3] === undefined ||
- process.argv[4] === undefined || process.argv[5] === undefined) {
- console.log('Usage: node revealBid.js org userID auctionID bidID');
- process.exit(1);
- }
-
- const org = process.argv[2];
- const user = process.argv[3];
- const auctionID = process.argv[4];
- const bidID = process.argv[5];
-
- if (org === 'Org1' || org === 'org1') {
- const ccp = buildCCPOrg1();
- const walletPath = path.join(__dirname, 'wallet/org1');
- const wallet = await buildWallet(Wallets, walletPath);
- await addBid(ccp, wallet, user, auctionID, bidID);
- } else if (org === 'Org2' || org === 'org2') {
- const ccp = buildCCPOrg2();
- const walletPath = path.join(__dirname, 'wallet/org2');
- const wallet = await buildWallet(Wallets, walletPath);
- await addBid(ccp, wallet, user, auctionID, bidID);
- } else {
- console.log('Usage: node revealBid.js org userID auctionID bidID');
- console.log('Org must be Org1 or Org2');
- }
- } catch (error) {
- console.error(`******** FAILED to run the application: ${error}`);
- if (error.stack) {
- console.error(error.stack);
- }
- process.exit(1);
- }
-}
-
-main();
diff --git a/auction-dutch/application-javascript/submitBid.js b/auction-dutch/application-javascript/submitBid.js
deleted file mode 100644
index adb3070f..00000000
--- a/auction-dutch/application-javascript/submitBid.js
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright IBM Corp. All Rights Reserved.
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-
-'use strict';
-
-const { Gateway, Wallets } = require('fabric-network');
-const path = require('path');
-const { buildCCPOrg1, buildCCPOrg2, buildWallet, prettyJSONString } = require('../../test-application/javascript/AppUtil.js');
-
-const myChannel = 'mychannel';
-const myChaincodeName = 'auction';
-
-async function submitBid (ccp, wallet, user, auctionID, bidID) {
- try {
- const gateway = new Gateway();
- // connect using Discovery enabled
-
- await gateway.connect(ccp,
- { wallet: wallet, identity: user, discovery: { enabled: true, asLocalhost: true } });
-
- const network = await gateway.getNetwork(myChannel);
- const contract = network.getContract(myChaincodeName);
-
- console.log('\n--> Evaluate Transaction: query the auction you want to join');
- const auctionString = await contract.evaluateTransaction('QueryAuction', auctionID);
- const auctionJSON = JSON.parse(auctionString);
-
- const statefulTxn = contract.createTransaction('SubmitBid');
-
- if (auctionJSON.organizations.length === 2) {
- statefulTxn.setEndorsingOrganizations(auctionJSON.organizations[0], auctionJSON.organizations[1]);
- } else {
- statefulTxn.setEndorsingOrganizations(auctionJSON.organizations[0]);
- }
-
- console.log('\n--> Submit Transaction: add bid to the auction');
- await statefulTxn.submit(auctionID, bidID);
-
- console.log('\n--> Evaluate Transaction: query the auction to see that our bid was added');
- const result = await contract.evaluateTransaction('QueryAuction', auctionID);
- console.log('*** Result: Auction: ' + prettyJSONString(result.toString()));
-
- gateway.disconnect();
- } catch (error) {
- console.error(`******** FAILED to submit bid: ${error}`);
- process.exit(1);
- }
-}
-
-async function main () {
- try {
- if (process.argv[2] === undefined || process.argv[3] === undefined ||
- process.argv[4] === undefined || process.argv[5] === undefined) {
- console.log('Usage: node submitBid.js org userID auctionID bidID');
- process.exit(1);
- }
-
- const org = process.argv[2];
- const user = process.argv[3];
- const auctionID = process.argv[4];
- const bidID = process.argv[5];
-
- if (org === 'Org1' || org === 'org1') {
- const ccp = buildCCPOrg1();
- const walletPath = path.join(__dirname, 'wallet/org1');
- const wallet = await buildWallet(Wallets, walletPath);
- await submitBid(ccp, wallet, user, auctionID, bidID);
- } else if (org === 'Org2' || org === 'org2') {
- const ccp = buildCCPOrg2();
- const walletPath = path.join(__dirname, 'wallet/org2');
- const wallet = await buildWallet(Wallets, walletPath);
- await submitBid(ccp, wallet, user, auctionID, bidID);
- } else {
- console.log('Usage: node submitBid.js org userID auctionID bidID');
- console.log('Org must be Org1 or Org2');
- }
- } catch (error) {
- console.error(`******** FAILED to run the application: ${error}`);
- if (error.stack) {
- console.error(error.stack);
- }
- process.exit(1);
- }
-}
-
-main();
diff --git a/auction-dutch/chaincode-go-auditor/go.mod b/auction-dutch/chaincode-go-auditor/go.mod
deleted file mode 100644
index efdae2fc..00000000
--- a/auction-dutch/chaincode-go-auditor/go.mod
+++ /dev/null
@@ -1,28 +0,0 @@
-module github.com/hyperledger/fabric-samples/auction/dutch-auction/chaincode-go-auditor
-
-go 1.22.0
-
-require (
- github.com/hyperledger/fabric-chaincode-go/v2 v2.0.0
- github.com/hyperledger/fabric-contract-api-go/v2 v2.2.0
- github.com/hyperledger/fabric-protos-go-apiv2 v0.3.4
- google.golang.org/protobuf v1.36.1
-)
-
-require (
- github.com/go-openapi/jsonpointer v0.21.0 // indirect
- github.com/go-openapi/jsonreference v0.21.0 // indirect
- github.com/go-openapi/spec v0.21.0 // indirect
- github.com/go-openapi/swag v0.23.0 // indirect
- github.com/josharian/intern v1.0.0 // indirect
- github.com/mailru/easyjson v0.7.7 // indirect
- github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect
- github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
- github.com/xeipuuv/gojsonschema v1.2.0 // indirect
- golang.org/x/net v0.28.0 // indirect
- golang.org/x/sys v0.24.0 // indirect
- golang.org/x/text v0.17.0 // indirect
- google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f // indirect
- google.golang.org/grpc v1.67.0 // indirect
- gopkg.in/yaml.v3 v3.0.1 // indirect
-)
diff --git a/auction-dutch/chaincode-go-auditor/go.sum b/auction-dutch/chaincode-go-auditor/go.sum
deleted file mode 100644
index fa4d3b24..00000000
--- a/auction-dutch/chaincode-go-auditor/go.sum
+++ /dev/null
@@ -1,61 +0,0 @@
-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/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1rr/O9oNQ=
-github.com/go-openapi/jsonpointer v0.21.0/go.mod h1:IUyH9l/+uyhIYQ/PXVA41Rexl+kOkAPDdXEYns6fzUY=
-github.com/go-openapi/jsonreference v0.21.0 h1:Rs+Y7hSXT83Jacb7kFyjn4ijOuVGSvOdF2+tg1TRrwQ=
-github.com/go-openapi/jsonreference v0.21.0/go.mod h1:LmZmgsrTkVg9LG4EaHeY8cBDslNPMo06cago5JNLkm4=
-github.com/go-openapi/spec v0.21.0 h1:LTVzPc3p/RzRnkQqLRndbAzjY0d0BCL72A6j3CdL9ZY=
-github.com/go-openapi/spec v0.21.0/go.mod h1:78u6VdPw81XU44qEWGhtr982gJ5BWg2c0I5XwVMotYk=
-github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+GrE=
-github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ=
-github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
-github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
-github.com/hyperledger/fabric-chaincode-go/v2 v2.0.0 h1:IhkHfrl5X/fVnmB6pWeCYCdIJRi9bxj+WTnVN8DtW3c=
-github.com/hyperledger/fabric-chaincode-go/v2 v2.0.0/go.mod h1:PHHaFffjw7p7n9bmCfcm7RqDqYdivNEsJdiNIKZo5Lk=
-github.com/hyperledger/fabric-contract-api-go/v2 v2.2.0 h1:rmUoBmciB0GL/miqcbJmJbgp5QTWoJUrZo+CNxrNLF4=
-github.com/hyperledger/fabric-contract-api-go/v2 v2.2.0/go.mod h1:FeWeO/jwGjiME7ak3GufqKIcwkejtzrDG4QxbfKydWs=
-github.com/hyperledger/fabric-protos-go-apiv2 v0.3.4 h1:YJrd+gMaeY0/vsN0aS0QkEKTivGoUnSRIXxGJ7KI+Pc=
-github.com/hyperledger/fabric-protos-go-apiv2 v0.3.4/go.mod h1:bau/6AJhvEcu9GKKYHlDXAxXKzYNfhP6xu2GXuxEcFk=
-github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
-github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
-github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
-github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
-github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
-github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
-github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=
-github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
-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/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8=
-github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4=
-github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
-github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY=
-github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
-github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
-github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
-github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
-github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=
-github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb h1:zGWFAtiMcyryUHoUjUJX0/lt1H2+i2Ka2n+D3DImSNo=
-github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=
-github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHovont7NscjpAxXsDA8S8BMYve8Y5+7cuRE7R0=
-github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ=
-github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74=
-github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y=
-golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE=
-golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg=
-golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg=
-golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
-golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc=
-golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
-google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f h1:BWUVssLB0HVOSY78gIdvk1dTVYtT1y8SBWtPYuTJ/6w=
-google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM=
-google.golang.org/grpc v1.67.0 h1:IdH9y6PF5MPSdAntIcpjQ+tXO41pcQsfZV2RxtQgVcw=
-google.golang.org/grpc v1.67.0/go.mod h1:1gLDyUQU7CTLJI90u3nXZ9ekeghjeM7pTDZlqFNg2AA=
-google.golang.org/protobuf v1.36.1 h1:yBPeRvTftaleIgM3PZ/WBIZ7XM/eEYAaEyCwvyjq/gk=
-google.golang.org/protobuf v1.36.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
-gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
-gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
-gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
-gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
-gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
diff --git a/auction-dutch/chaincode-go-auditor/smart-contract/auction.go b/auction-dutch/chaincode-go-auditor/smart-contract/auction.go
deleted file mode 100644
index c56daedd..00000000
--- a/auction-dutch/chaincode-go-auditor/smart-contract/auction.go
+++ /dev/null
@@ -1,440 +0,0 @@
-/*
-SPDX-License-Identifier: Apache-2.0
-*/
-
-package auction
-
-import (
- "bytes"
- "crypto/sha256"
- "encoding/json"
- "errors"
- "fmt"
- "sort"
-
- "github.com/hyperledger/fabric-contract-api-go/v2/contractapi"
-)
-
-type SmartContract struct {
- contractapi.Contract
-}
-
-// Auction data
-type Auction struct {
- Type string `json:"objectType"`
- ItemSold string `json:"item"`
- Seller string `json:"seller"`
- Quantity int `json:"quantity"`
- Orgs []string `json:"organizations"`
- PrivateBids map[string]BidHash `json:"privateBids"`
- RevealedBids map[string]FullBid `json:"revealedBids"`
- Winners []Winners `json:"winners"`
- Price int `json:"price"`
- Status string `json:"status"`
- Auditor bool `json:"auditor"`
-}
-
-// FullBid is the structure of a revealed bid
-type FullBid struct {
- Type string `json:"objectType"`
- Quantity int `json:"quantity"`
- Price int `json:"price"`
- Org string `json:"org"`
- Buyer string `json:"buyer"`
-}
-
-// BidHash is the structure of a private bid
-type BidHash struct {
- Org string `json:"org"`
- Hash string `json:"hash"`
-}
-
-// Winners stores the winners of the auction
-type Winners struct {
- Buyer string `json:"buyer"`
- Quantity int `json:"quantity"`
-}
-
-const bidKeyType = "bid"
-
-// SubmitBid is used by the bidder to add the hash of that bid stored in private data to the
-// auction. Note that this function alters the auction in private state, and needs
-// to meet the auction endorsement policy. Transaction ID is used identify the bid
-func (s *SmartContract) SubmitBid(ctx contractapi.TransactionContextInterface, auctionID string, txID string) error {
-
- // get the MSP ID of the bidder's org
- clientOrgID, err := ctx.GetClientIdentity().GetMSPID()
- if err != nil {
- return fmt.Errorf("failed to get client MSP ID: %v", err)
- }
-
- // get the auction from public state
- auction, err := s.QueryAuction(ctx, auctionID)
- if err != nil {
- return fmt.Errorf("failed to get auction from public state %v", err)
- }
-
- // the auction needs to be open for users to add their bid
- status := auction.Status
- if status != "open" {
- return fmt.Errorf("cannot join closed or ended auction")
- }
-
- // get the inplicit collection name of bidder's org
- collection, err := getCollectionName(ctx)
- if err != nil {
- return fmt.Errorf("failed to get implicit collection name: %v", err)
- }
-
- // use the transaction ID passed as a parameter to create composite bid key
- bidKey, err := ctx.GetStub().CreateCompositeKey(bidKeyType, []string{auctionID, txID})
- if err != nil {
- return fmt.Errorf("failed to create composite key: %v", err)
- }
-
- // get the hash of the bid if found in private collection
- bidHash, err := ctx.GetStub().GetPrivateDataHash(collection, bidKey)
- if err != nil {
- return fmt.Errorf("failed to read bid bash from collection: %v", err)
- }
- if bidHash == nil {
- return fmt.Errorf("bid hash does not exist: %s", bidKey)
- }
-
- // store the hash along with the bidder's organization
- newHash := BidHash{
- Org: clientOrgID,
- Hash: fmt.Sprintf("%x", bidHash),
- }
-
- auction.PrivateBids[bidKey] = newHash
-
- // Add the bidding organization to the list of participating organization's if it is not already
- orgs := auction.Orgs
- if !(contains(orgs, clientOrgID)) {
- newOrgs := append(orgs, clientOrgID)
- auction.Orgs = newOrgs
-
- err = setAssetStateBasedEndorsement(ctx, auctionID, newOrgs, auction.Auditor)
- if err != nil {
- return fmt.Errorf("failed setting state based endorsement for new organization: %v", err)
- }
- }
-
- newAuctionJSON, _ := json.Marshal(auction)
-
- err = ctx.GetStub().PutState(auctionID, newAuctionJSON)
- if err != nil {
- return fmt.Errorf("failed to update auction: %v", err)
- }
-
- return nil
-}
-
-// RevealBid is used by a bidder to reveal their bid after the auction is closed
-func (s *SmartContract) RevealBid(ctx contractapi.TransactionContextInterface, auctionID string, txID string) error {
-
- // get the MSP ID of the bidder's org
- clientOrgID, err := ctx.GetClientIdentity().GetMSPID()
- if err != nil {
- return fmt.Errorf("failed to get client MSP ID: %v", err)
- }
-
- // get bid from transient map
- transientMap, err := ctx.GetStub().GetTransient()
- if err != nil {
- return fmt.Errorf("error getting transient: %v", err)
- }
-
- transientBidJSON, ok := transientMap["bid"]
- if !ok {
- return errors.New("bid key not found in the transient map")
- }
-
- // get implicit collection name of organization ID
- collection, err := getCollectionName(ctx)
- if err != nil {
- return fmt.Errorf("failed to get implicit collection name: %v", err)
- }
-
- // use transaction ID to create composit bid key
- bidKey, err := ctx.GetStub().CreateCompositeKey(bidKeyType, []string{auctionID, txID})
- if err != nil {
- return fmt.Errorf("failed to create composite key: %v", err)
- }
-
- // get bid hash of bid if private bid on the public ledger
- bidHash, err := ctx.GetStub().GetPrivateDataHash(collection, bidKey)
- if err != nil {
- return fmt.Errorf("failed to read bid bash from collection: %v", err)
- }
- if bidHash == nil {
- return fmt.Errorf("bid hash does not exist: %s", bidKey)
- }
-
- // get auction from public state
- auction, err := s.QueryAuction(ctx, auctionID)
- if err != nil {
- return fmt.Errorf("failed to get auction from public state %v", err)
- }
-
- // check that the bidders org is a participant in the auction
- orgs := auction.Orgs
- if !(contains(orgs, clientOrgID)) {
- return fmt.Errorf("particiant %s is not a member of the auction", clientOrgID)
- }
-
- // Complete a series of three checks before we add the bid to the auction
-
- // check 1: check that the auction is closed. We cannot reveal an
- // bid to an open auction
- status := auction.Status
- if status != "closed" {
- return errors.New("cannot reveal bid for open or ended auction")
- }
-
- // check 2: check that hash of revealed bid matches hash of private bid
- // on the public ledger. This checks that the bidder is telling the truth
- // about the value of their bid
-
- hash := sha256.New()
- hash.Write(transientBidJSON)
- calculatedBidJSONHash := hash.Sum(nil)
-
- // verify that the hash of the passed immutable properties matches the on-chain hash
- if !bytes.Equal(calculatedBidJSONHash, bidHash) {
- return fmt.Errorf("hash %x for bid JSON %s does not match hash in auction: %x",
- calculatedBidJSONHash,
- transientBidJSON,
- bidHash,
- )
- }
-
- // check 3; check hash of relealed bid matches hash of private bid that was
- // added earlier. This ensures that the bid has not changed since it
- // was added to the auction
-
- privateBidHashString := auction.PrivateBids[bidKey].Hash
-
- onChainBidHashString := fmt.Sprintf("%x", bidHash)
- if privateBidHashString != onChainBidHashString {
- return fmt.Errorf("hash %s for bid JSON %s does not match hash in auction: %s, bidder must have changed bid",
- privateBidHashString,
- transientBidJSON,
- onChainBidHashString,
- )
- }
-
- // we can add the bid to the auction if all checks have passed
- type transientBidInput struct {
- Quantity int `json:"quantity"`
- Price int `json:"price"`
- Org string `json:"org"`
- Buyer string `json:"buyer"`
- }
-
- // unmarshal bid imput
- var bidInput transientBidInput
- err = json.Unmarshal(transientBidJSON, &bidInput)
- if err != nil {
- return fmt.Errorf("failed to unmarshal JSON: %v", err)
- }
-
- // get ID of submitting client
- clientID, err := s.GetSubmittingClientIdentity(ctx)
- if err != nil {
- return fmt.Errorf("failed to get client identity %v", err)
- }
-
- // marshal transient parameters and ID and MSPID into bid object
- newBid := FullBid{
- Type: bidKeyType,
- Quantity: bidInput.Quantity,
- Price: bidInput.Price,
- Org: bidInput.Org,
- Buyer: bidInput.Buyer,
- }
-
- // check 4: make sure that the transaction is being submitted is the bidder
- if bidInput.Buyer != clientID {
- return fmt.Errorf("permission denied, client id %v is not the owner of the bid", clientID)
- }
-
- auction.RevealedBids[bidKey] = newBid
-
- auctionJSON, _ := json.Marshal(auction)
-
- // put auction with bid added back into state
- err = ctx.GetStub().PutState(auctionID, auctionJSON)
- if err != nil {
- return fmt.Errorf("failed to update auction: %v", err)
- }
-
- return nil
-}
-
-// CloseAuction can be used by the seller to close the auction. This prevents
-// bids from being added to the auction, and allows users to reveal their bid
-func (s *SmartContract) CloseAuction(ctx contractapi.TransactionContextInterface, auctionID string) error {
-
- // get the MSP ID of the bidder's org
- clientOrgID, err := ctx.GetClientIdentity().GetMSPID()
- if err != nil {
- return fmt.Errorf("failed to get client MSP ID: %v", err)
- }
-
- // get auction from public state
- auction, err := s.QueryAuction(ctx, auctionID)
- if err != nil {
- return fmt.Errorf("failed to get auction from public state %v", err)
- }
-
- // check that the bidders org is a participant in the auction
- orgs := auction.Orgs
- if !(contains(orgs, clientOrgID)) {
- return fmt.Errorf("particiant %s is not a member of the auction", clientOrgID)
- }
-
- // the auction can only be closed by the seller
-
- // get ID of submitting client
- clientID, err := s.GetSubmittingClientIdentity(ctx)
- if err != nil {
- return fmt.Errorf("failed to get client identity %v", err)
- }
-
- seller := auction.Seller
- if seller != clientID {
- return fmt.Errorf("auction can only be closed by seller: %v", err)
- }
-
- status := auction.Status
- if status != "open" {
- return errors.New("cannot close auction that is not open")
- }
-
- auction.Status = string("closed")
-
- closedAuctionJSON, _ := json.Marshal(auction)
-
- err = ctx.GetStub().PutState(auctionID, closedAuctionJSON)
- if err != nil {
- return fmt.Errorf("failed to close auction: %v", err)
- }
-
- return nil
-}
-
-// EndAuction both changes the auction status to closed and calculates the winners
-// of the auction
-func (s *SmartContract) EndAuction(ctx contractapi.TransactionContextInterface, auctionID string) error {
-
- // get the MSP ID of the bidder's org
- clientOrgID, err := ctx.GetClientIdentity().GetMSPID()
- if err != nil {
- return fmt.Errorf("failed to get client MSP ID: %v", err)
- }
-
- // get auction from public state
- auction, err := s.QueryAuction(ctx, auctionID)
- if err != nil {
- return fmt.Errorf("failed to get auction from public state %v", err)
- }
-
- // check that the bidders org is a participant in the auction
- orgs := auction.Orgs
- if !(contains(orgs, clientOrgID)) {
- return fmt.Errorf("particiant %s is not a member of the auction", clientOrgID)
- }
-
- // Check that the auction is being ended by the seller
-
- // get ID of submitting client
- clientID, err := s.GetSubmittingClientIdentity(ctx)
- if err != nil {
- return fmt.Errorf("failed to get client identity %v", err)
- }
-
- seller := auction.Seller
- if seller != clientID {
- return fmt.Errorf("auction can only be ended by seller: %v", err)
- }
-
- status := auction.Status
- if status != "closed" {
- return errors.New("can only end a closed auction")
- }
-
- // get the list of revealed bids
-
- revealedBidMap := auction.RevealedBids
- if len(auction.RevealedBids) == 0 {
- return fmt.Errorf("no bids have been revealed, cannot end auction: %v", err)
- }
-
- // sort the map of revealed bids to make it easier to calculate winners
- // if bids are tied, fill smaller bids first
- var bidders []FullBid
-
- for _, bid := range revealedBidMap {
- bidders = append(bidders, bid)
- }
-
- sort.Slice(bidders, func(p, q int) bool {
- if bidders[p].Price > bidders[q].Price {
- return true
- }
- if bidders[p].Price < bidders[q].Price {
- return false
- }
- return bidders[p].Quantity < bidders[q].Quantity
- })
-
- i := 0
- remainingQuantity := auction.Quantity
-
- // calculate the winners
- for remainingQuantity > 0 {
-
- // create the next winning bid
- winner := Winners{
- Buyer: bidders[i].Buyer,
- Quantity: bidders[i].Quantity,
- }
-
- // add them to the list of winners and change the winning price
- auction.Winners = append(auction.Winners, winner)
- auction.Price = bidders[i].Price
-
- // Calculate the quantity that goes to the winner
- // if there is sufficient quantity to give them the full bid
- if remainingQuantity > bidders[i].Quantity {
- remainingQuantity = remainingQuantity - bidders[i].Quantity
-
- // if there is not, give the remainder
- } else {
- auction.Winners[i].Quantity = remainingQuantity
- remainingQuantity = 0
- }
- i++
- if i == len(bidders) {
- remainingQuantity = 0
- }
- }
-
- // check if there is a winning bid that has yet to be revealed
- err = checkForHigherBid(ctx, auction.Price, auction.RevealedBids, auction.PrivateBids)
- if err != nil {
- return fmt.Errorf("cannot end auction: %v", err)
- }
-
- auction.Status = "ended"
-
- endedAuctionJSON, _ := json.Marshal(auction)
-
- err = ctx.GetStub().PutState(auctionID, endedAuctionJSON)
- if err != nil {
- return fmt.Errorf("failed to end auction: %v", err)
- }
- return nil
-}
diff --git a/auction-dutch/chaincode-go-auditor/smart-contract/auctionQueries.go b/auction-dutch/chaincode-go-auditor/smart-contract/auctionQueries.go
deleted file mode 100644
index 45b84762..00000000
--- a/auction-dutch/chaincode-go-auditor/smart-contract/auctionQueries.go
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
-SPDX-License-Identifier: Apache-2.0
-*/
-
-package auction
-
-import (
- "encoding/json"
- "errors"
- "fmt"
-
- "github.com/hyperledger/fabric-chaincode-go/v2/shim"
- "github.com/hyperledger/fabric-contract-api-go/v2/contractapi"
-)
-
-// QueryAuction allows all members of the channel to read a public auction
-func (s *SmartContract) QueryAuction(ctx contractapi.TransactionContextInterface, auctionID string) (*Auction, error) {
-
- auctionJSON, err := ctx.GetStub().GetState(auctionID)
- if err != nil {
- return nil, fmt.Errorf("failed to get auction object %v: %v", auctionID, err)
- }
- if auctionJSON == nil {
- return nil, errors.New("auction does not exist")
- }
-
- var auction *Auction
- err = json.Unmarshal(auctionJSON, &auction)
- if err != nil {
- return nil, err
- }
-
- return auction, nil
-}
-
-// checkForHigherBid is an internal function that is used to determine if a winning bid has yet to be revealed
-func checkForHigherBid(ctx contractapi.TransactionContextInterface, auctionPrice int, revealedBidders map[string]FullBid, bidders map[string]BidHash) error {
-
- // Get MSP ID of peer org
- peerMSPID, err := shim.GetMSPID()
- if err != nil {
- return fmt.Errorf("failed getting the peer's MSPID: %v", err)
- }
-
- var error error
- error = nil
-
- for bidKey, privateBid := range bidders {
-
- if _, bidInAuction := revealedBidders[bidKey]; bidInAuction {
-
- // bid is already revealed, no action to take
-
- } else {
-
- collection := "_implicit_org_" + privateBid.Org
-
- if privateBid.Org == peerMSPID {
-
- bidJSON, err := ctx.GetStub().GetPrivateData(collection, bidKey)
- if err != nil {
- return fmt.Errorf("failed to get bid %v: %v", bidKey, err)
- }
- if bidJSON == nil {
- return fmt.Errorf("bid %v does not exist", bidKey)
- }
-
- var bid *FullBid
- err = json.Unmarshal(bidJSON, &bid)
- if err != nil {
- return err
- }
-
- if bid.Price > auctionPrice {
- error = fmt.Errorf("Cannot close auction, bidder has a higher price: %v", err)
- }
-
- } else {
-
- hash, err := ctx.GetStub().GetPrivateDataHash(collection, bidKey)
- if err != nil {
- return fmt.Errorf("failed to read bid hash from collection: %v", err)
- }
- if hash == nil {
- return fmt.Errorf("bid hash does not exist: %s", bidKey)
- }
- }
- }
- }
-
- return error
-}
diff --git a/auction-dutch/chaincode-go-auditor/smart-contract/utils.go b/auction-dutch/chaincode-go-auditor/smart-contract/utils.go
deleted file mode 100644
index 4b73a7f3..00000000
--- a/auction-dutch/chaincode-go-auditor/smart-contract/utils.go
+++ /dev/null
@@ -1,203 +0,0 @@
-/*
-SPDX-License-Identifier: Apache-2.0
-*/
-
-package auction
-
-import (
- "encoding/base64"
- "fmt"
-
- "github.com/hyperledger/fabric-chaincode-go/v2/shim"
- "github.com/hyperledger/fabric-contract-api-go/v2/contractapi"
- "github.com/hyperledger/fabric-protos-go-apiv2/common"
- "github.com/hyperledger/fabric-protos-go-apiv2/msp"
- "google.golang.org/protobuf/proto"
-)
-
-func (s *SmartContract) GetSubmittingClientIdentity(ctx contractapi.TransactionContextInterface) (string, error) {
-
- b64ID, err := ctx.GetClientIdentity().GetID()
- if err != nil {
- return "", fmt.Errorf("Failed to read clientID: %v", err)
- }
- decodeID, err := base64.StdEncoding.DecodeString(b64ID)
- if err != nil {
- return "", fmt.Errorf("failed to base64 decode clientID: %v", err)
- }
- return string(decodeID), nil
-}
-
-// getCollectionName is an internal helper function to get collection of submitting client identity.
-func getCollectionName(ctx contractapi.TransactionContextInterface) (string, error) {
-
- // Get the MSP ID of submitting client identity
- clientMSPID, err := ctx.GetClientIdentity().GetMSPID()
- if err != nil {
- return "", fmt.Errorf("failed to get verified MSPID: %v", err)
- }
-
- // Create the collection name
- orgCollection := "_implicit_org_" + clientMSPID
-
- return orgCollection, nil
-}
-
-// verifyClientOrgMatchesPeerOrg is an internal function used to verify that client org id matches peer org id.
-func verifyClientOrgMatchesPeerOrg(ctx contractapi.TransactionContextInterface) error {
-
- clientMSPID, err := ctx.GetClientIdentity().GetMSPID()
- if err != nil {
- return fmt.Errorf("failed getting the client's MSPID: %v", err)
- }
- peerMSPID, err := shim.GetMSPID()
- if err != nil {
- return fmt.Errorf("failed getting the peer's MSPID: %v", err)
- }
-
- if clientMSPID != peerMSPID {
- return fmt.Errorf("client from org %v is not authorized to read or write private data from an org %v peer", clientMSPID, peerMSPID)
- }
-
- return nil
-}
-
-func contains(sli []string, str string) bool {
- for _, a := range sli {
- if a == str {
- return true
- }
- }
- return false
-}
-
-func setAssetStateBasedEndorsement(ctx contractapi.TransactionContextInterface, assetId string, mspids []string, auditor bool) error {
-
- principals := make([]*msp.MSPPrincipal, len(mspids))
- participantSigsPolicy := make([]*common.SignaturePolicy, len(mspids))
-
- for i, id := range mspids {
- principal, err := proto.Marshal(
- &msp.MSPRole{
- Role: msp.MSPRole_PEER,
- MspIdentifier: id,
- },
- )
- if err != nil {
- return err
- }
- principals[i] = &msp.MSPPrincipal{
- PrincipalClassification: msp.MSPPrincipal_ROLE,
- Principal: principal,
- }
- participantSigsPolicy[i] = &common.SignaturePolicy{
- Type: &common.SignaturePolicy_SignedBy{
- SignedBy: int32(i),
- },
- }
- }
-
- if auditor == false {
- // create the defalt policy for an auction without an auditor
-
- policy := &common.SignaturePolicyEnvelope{
- Version: 0,
- Rule: &common.SignaturePolicy{
- Type: &common.SignaturePolicy_NOutOf_{
- NOutOf: &common.SignaturePolicy_NOutOf{
- N: int32(len(mspids)),
- Rules: participantSigsPolicy,
- },
- },
- },
- Identities: principals,
- }
-
- spBytes, err := proto.Marshal(policy)
- if err != nil {
- return err
- }
- err = ctx.GetStub().SetStateValidationParameter(assetId, spBytes)
- if err != nil {
- return fmt.Errorf("failed to set validation parameter on auction: %v", err)
- }
- } else {
-
- // create the defalt policy for an auction with an auditor
-
- // create the auditor identity and signature policy
- auditorMSP, err := proto.Marshal(
- &msp.MSPRole{
- Role: msp.MSPRole_PEER,
- MspIdentifier: "Org3MSP",
- },
- )
- if err != nil {
- return err
- }
- principals = append(principals, &msp.MSPPrincipal{
- PrincipalClassification: msp.MSPPrincipal_ROLE,
- Principal: auditorMSP,
- },
- )
- // Create the policies in case the auditor is needed. In this case, an
- // auditor and 1 participant can update the auction.
- auditorPolicies := make([]*common.SignaturePolicy, 2)
- auditorPolicies[0] = &common.SignaturePolicy{
- Type: &common.SignaturePolicy_SignedBy{
- SignedBy: int32(len(principals) - 1),
- },
- }
- auditorPolicies[1] = &common.SignaturePolicy{
- Type: &common.SignaturePolicy_NOutOf_{
- NOutOf: &common.SignaturePolicy_NOutOf{
- N: 1,
- Rules: participantSigsPolicy,
- },
- },
- }
-
- // The auditor policy below is equivilent to AND(auditor, OR(participants))
- policies := make([]*common.SignaturePolicy, 2)
- policies[0] = &common.SignaturePolicy{
- Type: &common.SignaturePolicy_NOutOf_{
- NOutOf: &common.SignaturePolicy_NOutOf{
- N: 2,
- Rules: auditorPolicies,
- },
- },
- }
- // Participants can also update the auction without an auditor
- policies[1] = &common.SignaturePolicy{
- Type: &common.SignaturePolicy_NOutOf_{
- NOutOf: &common.SignaturePolicy_NOutOf{
- N: int32(len(mspids)),
- Rules: participantSigsPolicy,
- },
- },
- }
- // Either the auditor policy or the participant policy can update
- // the auction
- policy := &common.SignaturePolicyEnvelope{
- Version: 0,
- Rule: &common.SignaturePolicy{
- Type: &common.SignaturePolicy_NOutOf_{
- NOutOf: &common.SignaturePolicy_NOutOf{
- N: 1,
- Rules: policies,
- },
- },
- },
- Identities: principals,
- }
- spBytes, err := proto.Marshal(policy)
- if err != nil {
- return err
- }
- err = ctx.GetStub().SetStateValidationParameter(assetId, spBytes)
- if err != nil {
- return fmt.Errorf("failed to set validation parameter on auction: %v", err)
- }
- }
- return nil
-}
diff --git a/auction-dutch/chaincode-go-auditor/smartContract.go b/auction-dutch/chaincode-go-auditor/smartContract.go
deleted file mode 100644
index f5feca58..00000000
--- a/auction-dutch/chaincode-go-auditor/smartContract.go
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
-SPDX-License-Identifier: Apache-2.0
-*/
-
-package main
-
-import (
- "log"
-
- "github.com/hyperledger/fabric-contract-api-go/v2/contractapi"
- auction "github.com/hyperledger/fabric-samples/auction/dutch-auction/chaincode-go-auditor/smart-contract"
-)
-
-func main() {
- auctionSmartContract, err := contractapi.NewChaincode(&auction.SmartContract{})
- if err != nil {
- log.Panicf("Error creating auction chaincode: %v", err)
- }
-
- if err := auctionSmartContract.Start(); err != nil {
- log.Panicf("Error starting auction chaincode: %v", err)
- }
-}
diff --git a/auction-dutch/chaincode-go/go.mod b/auction-dutch/chaincode-go/go.mod
deleted file mode 100644
index 24f1f572..00000000
--- a/auction-dutch/chaincode-go/go.mod
+++ /dev/null
@@ -1,28 +0,0 @@
-module github.com/hyperledger/fabric-samples/auction/dutch-auction/chaincode-go
-
-go 1.22.0
-
-require (
- github.com/hyperledger/fabric-chaincode-go/v2 v2.0.0
- github.com/hyperledger/fabric-contract-api-go/v2 v2.2.0
- github.com/hyperledger/fabric-protos-go-apiv2 v0.3.4
- google.golang.org/protobuf v1.36.1
-)
-
-require (
- github.com/go-openapi/jsonpointer v0.21.0 // indirect
- github.com/go-openapi/jsonreference v0.21.0 // indirect
- github.com/go-openapi/spec v0.21.0 // indirect
- github.com/go-openapi/swag v0.23.0 // indirect
- github.com/josharian/intern v1.0.0 // indirect
- github.com/mailru/easyjson v0.7.7 // indirect
- github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect
- github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
- github.com/xeipuuv/gojsonschema v1.2.0 // indirect
- golang.org/x/net v0.28.0 // indirect
- golang.org/x/sys v0.24.0 // indirect
- golang.org/x/text v0.17.0 // indirect
- google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f // indirect
- google.golang.org/grpc v1.67.0 // indirect
- gopkg.in/yaml.v3 v3.0.1 // indirect
-)
diff --git a/auction-dutch/chaincode-go/go.sum b/auction-dutch/chaincode-go/go.sum
deleted file mode 100644
index fa4d3b24..00000000
--- a/auction-dutch/chaincode-go/go.sum
+++ /dev/null
@@ -1,61 +0,0 @@
-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/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1rr/O9oNQ=
-github.com/go-openapi/jsonpointer v0.21.0/go.mod h1:IUyH9l/+uyhIYQ/PXVA41Rexl+kOkAPDdXEYns6fzUY=
-github.com/go-openapi/jsonreference v0.21.0 h1:Rs+Y7hSXT83Jacb7kFyjn4ijOuVGSvOdF2+tg1TRrwQ=
-github.com/go-openapi/jsonreference v0.21.0/go.mod h1:LmZmgsrTkVg9LG4EaHeY8cBDslNPMo06cago5JNLkm4=
-github.com/go-openapi/spec v0.21.0 h1:LTVzPc3p/RzRnkQqLRndbAzjY0d0BCL72A6j3CdL9ZY=
-github.com/go-openapi/spec v0.21.0/go.mod h1:78u6VdPw81XU44qEWGhtr982gJ5BWg2c0I5XwVMotYk=
-github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+GrE=
-github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ=
-github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
-github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
-github.com/hyperledger/fabric-chaincode-go/v2 v2.0.0 h1:IhkHfrl5X/fVnmB6pWeCYCdIJRi9bxj+WTnVN8DtW3c=
-github.com/hyperledger/fabric-chaincode-go/v2 v2.0.0/go.mod h1:PHHaFffjw7p7n9bmCfcm7RqDqYdivNEsJdiNIKZo5Lk=
-github.com/hyperledger/fabric-contract-api-go/v2 v2.2.0 h1:rmUoBmciB0GL/miqcbJmJbgp5QTWoJUrZo+CNxrNLF4=
-github.com/hyperledger/fabric-contract-api-go/v2 v2.2.0/go.mod h1:FeWeO/jwGjiME7ak3GufqKIcwkejtzrDG4QxbfKydWs=
-github.com/hyperledger/fabric-protos-go-apiv2 v0.3.4 h1:YJrd+gMaeY0/vsN0aS0QkEKTivGoUnSRIXxGJ7KI+Pc=
-github.com/hyperledger/fabric-protos-go-apiv2 v0.3.4/go.mod h1:bau/6AJhvEcu9GKKYHlDXAxXKzYNfhP6xu2GXuxEcFk=
-github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
-github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
-github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
-github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
-github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
-github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
-github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=
-github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
-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/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8=
-github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4=
-github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
-github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY=
-github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
-github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
-github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
-github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
-github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=
-github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb h1:zGWFAtiMcyryUHoUjUJX0/lt1H2+i2Ka2n+D3DImSNo=
-github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=
-github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHovont7NscjpAxXsDA8S8BMYve8Y5+7cuRE7R0=
-github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ=
-github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74=
-github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y=
-golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE=
-golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg=
-golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg=
-golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
-golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc=
-golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
-google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f h1:BWUVssLB0HVOSY78gIdvk1dTVYtT1y8SBWtPYuTJ/6w=
-google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM=
-google.golang.org/grpc v1.67.0 h1:IdH9y6PF5MPSdAntIcpjQ+tXO41pcQsfZV2RxtQgVcw=
-google.golang.org/grpc v1.67.0/go.mod h1:1gLDyUQU7CTLJI90u3nXZ9ekeghjeM7pTDZlqFNg2AA=
-google.golang.org/protobuf v1.36.1 h1:yBPeRvTftaleIgM3PZ/WBIZ7XM/eEYAaEyCwvyjq/gk=
-google.golang.org/protobuf v1.36.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
-gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
-gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
-gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
-gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
-gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
diff --git a/auction-dutch/chaincode-go/smart-contract/auction.go b/auction-dutch/chaincode-go/smart-contract/auction.go
deleted file mode 100644
index 90a9097b..00000000
--- a/auction-dutch/chaincode-go/smart-contract/auction.go
+++ /dev/null
@@ -1,513 +0,0 @@
-/*
-SPDX-License-Identifier: Apache-2.0
-*/
-
-package auction
-
-import (
- "bytes"
- "crypto/sha256"
- "encoding/json"
- "errors"
- "fmt"
- "sort"
-
- "github.com/hyperledger/fabric-contract-api-go/v2/contractapi"
-)
-
-type SmartContract struct {
- contractapi.Contract
-}
-
-// Auction data
-type Auction struct {
- Type string `json:"objectType"`
- ItemSold string `json:"item"`
- Seller string `json:"seller"`
- Quantity int `json:"quantity"`
- Orgs []string `json:"organizations"`
- PrivateBids map[string]BidHash `json:"privateBids"`
- RevealedBids map[string]FullBid `json:"revealedBids"`
- Winners []Winners `json:"winners"`
- Price int `json:"price"`
- Status string `json:"status"`
- Auditor bool `json:"auditor"`
-}
-
-// FullBid is the structure of a revealed bid
-type FullBid struct {
- Type string `json:"objectType"`
- Quantity int `json:"quantity"`
- Price int `json:"price"`
- Org string `json:"org"`
- Buyer string `json:"buyer"`
-}
-
-// BidHash is the structure of a private bid
-type BidHash struct {
- Org string `json:"org"`
- Hash string `json:"hash"`
-}
-
-// Winners stores the winners of the auction
-type Winners struct {
- Buyer string `json:"buyer"`
- Quantity int `json:"quantity"`
-}
-
-const bidKeyType = "bid"
-
-// CreateAuction creates on auction on the public channel. The identity that
-// submits the transacion becomes the seller of the auction
-func (s *SmartContract) CreateAuction(ctx contractapi.TransactionContextInterface, auctionID string, itemsold string, quantity int, withAuditor string) error {
-
- // get ID of submitting client
- clientID, err := s.GetSubmittingClientIdentity(ctx)
- if err != nil {
- return fmt.Errorf("failed to get client identity %v", err)
- }
-
- // get org of submitting client
- clientOrgID, err := ctx.GetClientIdentity().GetMSPID()
- if err != nil {
- return fmt.Errorf("failed to get client identity %v", err)
- }
-
- auditor := false
-
- if withAuditor == "withAuditor" {
- auditor = true
- }
-
- // Create auction
- bidders := make(map[string]BidHash)
- revealedBids := make(map[string]FullBid)
-
- auction := Auction{
- Type: "auction",
- ItemSold: itemsold,
- Quantity: quantity,
- Price: 0,
- Seller: clientID,
- Orgs: []string{clientOrgID},
- PrivateBids: bidders,
- RevealedBids: revealedBids,
- Winners: []Winners{},
- Status: "open",
- Auditor: auditor,
- }
-
- auctionJSON, err := json.Marshal(auction)
- if err != nil {
- return err
- }
-
- // put auction into state
- err = ctx.GetStub().PutState(auctionID, auctionJSON)
- if err != nil {
- return fmt.Errorf("failed to put auction in public data: %v", err)
- }
-
- // set the seller of the auction as an endorser
- err = setAssetStateBasedEndorsement(ctx, auctionID, []string{clientOrgID}, auditor)
- if err != nil {
- return fmt.Errorf("failed setting state based endorsement for new organization: %v", err)
- }
-
- return nil
-}
-
-// Bid is used to add a users bid to the auction. The bid is stored in the private
-// data collection on the peer of the bidder's organization. The function returns
-// the transaction ID so that users can identify and query their bid
-func (s *SmartContract) Bid(ctx contractapi.TransactionContextInterface, auctionID string) (string, error) {
-
- // get bid from transient map
- transientMap, err := ctx.GetStub().GetTransient()
- if err != nil {
- return "", fmt.Errorf("error getting transient: %v", err)
- }
-
- bidJSON, ok := transientMap["bid"]
- if !ok {
- return "", errors.New("bid key not found in the transient map")
- }
-
- // get the implicit collection name using the bidder's organization ID
- collection, err := getCollectionName(ctx)
- if err != nil {
- return "", fmt.Errorf("failed to get implicit collection name: %v", err)
- }
-
- // the bidder has to target their peer to store the bid
- err = verifyClientOrgMatchesPeerOrg(ctx)
- if err != nil {
- return "", fmt.Errorf("cannot store bid on this peer, not a member of this org: %v", err)
- }
-
- // the transaction ID is used as a unique index for the bid
- txID := ctx.GetStub().GetTxID()
-
- // create a composite key using the transaction ID
- bidKey, err := ctx.GetStub().CreateCompositeKey(bidKeyType, []string{auctionID, txID})
- if err != nil {
- return "", fmt.Errorf("failed to create composite key: %v", err)
- }
-
- // put the bid into the organization's implicit data collection
- err = ctx.GetStub().PutPrivateData(collection, bidKey, bidJSON)
- if err != nil {
- return "", fmt.Errorf("failed to input price into collection: %v", err)
- }
-
- // return the trannsaction ID so that the uset can identify their bid
- return txID, nil
-}
-
-// SubmitBid is used by the bidder to add the hash of that bid stored in private data to the
-// auction. Note that this function alters the auction in private state, and needs
-// to meet the auction endorsement policy. Transaction ID is used identify the bid
-func (s *SmartContract) SubmitBid(ctx contractapi.TransactionContextInterface, auctionID string, txID string) error {
-
- // get the MSP ID of the bidder's org
- clientOrgID, err := ctx.GetClientIdentity().GetMSPID()
- if err != nil {
- return fmt.Errorf("failed to get client MSP ID: %v", err)
- }
-
- // get the auction from public state
- auction, err := s.QueryAuction(ctx, auctionID)
- if err != nil {
- return fmt.Errorf("failed to get auction from public state %v", err)
- }
-
- // the auction needs to be open for users to add their bid
- status := auction.Status
- if status != "open" {
- return fmt.Errorf("cannot join closed or ended auction")
- }
-
- // get the inplicit collection name of bidder's org
- collection, err := getCollectionName(ctx)
- if err != nil {
- return fmt.Errorf("failed to get implicit collection name: %v", err)
- }
-
- // use the transaction ID passed as a parameter to create composite bid key
- bidKey, err := ctx.GetStub().CreateCompositeKey(bidKeyType, []string{auctionID, txID})
- if err != nil {
- return fmt.Errorf("failed to create composite key: %v", err)
- }
-
- // get the hash of the bid if found in private collection
- bidHash, err := ctx.GetStub().GetPrivateDataHash(collection, bidKey)
- if err != nil {
- return fmt.Errorf("failed to read bid bash from collection: %v", err)
- }
- if bidHash == nil {
- return fmt.Errorf("bid hash does not exist: %s", bidKey)
- }
-
- // store the hash along with the bidder's organization
- newHash := BidHash{
- Org: clientOrgID,
- Hash: fmt.Sprintf("%x", bidHash),
- }
-
- auction.PrivateBids[bidKey] = newHash
-
- // Add the bidding organization to the list of participating organization's if it is not already
- orgs := auction.Orgs
- if !(contains(orgs, clientOrgID)) {
- newOrgs := append(orgs, clientOrgID)
- auction.Orgs = newOrgs
-
- err = setAssetStateBasedEndorsement(ctx, auctionID, newOrgs, auction.Auditor)
- if err != nil {
- return fmt.Errorf("failed setting state based endorsement for new organization: %v", err)
- }
- }
-
- newAuctionJSON, _ := json.Marshal(auction)
-
- err = ctx.GetStub().PutState(auctionID, newAuctionJSON)
- if err != nil {
- return fmt.Errorf("failed to update auction: %v", err)
- }
-
- return nil
-}
-
-// RevealBid is used by a bidder to reveal their bid after the auction is closed
-func (s *SmartContract) RevealBid(ctx contractapi.TransactionContextInterface, auctionID string, txID string) error {
-
- // get bid from transient map
- transientMap, err := ctx.GetStub().GetTransient()
- if err != nil {
- return fmt.Errorf("error getting transient: %v", err)
- }
-
- transientBidJSON, ok := transientMap["bid"]
- if !ok {
- return fmt.Errorf("bid key not found in the transient map")
- }
-
- // get implicit collection name of organization ID
- collection, err := getCollectionName(ctx)
- if err != nil {
- return fmt.Errorf("failed to get implicit collection name: %v", err)
- }
-
- // use transaction ID to create composit bid key
- bidKey, err := ctx.GetStub().CreateCompositeKey(bidKeyType, []string{auctionID, txID})
- if err != nil {
- return fmt.Errorf("failed to create composite key: %v", err)
- }
-
- // get bid hash of bid if private bid on the public ledger
- bidHash, err := ctx.GetStub().GetPrivateDataHash(collection, bidKey)
- if err != nil {
- return fmt.Errorf("failed to read bid bash from collection: %v", err)
- }
- if bidHash == nil {
- return fmt.Errorf("bid hash does not exist: %s", bidKey)
- }
-
- // get auction from public state
- auction, err := s.QueryAuction(ctx, auctionID)
- if err != nil {
- return fmt.Errorf("failed to get auction from public state %v", err)
- }
-
- // Complete a series of three checks before we add the bid to the auction
-
- // check 1: check that the auction is closed. We cannot reveal an
- // bid to an open auction
- status := auction.Status
- if status != "closed" {
- return fmt.Errorf("cannot reveal bid for open or ended auction")
- }
-
- // check 2: check that hash of revealed bid matches hash of private bid
- // on the public ledger. This checks that the bidder is telling the truth
- // about the value of their bid
-
- hash := sha256.New()
- hash.Write(transientBidJSON)
- calculatedBidJSONHash := hash.Sum(nil)
-
- // verify that the hash of the passed immutable properties matches the on-chain hash
- if !bytes.Equal(calculatedBidJSONHash, bidHash) {
- return fmt.Errorf("hash %x for bid JSON %s does not match hash in auction: %x",
- calculatedBidJSONHash,
- transientBidJSON,
- bidHash,
- )
- }
-
- // check 3; check hash of relealed bid matches hash of private bid that was
- // added earlier. This ensures that the bid has not changed since it
- // was added to the auction
-
- privateBidHashString := auction.PrivateBids[bidKey].Hash
-
- onChainBidHashString := fmt.Sprintf("%x", bidHash)
- if privateBidHashString != onChainBidHashString {
- return fmt.Errorf("hash %s for bid JSON %s does not match hash in auction: %s, bidder must have changed bid",
- privateBidHashString,
- transientBidJSON,
- onChainBidHashString,
- )
- }
-
- // we can add the bid to the auction if all checks have passed
- type transientBidInput struct {
- Quantity int `json:"quantity"`
- Price int `json:"price"`
- Org string `json:"org"`
- Buyer string `json:"buyer"`
- }
-
- // unmarshal bid imput
- var bidInput transientBidInput
- err = json.Unmarshal(transientBidJSON, &bidInput)
- if err != nil {
- return fmt.Errorf("failed to unmarshal JSON: %v", err)
- }
-
- // get ID of submitting client
- clientID, err := s.GetSubmittingClientIdentity(ctx)
- if err != nil {
- return fmt.Errorf("failed to get client identity %v", err)
- }
-
- // marshal transient parameters and ID and MSPID into bid object
- newBid := FullBid{
- Type: bidKeyType,
- Quantity: bidInput.Quantity,
- Price: bidInput.Price,
- Org: bidInput.Org,
- Buyer: bidInput.Buyer,
- }
-
- // check 4: make sure that the transaction is being submitted is the bidder
- if bidInput.Buyer != clientID {
- return fmt.Errorf("permission denied, client id %v is not the owner of the bid", clientID)
- }
-
- revealedBids := auction.RevealedBids
- revealedBids[bidKey] = newBid
- auction.RevealedBids = revealedBids
-
- auctionJSON, _ := json.Marshal(auction)
-
- // put auction with bid added back into state
- err = ctx.GetStub().PutState(auctionID, auctionJSON)
- if err != nil {
- return fmt.Errorf("failed to update auction: %v", err)
- }
-
- return nil
-}
-
-// CloseAuction can be used by the seller to close the auction. This prevents
-// bids from being added to the auction, and allows users to reveal their bid
-func (s *SmartContract) CloseAuction(ctx contractapi.TransactionContextInterface, auctionID string) error {
-
- // get auction from public state
- auction, err := s.QueryAuction(ctx, auctionID)
- if err != nil {
- return fmt.Errorf("failed to get auction from public state %v", err)
- }
-
- // the auction can only be closed by the seller
-
- // get ID of submitting client
- clientID, err := s.GetSubmittingClientIdentity(ctx)
- if err != nil {
- return fmt.Errorf("failed to get client identity %v", err)
- }
-
- seller := auction.Seller
- if seller != clientID {
- return fmt.Errorf("auction can only be closed by seller: %v", err)
- }
-
- status := auction.Status
- if status != "open" {
- return fmt.Errorf("cannot close auction that is not open")
- }
-
- auction.Status = string("closed")
-
- closedAuctionJSON, _ := json.Marshal(auction)
-
- err = ctx.GetStub().PutState(auctionID, closedAuctionJSON)
- if err != nil {
- return fmt.Errorf("failed to close auction: %v", err)
- }
-
- return nil
-}
-
-// EndAuction both changes the auction status to closed and calculates the winners
-// of the auction
-func (s *SmartContract) EndAuction(ctx contractapi.TransactionContextInterface, auctionID string) error {
-
- // get auction from public state
- auction, err := s.QueryAuction(ctx, auctionID)
- if err != nil {
- return fmt.Errorf("failed to get auction from public state %v", err)
- }
-
- // Check that the auction is being ended by the seller
-
- // get ID of submitting client
- clientID, err := s.GetSubmittingClientIdentity(ctx)
- if err != nil {
- return fmt.Errorf("failed to get client identity %v", err)
- }
-
- seller := auction.Seller
- if seller != clientID {
- return fmt.Errorf("auction can only be ended by seller: %v", err)
- }
-
- status := auction.Status
- if status != "closed" {
- return fmt.Errorf("can only end a closed auction")
- }
-
- // get the list of revealed bids
-
- revealedBidMap := auction.RevealedBids
- if len(auction.RevealedBids) == 0 {
- return fmt.Errorf("no bids have been revealed, cannot end auction: %v", err)
- }
-
- // sort the map of revealed bids to make it easier to calculate winners
- // if bids are tied, fill smaller bids first
- var bidders []FullBid
-
- for _, bid := range revealedBidMap {
- bidders = append(bidders, bid)
- }
-
- sort.Slice(bidders, func(p, q int) bool {
- if bidders[p].Price > bidders[q].Price {
- return true
- }
- if bidders[p].Price < bidders[q].Price {
- return false
- }
- return bidders[p].Quantity < bidders[q].Quantity
- })
-
- i := 0
- remainingQuantity := auction.Quantity
-
- // calculate the winners
- for remainingQuantity > 0 {
-
- // create the next winning bid
- winner := Winners{
- Buyer: bidders[i].Buyer,
- Quantity: bidders[i].Quantity,
- }
-
- // add them to the list of winners and change the winning price
- auction.Winners = append(auction.Winners, winner)
- auction.Price = bidders[i].Price
-
- // Calculate the quantity that goes to the winner
- // if there is sufficient quantity to give them the full bid
- if remainingQuantity > bidders[i].Quantity {
- remainingQuantity = remainingQuantity - bidders[i].Quantity
-
- // if there is not, give the remainder
- } else {
- auction.Winners[i].Quantity = remainingQuantity
- remainingQuantity = 0
- }
- i++
- if i == len(bidders) {
- remainingQuantity = 0
- }
- }
-
- // check if there is a winning bid that has yet to be revealed
- err = checkForHigherBid(ctx, auction.Price, auction.RevealedBids, auction.PrivateBids)
- if err != nil {
- return fmt.Errorf("cannot end auction: %v", err)
- }
-
- auction.Status = "ended"
-
- endedAuctionJSON, _ := json.Marshal(auction)
-
- err = ctx.GetStub().PutState(auctionID, endedAuctionJSON)
- if err != nil {
- return fmt.Errorf("failed to end auction: %v", err)
- }
- return nil
-}
diff --git a/auction-dutch/chaincode-go/smart-contract/auctionQueries.go b/auction-dutch/chaincode-go/smart-contract/auctionQueries.go
deleted file mode 100644
index d5024fb4..00000000
--- a/auction-dutch/chaincode-go/smart-contract/auctionQueries.go
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
-SPDX-License-Identifier: Apache-2.0
-*/
-
-package auction
-
-import (
- "encoding/json"
- "errors"
- "fmt"
-
- "github.com/hyperledger/fabric-chaincode-go/v2/shim"
- "github.com/hyperledger/fabric-contract-api-go/v2/contractapi"
-)
-
-// QueryAuction allows all members of the channel to read a public auction
-func (s *SmartContract) QueryAuction(ctx contractapi.TransactionContextInterface, auctionID string) (*Auction, error) {
-
- auctionJSON, err := ctx.GetStub().GetState(auctionID)
- if err != nil {
- return nil, fmt.Errorf("failed to get auction object %v: %v", auctionID, err)
- }
- if auctionJSON == nil {
- return nil, errors.New("auction does not exist")
- }
-
- var auction *Auction
- err = json.Unmarshal(auctionJSON, &auction)
- if err != nil {
- return nil, err
- }
-
- return auction, nil
-}
-
-// QueryBid allows the submitter of the bid to read their bid from public state
-func (s *SmartContract) QueryBid(ctx contractapi.TransactionContextInterface, auctionID string, txID string) (*FullBid, error) {
-
- err := verifyClientOrgMatchesPeerOrg(ctx)
- if err != nil {
- return nil, fmt.Errorf("failed to get implicit collection name: %v", err)
- }
-
- clientID, err := s.GetSubmittingClientIdentity(ctx)
- if err != nil {
- return nil, fmt.Errorf("failed to get client identity %v", err)
- }
-
- collection, err := getCollectionName(ctx)
- if err != nil {
- return nil, fmt.Errorf("failed to get implicit collection name: %v", err)
- }
-
- bidKey, err := ctx.GetStub().CreateCompositeKey(bidKeyType, []string{auctionID, txID})
- if err != nil {
- return nil, fmt.Errorf("failed to create composite key: %v", err)
- }
-
- bidJSON, err := ctx.GetStub().GetPrivateData(collection, bidKey)
- if err != nil {
- return nil, fmt.Errorf("failed to get bid %v: %v", bidKey, err)
- }
- if bidJSON == nil {
- return nil, fmt.Errorf("bid %v does not exist", bidKey)
- }
-
- var bid *FullBid
- err = json.Unmarshal(bidJSON, &bid)
- if err != nil {
- return nil, err
- }
-
- // check that the client querying the bid is the bid owner
- if bid.Buyer != clientID {
- return nil, fmt.Errorf("permission denied, client id %v is not the owner of the bid", clientID)
- }
-
- return bid, nil
-}
-
-// checkForHigherBid is an internal function that is used to determine if a winning bid has yet to be revealed
-func checkForHigherBid(ctx contractapi.TransactionContextInterface, auctionPrice int, revealedBidders map[string]FullBid, bidders map[string]BidHash) error {
-
- // Get MSP ID of peer org
- peerMSPID, err := shim.GetMSPID()
- if err != nil {
- return fmt.Errorf("failed getting the peer's MSPID: %v", err)
- }
-
- var error error
- error = nil
-
- for bidKey, privateBid := range bidders {
-
- if _, bidInAuction := revealedBidders[bidKey]; bidInAuction {
-
- // bid is already revealed, no action to take
-
- } else {
-
- collection := "_implicit_org_" + privateBid.Org
-
- if privateBid.Org == peerMSPID {
-
- bidJSON, err := ctx.GetStub().GetPrivateData(collection, bidKey)
- if err != nil {
- return fmt.Errorf("failed to get bid %v: %v", bidKey, err)
- }
- if bidJSON == nil {
- return fmt.Errorf("bid %v does not exist", bidKey)
- }
-
- var bid *FullBid
- err = json.Unmarshal(bidJSON, &bid)
- if err != nil {
- return err
- }
-
- if bid.Price > auctionPrice {
- error = fmt.Errorf("cannot close auction, bidder has a higher price: %v", err)
- }
-
- } else {
-
- hash, err := ctx.GetStub().GetPrivateDataHash(collection, bidKey)
- if err != nil {
- return fmt.Errorf("failed to read bid hash from collection: %v", err)
- }
- if hash == nil {
- return fmt.Errorf("bid hash does not exist: %s", bidKey)
- }
- }
- }
- }
-
- return error
-}
diff --git a/auction-dutch/chaincode-go/smart-contract/utils.go b/auction-dutch/chaincode-go/smart-contract/utils.go
deleted file mode 100644
index 351826fb..00000000
--- a/auction-dutch/chaincode-go/smart-contract/utils.go
+++ /dev/null
@@ -1,205 +0,0 @@
-/*
-SPDX-License-Identifier: Apache-2.0
-*/
-
-package auction
-
-import (
- "encoding/base64"
- "fmt"
-
- "github.com/hyperledger/fabric-chaincode-go/v2/shim"
- "github.com/hyperledger/fabric-contract-api-go/v2/contractapi"
- "github.com/hyperledger/fabric-protos-go-apiv2/common"
- "github.com/hyperledger/fabric-protos-go-apiv2/msp"
- "google.golang.org/protobuf/proto"
-)
-
-func (s *SmartContract) GetSubmittingClientIdentity(ctx contractapi.TransactionContextInterface) (string, error) {
-
- b64ID, err := ctx.GetClientIdentity().GetID()
- if err != nil {
- return "", fmt.Errorf("failed to read clientID: %v", err)
- }
- decodeID, err := base64.StdEncoding.DecodeString(b64ID)
- if err != nil {
- return "", fmt.Errorf("failed to base64 decode clientID: %v", err)
- }
- return string(decodeID), nil
-}
-
-// getCollectionName is an internal helper function to get collection of submitting client identity.
-func getCollectionName(ctx contractapi.TransactionContextInterface) (string, error) {
-
- // Get the MSP ID of submitting client identity
- clientMSPID, err := ctx.GetClientIdentity().GetMSPID()
- if err != nil {
- return "", fmt.Errorf("failed to get verified MSPID: %v", err)
- }
-
- // Create the collection name
- orgCollection := "_implicit_org_" + clientMSPID
-
- return orgCollection, nil
-}
-
-// verifyClientOrgMatchesPeerOrg is an internal function used to verify that client org id matches peer org id.
-func verifyClientOrgMatchesPeerOrg(ctx contractapi.TransactionContextInterface) error {
-
- clientMSPID, err := ctx.GetClientIdentity().GetMSPID()
- if err != nil {
- return fmt.Errorf("failed getting the client's MSPID: %v", err)
- }
- peerMSPID, err := shim.GetMSPID()
- if err != nil {
- return fmt.Errorf("failed getting the peer's MSPID: %v", err)
- }
-
- if clientMSPID != peerMSPID {
- return fmt.Errorf("client from org %v is not authorized to read or write private data from an org %v peer", clientMSPID, peerMSPID)
- }
-
- return nil
-}
-
-func contains(sli []string, str string) bool {
- for _, a := range sli {
- if a == str {
- return true
- }
- }
- return false
-}
-
-func setAssetStateBasedEndorsement(ctx contractapi.TransactionContextInterface, assetId string, mspids []string, auditor bool) error {
-
- principals := make([]*msp.MSPPrincipal, len(mspids))
- participantSigsPolicy := make([]*common.SignaturePolicy, len(mspids))
-
- for i, id := range mspids {
- principal, err := proto.Marshal(
- &msp.MSPRole{
- Role: msp.MSPRole_PEER,
- MspIdentifier: id,
- },
- )
- if err != nil {
- return err
- }
- principals[i] = &msp.MSPPrincipal{
- PrincipalClassification: msp.MSPPrincipal_ROLE,
- Principal: principal,
- }
- participantSigsPolicy[i] = &common.SignaturePolicy{
- Type: &common.SignaturePolicy_SignedBy{
- SignedBy: int32(i),
- },
- }
- }
-
- if !auditor {
- // create the defalt policy for an auction without an auditor
-
- policy := &common.SignaturePolicyEnvelope{
- Version: 0,
- Rule: &common.SignaturePolicy{
- Type: &common.SignaturePolicy_NOutOf_{
- NOutOf: &common.SignaturePolicy_NOutOf{
- N: int32(len(mspids)),
- Rules: participantSigsPolicy,
- },
- },
- },
- Identities: principals,
- }
-
- spBytes, err := proto.Marshal(policy)
- if err != nil {
- return err
- }
- err = ctx.GetStub().SetStateValidationParameter(assetId, spBytes)
- if err != nil {
- return fmt.Errorf("failed to set validation parameter on auction: %v", err)
- }
- } else {
-
- // create the defalt policy for an auction with an auditor
-
- // create the auditor identity and signature policy
- auditorMSP, err := proto.Marshal(
- &msp.MSPRole{
- Role: msp.MSPRole_PEER,
- MspIdentifier: "Org3MSP",
- },
- )
- if err != nil {
- return err
- }
- principals = append(principals, &msp.MSPPrincipal{
- PrincipalClassification: msp.MSPPrincipal_ROLE,
- Principal: auditorMSP,
- },
- )
- // Create the policies in case the auditor is needed. In this case, an
- // auditor and 1 participant can update the auction.
- auditorPolicies := make([]*common.SignaturePolicy, 2)
- auditorPolicies[0] = &common.SignaturePolicy{
- Type: &common.SignaturePolicy_SignedBy{
- SignedBy: int32(len(principals) - 1),
- },
- }
- auditorPolicies[1] = &common.SignaturePolicy{
- Type: &common.SignaturePolicy_NOutOf_{
- NOutOf: &common.SignaturePolicy_NOutOf{
- N: 1,
- Rules: participantSigsPolicy,
- },
- },
- }
-
- // For two organizations, the auditor policy below is equivilent to
- // AND(auditor, OR(Org1, Org2))
- policies := make([]*common.SignaturePolicy, 2)
- policies[0] = &common.SignaturePolicy{
- Type: &common.SignaturePolicy_NOutOf_{
- NOutOf: &common.SignaturePolicy_NOutOf{
- N: 2,
- Rules: auditorPolicies,
- },
- },
- }
- // Participants can also update the auction without an auditor
- policies[1] = &common.SignaturePolicy{
- Type: &common.SignaturePolicy_NOutOf_{
- NOutOf: &common.SignaturePolicy_NOutOf{
- N: int32(len(mspids)),
- Rules: participantSigsPolicy,
- },
- },
- }
- // Either the auditor policy or the participant policy can update
- // the auction. For example, for two organizations, the full policy would be
- // equivilent to OR(AND(Org1, Org2),AND(auditor, OR(Org1, Org2)))
- policy := &common.SignaturePolicyEnvelope{
- Version: 0,
- Rule: &common.SignaturePolicy{
- Type: &common.SignaturePolicy_NOutOf_{
- NOutOf: &common.SignaturePolicy_NOutOf{
- N: 1,
- Rules: policies,
- },
- },
- },
- Identities: principals,
- }
- spBytes, err := proto.Marshal(policy)
- if err != nil {
- return err
- }
- err = ctx.GetStub().SetStateValidationParameter(assetId, spBytes)
- if err != nil {
- return fmt.Errorf("failed to set validation parameter on auction: %v", err)
- }
- }
- return nil
-}
diff --git a/auction-dutch/chaincode-go/smartContract.go b/auction-dutch/chaincode-go/smartContract.go
deleted file mode 100644
index 939a519c..00000000
--- a/auction-dutch/chaincode-go/smartContract.go
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
-SPDX-License-Identifier: Apache-2.0
-*/
-
-package main
-
-import (
- "log"
-
- "github.com/hyperledger/fabric-contract-api-go/v2/contractapi"
- auction "github.com/hyperledger/fabric-samples/auction/dutch-auction/chaincode-go/smart-contract"
-)
-
-func main() {
- auctionSmartContract, err := contractapi.NewChaincode(&auction.SmartContract{})
- if err != nil {
- log.Panicf("Error creating auction chaincode: %v", err)
- }
-
- if err := auctionSmartContract.Start(); err != nil {
- log.Panicf("Error starting auction chaincode: %v", err)
- }
-}
diff --git a/auction-simple/README.md b/auction-simple/README.md
deleted file mode 100644
index e6bb6308..00000000
--- a/auction-simple/README.md
+++ /dev/null
@@ -1,410 +0,0 @@
-## Simple blind auction sample
-
-The simple blind auction sample uses Hyperledger Fabric to run an auction where bids are kept private until the auction period is over. Instead of displaying the full bid on the public ledger, buyers can only see hashes of other bids while bidding is underway. This prevents buyers from changing their bids in response to bids submitted by others. After the bidding period ends, participants reveal their bid to try to win the auction. The organizations participating in the auction verify that a revealed bid matches the hash on the public ledger. Whichever has the highest bid wins.
-
-A user that wants to sell one item can use the smart contract to create an auction. The auction is stored on the channel ledger and can be read by all channel members. The auctions created by the smart contract are run in three steps:
-1. Each auction is created with the status **open**. While the auction is open, buyers can add new bids to the auction. The full bids of each buyer are stored in the implicit private data collections of their organization. After the bid is created, the bidder can submit the hash of the bid to the auction. A bid is added to the auction in two steps because the transaction that creates the bid only needs to be endorsed by a peer of the bidders organization, while a transaction that updates the auction may need to be endorsed by multiple organizations. When the bid is added to the auction, the bidder's organization is added to the list of organizations that need to endorse any updates to the auction.
-2. The auction is **closed** to prevent additional bids from being added to the auction. After the auction is closed, bidders that submitted bids to the auction can reveal their full bid. Only revealed bids can win the auction.
-3. The auction is **ended** to calculate the winner from the set of revealed bids. All organizations participating in the auction calculate the price that clears the auction and the winning bid. The seller can end the auction only if all bidding organizations endorse the same winner and price.
-
-Before endorsing the transaction that ends the auction, each organization queries the implicit private data collection on their peers to check if any organization member has a winning bid that has not yet been revealed. If a winning bid is found, the organization will withhold their endorsement and prevent the auction from being closed. This prevents the seller from ending the auction prematurely, or colluding with buyers to end the auction at an artificially low price.
-
-The sample uses several Fabric features to make the auction private and secure. Bids are stored in private data collections to prevent bids from being distributed to other peers in the channel. When bidding is closed, the auction smart contract uses the `GetPrivateDataHash()` API to verify that the bid stored in private data is the same bid that is being revealed. State based endorsement is used to add the organization of each bidder to the auction endorsement policy. The smart contract uses the `GetClientIdentity.GetID()` API to ensure that only the potential buyer can read their bid from private state and only the seller can close or end the auction.
-
-This tutorial uses the auction smart contract in a scenario where one seller wants to auction a painting. Four potential buyers from two different organizations will submit bids to the auction and try to win the auction.
-
-## Deploy the chaincode
-
-We will run the auction smart contract using the Fabric test network. Open a command terminal and navigate to the test network directory:
-```
-cd fabric-samples/test-network
-```
-
-You can then run the following command to deploy the test network.
-```
-./network.sh up createChannel -ca
-```
-
-Note that we use the `-ca` flag to deploy the network using certificate authorities. We will use the CA to register and enroll our sellers and buyers.
-
-Run the following command to deploy the auction smart contract. We will override the default endorsement policy to allow any channel member to create an auction without requiring an endorsement from another organization.
-```
-./network.sh deployCC -ccn auction -ccp ../auction-simple/chaincode-go/ -ccl go -ccep "OR('Org1MSP.peer','Org2MSP.peer')"
-```
-
-## Install the application dependencies
-
-We will interact with the auction smart contract through a set of Node.js applications. Change into the `application-javascript` directory:
-```
-cd fabric-samples/auction-simple/application-javascript
-```
-
-From this directory, run the following command to download the application dependencies:
-```
-npm install
-```
-
-## Register and enroll the application identities
-
-To interact with the network, you will need to enroll the Certificate Authority administrators of Org1 and Org2. You can use the `enrollAdmin.js` program for this task. Run the following command to enroll the Org1 admin:
-```
-node enrollAdmin.js org1
-```
-You should see the logs of the admin wallet being created on your local file system. Now run the command to enroll the CA admin of Org2:
-```
-node enrollAdmin.js org2
-```
-
-We can use the CA admins of both organizations to register and enroll the identities of the seller that will create the auction and the bidders who will try to purchase the painting.
-
-Run the following command to register and enroll the seller identity that will create the auction. The seller will belong to Org1.
-```
-node registerEnrollUser.js org1 seller
-```
-
-You should see the logs of the seller wallet being created as well. Run the following commands to register and enroll 2 bidders from Org1 and another 2 bidders from Org2:
-```
-node registerEnrollUser.js org1 bidder1
-node registerEnrollUser.js org1 bidder2
-node registerEnrollUser.js org2 bidder3
-node registerEnrollUser.js org2 bidder4
-```
-
-## Create the auction
-
-The seller from Org1 would like to create an auction to sell a vintage Matchbox painting. Run the following command to use the seller wallet to run the `createAuction.js` application. The program will submit a transaction to the network that creates the auction on the channel ledger. The organization and identity name are passed to the application to use the wallet that was created by the `registerEnrollUser.js` application. The seller needs to provide an ID for the auction and the item to be sold to create the auction:
-```
-node createAuction.js org1 seller PaintingAuction painting
-```
-
-After the transaction is complete, the `createAuction.js` application will query the auction stored in the public channel ledger:
-```
-*** Result: Auction: {
- "objectType": "auction",
- "item": "painting",
- "seller": "x509::CN=seller,OU=client+OU=org1+OU=department1::CN=ca.org1.example.com,O=org1.example.com,L=Durham,ST=North Carolina,C=US",
- "organizations": [
- "Org1MSP"
- ],
- "privateBids": {},
- "revealedBids": {},
- "winner": "",
- "price": 0,
- "status": "open"
-}
-```
-The smart contract uses the `GetClientIdentity().GetID()` API to read the identity that creates the auction and defines that identity as the auction `"seller"`. The seller is identified by the name and issuer of the seller's certificate.
-
-## Bid on the auction
-
-We can now use the bidder wallets to submit bids to the auction:
-
-### Bid as bidder1
-
-Bidder1 will create a bid to purchase the painting for 800 dollars.
-```
-node bid.js org1 bidder1 PaintingAuction 800
-```
-
-The application will query the bid after it is created:
-```
-*** Result: Bid: {
- "objectType": "bid",
- "price": 800,
- "org": "Org1MSP",
- "bidder": "x509::CN=bidder1,OU=client+OU=org1+OU=department1::CN=ca.org1.example.com,O=org1.example.com,L=Durham,ST=North Carolina,C=US"
-}
-```
-
-The bid is stored in the Org1 implicit data collection. The `"bidder"` parameter is the information from the certificate of the user that created the bid. Only this identity will be able can query the bid from private state or reveal the bid during the auction.
-
-The `bid.js` application also prints the bidID:
-```
-*** Result ***SAVE THIS VALUE*** BidID: 67d85ef08e32de20994c816362d0952fe5c2ae3f2d1083600c3ac61f65a89f60
-```
-
-The BidID acts as the unique identifier for the bid. This ID allows you to query the bid using the `queryBid.js` program and add the bid to the auction. Save the bidID returned by the application as an environment variable in your terminal:
-```
-export BIDDER1_BID_ID=67d85ef08e32de20994c816362d0952fe5c2ae3f2d1083600c3ac61f65a89f60
-```
-This value will be different for each transaction, so you will need to use the value returned in your terminal.
-
-Now that the bid has been created, you can submit the bid to the auction. Run the following command to submit the bid that was just created:
-```
-node submitBid.js org1 bidder1 PaintingAuction $BIDDER1_BID_ID
-```
-
-The hash of bid will be added to the list private bids in that have been submitted to `PaintingAuction`. Storing the hash in the public auction allows users to accurately reveal the bid after bidding is closed. The application will query the auction to verify that the bid was added:
-```
-*** Result: Auction: {
- "objectType": "auction",
- "item": "painting",
- "seller": "x509::CN=seller,OU=client+OU=org1+OU=department1::CN=ca.org1.example.com,O=org1.example.com,L=Durham,ST=North Carolina,C=US",
- "organizations": [
- "Org1MSP"
- ],
- "privateBids": {
- "\u0000bid\u0000PaintingAuction\u00005c049b0b4552d34c88e0f8fb5abca31fa04472b7e1336a16650ac8cfb0b16472\u0000": {
- "org": "Org1MSP",
- "hash": "0b8bbdb96b1d252e71ac1ed71df3580f7a0e31a743a4a09bbf5196dffef426b2"
- }
- },
- "revealedBids": {},
- "winner": "",
- "price": 0,
- "status": "open"
-}
-```
-
-### Bid as bidder2
-
-Let's submit another bid. Bidder2 would like to purchase the painting for 500 dollars.
-```
-node bid.js org1 bidder2 PaintingAuction 500
-```
-
-Save the Bid ID returned by the application:
-```
-export BIDDER2_BID_ID=0fa8b3b15923966f205a1f5ebd163d2707d069ffa055105114fc654d225f511d
-```
-
-Submit bidder2's bid to the auction:
-```
-node submitBid.js org1 bidder2 PaintingAuction $BIDDER2_BID_ID
-```
-
-### Bid as bidder3 from Org2
-
-Bidder3 will bid 700 dollars for the painting:
-```
-node bid.js org2 bidder3 PaintingAuction 700
-```
-
-Save the Bid ID returned by the application:
-```
-export BIDDER3_BID_ID=cda8bb2849fc0553efb036c56ea86d82791a695b5641941dac797dc6e2d75768
-```
-
-Add bidder3's bid to the auction:
-```
-node submitBid.js org2 bidder3 PaintingAuction $BIDDER3_BID_ID
-```
-
-Because bidder3 belongs to Org2, submitting the bid will add Org2 to the list of participating organizations. You can see the Org2 MSP ID has been added to the list of `"organizations"` in the updated auction returned by the application:
-```
-*** Result: Auction: {
- "objectType": "auction",
- "item": "painting",
- "seller": "x509::CN=seller,OU=client+OU=org1+OU=department1::CN=ca.org1.example.com,O=org1.example.com,L=Durham,ST=North Carolina,C=US",
- "organizations": [
- "Org1MSP",
- "Org2MSP"
- ],
- "privateBids": {
- "\u0000bid\u0000PaintingAuction\u00001b9dc0006fef10413df5cca927cabdf73ab854fe92b7a7b2eebfa00961fdac67\u0000": {
- "org": "Org1MSP",
- "hash": "15cd9a3e12825017f3e758499ac6138ebbe1adec4c49cc6ea6a0973fc6514666"
- },
- "\u0000bid\u0000PaintingAuction\u00005c049b0b4552d34c88e0f8fb5abca31fa04472b7e1336a16650ac8cfb0b16472\u0000": {
- "org": "Org1MSP",
- "hash": "0b8bbdb96b1d252e71ac1ed71df3580f7a0e31a743a4a09bbf5196dffef426b2"
- },
- "\u0000bid\u0000PaintingAuction\u00005ee4fa53b54ea0821e57a6884a1ada5eb04f136ee222e92d7399bcdf47556ea1\u0000": {
- "org": "Org2MSP",
- "hash": "14d47d17acceceb483e87c14a4349844874fce549d71c6a23457d953ed8ffbd3"
- }
- },
- "revealedBids": {},
- "winner": "",
- "price": 0,
- "status": "open"
-}
-```
-
-Now that a bid from Org2 has been added to the auction, any updates to the auction need to be endorsed by the Org2 peer. The applications will use `"organizations"` field to specify which organizations need to endorse submitting a new bid, revealing a bid, or updating the auction status.
-
-### Bid as bidder4
-
-Bidder4 from Org2 would like to purchase the painting for 900 dollars:
-```
-node bid.js org2 bidder4 PaintingAuction 900
-```
-
-Save the Bid ID returned by the application:
-```
-export BIDDER4_BID_ID=83861eb17715ff537a1e73cd2d08509dc7199572806a5368706516759af1a257
-```
-
-Add bidder4's bid to the auction:
-```
-node submitBid.js org2 bidder4 PaintingAuction $BIDDER4_BID_ID
-```
-
-## Close the auction
-
-Now that all four bidders have joined the auction, the seller would like to close the auction and allow buyers to reveal their bids. The seller identity that created the auction needs to submit the transaction:
-```
-node closeAuction.js org1 seller PaintingAuction
-```
-
-The application will query the auction to allow you to verify that the auction status has changed to closed. As a test, you can try to create and submit a new bid to verify that no new bids can be added to the auction.
-
-## Reveal bids
-
-After the auction is closed, bidders can try to win the auction by revealing their bids. The transaction to reveal a bid needs to pass four checks:
-1. The auction is closed.
-2. The transaction was submitted by the identity that created the bid.
-3. The hash of the revealed bid matches the hash of the bid on the channel ledger. This confirms that the bid is the same as the bid that is stored in the private data collection.
-4. The hash of the revealed bid matches the hash that was submitted to the auction. This confirms that the bid was not altered after the auction was closed.
-
-Use the `revealBid.js` application to reveal the bid of Bidder1:
-```
-node revealBid.js org1 bidder1 PaintingAuction $BIDDER1_BID_ID
-```
-
-The full bid details, including the price, are now visible:
-```
-*** Result: Auction: {
- "objectType": "auction",
- "item": "painting",
- "seller": "x509::CN=seller,OU=client+OU=org1+OU=department1::CN=ca.org1.example.com,O=org1.example.com,L=Durham,ST=North Carolina,C=US",
- "organizations": [
- "Org1MSP",
- "Org2MSP"
- ],
- "privateBids": {
- "\u0000bid\u0000PaintingAuction\u000019a7a0dd2c5456a3f79c2f9ccb09dddd0f1c9ece514dfea7cbea06e7cbc79855\u0000": {
- "org": "Org2MSP",
- "hash": "08db66c6cc226577a3153dadeb0b77d3834162fcf5f008b344058a1bc5c1b3a4"
- },
- "\u0000bid\u0000PaintingAuction\u00001b9dc0006fef10413df5cca927cabdf73ab854fe92b7a7b2eebfa00961fdac67\u0000": {
- "org": "Org1MSP",
- "hash": "15cd9a3e12825017f3e758499ac6138ebbe1adec4c49cc6ea6a0973fc6514666"
- },
- "\u0000bid\u0000PaintingAuction\u00005c049b0b4552d34c88e0f8fb5abca31fa04472b7e1336a16650ac8cfb0b16472\u0000": {
- "org": "Org1MSP",
- "hash": "0b8bbdb96b1d252e71ac1ed71df3580f7a0e31a743a4a09bbf5196dffef426b2"
- },
- "\u0000bid\u0000PaintingAuction\u00005ee4fa53b54ea0821e57a6884a1ada5eb04f136ee222e92d7399bcdf47556ea1\u0000": {
- "org": "Org2MSP",
- "hash": "14d47d17acceceb483e87c14a4349844874fce549d71c6a23457d953ed8ffbd3"
- }
- },
- "revealedBids": {
- "\u0000bid\u0000PaintingAuction\u00005c049b0b4552d34c88e0f8fb5abca31fa04472b7e1336a16650ac8cfb0b16472\u0000": {
- "objectType": "bid",
- "price": 800,
- "org": "Org1MSP",
- "bidder": "x509::CN=bidder1,OU=client+OU=org1+OU=department1::CN=ca.org1.example.com,O=org1.example.com,L=Durham,ST=North Carolina,C=US"
- }
- },
- "winner": "",
- "price": 0,
- "status": "closed"
-}
-```
-
-Bidder3 from Org2 will also reveal their bid:
-```
-node revealBid.js org2 bidder3 PaintingAuction $BIDDER3_BID_ID
-```
-
-If the auction ended now, Bidder1 would win. Let's try to end the auction using the seller identity and see what happens.
-
-```
-node endAuction.js org1 seller PaintingAuction
-```
-
-The output should look something like the following:
-
-```
---> Submit the transaction to end the auction
-2021-01-28T16:47:27.501Z - error: [DiscoveryHandler]: compareProposalResponseResults[undefined] - read/writes result sets do not match index=1
-2021-01-28T16:47:27.503Z - error: [Transaction]: Error: No valid responses from any peers. Errors:
- peer=undefined, status=grpc, message=Peer endorsements do not match
-******** FAILED to submit bid: Error: No valid responses from any peers. Errors:
- peer=undefined, status=grpc, message=Peer endorsements do not match
-```
-
-Instead of ending the auction, the transaction results in an endorsement policy failure. The end of the auction needs to be endorsed by Org2. Before endorsing the transaction, the Org2 peer queries its private data collection for any winning bids that have not yet been revealed. Because Bidder4 created a bid that is above the winning price, the Org2 peer refuses to endorse the transaction that would end the auction.
-
-Before we can end the auction, we need to reveal the bid from bidder4.
-```
-node revealBid.js org2 bidder4 PaintingAuction $BIDDER4_BID_ID
-```
-
-Bidder2 from Org1 would not win the auction in either case. As a result, Bidder2 decides not to reveal their bid.
-
-## End the auction
-
-Now that the winning bids have been revealed, we can end the auction:
-```
-node endAuction org1 seller PaintingAuction
-```
-
-The transaction was successfully endorsed by both Org1 and Org2, who both calculated the same price and winner. The winning bidder is listed along with the price:
-```
-*** Result: Auction: {
- "objectType": "auction",
- "item": "painting",
- "seller": "x509::CN=seller,OU=client+OU=org1+OU=department1::CN=ca.org1.example.com,O=org1.example.com,L=Durham,ST=North Carolina,C=US",
- "organizations": [
- "Org1MSP",
- "Org2MSP"
- ],
- "privateBids": {
- "\u0000bid\u0000PaintingAuction\u000019a7a0dd2c5456a3f79c2f9ccb09dddd0f1c9ece514dfea7cbea06e7cbc79855\u0000": {
- "org": "Org2MSP",
- "hash": "08db66c6cc226577a3153dadeb0b77d3834162fcf5f008b344058a1bc5c1b3a4"
- },
- "\u0000bid\u0000PaintingAuction\u00001b9dc0006fef10413df5cca927cabdf73ab854fe92b7a7b2eebfa00961fdac67\u0000": {
- "org": "Org1MSP",
- "hash": "15cd9a3e12825017f3e758499ac6138ebbe1adec4c49cc6ea6a0973fc6514666"
- },
- "\u0000bid\u0000PaintingAuction\u00005c049b0b4552d34c88e0f8fb5abca31fa04472b7e1336a16650ac8cfb0b16472\u0000": {
- "org": "Org1MSP",
- "hash": "0b8bbdb96b1d252e71ac1ed71df3580f7a0e31a743a4a09bbf5196dffef426b2"
- },
- "\u0000bid\u0000PaintingAuction\u00005ee4fa53b54ea0821e57a6884a1ada5eb04f136ee222e92d7399bcdf47556ea1\u0000": {
- "org": "Org2MSP",
- "hash": "14d47d17acceceb483e87c14a4349844874fce549d71c6a23457d953ed8ffbd3"
- }
- },
- "revealedBids": {
- "\u0000bid\u0000PaintingAuction\u000019a7a0dd2c5456a3f79c2f9ccb09dddd0f1c9ece514dfea7cbea06e7cbc79855\u0000": {
- "objectType": "bid",
- "price": 900,
- "org": "Org2MSP",
- "bidder": "x509::CN=bidder4,OU=client+OU=org2+OU=department1::CN=ca.org2.example.com,O=org2.example.com,L=Hursley,ST=Hampshire,C=UK"
- },
- "\u0000bid\u0000PaintingAuction\u00005c049b0b4552d34c88e0f8fb5abca31fa04472b7e1336a16650ac8cfb0b16472\u0000": {
- "objectType": "bid",
- "price": 800,
- "org": "Org1MSP",
- "bidder": "x509::CN=bidder1,OU=client+OU=org1+OU=department1::CN=ca.org1.example.com,O=org1.example.com,L=Durham,ST=North Carolina,C=US"
- },
- "\u0000bid\u0000PaintingAuction\u00005ee4fa53b54ea0821e57a6884a1ada5eb04f136ee222e92d7399bcdf47556ea1\u0000": {
- "objectType": "bid",
- "price": 700,
- "org": "Org2MSP",
- "bidder": "x509::CN=bidder3,OU=client+OU=org2+OU=department1::CN=ca.org2.example.com,O=org2.example.com,L=Hursley,ST=Hampshire,C=UK"
- }
- },
- "winner": "x509::CN=bidder4,OU=client+OU=org2+OU=department1::CN=ca.org2.example.com,O=org2.example.com,L=Hursley,ST=Hampshire,C=UK",
- "price": 900,
- "status": "ended"
-}
-```
-
-## Clean up
-
-When your are done using the auction smart contract, you can bring down the network and clean up the environment. In the `auction-simple/application-javascript` directory, run the following command to remove the wallets used to run the applications:
-```
-rm -rf wallet
-```
-
-You can then navigate to the test network directory and bring down the network:
-````
-cd ../../test-network/
-./network.sh down
-````
diff --git a/auction-simple/application-javascript/.eslintignore b/auction-simple/application-javascript/.eslintignore
deleted file mode 100644
index 15958470..00000000
--- a/auction-simple/application-javascript/.eslintignore
+++ /dev/null
@@ -1,5 +0,0 @@
-#
-# SPDX-License-Identifier: Apache-2.0
-#
-
-coverage
diff --git a/auction-simple/application-javascript/.eslintrc.js b/auction-simple/application-javascript/.eslintrc.js
deleted file mode 100644
index 20d4fcbd..00000000
--- a/auction-simple/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/auction-simple/application-javascript/bid.js b/auction-simple/application-javascript/bid.js
deleted file mode 100644
index d4b4de56..00000000
--- a/auction-simple/application-javascript/bid.js
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Copyright IBM Corp. All Rights Reserved.
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-
-'use strict';
-
-const { Gateway, Wallets } = require('fabric-network');
-const path = require('path');
-const { buildCCPOrg1, buildCCPOrg2, buildWallet, prettyJSONString} = require('../../test-application/javascript/AppUtil.js');
-
-const myChannel = 'mychannel';
-const myChaincodeName = 'auction';
-
-async function bid(ccp,wallet,user,orgMSP,auctionID,price) {
- try {
-
- const gateway = new Gateway();
- // Connect using Discovery enabled
-
- await gateway.connect(ccp,
- { wallet: wallet, identity: user, discovery: { enabled: true, asLocalhost: true } });
-
- const network = await gateway.getNetwork(myChannel);
- const contract = network.getContract(myChaincodeName);
-
- console.log('\n--> Evaluate Transaction: get your client ID');
- let bidder = await contract.evaluateTransaction('GetSubmittingClientIdentity');
- console.log('*** Result: Bidder ID is ' + bidder.toString());
-
- let bidData = { objectType: 'bid', price: parseInt(price), org: orgMSP, bidder: bidder.toString()};
-
- let statefulTxn = contract.createTransaction('Bid');
- statefulTxn.setEndorsingOrganizations(orgMSP);
- let tmapData = Buffer.from(JSON.stringify(bidData));
- statefulTxn.setTransient({
- bid: tmapData
- });
-
- let bidID = statefulTxn.getTransactionId();
-
- console.log('\n--> Submit Transaction: Create the bid that is stored in your organization\'s private data collection');
- await statefulTxn.submit(auctionID);
- console.log('*** Result: committed');
- console.log('*** Result ***SAVE THIS VALUE*** BidID: ' + bidID.toString());
-
- console.log('\n--> Evaluate Transaction: read the bid that was just created');
- let result = await contract.evaluateTransaction('QueryBid',auctionID,bidID);
- console.log('*** Result: Bid: ' + prettyJSONString(result.toString()));
-
- gateway.disconnect();
- } catch (error) {
- console.error(`******** FAILED to submit bid: ${error}`);
- if (error.stack) {
- console.error(error.stack);
- }
- process.exit(1);
- }
-}
-
-async function main() {
- try {
-
- if (process.argv[2] === undefined || process.argv[3] === undefined ||
- process.argv[4] === undefined || process.argv[5] === undefined) {
- console.log('Usage: node bid.js org userID auctionID price');
- process.exit(1);
- }
-
- const org = process.argv[2];
- const user = process.argv[3];
- const auctionID = process.argv[4];
- const price = process.argv[5];
-
- if (org === 'Org1' || org === 'org1') {
-
- const orgMSP = 'Org1MSP';
- const ccp = buildCCPOrg1();
- const walletPath = path.join(__dirname, 'wallet/org1');
- const wallet = await buildWallet(Wallets, walletPath);
- await bid(ccp,wallet,user,orgMSP,auctionID,price);
- }
- else if (org === 'Org2' || org === 'org2') {
-
- const orgMSP = 'Org2MSP';
- const ccp = buildCCPOrg2();
- const walletPath = path.join(__dirname, 'wallet/org2');
- const wallet = await buildWallet(Wallets, walletPath);
- await bid(ccp,wallet,user,orgMSP,auctionID,price);
- } else {
- console.log('Usage: node bid.js org userID auctionID price');
- console.log('Org must be Org1 or Org2');
- }
- } catch (error) {
- console.error(`******** FAILED to run the application: ${error}`);
- process.exit(1);
- }
-}
-
-main();
diff --git a/auction-simple/application-javascript/closeAuction.js b/auction-simple/application-javascript/closeAuction.js
deleted file mode 100644
index b637e761..00000000
--- a/auction-simple/application-javascript/closeAuction.js
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Copyright IBM Corp. All Rights Reserved.
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-
-'use strict';
-
-const { Gateway, Wallets } = require('fabric-network');
-const path = require('path');
-const { buildCCPOrg1, buildCCPOrg2, buildWallet, prettyJSONString} = require('../../test-application/javascript/AppUtil.js');
-
-const myChannel = 'mychannel';
-const myChaincodeName = 'auction';
-
-async function closeAuction(ccp,wallet,user,auctionID) {
- try {
-
- const gateway = new Gateway();
-
- // Connect using Discovery enabled
- await gateway.connect(ccp,
- { wallet: wallet, identity: user, discovery: { enabled: true, asLocalhost: true } });
-
- const network = await gateway.getNetwork(myChannel);
- const contract = network.getContract(myChaincodeName);
-
- // Query the auction to get the list of endorsing orgs.
- let auctionString = await contract.evaluateTransaction('QueryAuction',auctionID);
- let auctionJSON = JSON.parse(auctionString);
-
- let statefulTxn = contract.createTransaction('CloseAuction');
-
- if (auctionJSON.organizations.length === 2) {
- statefulTxn.setEndorsingOrganizations(auctionJSON.organizations[0],auctionJSON.organizations[1]);
- } else {
- statefulTxn.setEndorsingOrganizations(auctionJSON.organizations[0]);
- }
-
- console.log('\n--> Submit Transaction: close auction');
- await statefulTxn.submit(auctionID);
- console.log('*** Result: committed');
-
- console.log('\n--> Evaluate Transaction: query the updated auction');
- let result = await contract.evaluateTransaction('QueryAuction',auctionID);
- console.log('*** Result: Auction: ' + prettyJSONString(result.toString()));
-
- gateway.disconnect();
- } catch (error) {
- console.error(`******** FAILED to submit bid: ${error}`);
- process.exit(1);
- }
-}
-
-async function main() {
- try {
-
- if (process.argv[2] === undefined || process.argv[3] === undefined ||
- process.argv[4] === undefined) {
- console.log('Usage: node closeAuction.js org userID auctionID');
- process.exit(1);
- }
-
- const org = process.argv[2];
- const user = process.argv[3];
- const auctionID = process.argv[4];
-
- if (org === 'Org1' || org === 'org1') {
- const ccp = buildCCPOrg1();
- const walletPath = path.join(__dirname, 'wallet/org1');
- const wallet = await buildWallet(Wallets, walletPath);
- await closeAuction(ccp,wallet,user,auctionID);
- }
- else if (org === 'Org2' || org === 'org2') {
- const ccp = buildCCPOrg2();
- const walletPath = path.join(__dirname, 'wallet/org2');
- const wallet = await buildWallet(Wallets, walletPath);
- await closeAuction(ccp,wallet,user,auctionID);
- } else {
- console.log('Usage: node closeAuction.js org userID auctionID ');
- console.log('Org must be Org1 or Org2');
- }
- } catch (error) {
- console.error(`******** FAILED to run the application: ${error}`);
- if (error.stack) {
- console.error(error.stack);
- }
- process.exit(1);
- }
-}
-
-
-main();
diff --git a/auction-simple/application-javascript/createAuction.js b/auction-simple/application-javascript/createAuction.js
deleted file mode 100644
index a05d4f96..00000000
--- a/auction-simple/application-javascript/createAuction.js
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright IBM Corp. All Rights Reserved.
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-
-'use strict';
-
-const { Gateway, Wallets } = require('fabric-network');
-const path = require('path');
-const { buildCCPOrg1, buildCCPOrg2, buildWallet, prettyJSONString} = require('../../test-application/javascript/AppUtil.js');
-
-const myChannel = 'mychannel';
-const myChaincodeName = 'auction';
-
-async function createAuction(ccp,wallet,user,auctionID,item) {
- try {
-
- const gateway = new Gateway();
-
- // Connect using Discovery enabled
- await gateway.connect(ccp,
- { wallet: wallet, identity: user, discovery: { enabled: true, asLocalhost: true } });
-
- const network = await gateway.getNetwork(myChannel);
- const contract = network.getContract(myChaincodeName);
-
- let statefulTxn = contract.createTransaction('CreateAuction');
-
- console.log('\n--> Submit Transaction: Propose a new auction');
- await statefulTxn.submit(auctionID,item);
- console.log('*** Result: committed');
-
- console.log('\n--> Evaluate Transaction: query the auction that was just created');
- let result = await contract.evaluateTransaction('QueryAuction',auctionID);
- console.log('*** Result: Auction: ' + prettyJSONString(result.toString()));
-
- gateway.disconnect();
- } catch (error) {
- console.error(`******** FAILED to submit bid: ${error}`);
- }
-}
-
-async function main() {
- try {
-
- if (process.argv[2] === undefined || process.argv[3] === undefined ||
- process.argv[4] === undefined || process.argv[5] === undefined) {
- console.log('Usage: node createAuction.js org userID auctionID item');
- process.exit(1);
- }
-
- const org = process.argv[2];
- const user = process.argv[3];
- const auctionID = process.argv[4];
- const item = process.argv[5];
-
- if (org === 'Org1' || org === 'org1') {
- const ccp = buildCCPOrg1();
- const walletPath = path.join(__dirname, 'wallet/org1');
- const wallet = await buildWallet(Wallets, walletPath);
- await createAuction(ccp,wallet,user,auctionID,item);
- }
- else if (org === 'Org2' || org === 'org2') {
- const ccp = buildCCPOrg2();
- const walletPath = path.join(__dirname, 'wallet/org2');
- const wallet = await buildWallet(Wallets, walletPath);
- await createAuction(ccp,wallet,user,auctionID,item);
- } else {
- console.log('Usage: node createAuction.js org userID auctionID item');
- console.log('Org must be Org1 or Org2');
- }
- } catch (error) {
- console.error(`******** FAILED to run the application: ${error}`);
- }
-}
-
-
-main();
diff --git a/auction-simple/application-javascript/endAuction.js b/auction-simple/application-javascript/endAuction.js
deleted file mode 100644
index 27ea5983..00000000
--- a/auction-simple/application-javascript/endAuction.js
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Copyright IBM Corp. All Rights Reserved.
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-
-'use strict';
-
-const { Gateway, Wallets } = require('fabric-network');
-const path = require('path');
-const { buildCCPOrg1, buildCCPOrg2, buildWallet, prettyJSONString} = require('../../test-application/javascript/AppUtil.js');
-
-const myChannel = 'mychannel';
-const myChaincodeName = 'auction';
-
-async function endAuction(ccp,wallet,user,auctionID) {
- try {
-
- const gateway = new Gateway();
-
- // Connect using Discovery enabled
- await gateway.connect(ccp,
- { wallet: wallet, identity: user, discovery: { enabled: true, asLocalhost: true } });
-
- const network = await gateway.getNetwork(myChannel);
- const contract = network.getContract(myChaincodeName);
-
- // Query the auction to get the list of endorsing orgs.
- let auctionString = await contract.evaluateTransaction('QueryAuction',auctionID);
- let auctionJSON = JSON.parse(auctionString);
-
- let statefulTxn = contract.createTransaction('EndAuction');
-
- if (auctionJSON.organizations.length === 2) {
- statefulTxn.setEndorsingOrganizations(auctionJSON.organizations[0],auctionJSON.organizations[1]);
- } else {
- statefulTxn.setEndorsingOrganizations(auctionJSON.organizations[0]);
- }
-
- console.log('\n--> Submit the transaction to end the auction');
- await statefulTxn.submit(auctionID);
- console.log('*** Result: committed');
-
- console.log('\n--> Evaluate Transaction: query the updated auction');
- let result = await contract.evaluateTransaction('QueryAuction',auctionID);
- console.log('*** Result: Auction: ' + prettyJSONString(result.toString()));
-
- gateway.disconnect();
- } catch (error) {
- console.error(`******** FAILED to submit bid: ${error}`);
- process.exit(1);
- }
-}
-
-async function main() {
- try {
-
- if (process.argv[2] === undefined || process.argv[3] === undefined ||
- process.argv[4] === undefined) {
- console.log('Usage: node endAuction.js org userID auctionID');
- process.exit(1);
- }
-
- const org = process.argv[2];
- const user = process.argv[3];
- const auctionID = process.argv[4];
-
- if (org === 'Org1' || org === 'org1') {
- const ccp = buildCCPOrg1();
- const walletPath = path.join(__dirname, 'wallet/org1');
- const wallet = await buildWallet(Wallets, walletPath);
- await endAuction(ccp,wallet,user,auctionID);
- }
- else if (org === 'Org2' || org === 'org2') {
- const ccp = buildCCPOrg2();
- const walletPath = path.join(__dirname, 'wallet/org2');
- const wallet = await buildWallet(Wallets, walletPath);
- await endAuction(ccp,wallet,user,auctionID);
- } else {
- console.log('Usage: node endAuction.js org userID auctionID');
- console.log('Org must be Org1 or Org2');
- }
- } catch (error) {
- console.error(`******** FAILED to run the application: ${error}`);
- if (error.stack) {
- console.error(error.stack);
- }
- process.exit(1);
- }
-}
-
-
-main();
diff --git a/auction-simple/application-javascript/enrollAdmin.js b/auction-simple/application-javascript/enrollAdmin.js
deleted file mode 100644
index 1c87cad5..00000000
--- a/auction-simple/application-javascript/enrollAdmin.js
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Copyright IBM Corp. All Rights Reserved.
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-
-'use strict';
-
-const { Wallets } = require('fabric-network');
-const FabricCAServices = require('fabric-ca-client');
-const path = require('path');
-const { buildCAClient, enrollAdmin } = require('../../test-application/javascript/CAUtil.js');
-const { buildCCPOrg1, buildCCPOrg2, buildWallet } = require('../../test-application/javascript/AppUtil.js');
-
-const mspOrg1 = 'Org1MSP';
-const mspOrg2 = 'Org2MSP';
-
-async function connectToOrg1CA() {
- console.log('\n--> Enrolling the Org1 CA admin');
- const ccpOrg1 = buildCCPOrg1();
- const caOrg1Client = buildCAClient(FabricCAServices, ccpOrg1, 'ca.org1.example.com');
-
- const walletPathOrg1 = path.join(__dirname, 'wallet/org1');
- const walletOrg1 = await buildWallet(Wallets, walletPathOrg1);
-
- await enrollAdmin(caOrg1Client, walletOrg1, mspOrg1);
-
-}
-
-async function connectToOrg2CA() {
- console.log('\n--> Enrolling the Org2 CA admin');
- 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);
-
-}
-async function main() {
-
- if (process.argv[2] === undefined) {
- console.log('Usage: node enrollAdmin.js Org');
- process.exit(1);
- }
-
- const org = process.argv[2];
-
- try {
-
- if (org === 'Org1' || org === 'org1') {
- await connectToOrg1CA();
- }
- else if (org === 'Org2' || org === 'org2') {
- await connectToOrg2CA();
- } else {
- console.log('Usage: node registerUser.js org userID');
- console.log('Org must be Org1 or Org2');
- }
- } catch (error) {
- console.error(`Error in enrolling admin: ${error}`);
- process.exit(1);
- }
-}
-
-main();
diff --git a/auction-simple/application-javascript/package.json b/auction-simple/application-javascript/package.json
deleted file mode 100644
index 49bf01e8..00000000
--- a/auction-simple/application-javascript/package.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "name": "auction",
- "version": "1.0.0",
- "description": "auction application implemented in JavaScript",
- "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/auction-simple/application-javascript/queryAuction.js b/auction-simple/application-javascript/queryAuction.js
deleted file mode 100644
index 046267af..00000000
--- a/auction-simple/application-javascript/queryAuction.js
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright IBM Corp. All Rights Reserved.
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-
-'use strict';
-
-const { Gateway, Wallets } = require('fabric-network');
-const path = require('path');
-const { buildCCPOrg1, buildCCPOrg2, buildWallet, prettyJSONString} = require('../../test-application/javascript/AppUtil.js');
-
-const myChannel = 'mychannel';
-const myChaincodeName = 'auction';
-
-async function queryAuction(ccp,wallet,user,auctionID) {
- try {
-
- const gateway = new Gateway();
-
- // Connect using Discovery enabled
- await gateway.connect(ccp,
- { wallet: wallet, identity: user, discovery: { enabled: true, asLocalhost: true } });
-
- const network = await gateway.getNetwork(myChannel);
- const contract = network.getContract(myChaincodeName);
-
- console.log('\n--> Evaluate Transaction: query the auction');
- let result = await contract.evaluateTransaction('QueryAuction',auctionID);
- console.log('*** Result: Auction: ' + prettyJSONString(result.toString()));
-
- gateway.disconnect();
- } catch (error) {
- console.error(`******** FAILED to submit bid: ${error}`);
- }
-}
-
-async function main() {
- try {
-
- if (process.argv[2] === undefined || process.argv[3] === undefined ||
- process.argv[4] === undefined) {
- console.log('Usage: node queryAuction.js org userID auctionID');
- process.exit(1);
- }
-
- const org = process.argv[2];
- const user = process.argv[3];
- const auctionID = process.argv[4];
-
- if (org === 'Org1' || org === 'org1') {
- const ccp = buildCCPOrg1();
- const walletPath = path.join(__dirname, 'wallet/org1');
- const wallet = await buildWallet(Wallets, walletPath);
- await queryAuction(ccp,wallet,user,auctionID);
- }
- else if (org === 'Org2' || org === 'org2') {
- const ccp = buildCCPOrg2();
- const walletPath = path.join(__dirname, 'wallet/org2');
- const wallet = await buildWallet(Wallets, walletPath);
- await queryAuction(ccp,wallet,user,auctionID);
- } else {
- console.log('Usage: node queryAuction.js org userID auctionID');
- console.log('Org must be Org1 or Org2');
- }
- } catch (error) {
- console.error(`******** FAILED to run the application: ${error}`);
- }
-}
-
-
-main();
diff --git a/auction-simple/application-javascript/queryBid.js b/auction-simple/application-javascript/queryBid.js
deleted file mode 100644
index 57ce37ba..00000000
--- a/auction-simple/application-javascript/queryBid.js
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright IBM Corp. All Rights Reserved.
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-
-'use strict';
-
-const { Gateway, Wallets } = require('fabric-network');
-const path = require('path');
-const { buildCCPOrg1, buildCCPOrg2, buildWallet, prettyJSONString} = require('../../test-application/javascript/AppUtil.js');
-
-const myChannel = 'mychannel';
-const myChaincodeName = 'auction';
-
-async function queryBid(ccp,wallet,user,auctionID,bidID) {
- try {
-
- const gateway = new Gateway();
-
- // Connect using Discovery enabled
- await gateway.connect(ccp,
- { wallet: wallet, identity: user, discovery: { enabled: true, asLocalhost: true } });
-
- const network = await gateway.getNetwork(myChannel);
- const contract = network.getContract(myChaincodeName);
-
- console.log('\n--> Evaluate Transaction: read bid from private data store');
- let result = await contract.evaluateTransaction('QueryBid',auctionID,bidID);
- console.log('*** Result: Bid: ' + prettyJSONString(result.toString()));
-
- gateway.disconnect();
- } catch (error) {
- console.error(`******** FAILED to submit bid: ${error}`);
- }
-}
-
-async function main() {
- try {
-
- if (process.argv[2] === undefined || process.argv[3] === undefined ||
- process.argv[4] === undefined || process.argv[5] === undefined) {
- console.log('Usage: node bid.js org userID auctionID bidID');
- process.exit(1);
- }
-
- const org = process.argv[2];
- const user = process.argv[3];
- const auctionID = process.argv[4];
- const bidID = process.argv[5];
-
- if (org === 'Org1' || org === 'org1') {
- const ccp = buildCCPOrg1();
- const walletPath = path.join(__dirname, 'wallet/org1');
- const wallet = await buildWallet(Wallets, walletPath);
- await queryBid(ccp,wallet,user,auctionID,bidID);
- }
- else if (org === 'Org2' || org === 'org2') {
- const ccp = buildCCPOrg2();
- const walletPath = path.join(__dirname, 'wallet/org2');
- const wallet = await buildWallet(Wallets, walletPath);
- await queryBid(ccp,wallet,user,auctionID,bidID);
- } else {
- console.log('Usage: node bid.js org userID auctionID bidID');
- console.log('Org must be Org1 or Org2');
- }
- } catch (error) {
- console.error(`******** FAILED to run the application: ${error}`);
- }
-}
-
-
-main();
diff --git a/auction-simple/application-javascript/registerEnrollUser.js b/auction-simple/application-javascript/registerEnrollUser.js
deleted file mode 100644
index d6cb9a66..00000000
--- a/auction-simple/application-javascript/registerEnrollUser.js
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright IBM Corp. All Rights Reserved.
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-
-'use strict';
-
-const { Wallets } = require('fabric-network');
-const FabricCAServices = require('fabric-ca-client');
-const path = require('path');
-const { buildCAClient, registerAndEnrollUser } = require('../../test-application/javascript/CAUtil.js');
-const { buildCCPOrg1, buildCCPOrg2, buildWallet } = require('../../test-application/javascript/AppUtil.js');
-
-const mspOrg1 = 'Org1MSP';
-const mspOrg2 = 'Org2MSP';
-
-async function connectToOrg1CA(UserID) {
- console.log('\n--> Register and enrolling new user');
- const ccpOrg1 = buildCCPOrg1();
- const caOrg1Client = buildCAClient(FabricCAServices, ccpOrg1, 'ca.org1.example.com');
-
- const walletPathOrg1 = path.join(__dirname, 'wallet/org1');
- const walletOrg1 = await buildWallet(Wallets, walletPathOrg1);
-
- await registerAndEnrollUser(caOrg1Client, walletOrg1, mspOrg1, UserID, 'org1.department1');
-
-}
-
-async function connectToOrg2CA(UserID) {
- console.log('\n--> Register and enrolling new user');
- 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 registerAndEnrollUser(caOrg2Client, walletOrg2, mspOrg2, UserID, 'org2.department1');
-
-}
-async function main() {
-
- if (process.argv[2] === undefined && process.argv[3] === undefined) {
- console.log('Usage: node registerEnrollUser.js org userID');
- process.exit(1);
- }
-
- const org = process.argv[2];
- const userId = process.argv[3];
-
- try {
-
- if (org === 'Org1' || org === 'org1') {
- await connectToOrg1CA(userId);
- }
- else if (org === 'Org2' || org === 'org2') {
- await connectToOrg2CA(userId);
- } else {
- console.log('Usage: node registerEnrollUser.js org userID');
- console.log('Org must be Org1 or Org2');
- }
- } catch (error) {
- console.error(`Error in enrolling admin: ${error}`);
- process.exit(1);
- }
-}
-
-main();
diff --git a/auction-simple/application-javascript/revealBid.js b/auction-simple/application-javascript/revealBid.js
deleted file mode 100644
index bb0b1a7f..00000000
--- a/auction-simple/application-javascript/revealBid.js
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * Copyright IBM Corp. All Rights Reserved.
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-
-'use strict';
-
-const { Gateway, Wallets } = require('fabric-network');
-const path = require('path');
-const { buildCCPOrg1, buildCCPOrg2, buildWallet, prettyJSONString} = require('../../test-application/javascript/AppUtil.js');
-
-const myChannel = 'mychannel';
-const myChaincodeName = 'auction';
-
-async function addBid(ccp,wallet,user,auctionID,bidID) {
- try {
-
- const gateway = new Gateway();
- await gateway.connect(ccp,
- { wallet: wallet, identity: user, discovery: { enabled: true, asLocalhost: true } });
-
- const network = await gateway.getNetwork(myChannel);
- const contract = network.getContract(myChaincodeName);
-
- console.log('\n--> Evaluate Transaction: read your bid');
- let bidString = await contract.evaluateTransaction('QueryBid',auctionID,bidID);
- let bidJSON = JSON.parse(bidString);
-
- // console.log('\n--> Evaluate Transaction: query the auction you want to join');
- let auctionString = await contract.evaluateTransaction('QueryAuction',auctionID);
- // console.log('*** Result: Bid: ' + prettyJSONString(auctionString.toString()));
- let auctionJSON = JSON.parse(auctionString);
-
- let bidData = { objectType: 'bid', price: parseInt(bidJSON.price), org: bidJSON.org, bidder: bidJSON.bidder};
- console.log('*** Result: Bid: ' + JSON.stringify(bidData,null,2));
-
- let statefulTxn = contract.createTransaction('RevealBid');
- let tmapData = Buffer.from(JSON.stringify(bidData));
- statefulTxn.setTransient({
- bid: tmapData
- });
-
- if (auctionJSON.organizations.length === 2) {
- statefulTxn.setEndorsingOrganizations(auctionJSON.organizations[0],auctionJSON.organizations[1]);
- } else {
- statefulTxn.setEndorsingOrganizations(auctionJSON.organizations[0]);
- }
-
- await statefulTxn.submit(auctionID,bidID);
-
- console.log('\n--> Evaluate Transaction: query the auction to see that our bid was added');
- let result = await contract.evaluateTransaction('QueryAuction',auctionID);
- console.log('*** Result: Auction: ' + prettyJSONString(result.toString()));
-
- gateway.disconnect();
- } catch (error) {
- console.error(`******** FAILED to submit bid: ${error}`);
- process.exit(1);
- }
-}
-
-async function main() {
- try {
-
- if (process.argv[2] === undefined || process.argv[3] === undefined ||
- process.argv[4] === undefined || process.argv[5] === undefined) {
- console.log('Usage: node revealBid.js org userID auctionID bidID');
- process.exit(1);
- }
-
- const org = process.argv[2];
- const user = process.argv[3];
- const auctionID = process.argv[4];
- const bidID = process.argv[5];
-
- if (org === 'Org1' || org === 'org1') {
- const ccp = buildCCPOrg1();
- const walletPath = path.join(__dirname, 'wallet/org1');
- const wallet = await buildWallet(Wallets, walletPath);
- await addBid(ccp,wallet,user,auctionID,bidID);
- }
- else if (org === 'Org2' || org === 'org2') {
- const ccp = buildCCPOrg2();
- const walletPath = path.join(__dirname, 'wallet/org2');
- const wallet = await buildWallet(Wallets, walletPath);
- await addBid(ccp,wallet,user,auctionID,bidID);
- }
- else {
- console.log('Usage: node revealBid.js org userID auctionID bidID');
- console.log('Org must be Org1 or Org2');
- }
- } catch (error) {
- console.error(`******** FAILED to run the application: ${error}`);
- if (error.stack) {
- console.error(error.stack);
- }
- process.exit(1);
- }
-}
-
-
-main();
diff --git a/auction-simple/application-javascript/submitBid.js b/auction-simple/application-javascript/submitBid.js
deleted file mode 100644
index 6c2e0669..00000000
--- a/auction-simple/application-javascript/submitBid.js
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Copyright IBM Corp. All Rights Reserved.
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-
-'use strict';
-
-const { Gateway, Wallets } = require('fabric-network');
-const path = require('path');
-const { buildCCPOrg1, buildCCPOrg2, buildWallet } = require('../../test-application/javascript/AppUtil.js');
-
-const myChannel = 'mychannel';
-const myChaincodeName = 'auction';
-
-
-function prettyJSONString(inputString) {
- if (inputString) {
- return JSON.stringify(JSON.parse(inputString), null, 2);
- }
- else {
- return inputString;
- }
-}
-
-async function submitBid(ccp,wallet,user,auctionID,bidID) {
- try {
-
- const gateway = new Gateway();
-
- // Connect using Discovery enabled
- await gateway.connect(ccp,
- { wallet: wallet, identity: user, discovery: { enabled: true, asLocalhost: true } });
-
- const network = await gateway.getNetwork(myChannel);
- const contract = network.getContract(myChaincodeName);
-
- console.log('\n--> Evaluate Transaction: query the auction you want to join');
- let auctionString = await contract.evaluateTransaction('QueryAuction',auctionID);
- let auctionJSON = JSON.parse(auctionString);
-
- let statefulTxn = contract.createTransaction('SubmitBid');
-
- if (auctionJSON.organizations.length === 2) {
- statefulTxn.setEndorsingOrganizations(auctionJSON.organizations[0],auctionJSON.organizations[1]);
- } else {
- statefulTxn.setEndorsingOrganizations(auctionJSON.organizations[0]);
- }
-
- console.log('\n--> Submit Transaction: add bid to the auction');
- await statefulTxn.submit(auctionID,bidID);
-
- console.log('\n--> Evaluate Transaction: query the auction to see that our bid was added');
- let result = await contract.evaluateTransaction('QueryAuction',auctionID);
- console.log('*** Result: Auction: ' + prettyJSONString(result.toString()));
-
- gateway.disconnect();
- } catch (error) {
- console.error(`******** FAILED to submit bid: ${error}`);
- process.exit(1);
- }
-}
-
-async function main() {
- try {
-
- if (process.argv[2] === undefined || process.argv[3] === undefined ||
- process.argv[4] === undefined || process.argv[5] === undefined) {
- console.log('Usage: node submitBid.js org userID auctionID bidID');
- process.exit(1);
- }
-
- const org = process.argv[2];
- const user = process.argv[3];
- const auctionID = process.argv[4];
- const bidID = process.argv[5];
-
- if (org === 'Org1' || org === 'org1') {
- const ccp = buildCCPOrg1();
- const walletPath = path.join(__dirname, 'wallet/org1');
- const wallet = await buildWallet(Wallets, walletPath);
- await submitBid(ccp,wallet,user,auctionID,bidID);
- }
- else if (org === 'Org2' || org === 'org2') {
- const ccp = buildCCPOrg2();
- const walletPath = path.join(__dirname, 'wallet/org2');
- const wallet = await buildWallet(Wallets, walletPath);
- await submitBid(ccp,wallet,user,auctionID,bidID);
- }
- else {
- console.log('Usage: node submitBid.js org userID auctionID bidID');
- console.log('Org must be Org1 or Org2');
- }
- } catch (error) {
- console.error(`******** FAILED to run the application: ${error}`);
- if (error.stack) {
- console.error(error.stack);
- }
- process.exit(1);
- }
-}
-
-
-main();
diff --git a/auction-simple/chaincode-go/go.mod b/auction-simple/chaincode-go/go.mod
deleted file mode 100644
index 3d087a3c..00000000
--- a/auction-simple/chaincode-go/go.mod
+++ /dev/null
@@ -1,28 +0,0 @@
-module github.com/hyperledger/fabric-samples/auction/chaincode-go
-
-go 1.22.0
-
-require (
- github.com/hyperledger/fabric-chaincode-go/v2 v2.0.0
- github.com/hyperledger/fabric-contract-api-go/v2 v2.2.0
-)
-
-require (
- github.com/go-openapi/jsonpointer v0.21.0 // indirect
- github.com/go-openapi/jsonreference v0.21.0 // indirect
- github.com/go-openapi/spec v0.21.0 // indirect
- github.com/go-openapi/swag v0.23.0 // indirect
- github.com/hyperledger/fabric-protos-go-apiv2 v0.3.4 // indirect
- github.com/josharian/intern v1.0.0 // indirect
- github.com/mailru/easyjson v0.7.7 // indirect
- github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect
- github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
- github.com/xeipuuv/gojsonschema v1.2.0 // indirect
- golang.org/x/net v0.28.0 // indirect
- golang.org/x/sys v0.24.0 // indirect
- golang.org/x/text v0.17.0 // indirect
- google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f // indirect
- google.golang.org/grpc v1.67.0 // indirect
- google.golang.org/protobuf v1.36.1 // indirect
- gopkg.in/yaml.v3 v3.0.1 // indirect
-)
diff --git a/auction-simple/chaincode-go/go.sum b/auction-simple/chaincode-go/go.sum
deleted file mode 100644
index fa4d3b24..00000000
--- a/auction-simple/chaincode-go/go.sum
+++ /dev/null
@@ -1,61 +0,0 @@
-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/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1rr/O9oNQ=
-github.com/go-openapi/jsonpointer v0.21.0/go.mod h1:IUyH9l/+uyhIYQ/PXVA41Rexl+kOkAPDdXEYns6fzUY=
-github.com/go-openapi/jsonreference v0.21.0 h1:Rs+Y7hSXT83Jacb7kFyjn4ijOuVGSvOdF2+tg1TRrwQ=
-github.com/go-openapi/jsonreference v0.21.0/go.mod h1:LmZmgsrTkVg9LG4EaHeY8cBDslNPMo06cago5JNLkm4=
-github.com/go-openapi/spec v0.21.0 h1:LTVzPc3p/RzRnkQqLRndbAzjY0d0BCL72A6j3CdL9ZY=
-github.com/go-openapi/spec v0.21.0/go.mod h1:78u6VdPw81XU44qEWGhtr982gJ5BWg2c0I5XwVMotYk=
-github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+GrE=
-github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ=
-github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
-github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
-github.com/hyperledger/fabric-chaincode-go/v2 v2.0.0 h1:IhkHfrl5X/fVnmB6pWeCYCdIJRi9bxj+WTnVN8DtW3c=
-github.com/hyperledger/fabric-chaincode-go/v2 v2.0.0/go.mod h1:PHHaFffjw7p7n9bmCfcm7RqDqYdivNEsJdiNIKZo5Lk=
-github.com/hyperledger/fabric-contract-api-go/v2 v2.2.0 h1:rmUoBmciB0GL/miqcbJmJbgp5QTWoJUrZo+CNxrNLF4=
-github.com/hyperledger/fabric-contract-api-go/v2 v2.2.0/go.mod h1:FeWeO/jwGjiME7ak3GufqKIcwkejtzrDG4QxbfKydWs=
-github.com/hyperledger/fabric-protos-go-apiv2 v0.3.4 h1:YJrd+gMaeY0/vsN0aS0QkEKTivGoUnSRIXxGJ7KI+Pc=
-github.com/hyperledger/fabric-protos-go-apiv2 v0.3.4/go.mod h1:bau/6AJhvEcu9GKKYHlDXAxXKzYNfhP6xu2GXuxEcFk=
-github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
-github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
-github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
-github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
-github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
-github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
-github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=
-github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
-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/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8=
-github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4=
-github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
-github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY=
-github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
-github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
-github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
-github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
-github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=
-github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb h1:zGWFAtiMcyryUHoUjUJX0/lt1H2+i2Ka2n+D3DImSNo=
-github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=
-github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHovont7NscjpAxXsDA8S8BMYve8Y5+7cuRE7R0=
-github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ=
-github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74=
-github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y=
-golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE=
-golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg=
-golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg=
-golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
-golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc=
-golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
-google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f h1:BWUVssLB0HVOSY78gIdvk1dTVYtT1y8SBWtPYuTJ/6w=
-google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM=
-google.golang.org/grpc v1.67.0 h1:IdH9y6PF5MPSdAntIcpjQ+tXO41pcQsfZV2RxtQgVcw=
-google.golang.org/grpc v1.67.0/go.mod h1:1gLDyUQU7CTLJI90u3nXZ9ekeghjeM7pTDZlqFNg2AA=
-google.golang.org/protobuf v1.36.1 h1:yBPeRvTftaleIgM3PZ/WBIZ7XM/eEYAaEyCwvyjq/gk=
-google.golang.org/protobuf v1.36.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
-gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
-gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
-gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
-gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
-gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
diff --git a/auction-simple/chaincode-go/smart-contract/auction.go b/auction-simple/chaincode-go/smart-contract/auction.go
deleted file mode 100644
index f0f5e14d..00000000
--- a/auction-simple/chaincode-go/smart-contract/auction.go
+++ /dev/null
@@ -1,448 +0,0 @@
-/*
-SPDX-License-Identifier: Apache-2.0
-*/
-
-package auction
-
-import (
- "bytes"
- "crypto/sha256"
- "encoding/json"
- "errors"
- "fmt"
-
- "github.com/hyperledger/fabric-contract-api-go/v2/contractapi"
-)
-
-type SmartContract struct {
- contractapi.Contract
-}
-
-// Auction data
-type Auction struct {
- Type string `json:"objectType"`
- ItemSold string `json:"item"`
- Seller string `json:"seller"`
- Orgs []string `json:"organizations"`
- PrivateBids map[string]BidHash `json:"privateBids"`
- RevealedBids map[string]FullBid `json:"revealedBids"`
- Winner string `json:"winner"`
- Price int `json:"price"`
- Status string `json:"status"`
-}
-
-// FullBid is the structure of a revealed bid
-type FullBid struct {
- Type string `json:"objectType"`
- Price int `json:"price"`
- Org string `json:"org"`
- Bidder string `json:"bidder"`
-}
-
-// BidHash is the structure of a private bid
-type BidHash struct {
- Org string `json:"org"`
- Hash string `json:"hash"`
-}
-
-const bidKeyType = "bid"
-
-// CreateAuction creates on auction on the public channel. The identity that
-// submits the transacion becomes the seller of the auction
-func (s *SmartContract) CreateAuction(ctx contractapi.TransactionContextInterface, auctionID string, itemsold string) error {
-
- // get ID of submitting client
- clientID, err := s.GetSubmittingClientIdentity(ctx)
- if err != nil {
- return fmt.Errorf("failed to get client identity %v", err)
- }
-
- // get org of submitting client
- clientOrgID, err := ctx.GetClientIdentity().GetMSPID()
- if err != nil {
- return fmt.Errorf("failed to get client identity %v", err)
- }
-
- // Create auction
- bidders := make(map[string]BidHash)
- revealedBids := make(map[string]FullBid)
-
- auction := Auction{
- Type: "auction",
- ItemSold: itemsold,
- Price: 0,
- Seller: clientID,
- Orgs: []string{clientOrgID},
- PrivateBids: bidders,
- RevealedBids: revealedBids,
- Winner: "",
- Status: "open",
- }
-
- auctionJSON, err := json.Marshal(auction)
- if err != nil {
- return err
- }
-
- // put auction into state
- err = ctx.GetStub().PutState(auctionID, auctionJSON)
- if err != nil {
- return fmt.Errorf("failed to put auction in public data: %v", err)
- }
-
- // set the seller of the auction as an endorser
- err = setAssetStateBasedEndorsement(ctx, auctionID, clientOrgID)
- if err != nil {
- return fmt.Errorf("failed setting state based endorsement for new organization: %v", err)
- }
-
- return nil
-}
-
-// Bid is used to add a user's bid to the auction. The bid is stored in the private
-// data collection on the peer of the bidder's organization. The function returns
-// the transaction ID so that users can identify and query their bid
-func (s *SmartContract) Bid(ctx contractapi.TransactionContextInterface, auctionID string) (string, error) {
-
- // get bid from transient map
- transientMap, err := ctx.GetStub().GetTransient()
- if err != nil {
- return "", fmt.Errorf("error getting transient: %v", err)
- }
-
- BidJSON, ok := transientMap["bid"]
- if !ok {
- return "", errors.New("bid key not found in the transient map")
- }
-
- // get the implicit collection name using the bidder's organization ID
- collection, err := getCollectionName(ctx)
- if err != nil {
- return "", fmt.Errorf("failed to get implicit collection name: %v", err)
- }
-
- // the bidder has to target their peer to store the bid
- err = verifyClientOrgMatchesPeerOrg(ctx)
- if err != nil {
- return "", fmt.Errorf("cannot store bid on this peer, not a member of this org: Error %v", err)
- }
-
- // the transaction ID is used as a unique index for the bid
- txID := ctx.GetStub().GetTxID()
-
- // create a composite key using the transaction ID
- bidKey, err := ctx.GetStub().CreateCompositeKey(bidKeyType, []string{auctionID, txID})
- if err != nil {
- return "", fmt.Errorf("failed to create composite key: %v", err)
- }
-
- // put the bid into the organization's implicit data collection
- err = ctx.GetStub().PutPrivateData(collection, bidKey, BidJSON)
- if err != nil {
- return "", fmt.Errorf("failed to input price into collection: %v", err)
- }
-
- // return the trannsaction ID so that the uset can identify their bid
- return txID, nil
-}
-
-// SubmitBid is used by the bidder to add the hash of that bid stored in private data to the
-// auction. Note that this function alters the auction in private state, and needs
-// to meet the auction endorsement policy. Transaction ID is used identify the bid
-func (s *SmartContract) SubmitBid(ctx contractapi.TransactionContextInterface, auctionID string, txID string) error {
-
- // get the MSP ID of the bidder's org
- clientOrgID, err := ctx.GetClientIdentity().GetMSPID()
- if err != nil {
- return fmt.Errorf("failed to get client MSP ID: %v", err)
- }
-
- // get the auction from public state
- auction, err := s.QueryAuction(ctx, auctionID)
- if err != nil {
- return fmt.Errorf("failed to get auction from public state %v", err)
- }
-
- // the auction needs to be open for users to add their bid
- Status := auction.Status
- if Status != "open" {
- return errors.New("cannot join closed or ended auction")
- }
-
- // get the inplicit collection name of bidder's org
- collection, err := getCollectionName(ctx)
- if err != nil {
- return fmt.Errorf("failed to get implicit collection name: %v", err)
- }
-
- // use the transaction ID passed as a parameter to create composite bid key
- bidKey, err := ctx.GetStub().CreateCompositeKey(bidKeyType, []string{auctionID, txID})
- if err != nil {
- return fmt.Errorf("failed to create composite key: %v", err)
- }
-
- // get the hash of the bid stored in private data collection
- bidHash, err := ctx.GetStub().GetPrivateDataHash(collection, bidKey)
- if err != nil {
- return fmt.Errorf("failed to read bid bash from collection: %v", err)
- }
- if bidHash == nil {
- return fmt.Errorf("bid hash does not exist: %s", bidKey)
- }
-
- // store the hash along with the bidder's organization
- NewHash := BidHash{
- Org: clientOrgID,
- Hash: fmt.Sprintf("%x", bidHash),
- }
-
- auction.PrivateBids[bidKey] = NewHash
-
- // Add the bidding organization to the list of participating organizations if it is not already
- Orgs := auction.Orgs
- if !(contains(Orgs, clientOrgID)) {
- newOrgs := append(Orgs, clientOrgID)
- auction.Orgs = newOrgs
-
- err = addAssetStateBasedEndorsement(ctx, auctionID, clientOrgID)
- if err != nil {
- return fmt.Errorf("failed setting state based endorsement for new organization: %v", err)
- }
- }
-
- newAuctionJSON, _ := json.Marshal(auction)
-
- err = ctx.GetStub().PutState(auctionID, newAuctionJSON)
- if err != nil {
- return fmt.Errorf("failed to update auction: %v", err)
- }
-
- return nil
-}
-
-// RevealBid is used by a bidder to reveal their bid after the auction is closed
-func (s *SmartContract) RevealBid(ctx contractapi.TransactionContextInterface, auctionID string, txID string) error {
-
- // get bid from transient map
- transientMap, err := ctx.GetStub().GetTransient()
- if err != nil {
- return fmt.Errorf("error getting transient: %v", err)
- }
-
- transientBidJSON, ok := transientMap["bid"]
- if !ok {
- return errors.New("bid key not found in the transient map")
- }
-
- // get implicit collection name of organization ID
- collection, err := getCollectionName(ctx)
- if err != nil {
- return fmt.Errorf("failed to get implicit collection name: %v", err)
- }
-
- // use transaction ID to create composit bid key
- bidKey, err := ctx.GetStub().CreateCompositeKey(bidKeyType, []string{auctionID, txID})
- if err != nil {
- return fmt.Errorf("failed to create composite key: %v", err)
- }
-
- // get bid hash of bid if private bid on the public ledger
- bidHash, err := ctx.GetStub().GetPrivateDataHash(collection, bidKey)
- if err != nil {
- return fmt.Errorf("failed to read bid bash from collection: %v", err)
- }
- if bidHash == nil {
- return fmt.Errorf("bid hash does not exist: %s", bidKey)
- }
-
- // get auction from public state
- auction, err := s.QueryAuction(ctx, auctionID)
- if err != nil {
- return fmt.Errorf("failed to get auction from public state %v", err)
- }
-
- // Complete a series of three checks before we add the bid to the auction
-
- // check 1: check that the auction is closed. We cannot reveal a
- // bid to an open auction
- Status := auction.Status
- if Status != "closed" {
- return errors.New("cannot reveal bid for open or ended auction")
- }
-
- // check 2: check that hash of revealed bid matches hash of private bid
- // on the public ledger. This checks that the bidder is telling the truth
- // about the value of their bid
-
- hash := sha256.New()
- hash.Write(transientBidJSON)
- calculatedBidJSONHash := hash.Sum(nil)
-
- // verify that the hash of the passed immutable properties matches the on-chain hash
- if !bytes.Equal(calculatedBidJSONHash, bidHash) {
- return fmt.Errorf("hash %x for bid JSON %s does not match hash in auction: %x",
- calculatedBidJSONHash,
- transientBidJSON,
- bidHash,
- )
- }
-
- // check 3; check hash of relealed bid matches hash of private bid that was
- // added earlier. This ensures that the bid has not changed since it
- // was added to the auction
-
- privateBidHashString := auction.PrivateBids[bidKey].Hash
-
- onChainBidHashString := fmt.Sprintf("%x", bidHash)
- if privateBidHashString != onChainBidHashString {
- return fmt.Errorf("hash %s for bid JSON %s does not match hash in auction: %s, bidder must have changed bid",
- privateBidHashString,
- transientBidJSON,
- onChainBidHashString,
- )
- }
-
- // we can add the bid to the auction if all checks have passed
- type transientBidInput struct {
- Price int `json:"price"`
- Org string `json:"org"`
- Bidder string `json:"bidder"`
- }
-
- // unmarshal bid input
- var bidInput transientBidInput
- err = json.Unmarshal(transientBidJSON, &bidInput)
- if err != nil {
- return fmt.Errorf("failed to unmarshal JSON: %v", err)
- }
-
- // Get ID of submitting client identity
- clientID, err := s.GetSubmittingClientIdentity(ctx)
- if err != nil {
- return fmt.Errorf("failed to get client identity %v", err)
- }
-
- // marshal transient parameters and ID and MSPID into bid object
- NewBid := FullBid{
- Type: bidKeyType,
- Price: bidInput.Price,
- Org: bidInput.Org,
- Bidder: bidInput.Bidder,
- }
-
- // check 4: make sure that the transaction is being submitted is the bidder
- if bidInput.Bidder != clientID {
- return fmt.Errorf("permission denied, client id %v is not the owner of the bid", clientID)
- }
-
- auction.RevealedBids[bidKey] = NewBid
-
- newAuctionJSON, _ := json.Marshal(auction)
-
- // put auction with bid added back into state
- err = ctx.GetStub().PutState(auctionID, newAuctionJSON)
- if err != nil {
- return fmt.Errorf("failed to update auction: %v", err)
- }
-
- return nil
-}
-
-// CloseAuction can be used by the seller to close the auction. This prevents
-// bids from being added to the auction, and allows users to reveal their bid
-func (s *SmartContract) CloseAuction(ctx contractapi.TransactionContextInterface, auctionID string) error {
-
- // get auction from public state
- auction, err := s.QueryAuction(ctx, auctionID)
- if err != nil {
- return fmt.Errorf("failed to get auction from public state %v", err)
- }
-
- // the auction can only be closed by the seller
-
- // get ID of submitting client
- clientID, err := s.GetSubmittingClientIdentity(ctx)
- if err != nil {
- return fmt.Errorf("failed to get client identity %v", err)
- }
-
- Seller := auction.Seller
- if Seller != clientID {
- return fmt.Errorf("auction can only be closed by seller: %v", err)
- }
-
- Status := auction.Status
- if Status != "open" {
- return errors.New("cannot close auction that is not open")
- }
-
- auction.Status = string("closed")
-
- closedAuctionJSON, _ := json.Marshal(auction)
-
- err = ctx.GetStub().PutState(auctionID, closedAuctionJSON)
- if err != nil {
- return fmt.Errorf("failed to close auction: %v", err)
- }
-
- return nil
-}
-
-// EndAuction both changes the auction status to closed and calculates the winners
-// of the auction
-func (s *SmartContract) EndAuction(ctx contractapi.TransactionContextInterface, auctionID string) error {
-
- // get auction from public state
- auction, err := s.QueryAuction(ctx, auctionID)
- if err != nil {
- return fmt.Errorf("failed to get auction from public state %v", err)
- }
-
- // Check that the auction is being ended by the seller
-
- // get ID of submitting client
- clientID, err := s.GetSubmittingClientIdentity(ctx)
- if err != nil {
- return fmt.Errorf("failed to get client identity %v", err)
- }
-
- Seller := auction.Seller
- if Seller != clientID {
- return fmt.Errorf("auction can only be ended by seller: %v", err)
- }
-
- Status := auction.Status
- if Status != "closed" {
- return errors.New("can only end a closed auction")
- }
-
- // get the list of revealed bids
- revealedBidMap := auction.RevealedBids
- if len(auction.RevealedBids) == 0 {
- return fmt.Errorf("no bids have been revealed, cannot end auction: %v", err)
- }
-
- // determine the highest bid
- for _, bid := range revealedBidMap {
- if bid.Price > auction.Price {
- auction.Winner = bid.Bidder
- auction.Price = bid.Price
- }
- }
-
- // check if there is a winning bid that has yet to be revealed
- err = checkForHigherBid(ctx, auction.Price, auction.RevealedBids, auction.PrivateBids)
- if err != nil {
- return fmt.Errorf("cannot end auction: %v", err)
- }
-
- auction.Status = "ended"
-
- endedAuctionJSON, _ := json.Marshal(auction)
-
- err = ctx.GetStub().PutState(auctionID, endedAuctionJSON)
- if err != nil {
- return fmt.Errorf("failed to end auction: %v", err)
- }
- return nil
-}
diff --git a/auction-simple/chaincode-go/smart-contract/auctionQueries.go b/auction-simple/chaincode-go/smart-contract/auctionQueries.go
deleted file mode 100644
index cd99558b..00000000
--- a/auction-simple/chaincode-go/smart-contract/auctionQueries.go
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
-SPDX-License-Identifier: Apache-2.0
-*/
-
-package auction
-
-import (
- "encoding/json"
- "errors"
- "fmt"
-
- "github.com/hyperledger/fabric-chaincode-go/v2/shim"
- "github.com/hyperledger/fabric-contract-api-go/v2/contractapi"
-)
-
-// QueryAuction allows all members of the channel to read a public auction
-func (s *SmartContract) QueryAuction(ctx contractapi.TransactionContextInterface, auctionID string) (*Auction, error) {
-
- auctionJSON, err := ctx.GetStub().GetState(auctionID)
- if err != nil {
- return nil, fmt.Errorf("failed to get auction object %v: %v", auctionID, err)
- }
- if auctionJSON == nil {
- return nil, errors.New("auction does not exist")
- }
-
- var auction *Auction
- err = json.Unmarshal(auctionJSON, &auction)
- if err != nil {
- return nil, err
- }
-
- return auction, nil
-}
-
-// QueryBid allows the submitter of the bid to read their bid from public state
-func (s *SmartContract) QueryBid(ctx contractapi.TransactionContextInterface, auctionID string, txID string) (*FullBid, error) {
-
- err := verifyClientOrgMatchesPeerOrg(ctx)
- if err != nil {
- return nil, fmt.Errorf("failed to get implicit collection name: %v", err)
- }
-
- clientID, err := s.GetSubmittingClientIdentity(ctx)
- if err != nil {
- return nil, fmt.Errorf("failed to get client identity %v", err)
- }
-
- collection, err := getCollectionName(ctx)
- if err != nil {
- return nil, fmt.Errorf("failed to get implicit collection name: %v", err)
- }
-
- bidKey, err := ctx.GetStub().CreateCompositeKey(bidKeyType, []string{auctionID, txID})
- if err != nil {
- return nil, fmt.Errorf("failed to create composite key: %v", err)
- }
-
- bidJSON, err := ctx.GetStub().GetPrivateData(collection, bidKey)
- if err != nil {
- return nil, fmt.Errorf("failed to get bid %v: %v", bidKey, err)
- }
- if bidJSON == nil {
- return nil, fmt.Errorf("bid %v does not exist", bidKey)
- }
-
- var bid *FullBid
- err = json.Unmarshal(bidJSON, &bid)
- if err != nil {
- return nil, err
- }
-
- // check that the client querying the bid is the bid owner
- if bid.Bidder != clientID {
- return nil, fmt.Errorf("permission denied, client id %v is not the owner of the bid", clientID)
- }
-
- return bid, nil
-}
-
-// checkForHigherBid is an internal function that is used to determine if a winning bid has yet to be revealed
-func checkForHigherBid(ctx contractapi.TransactionContextInterface, auctionPrice int, revealedBidders map[string]FullBid, bidders map[string]BidHash) error {
-
- // Get MSP ID of peer org
- peerMSPID, err := shim.GetMSPID()
- if err != nil {
- return fmt.Errorf("failed getting the peer's MSPID: %v", err)
- }
-
- var error error
- error = nil
-
- for bidKey, privateBid := range bidders {
-
- if _, bidInAuction := revealedBidders[bidKey]; bidInAuction {
-
- // bid is already revealed, no action to take
-
- } else {
-
- collection := "_implicit_org_" + privateBid.Org
-
- if privateBid.Org == peerMSPID {
-
- bidJSON, err := ctx.GetStub().GetPrivateData(collection, bidKey)
- if err != nil {
- return fmt.Errorf("failed to get bid %v: %v", bidKey, err)
- }
- if bidJSON == nil {
- return fmt.Errorf("bid %v does not exist", bidKey)
- }
-
- var bid *FullBid
- err = json.Unmarshal(bidJSON, &bid)
- if err != nil {
- return err
- }
-
- if bid.Price > auctionPrice {
- error = fmt.Errorf("cannot close auction, bidder has a higher price: %v", err)
- }
-
- } else {
-
- Hash, err := ctx.GetStub().GetPrivateDataHash(collection, bidKey)
- if err != nil {
- return fmt.Errorf("failed to read bid hash from collection: %v", err)
- }
- if Hash == nil {
- return fmt.Errorf("bid hash does not exist: %s", bidKey)
- }
- }
- }
- }
-
- return error
-}
diff --git a/auction-simple/chaincode-go/smart-contract/utils.go b/auction-simple/chaincode-go/smart-contract/utils.go
deleted file mode 100644
index b663e608..00000000
--- a/auction-simple/chaincode-go/smart-contract/utils.go
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
-SPDX-License-Identifier: Apache-2.0
-*/
-
-package auction
-
-import (
- "encoding/base64"
- "fmt"
-
- "github.com/hyperledger/fabric-chaincode-go/v2/pkg/statebased"
- "github.com/hyperledger/fabric-chaincode-go/v2/shim"
- "github.com/hyperledger/fabric-contract-api-go/v2/contractapi"
-)
-
-func (s *SmartContract) GetSubmittingClientIdentity(ctx contractapi.TransactionContextInterface) (string, error) {
-
- b64ID, err := ctx.GetClientIdentity().GetID()
- if err != nil {
- return "", fmt.Errorf("failed to read clientID: %v", err)
- }
- decodeID, err := base64.StdEncoding.DecodeString(b64ID)
- if err != nil {
- return "", fmt.Errorf("failed to base64 decode clientID: %v", err)
- }
- return string(decodeID), nil
-}
-
-// setAssetStateBasedEndorsement sets the endorsement policy of a new auction
-func setAssetStateBasedEndorsement(ctx contractapi.TransactionContextInterface, auctionID string, orgToEndorse string) error {
-
- endorsementPolicy, err := statebased.NewStateEP(nil)
- if err != nil {
- return err
- }
- err = endorsementPolicy.AddOrgs(statebased.RoleTypePeer, orgToEndorse)
- if err != nil {
- return fmt.Errorf("failed to add org to endorsement policy: %v", err)
- }
- policy, err := endorsementPolicy.Policy()
- if err != nil {
- return fmt.Errorf("failed to create endorsement policy bytes from org: %v", err)
- }
- err = ctx.GetStub().SetStateValidationParameter(auctionID, policy)
- if err != nil {
- return fmt.Errorf("failed to set validation parameter on auction: %v", err)
- }
-
- return nil
-}
-
-// addAssetStateBasedEndorsement adds a new organization as an endorser of the auction
-func addAssetStateBasedEndorsement(ctx contractapi.TransactionContextInterface, auctionID string, orgToEndorse string) error {
-
- endorsementPolicy, err := ctx.GetStub().GetStateValidationParameter(auctionID)
- if err != nil {
- return err
- }
-
- newEndorsementPolicy, err := statebased.NewStateEP(endorsementPolicy)
- if err != nil {
- return err
- }
-
- err = newEndorsementPolicy.AddOrgs(statebased.RoleTypePeer, orgToEndorse)
- if err != nil {
- return fmt.Errorf("failed to add org to endorsement policy: %v", err)
- }
- policy, err := newEndorsementPolicy.Policy()
- if err != nil {
- return fmt.Errorf("failed to create endorsement policy bytes from org: %v", err)
- }
- err = ctx.GetStub().SetStateValidationParameter(auctionID, policy)
- if err != nil {
- return fmt.Errorf("failed to set validation parameter on auction: %v", err)
- }
-
- return nil
-}
-
-// getCollectionName is an internal helper function to get collection of submitting client identity.
-func getCollectionName(ctx contractapi.TransactionContextInterface) (string, error) {
-
- // Get the MSP ID of submitting client identity
- clientMSPID, err := ctx.GetClientIdentity().GetMSPID()
- if err != nil {
- return "", fmt.Errorf("failed to get verified MSPID: %v", err)
- }
-
- // Create the collection name
- orgCollection := "_implicit_org_" + clientMSPID
-
- return orgCollection, nil
-}
-
-// verifyClientOrgMatchesPeerOrg is an internal function used to verify that client org id matches peer org id.
-func verifyClientOrgMatchesPeerOrg(ctx contractapi.TransactionContextInterface) error {
- clientMSPID, err := ctx.GetClientIdentity().GetMSPID()
- if err != nil {
- return fmt.Errorf("failed getting the client's MSPID: %v", err)
- }
- peerMSPID, err := shim.GetMSPID()
- if err != nil {
- return fmt.Errorf("failed getting the peer's MSPID: %v", err)
- }
-
- if clientMSPID != peerMSPID {
- return fmt.Errorf("client from org %v is not authorized to read or write private data from an org %v peer", clientMSPID, peerMSPID)
- }
-
- return nil
-}
-
-func contains(sli []string, str string) bool {
- for _, a := range sli {
- if a == str {
- return true
- }
- }
- return false
-}
diff --git a/auction-simple/chaincode-go/smartContract.go b/auction-simple/chaincode-go/smartContract.go
deleted file mode 100644
index c165075d..00000000
--- a/auction-simple/chaincode-go/smartContract.go
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
-SPDX-License-Identifier: Apache-2.0
-*/
-
-package main
-
-import (
- "log"
-
- "github.com/hyperledger/fabric-contract-api-go/v2/contractapi"
- "github.com/hyperledger/fabric-samples/auction/chaincode-go/smart-contract"
-)
-
-func main() {
- auctionSmartContract, err := contractapi.NewChaincode(&auction.SmartContract{})
- if err != nil {
- log.Panicf("Error creating auction chaincode: %v", err)
- }
-
- if err := auctionSmartContract.Start(); err != nil {
- log.Panicf("Error starting auction chaincode: %v", err)
- }
-}
diff --git a/full-stack-asset-transfer-guide/.gitignore b/full-stack-asset-transfer-guide/.gitignore
deleted file mode 100644
index a7148016..00000000
--- a/full-stack-asset-transfer-guide/.gitignore
+++ /dev/null
@@ -1,17 +0,0 @@
-fabric
-_cfg
-node_modules
-*.bin
-.idea/
-_*
-*tgz
-*.tar.gz
-~*.pptx
-
-bin
-config/
-
-.DS_Store
-.idea/
-
-rook
\ No newline at end of file
diff --git a/full-stack-asset-transfer-guide/LICENSE b/full-stack-asset-transfer-guide/LICENSE
deleted file mode 100644
index 261eeb9e..00000000
--- a/full-stack-asset-transfer-guide/LICENSE
+++ /dev/null
@@ -1,201 +0,0 @@
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- 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
-
- http://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.
diff --git a/full-stack-asset-transfer-guide/README.md b/full-stack-asset-transfer-guide/README.md
deleted file mode 100644
index 2d886005..00000000
--- a/full-stack-asset-transfer-guide/README.md
+++ /dev/null
@@ -1,108 +0,0 @@
-
-
-# Fabric Full Stack Development Workshop
-
-
-
-Hyperledger Fabric can be used to represent assets of any kind on a permissioned decentralized ledger, from fungible tokens to non-fungible tokens, including monetary products, marbles, pineapples, classic cars, fine art, and anything else you can imagine.
-Fabric can be used to track and update anything about these assets, common examples include asset ownership, exchange, provenance, and lifecycle.
-
-This workshop will demonstrate how a generic asset transfer solution can be modeled and deployed to take advantage of a blockchains qualitites of service.
-
-The workshop will be split into three sections:
-- Smart Contract Development
-- Client Application Development
-- Cloud Native Fabric Deployment
-
-
-
-**OBJECTIVES:**
-
-- Show how an Asset Transfer smart contract can be written to encapsulate business logic
- - Show how the smart contract can be developed iteratively to get correct function in a development context
-- Show how client applications can be written using the Gateway functionality
- - Show how the simplification of the Gateway programming model makes connecting applications more streamlined
- - Show how this streamlined approach improves resilience and availability
-- Show how the solution can then be deployed to a production-class environment
- - Show how a Hyperledger Fabric network can be created and managed in Kubernetes (K8S) using automation
- - Show how the Fabric Operator and Console can be installed via Ansible playbooks
- - Show how a multi-organization configuration of Fabric can be created
-
----
-
-**Please ensure you've got the [required tools](./SETUP.md) on your local machine or in a virtual machine -- To check, run `./check.sh`**
-
----
-
-
-## Before you begin....
-
-Fabric is a multi-server decentralized system with orderer and peer nodes, so it can be quite complex to configure. Even the simplest smart contract needs a running Fabric Infrastructure and one size does not fit all.
-
-There are configurations that can run Fabric either as local binaries, in a single docker container, in multiple containers, or in K8S.
-This workshop will show some of the approaches that can be used for developing applications and contracts with a minimal Fabric environment (Microfab), and how a production deployment can be achieved.
-There are other ways of deploying Fabric produced by the community - these are equally valid and useful. Feel free to try the others, once you understand the basic concepts to find what works best for you.
-
-At a high-level remember that a solution using Fabric has (a) client application to send in transaction requests (b) Fabric infrastructure to service those requests (c) Smart Contract to action the transactions.
-The nature of (b) the fabric infrastructure will change depending on your scenario; start simple and build up. The smart contracts and client application's code will remain the same no matter the way Fabric is provisioned.
-There will be minor variations in deployment (eg local docker container vs remote K8S cluster) but fundamentally the process is the same.
-
-## Running the workshop
-
- If you're running on Windows, please check the [hints and tips](./docs/tips-for-windows-dev.md)
-
-- Ensure you've got the tools you may need, either installed locally or in a multipass virtual machine. See the [setup page](./SETUP.md) for details.
-- Clone this repository to a convient location
-- We suggest that you open 3 or 4 terminal windows
- - One for running chaincode in dev mode
- - One for running the fabric infrastructure and optionally one for monitoring it
- - One for client applications
-
-- Work through the sections below in order, although you don't necessarily need to complete all the Exercises before moving to the next section.
-
----
-## Scenario
-
-Lets assume the assets you are tracking on the blockchain ledger are trading cards. Each trading card represents a comic book character and has an id, size, favorite color, and owner.
-These trading cards can be passed between people, with some cards having more 'value' due to rarity or having notable attributes.
-
-In token terms, think of these cards as non-fungible tokens. Each card has different attributes and individual cards can't be subdivided.
-
-We'll create a digital representation of these cards on the blockchain ledger. There are a few important aspects of this solution to consider:
-
-- Ledger - The blockchain ledger on each peer maintains the current state of each card (asset), as well as the history of transactions that led to the current state, so that there is no doubt about the assets issuance, provenance, attributes, and ownership.
-- Asset transfer smart contract - manage changes to asset state such as the transfer of cards between people
-- Organizations - Since this is a permissioned blockchain we'll model the participants as organizations that are authorized to run nodes or transact on the Fabric network. Our simple network will consist of an ordering service organization and two transacting organizations.
- - Ordering service organization - runs the ordering service to ensure transactions get ordered into blocks fairly, this may be a consortium leader or regulator in the industry. Note that ordering service nodes could also be contributed from multiple organizations, this becomes especially important when running a Byzantine Fault Tolerant (BFT) ordering service.
- - Owner Organizations - Each owner organization is authorized to run peers and submit transfer transactions for the cards (assets) that they own.
-
-
-## Smart Contract Development
-
-- [Introduction](./docs/SmartContractDev/00-Introduction.md) [Español](./docs/SmartContractDev/00-Introduction-ES.md)
-- **Exercise**: [Getting Started with a Smart Contract](./docs/SmartContractDev/01-Exercise-Getting-Started.md) [Español](./docs/SmartContractDev/01-Exercise-Getting-Started-ES.md)
-- **Exercise**: [Adding a new transaction function](./docs/SmartContractDev/02-Exercise-Adding-tx-function.md) [Español](./docs/SmartContractDev/02-Exercise-Adding-tx-function-ES.md)
-- Reference:
- - [Detailed Test and Debug](./docs/SmartContractDev/03-Test-And-Debug-Reference.md) [Español](./docs/SmartContractDev/03-Test-And-Debug-Reference-ES.md)
-
-## Client Application Development
-
-- [Fabric Gateway](docs/ApplicationDev/01-FabricGateway.md)
-- **Exercise:** [Run the client application](docs/ApplicationDev/02-Exercise-RunApplication.md)
-- [Application overview](docs/ApplicationDev/03-ApplicationOverview.md)
-- **Exercise:** [Implement asset transfer](docs/ApplicationDev/04-Exercise-AssetTransfer.md)
-- [Chaincode events](docs/ApplicationDev/05-ChaincodeEvents.md)
-- **Exercise:** [Use chaincode events](docs/ApplicationDev/06-Exercise-ChaincodeEvents.md)
-
-## Cloud Native Fabric
-
-- [Cloud Ready!](docs/CloudReady/00-setup.md) [中文](docs/CloudReady/00-setup-zh.md)
-- **Exercise:** [Deploy a Kubernetes Cluster](docs/CloudReady/10-kube.md) [中文](docs/CloudReady/10-kube-zh.md)
-- **Exercise:** [Deploy a Fabric Network](docs/CloudReady/20-fabric.md) [中文](docs/CloudReady/20-fabric-zh.md)
-- **Exercise:** [Deploy a Smart Contract](docs/CloudReady/30-chaincode.md)[中文](docs/CloudReady/30-chaincode-zh.md)
-- **Exercise:** [Deploy a Client Application](docs/CloudReady/40-bananas.md)[中文](docs/CloudReady/40-bananas-zh.md)
-
-## Epilogue
-
-- [Go Bananas](docs/CloudReady/40-bananas.md)
-- [Bring it Home](docs/CloudReady/90-teardown.md)
diff --git a/full-stack-asset-transfer-guide/SETUP.md b/full-stack-asset-transfer-guide/SETUP.md
deleted file mode 100644
index 4f8f0d2d..00000000
--- a/full-stack-asset-transfer-guide/SETUP.md
+++ /dev/null
@@ -1,138 +0,0 @@
-# Essential Setup
-
-Remember to clone this repository!
-
-```shell
-git clone https://github.com/hyperledger/fabric-samples.git fabric-samples
-cd fabric-samples/full-stack-asset-transfer-guide
-export WORKSHOP_PATH=$(pwd)
-```
-
-> to check the tools you already have `./check.sh`
-
-## Option 1: Use local environment
-
-Do you want to configure your local environment with the workshop dependencies?
-
-- To develop an application and/or contract (first two parts of workshop) follow the *DEV* setup below
-
-- To deploy a chaincode to kubernetes in a production manner (third part of workshop) follow the *PROD* setup below
-
-## Option 2: Use a Multipass Ubuntu image
-
-If you do not want to install dependencies on your local environment, you can use a Multipass Ubuntu image instead.
-
-Tip - You may need to stop any VPN client for the Multipass networking to work.
-
-- [Install multipass](https://multipass.run/install)
-
-- Launch the virtual machine and automatically install the workshop dependencies:
-
-```shell
-multipass launch \
- --name fabric-dev \
- --disk 80G \
- --cpus 8 \
- --mem 8G \
- --cloud-init infrastructure/multipass-cloud-config.yaml
-```
-
-- Mount the local workshop to your multipass vm:
-
-```shell
-multipass mount $PWD fabric-dev:/home/ubuntu/full-stack-asset-transfer-guide
-```
-
-- Open a shell on the virtual machine:
-
-```shell
-multipass shell fabric-dev
-```
-
-Tip - The vm creation log can be seen at /var/log/cloud-init-output.log if you need to troubleshoot anything.
-
-- You are now inside the virtual machine. cd to the workshop directory:
-
-```shell
-cd full-stack-asset-transfer-guide
-```
-
-- Install Fabric peer CLI and set environment variables
-```shell
-curl -sSLO https://raw.githubusercontent.com/hyperledger/fabric/main/scripts/install-fabric.sh && chmod +x install-fabric.sh
-./install-fabric.sh binary
-export WORKSHOP_PATH=$(pwd)
-export PATH=${WORKSHOP_PATH}/bin:$PATH
-export FABRIC_CFG_PATH=${WORKSHOP_PATH}/config
-```
-
-Note - You'll probably want three terminal windows for running the workshop, go ahead and open the shells now:
-
-```shell
-multipass shell fabric-dev
-```
-
-- Eventual cleanup - To remove the multipass image when you are done with it after the workshop:
-```shell
-multipass delete fabric-dev
-multipass purge
-multipass list
-```
-
-## DEV - Required Tools
-
-You will need a set of tools to assist with chaincode and application development.
-We'll assume you are developing in Node for this workshop, but you could also develop in Java or Go by installing the respective compilers.
-
-- [docker engine](https://docs.docker.com/engine/install/)
-
-- [just](https://github.com/casey/just#installation) to run all the commands here directly
-
-- [nvm](https://github.com/nvm-sh/nvm#installing-and-updating) to install node and npm
-```shell
-curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
-```
-
-- [node v16 and npm](https://github.com/nvm-sh/nvm#usage) to run node chaincode and applications
-```shell
-nvm install 16
-```
-
-- [typescript](https://www.typescriptlang.org/download) to compile typescript chaincode and applications to node
-```shell
-npm install -g typescript
-```
-
-- [weft ](https://www.npmjs.com/package/@hyperledger-labs/weft) Hyperledger-Labs cli to work with identities and chaincode packages
-```shell
-npm install -g @hyperledger-labs/weft
-```
-
-- [jq](https://stedolan.github.io/jq/) jq JSON command-line processor
-```shell
-sudo apt-get update && sudo apt-get install -y jq
-```
-
-- Fabric peer CLI
-```shell
-curl -sSL https://raw.githubusercontent.com/hyperledger/fabric/main/scripts/install-fabric.sh | bash -s -- binary
-export WORKSHOP_PATH=$(pwd)
-export PATH=${WORKSHOP_PATH}/bin:$PATH
-export FABRIC_CFG_PATH=${WORKSHOP_PATH}/config
-```
-
-## PROD - Required Tools for Kubernetes Deployment
-
-- [kubectl](https://kubernetes.io/docs/tasks/tools/)
-- [jq](https://stedolan.github.io/jq/)
-- [just](https://github.com/casey/just#installation) to run all the comamnds here directly
-- [kind](https://kind.sigs.k8s.io/) if you want to create a cluster locally, see below for other options
-- [k9s](https://k9scli.io) (recommended, but not essential)
-
-### Beta Ansible Playbooks
-
-The v2.0.0-beta Ansible Collection for Hyperledger Fabric is required for Kubernetes deployment. This isn't yet being published to DockerHub but is being published to Github Packages.
-
-For reference check the latest version of [ofs-ansible](https://github.com/IBM-Blockchain/ansible-collection/pkgs/container/ofs-ansibe)
-
-The Ansible scripts in the workshop are set to use the latest image here by default.
diff --git a/full-stack-asset-transfer-guide/applications/conga-cards/.eslintrc.js b/full-stack-asset-transfer-guide/applications/conga-cards/.eslintrc.js
deleted file mode 100644
index ad992fae..00000000
--- a/full-stack-asset-transfer-guide/applications/conga-cards/.eslintrc.js
+++ /dev/null
@@ -1,12 +0,0 @@
-module.exports = {
- root: true,
- parser: '@typescript-eslint/parser',
- plugins: [
- '@typescript-eslint',
- ],
- extends: [
- 'eslint:recommended',
- 'plugin:@typescript-eslint/recommended',
- 'prettier',
- ],
-};
\ No newline at end of file
diff --git a/full-stack-asset-transfer-guide/applications/conga-cards/.gitignore b/full-stack-asset-transfer-guide/applications/conga-cards/.gitignore
deleted file mode 100644
index 1276eb3b..00000000
--- a/full-stack-asset-transfer-guide/applications/conga-cards/.gitignore
+++ /dev/null
@@ -1,18 +0,0 @@
-#
-# SPDX-License-Identifier: Apache-2.0
-#
-
-# Coverage directory used by tools like istanbul
-coverage
-
-# Dependencies
-node_modules/
-jspm_packages/
-package-lock.json
-
-# Compiled TypeScript files
-dist
-
-# Files generated by the application at runtime
-checkpoint.json
-store.log
diff --git a/full-stack-asset-transfer-guide/applications/conga-cards/.npmrc b/full-stack-asset-transfer-guide/applications/conga-cards/.npmrc
deleted file mode 100644
index b6f27f13..00000000
--- a/full-stack-asset-transfer-guide/applications/conga-cards/.npmrc
+++ /dev/null
@@ -1 +0,0 @@
-engine-strict=true
diff --git a/full-stack-asset-transfer-guide/applications/conga-cards/README.md b/full-stack-asset-transfer-guide/applications/conga-cards/README.md
deleted file mode 100644
index e99b1bcc..00000000
--- a/full-stack-asset-transfer-guide/applications/conga-cards/README.md
+++ /dev/null
@@ -1,73 +0,0 @@
-# Conga Cards
-
-This Gateway Client application will listen for chaincode events, invoking a [#discord webhook](https://discord.com/developers/docs/resources/webhook)
-to post a channel message when [Conga Cards](assets/) are created, deleted, and exchanged on a channel.
-
-> [Conga Comics](https://congacomic.github.io) | Life on the chain, one block at a time by Ed Moffatt & some friends
-
-This project is based on the [trader-typescript](../trader-typescript) sample Gateway Client application.
-
-
-## Prerequisites
-
-The client application requires Node.js 16 or later.
-
-## Set up
-
-The following steps prepare the client application for execution:
-
-1. Ensure the [asset-transfer](../../contracts/asset-transfer-typescript/) smart contract is deployed to a running Fabric network.
-1. Run `npm install` to download dependencies and compile the application code.
-
-> **Note:** After making any code changes to the application, be sure to recompile the application code. This can be done by explicitly running `npm install` again, or you can leave `npm run build:watch` running in a terminal window to automatically rebuild the application on any code change.
-
-
-The client application uses environment variables to supply configuration options. You must set the following environment variables when running the application:
-
-- `ENDPOINT` - endpoint address for the Gateway service to which the client will connect in the form **hostname:port**. Depending on your environment, this can be the address of a specific peer within the user's organization, or an ingress endpoint that dispatches to any available peer in the user's organization.
-- `MSP_ID` - member service provider ID for the user's organization.
-- `CERTIFICATE` - PEM file containing the user's X.509 certificate.
-- `PRIVATE_KEY` - PEM file containing the user's private key.
-
-The following environment variables are optional and can be set if required by your environment:
-
-- `CHANNEL_NAME` - Channel to which the chaincode is deployed. (Default: `mychannel`)
-- `CHAINCODE_NAME` - Channel to which the chaincode is deployed. (Default: `asset-transfer`)
-- `TLS_CERT` - PEM file containing the CA certificate used to authenticate the TLS connection to the Gateway peer. *Only required if using a TLS connection and a private CA.*
-- `HOST_ALIAS` - the name of the Gateway peer as it appears in its TLS certificate. *Only required if the endpoint address used by the client does not match the address in the Gateway peer's TLS certificate.*
-
-- `WEBHOOK_URL` - the [#discord webhook](https://discord.com/developers/docs/resources/webhook) to which the channel
- events will be relayed.
-
-
-# Run
-
-The sample application is run as a command-line application, and is lauched using `npm start [ ...]`. The following commands are available:
-
-- `npm start create ` to create a new asset.
-- `npm start delete ` to delete an existing asset.
-- `npm start getAllAssets` to list all assets.
-- `npm start read ` to view an existing asset.
-- `npm start transfer ` to transfer an asset to a new owner within an organization MSP ID.
-- `npm start discord` starts an event loop, relaying channel events to `${WEBHOOK_URL}`
-
-
-## Sample Interaction:
-
-- Submit some transactions to a ledger:
-```shell
-npm start create blockbert SeanB orange
-
-npm start create count-blockula jkneubuhl Org1MSP purple
-
-npm start transfer count-blockula davidboswell Org1MSP
-```
-
-- Run the discord event listener:
-```shell
-export WEBHOOK_URL="https://discord.com/api/webhooks/123456789/xyzzy-abcdef-12345"
-
-npm start discord
-```
-
-
\ No newline at end of file
diff --git a/full-stack-asset-transfer-guide/applications/conga-cards/assets/appleplectic.png b/full-stack-asset-transfer-guide/applications/conga-cards/assets/appleplectic.png
deleted file mode 100644
index 7a8da445..00000000
Binary files a/full-stack-asset-transfer-guide/applications/conga-cards/assets/appleplectic.png and /dev/null differ
diff --git a/full-stack-asset-transfer-guide/applications/conga-cards/assets/bananomatopoeia.png b/full-stack-asset-transfer-guide/applications/conga-cards/assets/bananomatopoeia.png
deleted file mode 100644
index 40fcba25..00000000
Binary files a/full-stack-asset-transfer-guide/applications/conga-cards/assets/bananomatopoeia.png and /dev/null differ
diff --git a/full-stack-asset-transfer-guide/applications/conga-cards/assets/block-norris.png b/full-stack-asset-transfer-guide/applications/conga-cards/assets/block-norris.png
deleted file mode 100644
index efc2ec84..00000000
Binary files a/full-stack-asset-transfer-guide/applications/conga-cards/assets/block-norris.png and /dev/null differ
diff --git a/full-stack-asset-transfer-guide/applications/conga-cards/assets/blockbert.png b/full-stack-asset-transfer-guide/applications/conga-cards/assets/blockbert.png
deleted file mode 100644
index 43ff9b46..00000000
Binary files a/full-stack-asset-transfer-guide/applications/conga-cards/assets/blockbert.png and /dev/null differ
diff --git a/full-stack-asset-transfer-guide/applications/conga-cards/assets/count-blockula.png b/full-stack-asset-transfer-guide/applications/conga-cards/assets/count-blockula.png
deleted file mode 100644
index e49fb0cc..00000000
Binary files a/full-stack-asset-transfer-guide/applications/conga-cards/assets/count-blockula.png and /dev/null differ
diff --git a/full-stack-asset-transfer-guide/applications/conga-cards/assets/darth-conga.png b/full-stack-asset-transfer-guide/applications/conga-cards/assets/darth-conga.png
deleted file mode 100644
index 7e182204..00000000
Binary files a/full-stack-asset-transfer-guide/applications/conga-cards/assets/darth-conga.png and /dev/null differ
diff --git a/full-stack-asset-transfer-guide/applications/conga-cards/assets/no-pun-intended.png b/full-stack-asset-transfer-guide/applications/conga-cards/assets/no-pun-intended.png
deleted file mode 100644
index 24018022..00000000
Binary files a/full-stack-asset-transfer-guide/applications/conga-cards/assets/no-pun-intended.png and /dev/null differ
diff --git a/full-stack-asset-transfer-guide/applications/conga-cards/assets/template.png b/full-stack-asset-transfer-guide/applications/conga-cards/assets/template.png
deleted file mode 100644
index b04d8126..00000000
Binary files a/full-stack-asset-transfer-guide/applications/conga-cards/assets/template.png and /dev/null differ
diff --git a/full-stack-asset-transfer-guide/applications/conga-cards/hooks/captain-hook.json b/full-stack-asset-transfer-guide/applications/conga-cards/hooks/captain-hook.json
deleted file mode 100644
index ce0a15e0..00000000
--- a/full-stack-asset-transfer-guide/applications/conga-cards/hooks/captain-hook.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "content": "Tail recursion is its own reward.",
- "avatar_url": "https://avatars.githubusercontent.com/u/49026922?s=200&v=4",
- "username": "Conga-Bot"
-}
\ No newline at end of file
diff --git a/full-stack-asset-transfer-guide/applications/conga-cards/images/interaction.png b/full-stack-asset-transfer-guide/applications/conga-cards/images/interaction.png
deleted file mode 100644
index e7440050..00000000
Binary files a/full-stack-asset-transfer-guide/applications/conga-cards/images/interaction.png and /dev/null differ
diff --git a/full-stack-asset-transfer-guide/applications/conga-cards/package.json b/full-stack-asset-transfer-guide/applications/conga-cards/package.json
deleted file mode 100644
index 8c6d8b2c..00000000
--- a/full-stack-asset-transfer-guide/applications/conga-cards/package.json
+++ /dev/null
@@ -1,36 +0,0 @@
-{
- "name": "conga-cards",
- "version": "1.0.0",
- "description": "Conga Cards client application",
- "main": "dist/index.js",
- "typings": "dist/index.d.ts",
- "engines": {
- "node": ">=18"
- },
- "scripts": {
- "build": "tsc",
- "build:watch": "tsc -w",
- "lint": "eslint ./src",
- "prepare": "npm run build",
- "pretest": "npm run lint",
- "start": "node ./dist/app",
- "test": ""
- },
- "author": "Hyperledger",
- "license": "Apache-2.0",
- "dependencies": {
- "@grpc/grpc-js": "^1.12.2",
- "@hyperledger/fabric-gateway": "^1.7.0",
- "axios": "^1.7.7",
- "source-map-support": "^0.5.21"
- },
- "devDependencies": {
- "@tsconfig/node18": "^18.2.2",
- "@types/node": "^18.18.6",
- "@types/source-map-support": "^0.5.6",
- "@typescript-eslint/eslint-plugin": "^6.9.0",
- "@typescript-eslint/parser": "^6.9.0",
- "eslint": "^8.52.0",
- "typescript": "~5.2.2"
- }
-}
diff --git a/full-stack-asset-transfer-guide/applications/conga-cards/src/app.ts b/full-stack-asset-transfer-guide/applications/conga-cards/src/app.ts
deleted file mode 100644
index acbdf3a9..00000000
--- a/full-stack-asset-transfer-guide/applications/conga-cards/src/app.ts
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright contributors to the Hyperledgendary Full Stack Asset Transfer Guide project
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-
-import * as sourceMapSupport from 'source-map-support';
-sourceMapSupport.install();
-
-import { Command, commands } from './commands';
-import { newGatewayConnection, newGrpcConnection } from './connect';
-import { ExpectedError } from './expectedError';
-
-async function main(): Promise {
- const commandName = process.argv[2];
- const args = process.argv.slice(3);
-
- const command = commands[commandName];
- if (!command) {
- printUsage();
- throw new Error(`Unknown command: ${commandName}`);
- }
-
- await runCommand(command, args);
-}
-
-async function runCommand(command: Command, args: string[]): Promise {
- const client = await newGrpcConnection();
- try {
- const gateway = await newGatewayConnection(client);
- try {
- await command(gateway, args);
- } finally {
- gateway.close();
- }
- } finally {
- client.close();
- }
-}
-
-function printUsage(): void {
- console.log('Arguments: [ ...]');
- console.log('Available commands:');
- console.log(`\t${Object.keys(commands).sort().join('\n\t')}`);
-}
-
-main().catch(error => {
- if (error instanceof ExpectedError) {
- console.log(error);
- } else {
- console.error('\nUnexpected application error:', error);
- process.exitCode = 1;
- }
-});
diff --git a/full-stack-asset-transfer-guide/applications/conga-cards/src/commands/create.ts b/full-stack-asset-transfer-guide/applications/conga-cards/src/commands/create.ts
deleted file mode 100644
index 3d823351..00000000
--- a/full-stack-asset-transfer-guide/applications/conga-cards/src/commands/create.ts
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Copyright contributors to the Hyperledgendary Full Stack Asset Transfer Guide project
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-
-import { Gateway } from '@hyperledger/fabric-gateway';
-import { CHAINCODE_NAME, CHANNEL_NAME } from '../config';
-import { AssetTransfer } from '../contract';
-import { assertAllDefined } from '../utils';
-
-export default async function main(gateway: Gateway, args: string[]): Promise {
- const [assetId, owner, color] = assertAllDefined([args[0], args[1], args[2]], 'Arguments: ');
-
- const network = gateway.getNetwork(CHANNEL_NAME);
- const contract = network.getContract(CHAINCODE_NAME);
-
- const smartContract = new AssetTransfer(contract);
- await smartContract.createAsset({
- ID: assetId,
- Owner: owner,
- Color: color,
- Size: 1,
- AppraisedValue: 1,
- });
-}
diff --git a/full-stack-asset-transfer-guide/applications/conga-cards/src/commands/delete.ts b/full-stack-asset-transfer-guide/applications/conga-cards/src/commands/delete.ts
deleted file mode 100644
index 1026a006..00000000
--- a/full-stack-asset-transfer-guide/applications/conga-cards/src/commands/delete.ts
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright contributors to the Hyperledgendary Full Stack Asset Transfer Guide project
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-
-import { Gateway } from '@hyperledger/fabric-gateway';
-import { CHAINCODE_NAME, CHANNEL_NAME } from '../config';
-import { AssetTransfer } from '../contract';
-import { assertDefined } from '../utils';
-
-export default async function main(gateway: Gateway, args: string[]): Promise {
- const assetId = assertDefined(args[0], 'Arguments: ');
-
- const network = gateway.getNetwork(CHANNEL_NAME);
- const contract = network.getContract(CHAINCODE_NAME);
-
- const smartContract = new AssetTransfer(contract);
- await smartContract.deleteAsset(assetId);
-}
diff --git a/full-stack-asset-transfer-guide/applications/conga-cards/src/commands/discord.ts b/full-stack-asset-transfer-guide/applications/conga-cards/src/commands/discord.ts
deleted file mode 100644
index 6e06688f..00000000
--- a/full-stack-asset-transfer-guide/applications/conga-cards/src/commands/discord.ts
+++ /dev/null
@@ -1,175 +0,0 @@
-/*
- * Copyright contributors to the Hyperledgendary Full Stack Asset Transfer Guide project
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-import { ChaincodeEvent, checkpointers, Gateway } from '@hyperledger/fabric-gateway';
-import * as path from 'path';
-import { CHAINCODE_NAME, CHANNEL_NAME } from '../config';
-import { Asset } from '../contract';
-import { assertDefined } from '../utils';
-import { TextDecoder } from 'util';
-
-const axios = require('axios');
-const utf8Decoder = new TextDecoder();
-
-const checkpointFile = path.resolve(process.env.CHECKPOINT_FILE ?? 'checkpoint.json');
-
-const startBlock = BigInt(0);
-
-// Webhook / bot display names for create
-const createUsername = 'King Conga';
-const createAvatar = 'https://avatars.githubusercontent.com/u/49026922?s=200&v=4';
-
-const transferUsername = createUsername;
-const transferAvatar = createAvatar;
-
-const deleteUsername = createUsername;
-const deleteAvatar = createAvatar;
-
-export default async function main(gateway: Gateway): Promise {
- const webhookURL = assertDefined(process.env['WEBHOOK_URL'], () => { return 'WEBHOOK_URL is not defined in the env' });
- const network = gateway.getNetwork(CHANNEL_NAME);
- const checkpointer = await checkpointers.file(checkpointFile);
-
- console.log(`Connecting to #discord webhook ${webhookURL}`);
- console.log(`Starting event discording from block ${checkpointer.getBlockNumber() ?? startBlock}`);
- console.log('Last processed transaction ID within block:', checkpointer.getTransactionId());
-
- const events = await network.getChaincodeEvents(CHAINCODE_NAME, {
- checkpoint: checkpointer,
- startBlock, // Used only if there is no checkpoint block number
- });
-
- try {
- for await (const event of events) {
- await discord(webhookURL, event);
-
- await checkpointer.checkpointChaincodeEvent(event)
-
- // Slow down the event iterator to avoid rate limitations imposed by discord.
- // This could be improved to catch the "try again" error from discord and resubmit the event before
- // checkpointing the iterator.
- await new Promise(resolve => setTimeout(resolve, 1000));
- }
- } finally {
- events.close();
- }
-}
-
-// Relay a quick message to the discord webhook to indicate the transaction has been processed.
-async function discord(webhookURL: string, event: ChaincodeEvent): Promise {
-
- const asset = parseJson(event.payload);
- console.log(`\n<-- Chaincode event received: ${event.eventName}: `, asset);
-
- // const message = boringLogMessage(event, asset);
- const message = splashyShoutMessage(event, asset);
-
- deliverMessage(webhookURL, message);
-}
-
-// Send an event to a discord webhook.
-async function deliverMessage(webhookURL: string, message: any): Promise {
- console.log('--> Sending to discord webhook: ' + webhookURL);
- console.log(JSON.stringify(message));
-
- try {
- await axios.post(webhookURL, message);
-
- } catch (error) {
- console.log(error);
- }
-}
-
-function boringLogMessage(event: ChaincodeEvent, asset: Asset): any {
- const owner = ownerNickname(asset);
- const text = format(event, asset, owner);
-
- return {
- username: 'Ledger Troll',
- // avatar_url: avatarURL,
- content: text,
- }
-}
-
-function splashyShoutMessage(event: ChaincodeEvent, asset: Asset): any {
-
- const owner:any = JSON.parse(asset.Owner);
-
- if (event.eventName == 'CreateAsset') {
- return {
- username: createUsername,
- avatar_url: createAvatar,
- content: `${bold(owner.user)} has caught a wild ${bold(asset.ID)}!` + getRandomEmoji(),
- embeds: [
- {
- title: `${owner.org}`,
- image: {
- // an actual conga comic (sometimes png and sometimes jpg)
- // url: `https://congacomic.github.io/assets/img/blockheight-${offset}.png`
- url: `https://github.com/hyperledgendary/full-stack-asset-transfer-guide/blob/main/applications/conga-cards/assets/${asset.ID}.png?raw=true`
- }
- }
- ],
- };
- }
-
- if (event.eventName == 'TransferAsset') {
- return {
- username: transferUsername,
- avatar_url: transferAvatar,
- content: `${bold(owner.user)} is now the owner of ${bold(asset.ID)}: ✈️ ${snippet(JSON.stringify(asset, null, 2))}`,
- };
- }
-
- if (event.eventName == 'DeletaAsset') {
- return {
- username: deleteUsername,
- avatar_url: deleteAvatar,
- content: `${bold(asset.ID)} ran away from ${bold(owner.user)}! 😮`,
- };
- }
-
- return {};
-}
-
-function format(event: ChaincodeEvent, asset: Asset, owner: string): string {
- return `${quote(event.transactionId)} ${italic(event.eventName)}(${bold(asset.ID)}, ${owner})`;
-}
-
-function parseJson(jsonBytes: Uint8Array): Asset {
- const json = utf8Decoder.decode(jsonBytes);
- return JSON.parse(json);
-}
-
-function quote(s: string): string {
- return `\`${s}\``
-}
-
-function italic(s: string): string {
- return `_${s}_`;
-}
-
-function bold(s: string) {
- return `**${s}**`;
-}
-
-function snippet(s: string) {
- return "```" + s + "```";
-}
-
-function ownerNickname(asset: Asset): string {
- const owner:any = JSON.parse(asset.Owner);
-
- return `${owner.org}, ${owner.user}`;
-}
-
-// https://github.com/discord/discord-example-app/blob/main/utils.js#L43
-// Simple method that returns a random emoji from list
-function getRandomEmoji(): string {
- const emojiList = ['😭','😄','😌','🤓','😎','😤','🤖','😶🌫', '🌏','📸','💿','👋','🌊','✨'];
- return emojiList[Math.floor(Math.random() * emojiList.length)];
-}
-
-
diff --git a/full-stack-asset-transfer-guide/applications/conga-cards/src/commands/getAllAssets.ts b/full-stack-asset-transfer-guide/applications/conga-cards/src/commands/getAllAssets.ts
deleted file mode 100644
index 9b095dc4..00000000
--- a/full-stack-asset-transfer-guide/applications/conga-cards/src/commands/getAllAssets.ts
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright contributors to the Hyperledgendary Full Stack Asset Transfer Guide project
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-
-import { Gateway } from '@hyperledger/fabric-gateway';
-import { CHAINCODE_NAME, CHANNEL_NAME } from '../config';
-import { AssetTransfer } from '../contract';
-
-export default async function main(gateway: Gateway): Promise {
- const network = gateway.getNetwork(CHANNEL_NAME);
- const contract = network.getContract(CHAINCODE_NAME);
-
- const smartContract = new AssetTransfer(contract);
- const assets = await smartContract.getAllAssets();
-
- const assetsJson = JSON.stringify(assets, undefined, 2);
- assetsJson.split('\n').forEach(line => console.log(line)); // Write line-by-line to avoid truncation
-}
diff --git a/full-stack-asset-transfer-guide/applications/conga-cards/src/commands/index.ts b/full-stack-asset-transfer-guide/applications/conga-cards/src/commands/index.ts
deleted file mode 100644
index aee38680..00000000
--- a/full-stack-asset-transfer-guide/applications/conga-cards/src/commands/index.ts
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Copyright contributors to the Hyperledgendary Full Stack Asset Transfer Guide project
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-
-import { Gateway } from '@hyperledger/fabric-gateway';
-import create from './create';
-import deleteCommand from './delete';
-import discord from './discord';
-import getAllAssets from './getAllAssets';
-import read from './read';
-import transfer from './transfer';
-
-export type Command = (gateway: Gateway, args: string[]) => Promise;
-
-export const commands: Record = {
- create,
- delete: deleteCommand,
- discord,
- getAllAssets,
- read,
- transfer,
-};
diff --git a/full-stack-asset-transfer-guide/applications/conga-cards/src/commands/read.ts b/full-stack-asset-transfer-guide/applications/conga-cards/src/commands/read.ts
deleted file mode 100644
index a101fb07..00000000
--- a/full-stack-asset-transfer-guide/applications/conga-cards/src/commands/read.ts
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright contributors to the Hyperledgendary Full Stack Asset Transfer Guide project
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-
-import { Gateway } from '@hyperledger/fabric-gateway';
-import { CHAINCODE_NAME, CHANNEL_NAME } from '../config';
-import { AssetTransfer } from '../contract';
-import { assertDefined } from '../utils';
-
-export default async function main(gateway: Gateway, args: string[]): Promise {
- const assetId = assertDefined(args[0], 'Arguments: ');
-
- const network = gateway.getNetwork(CHANNEL_NAME);
- const contract = network.getContract(CHAINCODE_NAME);
-
- const smartContract = new AssetTransfer(contract);
- const asset = await smartContract.readAsset(assetId);
-
- const assetsJson = JSON.stringify(asset, undefined, 2);
- console.log(assetsJson);
-}
diff --git a/full-stack-asset-transfer-guide/applications/conga-cards/src/commands/transfer.ts b/full-stack-asset-transfer-guide/applications/conga-cards/src/commands/transfer.ts
deleted file mode 100644
index bdfd532e..00000000
--- a/full-stack-asset-transfer-guide/applications/conga-cards/src/commands/transfer.ts
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright contributors to the Hyperledgendary Full Stack Asset Transfer Guide project
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-
-import { Gateway } from '@hyperledger/fabric-gateway';
-import { CHAINCODE_NAME, CHANNEL_NAME } from '../config';
-import { AssetTransfer } from '../contract';
-import { assertAllDefined } from '../utils';
-
-export default async function main(gateway: Gateway, args: string[]): Promise {
- const [assetId, newOwner, newOwnerOrg] = assertAllDefined([args[0], args[1], args[2]], 'Arguments: ');
-
- const network = gateway.getNetwork(CHANNEL_NAME);
- const contract = network.getContract(CHAINCODE_NAME);
-
- const smartContract = new AssetTransfer(contract);
- await smartContract.transferAsset(assetId, newOwner, newOwnerOrg);
-}
diff --git a/full-stack-asset-transfer-guide/applications/conga-cards/src/config.ts b/full-stack-asset-transfer-guide/applications/conga-cards/src/config.ts
deleted file mode 100644
index e6b45f7f..00000000
--- a/full-stack-asset-transfer-guide/applications/conga-cards/src/config.ts
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright contributors to the Hyperledgendary Full Stack Asset Transfer Guide project
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-
-import { resolve } from 'path';
-import { assertDefined } from './utils';
-
-export const GATEWAY_ENDPOINT = assertEnv('ENDPOINT');
-export const MSP_ID = assertEnv('MSP_ID');
-export const CLIENT_CERT_PATH = resolve(assertEnv('CERTIFICATE'));
-export const PRIVATE_KEY_PATH = resolve(assertEnv('PRIVATE_KEY'));
-export const TLS_CERT_PATH = resolvePathIfPresent(process.env.TLS_CERT);
-export const CHANNEL_NAME = process.env.CHANNEL_NAME ?? 'mychannel';
-export const CHAINCODE_NAME = process.env.CHAINCODE_NAME ?? 'asset-transfer';
-
-// Gateway peer SSL host name override.
-export const HOST_ALIAS = process.env.HOST_ALIAS;
-
-function assertEnv(envName: string): string {
- return assertDefined(process.env[envName], () => {
- console.error('The following environment variables must be set:' +
- '\n ENDPOINT - Endpoint address of the gateway service' +
- '\n MSP_ID - User\'s organization Member Services Provider ID' +
- '\n CERTIFICATE - User\'s certificate file' +
- '\n PRIVATE_KEY - User\'s private key file' +
- '\n' +
- '\nThe following environment variables are optional:' +
- '\n CHANNEL_NAME - Channel to which the chaincode is deployed' +
- '\n CHAINCODE_NAME - Channel to which the chaincode is deployed' +
- '\n TLS_CERT - TLS CA root certificate (only if using TLS and private CA)' +
- '\n HOST_ALIAS - TLS hostname override (only if TLS cert does not match endpoint)' +
- '\n');
- return `Environment variable ${envName} not set`;
- });
-}
-
-function resolvePathIfPresent(path: string | undefined): string | undefined {
- if (path == undefined) {
- return undefined;
- }
-
- return resolve(path);
-}
diff --git a/full-stack-asset-transfer-guide/applications/conga-cards/src/connect.ts b/full-stack-asset-transfer-guide/applications/conga-cards/src/connect.ts
deleted file mode 100644
index d34147a5..00000000
--- a/full-stack-asset-transfer-guide/applications/conga-cards/src/connect.ts
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Copyright contributors to the Hyperledgendary Full Stack Asset Transfer Guide project
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-
-import * as grpc from '@grpc/grpc-js';
-import { connect, Gateway, hash, Identity, Signer, signers } from '@hyperledger/fabric-gateway';
-import * as crypto from 'crypto';
-import * as fs from 'fs';
-import * as path from 'path';
-import { CLIENT_CERT_PATH, GATEWAY_ENDPOINT, HOST_ALIAS, MSP_ID, PRIVATE_KEY_PATH, TLS_CERT_PATH } from './config';
-
-export async function newGrpcConnection(): Promise {
- if (TLS_CERT_PATH) {
- const tlsRootCert = await fs.promises.readFile(TLS_CERT_PATH);
- const tlsCredentials = grpc.credentials.createSsl(tlsRootCert);
- return new grpc.Client(GATEWAY_ENDPOINT, tlsCredentials, newGrpcClientOptions());
- }
-
- return new grpc.Client(GATEWAY_ENDPOINT, grpc.ChannelCredentials.createInsecure());
-}
-
-function newGrpcClientOptions(): grpc.ClientOptions {
- const result: grpc.ClientOptions = {};
- if (HOST_ALIAS) {
- result['grpc.ssl_target_name_override'] = HOST_ALIAS; // Only required if server TLS cert does not match the endpoint address we use
- }
- return result;
-}
-
-export async function newGatewayConnection(client: grpc.Client): Promise {
- return connect({
- client,
- identity: await newIdentity(),
- signer: await newSigner(),
- hash: hash.sha256,
- // Default timeouts for different gRPC calls
- evaluateOptions: () => {
- return { deadline: Date.now() + 5000 }; // 5 seconds
- },
- endorseOptions: () => {
- return { deadline: Date.now() + 15000 }; // 15 seconds
- },
- submitOptions: () => {
- return { deadline: Date.now() + 5000 }; // 5 seconds
- },
- commitStatusOptions: () => {
- return { deadline: Date.now() + 60000 }; // 1 minute
- },
- });
-}
-
-async function newIdentity(): Promise {
- const certPath = path.resolve(CLIENT_CERT_PATH);
- const credentials = await fs.promises.readFile(certPath);
-
- return { mspId: MSP_ID, credentials };
-}
-
-async function newSigner(): Promise {
- const keyPath = path.resolve(PRIVATE_KEY_PATH);
- const privateKeyPem = await fs.promises.readFile(keyPath);
- const privateKey = crypto.createPrivateKey(privateKeyPem);
-
- return signers.newPrivateKeySigner(privateKey);
-}
diff --git a/full-stack-asset-transfer-guide/applications/conga-cards/src/contract.ts b/full-stack-asset-transfer-guide/applications/conga-cards/src/contract.ts
deleted file mode 100644
index 3dcb92b3..00000000
--- a/full-stack-asset-transfer-guide/applications/conga-cards/src/contract.ts
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Copyright contributors to the Hyperledgendary Full Stack Asset Transfer Guide project
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-
-import { CommitError, Contract, StatusCode } from '@hyperledger/fabric-gateway';
-import { TextDecoder } from 'util';
-
-const RETRIES = 2;
-
-const utf8Decoder = new TextDecoder();
-
-export interface Asset {
- ID: string;
- Color: string;
- Size: number;
- Owner: string;
- AppraisedValue: number;
-}
-
-export type AssetCreate = Omit & Partial;
-export type AssetUpdate = Pick & Partial>;
-
-/**
- * AssetTransfer presents the smart contract in a form appropriate to the business application. Internally it uses the
- * Fabric Gateway client API to invoke transaction functions, and deals with the translation between the business
- * application and API representation of parameters and return values.
- */
-export class AssetTransfer {
- readonly #contract: Contract;
-
- constructor(contract: Contract) {
- this.#contract = contract;
- }
-
- async createAsset(asset: AssetCreate): Promise {
- await this.#contract.submit('CreateAsset', {
- arguments: [JSON.stringify(asset)],
- });
- }
-
- async getAllAssets(): Promise {
- const result = await this.#contract.evaluate('GetAllAssets');
- if (result.length === 0) {
- return [];
- }
-
- return JSON.parse(utf8Decoder.decode(result)) as Asset[];
- }
-
- async readAsset(id: string): Promise {
- const result = await this.#contract.evaluate('ReadAsset', {
- arguments: [id],
- });
- return JSON.parse(utf8Decoder.decode(result)) as Asset;
- }
-
- async updateAsset(asset: AssetUpdate): Promise {
- await submitWithRetry(() => this.#contract.submit('UpdateAsset', {
- arguments: [JSON.stringify(asset)],
- }));
- }
-
- async deleteAsset(id: string): Promise {
- await submitWithRetry(() => this.#contract.submit('DeleteAsset', {
- arguments: [id],
- }));
- }
-
- async assetExists(id: string): Promise {
- const result = await this.#contract.evaluate('AssetExists', {
- arguments: [id],
- });
- return utf8Decoder.decode(result).toLowerCase() === 'true';
- }
-
- async transferAsset(id: string, newOwner: string, newOwnerOrg: string): Promise {
- await submitWithRetry(() => this.#contract.submit('TransferAsset', {
- arguments: [id, newOwner, newOwnerOrg],
- }));
- }
-}
-
-async function submitWithRetry(submit: () => Promise): Promise {
- let lastError: unknown | undefined;
-
- for (let retryCount = 0; retryCount < RETRIES; retryCount++) {
- try {
- return await submit();
- } catch (err: unknown) {
- lastError = err;
- if (err instanceof CommitError) {
- // Transaction failed validation and did not update the ledger. Handle specific transaction validation codes.
- if (err.code === StatusCode.MVCC_READ_CONFLICT) {
- continue; // Retry
- }
- }
- break; // Failure -- don't retry
- }
- }
-
- throw lastError;
-}
diff --git a/full-stack-asset-transfer-guide/applications/conga-cards/src/expectedError.ts b/full-stack-asset-transfer-guide/applications/conga-cards/src/expectedError.ts
deleted file mode 100644
index 3b1466b4..00000000
--- a/full-stack-asset-transfer-guide/applications/conga-cards/src/expectedError.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-/*
- * Copyright contributors to the Hyperledgendary Full Stack Asset Transfer Guide project
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-
-export class ExpectedError extends Error {
- constructor(message?: string) {
- super(message);
- this.name = ExpectedError.name;
- }
-}
diff --git a/full-stack-asset-transfer-guide/applications/conga-cards/src/utils.ts b/full-stack-asset-transfer-guide/applications/conga-cards/src/utils.ts
deleted file mode 100644
index e9b1e594..00000000
--- a/full-stack-asset-transfer-guide/applications/conga-cards/src/utils.ts
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright contributors to the Hyperledgendary Full Stack Asset Transfer Guide project
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-
-import { inspect, TextDecoder } from 'util';
-
-const utf8Decoder = new TextDecoder();
-
-/**
- * Pick a random element from an array.
- * @param values Candidate elements.
- */
-export function randomElement(values: T[]): T {
- return values[randomInt(values.length)];
-}
-
-/**
- * Generate a random integer in the range 0 to max - 1.
- * @param max Maximum value (exclusive).
- */
-export function randomInt(max: number): number {
- return Math.floor(Math.random() * max);
-}
-
-/**
- * Pick a random element from an array, excluding the current value.
- * @param values Candidate elements.
- * @param currentValue Value to avoid.
- */
-export function differentElement(values: T[], currentValue: T): T {
- const candidateValues = values.filter(value => value !== currentValue);
- return randomElement(candidateValues);
-}
-
-/**
- * Wait for all promises to complete, then throw an Error only if any of the promises were rejected.
- * @param promises Promises to be awaited.
- */
-export async function allFulfilled(promises: Promise[]): Promise {
- const results = await Promise.allSettled(promises);
- const failures = results
- .map(result => result.status === 'rejected' && result.reason as unknown)
- .filter(reason => !!reason)
- .map(reason => inspect(reason));
-
- if (failures.length > 0) {
- const failMessages = '- ' + failures.join('\n- ');
- throw new Error(`${failures.length} failures:\n${failMessages}\n`);
- }
-}
-
-export type PrintView = {
- [K in keyof T]: T[K] extends Uint8Array ? string : T[K];
-};
-
-export function printable(event: T): PrintView {
- return Object.fromEntries(
- Object.entries(event).map(([k, v]) => [k, v instanceof Uint8Array ? utf8Decoder.decode(v) : v])
- ) as PrintView;
-}
-
-export function assertAllDefined(values: (T | undefined)[], message: string | (() => string)): T[] {
- values.forEach(value => assertDefined(value, message));
- return values as T[];
-}
-
-export function assertDefined(value: T | undefined, message: string | (() => string)): T {
- if (value == undefined) {
- throw new Error(typeof message === 'string' ? message : message());
- }
-
- return value;
-}
diff --git a/full-stack-asset-transfer-guide/applications/conga-cards/tsconfig.json b/full-stack-asset-transfer-guide/applications/conga-cards/tsconfig.json
deleted file mode 100644
index 891d7c74..00000000
--- a/full-stack-asset-transfer-guide/applications/conga-cards/tsconfig.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- "$schema": "https://json.schemastore.org/tsconfig",
- "extends": "@tsconfig/node18/tsconfig.json",
- "compilerOptions": {
- "declaration": true,
- "declarationMap": true,
- "sourceMap": true,
- "outDir": "dist",
- "rootDir": "src",
- "noUnusedLocals": false,
- "noImplicitReturns": true
- },
- "include": [
- "src/"
- ],
- "exclude": [
- "src/**/*.spec.ts"
- ]
-}
diff --git a/full-stack-asset-transfer-guide/applications/frontend/.browserslistrc b/full-stack-asset-transfer-guide/applications/frontend/.browserslistrc
deleted file mode 100644
index 4f9ac269..00000000
--- a/full-stack-asset-transfer-guide/applications/frontend/.browserslistrc
+++ /dev/null
@@ -1,16 +0,0 @@
-# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
-# For additional information regarding the format and rule options, please see:
-# https://github.com/browserslist/browserslist#queries
-
-# For the full list of supported browsers by the Angular framework, please see:
-# https://angular.io/guide/browser-support
-
-# You can see what browsers were selected by your queries by running:
-# npx browserslist
-
-last 1 Chrome version
-last 1 Firefox version
-last 2 Edge major versions
-last 2 Safari major versions
-last 2 iOS major versions
-Firefox ESR
diff --git a/full-stack-asset-transfer-guide/applications/frontend/.editorconfig b/full-stack-asset-transfer-guide/applications/frontend/.editorconfig
deleted file mode 100644
index 59d9a3a3..00000000
--- a/full-stack-asset-transfer-guide/applications/frontend/.editorconfig
+++ /dev/null
@@ -1,16 +0,0 @@
-# Editor configuration, see https://editorconfig.org
-root = true
-
-[*]
-charset = utf-8
-indent_style = space
-indent_size = 2
-insert_final_newline = true
-trim_trailing_whitespace = true
-
-[*.ts]
-quote_type = single
-
-[*.md]
-max_line_length = off
-trim_trailing_whitespace = false
diff --git a/full-stack-asset-transfer-guide/applications/frontend/.gitignore b/full-stack-asset-transfer-guide/applications/frontend/.gitignore
deleted file mode 100644
index 0711527e..00000000
--- a/full-stack-asset-transfer-guide/applications/frontend/.gitignore
+++ /dev/null
@@ -1,42 +0,0 @@
-# See http://help.github.com/ignore-files/ for more about ignoring files.
-
-# Compiled output
-/dist
-/tmp
-/out-tsc
-/bazel-out
-
-# Node
-/node_modules
-npm-debug.log
-yarn-error.log
-
-# IDEs and editors
-.idea/
-.project
-.classpath
-.c9/
-*.launch
-.settings/
-*.sublime-workspace
-
-# Visual Studio Code
-.vscode/*
-!.vscode/settings.json
-!.vscode/tasks.json
-!.vscode/launch.json
-!.vscode/extensions.json
-.history/*
-
-# Miscellaneous
-/.angular/cache
-.sass-cache/
-/connect.lock
-/coverage
-/libpeerconnection.log
-testem.log
-/typings
-
-# System files
-.DS_Store
-Thumbs.db
diff --git a/full-stack-asset-transfer-guide/applications/frontend/Dockerfile b/full-stack-asset-transfer-guide/applications/frontend/Dockerfile
deleted file mode 100644
index b3d16aab..00000000
--- a/full-stack-asset-transfer-guide/applications/frontend/Dockerfile
+++ /dev/null
@@ -1,11 +0,0 @@
-# FROM node:14-alpine3.14 AS build
-# WORKDIR /app
-# COPY package.json /app
-# RUN npm install
-# CMD npm run build
-
-# COPY . /app
-# CMD [ "npm","run","prod" ]
-
-FROM nginx:alpine
-COPY /dist/frontend /usr/share/nginx/html
\ No newline at end of file
diff --git a/full-stack-asset-transfer-guide/applications/frontend/README.md b/full-stack-asset-transfer-guide/applications/frontend/README.md
deleted file mode 100644
index 5d96edcf..00000000
--- a/full-stack-asset-transfer-guide/applications/frontend/README.md
+++ /dev/null
@@ -1,18 +0,0 @@
-local build
-
-npm install
-npm start
-
-
-k8s deployment
-Step-1 Prodction build
-ng build
-Step-2 Build docker image & tag
-docker build -t localhost:5000/frontend .
-Step-3 Push image to local registary
-docker push localhost:5000/frontend
-Step-4 deploy to k8s
-kubectl apply -f deployment.yaml -n test-network
-
-Step-5 Navigate to frontend using below url
-https://frontend.localho.st/
\ No newline at end of file
diff --git a/full-stack-asset-transfer-guide/applications/frontend/angular.json b/full-stack-asset-transfer-guide/applications/frontend/angular.json
deleted file mode 100644
index 63df0214..00000000
--- a/full-stack-asset-transfer-guide/applications/frontend/angular.json
+++ /dev/null
@@ -1,112 +0,0 @@
-{
- "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
- "version": 1,
- "newProjectRoot": "projects",
- "projects": {
- "frontend": {
- "projectType": "application",
- "schematics": {
- "@schematics/angular:component": {
- "style": "scss"
- }
- },
- "root": "",
- "sourceRoot": "src",
- "prefix": "app",
- "architect": {
- "build": {
- "builder": "@angular-devkit/build-angular:browser",
- "options": {
- "outputPath": "dist/frontend",
- "index": "src/index.html",
- "main": "src/main.ts",
- "polyfills": "src/polyfills.ts",
- "tsConfig": "tsconfig.app.json",
- "inlineStyleLanguage": "scss",
- "assets": [
- "src/favicon.ico",
- "src/assets"
- ],
- "styles": [
- "./node_modules/@angular/material/prebuilt-themes/indigo-pink.css",
- "src/styles.scss"
- ],
- "scripts": []
- },
- "configurations": {
- "production": {
- "budgets": [
- {
- "type": "initial",
- "maximumWarning": "500kb",
- "maximumError": "1mb"
- },
- {
- "type": "anyComponentStyle",
- "maximumWarning": "2kb",
- "maximumError": "4kb"
- }
- ],
- "fileReplacements": [
- {
- "replace": "src/environments/environment.ts",
- "with": "src/environments/environment.prod.ts"
- }
- ],
- "outputHashing": "all"
- },
- "development": {
- "buildOptimizer": false,
- "optimization": false,
- "vendorChunk": true,
- "extractLicenses": false,
- "sourceMap": true,
- "namedChunks": true
- }
- },
- "defaultConfiguration": "production"
- },
- "serve": {
- "builder": "@angular-devkit/build-angular:dev-server",
- "configurations": {
- "production": {
- "browserTarget": "frontend:build:production"
- },
- "development": {
- "browserTarget": "frontend:build:development"
- }
- },
- "defaultConfiguration": "development"
- },
- "extract-i18n": {
- "builder": "@angular-devkit/build-angular:extract-i18n",
- "options": {
- "browserTarget": "frontend:build"
- }
- },
- "test": {
- "builder": "@angular-devkit/build-angular:karma",
- "options": {
- "main": "src/test.ts",
- "polyfills": "src/polyfills.ts",
- "tsConfig": "tsconfig.spec.json",
- "karmaConfig": "karma.conf.js",
- "inlineStyleLanguage": "scss",
- "assets": [
- "src/favicon.ico",
- "src/assets"
- ],
- "styles": [
- "./node_modules/@angular/material/prebuilt-themes/indigo-pink.css",
- "src/styles.scss"
- ],
- "scripts": []
- }
- }
- }
- }
- },
- "cli": {
- "analytics": "2231f71d-331b-4f3d-8391-0f5998405c1e"
- }
-}
diff --git a/full-stack-asset-transfer-guide/applications/frontend/karma.conf.js b/full-stack-asset-transfer-guide/applications/frontend/karma.conf.js
deleted file mode 100644
index 36356397..00000000
--- a/full-stack-asset-transfer-guide/applications/frontend/karma.conf.js
+++ /dev/null
@@ -1,44 +0,0 @@
-// Karma configuration file, see link for more information
-// https://karma-runner.github.io/1.0/config/configuration-file.html
-
-module.exports = function (config) {
- config.set({
- basePath: '',
- frameworks: ['jasmine', '@angular-devkit/build-angular'],
- plugins: [
- require('karma-jasmine'),
- require('karma-chrome-launcher'),
- require('karma-jasmine-html-reporter'),
- require('karma-coverage'),
- require('@angular-devkit/build-angular/plugins/karma')
- ],
- client: {
- jasmine: {
- // you can add configuration options for Jasmine here
- // the possible options are listed at https://jasmine.github.io/api/edge/Configuration.html
- // for example, you can disable the random execution with `random: false`
- // or set a specific seed with `seed: 4321`
- },
- clearContext: false // leave Jasmine Spec Runner output visible in browser
- },
- jasmineHtmlReporter: {
- suppressAll: true // removes the duplicated traces
- },
- coverageReporter: {
- dir: require('path').join(__dirname, './coverage/frontend'),
- subdir: '.',
- reporters: [
- { type: 'html' },
- { type: 'text-summary' }
- ]
- },
- reporters: ['progress', 'kjhtml'],
- port: 9876,
- colors: true,
- logLevel: config.LOG_INFO,
- autoWatch: true,
- browsers: ['Chrome'],
- singleRun: false,
- restartOnFileChange: true
- });
-};
diff --git a/full-stack-asset-transfer-guide/applications/frontend/package.json b/full-stack-asset-transfer-guide/applications/frontend/package.json
deleted file mode 100644
index 29120e1f..00000000
--- a/full-stack-asset-transfer-guide/applications/frontend/package.json
+++ /dev/null
@@ -1,40 +0,0 @@
-{
- "name": "frontend",
- "version": "0.0.0",
- "scripts": {
- "ng": "ng",
- "start": "ng serve",
- "build": "ng build",
- "watch": "ng build --watch --configuration development",
- "test": "ng test"
- },
- "private": true,
- "dependencies": {
- "@angular/animations": "^14.1.0",
- "@angular/cdk": "^14.2.0",
- "@angular/common": "^14.1.0",
- "@angular/compiler": "^14.1.0",
- "@angular/core": "^14.1.0",
- "@angular/forms": "^14.1.0",
- "@angular/material": "^14.2.0",
- "@angular/platform-browser": "^14.1.0",
- "@angular/platform-browser-dynamic": "^14.1.0",
- "@angular/router": "^14.1.0",
- "rxjs": "~7.5.0",
- "tslib": "^2.3.0",
- "zone.js": "~0.11.4"
- },
- "devDependencies": {
- "@angular-devkit/build-angular": "^14.1.1",
- "@angular/cli": "~14.1.1",
- "@angular/compiler-cli": "^14.1.0",
- "@types/jasmine": "~4.0.0",
- "jasmine-core": "~4.2.0",
- "karma": "~6.4.0",
- "karma-chrome-launcher": "~3.1.0",
- "karma-coverage": "~2.2.0",
- "karma-jasmine": "~5.1.0",
- "karma-jasmine-html-reporter": "~2.0.0",
- "typescript": "~4.7.2"
- }
-}
\ No newline at end of file
diff --git a/full-stack-asset-transfer-guide/applications/frontend/screenshots/Create.png b/full-stack-asset-transfer-guide/applications/frontend/screenshots/Create.png
deleted file mode 100644
index 2603c4c8..00000000
Binary files a/full-stack-asset-transfer-guide/applications/frontend/screenshots/Create.png and /dev/null differ
diff --git a/full-stack-asset-transfer-guide/applications/frontend/screenshots/list.png b/full-stack-asset-transfer-guide/applications/frontend/screenshots/list.png
deleted file mode 100644
index 807721ee..00000000
Binary files a/full-stack-asset-transfer-guide/applications/frontend/screenshots/list.png and /dev/null differ
diff --git a/full-stack-asset-transfer-guide/applications/frontend/src/app/app-routing.module.ts b/full-stack-asset-transfer-guide/applications/frontend/src/app/app-routing.module.ts
deleted file mode 100644
index 02972627..00000000
--- a/full-stack-asset-transfer-guide/applications/frontend/src/app/app-routing.module.ts
+++ /dev/null
@@ -1,10 +0,0 @@
-import { NgModule } from '@angular/core';
-import { RouterModule, Routes } from '@angular/router';
-
-const routes: Routes = [];
-
-@NgModule({
- imports: [RouterModule.forRoot(routes)],
- exports: [RouterModule]
-})
-export class AppRoutingModule { }
diff --git a/full-stack-asset-transfer-guide/applications/frontend/src/app/app.component.html b/full-stack-asset-transfer-guide/applications/frontend/src/app/app.component.html
deleted file mode 100644
index 252123ea..00000000
--- a/full-stack-asset-transfer-guide/applications/frontend/src/app/app.component.html
+++ /dev/null
@@ -1,66 +0,0 @@
-Asset (Create,Edit,Delete,Transfer)
-
-
- Assets
-
-
-
-
-
-
-
-
-
-
-
- No. |
- {{ (i+1) + (paginator.pageIndex *
- paginator.pageSize) }} |
-
-
- Id |
- {{element.ID}} |
-
-
- Color |
- {{element.Color}} |
-
-
- Owner |
- {{element.Owner}} |
-
-
- Appraised Value |
- {{element.AppraisedValue}} |
-
-
- Size |
- {{element.Size}} |
-
-
- Trasnfer |
-
- arrow_forward
- |
-
-
- Edit |
-
- edit
- |
-
-
- Delete |
-
- delete
- |
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/full-stack-asset-transfer-guide/applications/frontend/src/app/app.component.scss b/full-stack-asset-transfer-guide/applications/frontend/src/app/app.component.scss
deleted file mode 100644
index acd75952..00000000
--- a/full-stack-asset-transfer-guide/applications/frontend/src/app/app.component.scss
+++ /dev/null
@@ -1,6 +0,0 @@
-.layout{
- margin: 40px 10%;
-}
-.search{
- float: right;
-}
\ No newline at end of file
diff --git a/full-stack-asset-transfer-guide/applications/frontend/src/app/app.component.spec.ts b/full-stack-asset-transfer-guide/applications/frontend/src/app/app.component.spec.ts
deleted file mode 100644
index 74b5b3eb..00000000
--- a/full-stack-asset-transfer-guide/applications/frontend/src/app/app.component.spec.ts
+++ /dev/null
@@ -1,35 +0,0 @@
-import { TestBed } from '@angular/core/testing';
-import { RouterTestingModule } from '@angular/router/testing';
-import { AppComponent } from './app.component';
-
-describe('AppComponent', () => {
- beforeEach(async () => {
- await TestBed.configureTestingModule({
- imports: [
- RouterTestingModule
- ],
- declarations: [
- AppComponent
- ],
- }).compileComponents();
- });
-
- it('should create the app', () => {
- const fixture = TestBed.createComponent(AppComponent);
- const app = fixture.componentInstance;
- expect(app).toBeTruthy();
- });
-
- it(`should have as title 'frontend'`, () => {
- const fixture = TestBed.createComponent(AppComponent);
- const app = fixture.componentInstance;
- expect(app.title).toEqual('frontend');
- });
-
- it('should render title', () => {
- const fixture = TestBed.createComponent(AppComponent);
- fixture.detectChanges();
- const compiled = fixture.nativeElement as HTMLElement;
- expect(compiled.querySelector('.content span')?.textContent).toContain('frontend app is running!');
- });
-});
diff --git a/full-stack-asset-transfer-guide/applications/frontend/src/app/app.component.ts b/full-stack-asset-transfer-guide/applications/frontend/src/app/app.component.ts
deleted file mode 100644
index c26dc0c1..00000000
--- a/full-stack-asset-transfer-guide/applications/frontend/src/app/app.component.ts
+++ /dev/null
@@ -1,82 +0,0 @@
-import { HttpClient, HttpHeaders } from '@angular/common/http';
-import { Component, OnInit, ViewChild } from '@angular/core';
-import { MatDialog } from '@angular/material/dialog';
-import { MatPaginator } from '@angular/material/paginator';
-import { MatSnackBar } from '@angular/material/snack-bar';
-import { MatSort } from '@angular/material/sort';
-import { MatTableDataSource } from '@angular/material/table';
-import { AssetDialogComponent } from './asset-dialog/asset-dialog.component';
-import { URLS } from './urls';
-
-@Component({
- selector: 'app-root',
- templateUrl: './app.component.html',
- styleUrls: ['./app.component.scss']
-})
-export class AppComponent implements OnInit {
-
- @ViewChild(MatSort, { static: false }) sort!: MatSort ;
- @ViewChild(MatPaginator, { static: true }) paginator!: MatPaginator;
- dataSource = new MatTableDataSource();
- httpOptions;
- title = 'frontend';
- assets = [];
- displayedColumns: String[] = ["position", "id",'owner','color','appraisedValue',"size" ,'transfer','edit','delete'];
- constructor(private _http: HttpClient, private dialog: MatDialog,private snackBar:MatSnackBar) {
- this.httpOptions = {
- headers: new HttpHeaders({
- 'Content-Type': 'application/json',
- 'Access-Control-Allow-Origin': '*'
-
- })
- }
- this._http.get(URLS.LIST,this.httpOptions).subscribe(data => {
- this.dataSource.data = data;
- })
- }
- ngOnInit() {
-
- }
- editRow(asset:any,index:number){
- const dialogRef = this.dialog.open(AssetDialogComponent, {
- width: '500px', height: '100vh',position:{right:'0'},data:asset
-
- });
- dialogRef.afterClosed().subscribe(result => {
- if (result) {
- this.dataSource.data[index]=(result)
- this.dataSource._updateChangeSubscription();
- }
- });
- }
- delete(asset:any,index:number){
- this._http.post(URLS.DELETE,JSON.stringify({"id":asset.ID}),this.httpOptions).subscribe((data:any) => {
- console.log(data);
- this.dataSource.data.splice(index,1)
- this.dataSource._updateChangeSubscription();
- this.snackBar.open(asset.ID+ ' deleted', '', {duration:1000
- });
- })
- }
- addNewAsset(){
- const dialogRef = this.dialog.open(AssetDialogComponent, {
- width: '500px', height: '100vh',position:{right:'0'},
-
- });
- dialogRef.afterClosed().subscribe(result => {
- if (result) {
- this.dataSource.data.push(result)
- this.dataSource._updateChangeSubscription();
- }
- });
- }
- applyFilter(event: Event) {
- const filterValue = (event.target as HTMLInputElement).value;
- this.dataSource.filter = filterValue.trim().toLowerCase();
- }
- ngAfterViewInit() {
- console.log('after ininti');
- this.dataSource.sort = this.sort;
- this.dataSource.paginator = this.paginator;
- }
-}
diff --git a/full-stack-asset-transfer-guide/applications/frontend/src/app/app.module.ts b/full-stack-asset-transfer-guide/applications/frontend/src/app/app.module.ts
deleted file mode 100644
index eb0ad4b7..00000000
--- a/full-stack-asset-transfer-guide/applications/frontend/src/app/app.module.ts
+++ /dev/null
@@ -1,32 +0,0 @@
-import { NgModule } from '@angular/core';
-import { BrowserModule } from '@angular/platform-browser';
-
-import { AppRoutingModule } from './app-routing.module';
-import { AppComponent } from './app.component';
-import { HttpClientModule } from '@angular/common/http';
-import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
-import { MatTableModule } from '@angular/material/table';
-import { MatInputModule } from '@angular/material/input';
-import { MatButtonModule } from '@angular/material/button';
-import { MatPaginatorModule } from '@angular/material/paginator';
-import { AssetDialogComponent } from './asset-dialog/asset-dialog.component';
-import { MatDialogModule } from '@angular/material/dialog';
-import { FormsModule, ReactiveFormsModule } from '@angular/forms';
-import { MatSnackBarModule } from '@angular/material/snack-bar';
-import { MatIconModule } from '@angular/material/icon';
-import { MatToolbarModule } from '@angular/material/toolbar';
-
-@NgModule({
- declarations: [
- AppComponent,
- AssetDialogComponent
- ],
- imports: [
- BrowserModule,
- AppRoutingModule, HttpClientModule, BrowserAnimationsModule, MatTableModule,MatInputModule,MatButtonModule,MatPaginatorModule,
- MatDialogModule,FormsModule, ReactiveFormsModule,MatSnackBarModule,MatIconModule,MatToolbarModule
- ],
- providers: [],
- bootstrap: [AppComponent]
-})
-export class AppModule { }
diff --git a/full-stack-asset-transfer-guide/applications/frontend/src/app/asset-dialog/asset-dialog.component.html b/full-stack-asset-transfer-guide/applications/frontend/src/app/asset-dialog/asset-dialog.component.html
deleted file mode 100644
index 87977d9d..00000000
--- a/full-stack-asset-transfer-guide/applications/frontend/src/app/asset-dialog/asset-dialog.component.html
+++ /dev/null
@@ -1,51 +0,0 @@
-
- highlight_off
-
-
\ No newline at end of file
diff --git a/full-stack-asset-transfer-guide/applications/frontend/src/app/asset-dialog/asset-dialog.component.scss b/full-stack-asset-transfer-guide/applications/frontend/src/app/asset-dialog/asset-dialog.component.scss
deleted file mode 100644
index f0845f1d..00000000
--- a/full-stack-asset-transfer-guide/applications/frontend/src/app/asset-dialog/asset-dialog.component.scss
+++ /dev/null
@@ -1,3 +0,0 @@
-.mat-form-field{
- width: 100% !important;
-}
\ No newline at end of file
diff --git a/full-stack-asset-transfer-guide/applications/frontend/src/app/asset-dialog/asset-dialog.component.spec.ts b/full-stack-asset-transfer-guide/applications/frontend/src/app/asset-dialog/asset-dialog.component.spec.ts
deleted file mode 100644
index 88866e94..00000000
--- a/full-stack-asset-transfer-guide/applications/frontend/src/app/asset-dialog/asset-dialog.component.spec.ts
+++ /dev/null
@@ -1,23 +0,0 @@
-import { ComponentFixture, TestBed } from '@angular/core/testing';
-
-import { AssetDialogComponent } from './asset-dialog.component';
-
-describe('AssetDialogComponent', () => {
- let component: AssetDialogComponent;
- let fixture: ComponentFixture;
-
- beforeEach(async () => {
- await TestBed.configureTestingModule({
- declarations: [ AssetDialogComponent ]
- })
- .compileComponents();
-
- fixture = TestBed.createComponent(AssetDialogComponent);
- component = fixture.componentInstance;
- fixture.detectChanges();
- });
-
- it('should create', () => {
- expect(component).toBeTruthy();
- });
-});
diff --git a/full-stack-asset-transfer-guide/applications/frontend/src/app/asset-dialog/asset-dialog.component.ts b/full-stack-asset-transfer-guide/applications/frontend/src/app/asset-dialog/asset-dialog.component.ts
deleted file mode 100644
index 1480bcc8..00000000
--- a/full-stack-asset-transfer-guide/applications/frontend/src/app/asset-dialog/asset-dialog.component.ts
+++ /dev/null
@@ -1,74 +0,0 @@
-import { Component, Inject, OnInit } from '@angular/core';
-import { FormGroup, FormControl } from '@angular/forms';
-import { MatSnackBar } from '@angular/material/snack-bar';
-import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
-import { Data } from '@angular/router';
-import { HttpClient, HttpHeaders } from '@angular/common/http';
-import { URLS } from '../urls';
-
-@Component({
- selector: 'app-asset-dialog',
- templateUrl: './asset-dialog.component.html',
- styleUrls: ['./asset-dialog.component.scss']
-})
-export class AssetDialogComponent implements OnInit {
- stores = [];
- isEdit: Boolean = false;
- aseet= { "Color": "", "AppraisedValue": "", "ID": "", "Size": "", "Owner": "" };
- buttonText = "Save";
- form = new FormGroup({
- Color: new FormControl(''),
- AppraisedValue: new FormControl(''),
- Owner: new FormControl(''),
- Size: new FormControl('')
- });
- httpOptions: any;
- data:any;
- constructor(public dialogRef: MatDialogRef,
- @Inject(MAT_DIALOG_DATA) public dialogdata: Data, private snackBar: MatSnackBar, private _http: HttpClient) {
- console.log(dialogdata);
- this.data=dialogdata;
- if (dialogdata) {
- var data = dialogdata;
- this.aseet.AppraisedValue = data['AppraisedValue'];
- this.aseet.Color = data['Color'];
- this.aseet.Size = data['Size'];
- this.aseet.ID = data['Id'];
- var owner = JSON.parse(data['Owner'])
- this.aseet.Owner = owner.user;
- }
-
- }
- ngOnInit() {
-
- }
-
- onSubmit() {
- console.log(this.form.value);
- this.httpOptions = {
- headers: new HttpHeaders({
- 'Content-Type': 'application/json',
- 'Access-Control-Allow-Origin': '*'
-
- })
- }
- if (this.data) {
- var request = { "Color": this.form.value.Color, "AppraisedValue": this.form.value.AppraisedValue, "ID": this.data.ID, "Size": this.form.value.Size, "Owner": { "org": "Org1MSP", "user": this.form.value.Owner } };
- this._http.post(URLS.UPDATE, JSON.stringify(request), this.httpOptions).subscribe((data: any) => {
- console.log(data);
- var response = { "Color": this.form.value.Color, "AppraisedValue": this.form.value.AppraisedValue, "ID": this.data.ID, "Size": this.form.value.Size, "Owner": JSON.stringify({ "org": "Org1MSP", "user": this.form.value.Owner }) };
- this.dialogRef.close(response)
- })
- }else{
- this._http.post(URLS.CREATE, JSON.stringify(this.form.value), this.httpOptions).subscribe((data: any) => {
- console.log(data);
- var response = { "Color": this.form.value.Color, "AppraisedValue": this.form.value.AppraisedValue, "ID": data.AssetId, "Size": this.form.value.Size, "Owner": JSON.stringify({ "org": "Org1MSP", "user": this.form.value.Owner }) };
- this.dialogRef.close(response)
- })
- }
-
- }
- close() {
- this.dialogRef.close();
- }
-}
\ No newline at end of file
diff --git a/full-stack-asset-transfer-guide/applications/frontend/src/app/urls.ts b/full-stack-asset-transfer-guide/applications/frontend/src/app/urls.ts
deleted file mode 100644
index 5e553a3f..00000000
--- a/full-stack-asset-transfer-guide/applications/frontend/src/app/urls.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-export class URLS {
- // private static IP = "http://localhost:8080/";
- private static IP = "https://restapi.localho.st/";
- public static LIST = URLS.IP + "list";
- public static CREATE = URLS.IP + "create";
- public static UPDATE = URLS.IP + "update";
- public static DELETE = URLS.IP + "delete";
-}
\ No newline at end of file
diff --git a/full-stack-asset-transfer-guide/applications/frontend/src/assets/.gitkeep b/full-stack-asset-transfer-guide/applications/frontend/src/assets/.gitkeep
deleted file mode 100644
index e69de29b..00000000
diff --git a/full-stack-asset-transfer-guide/applications/frontend/src/environments/environment.prod.ts b/full-stack-asset-transfer-guide/applications/frontend/src/environments/environment.prod.ts
deleted file mode 100644
index 3612073b..00000000
--- a/full-stack-asset-transfer-guide/applications/frontend/src/environments/environment.prod.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-export const environment = {
- production: true
-};
diff --git a/full-stack-asset-transfer-guide/applications/frontend/src/environments/environment.ts b/full-stack-asset-transfer-guide/applications/frontend/src/environments/environment.ts
deleted file mode 100644
index f56ff470..00000000
--- a/full-stack-asset-transfer-guide/applications/frontend/src/environments/environment.ts
+++ /dev/null
@@ -1,16 +0,0 @@
-// This file can be replaced during build by using the `fileReplacements` array.
-// `ng build` replaces `environment.ts` with `environment.prod.ts`.
-// The list of file replacements can be found in `angular.json`.
-
-export const environment = {
- production: false
-};
-
-/*
- * For easier debugging in development mode, you can import the following file
- * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`.
- *
- * This import should be commented out in production mode because it will have a negative impact
- * on performance if an error is thrown.
- */
-// import 'zone.js/plugins/zone-error'; // Included with Angular CLI.
diff --git a/full-stack-asset-transfer-guide/applications/frontend/src/favicon.ico b/full-stack-asset-transfer-guide/applications/frontend/src/favicon.ico
deleted file mode 100644
index 997406ad..00000000
Binary files a/full-stack-asset-transfer-guide/applications/frontend/src/favicon.ico and /dev/null differ
diff --git a/full-stack-asset-transfer-guide/applications/frontend/src/index.html b/full-stack-asset-transfer-guide/applications/frontend/src/index.html
deleted file mode 100644
index 41bf45ce..00000000
--- a/full-stack-asset-transfer-guide/applications/frontend/src/index.html
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-
- Frontend
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/full-stack-asset-transfer-guide/applications/frontend/src/main.ts b/full-stack-asset-transfer-guide/applications/frontend/src/main.ts
deleted file mode 100644
index c7b673cf..00000000
--- a/full-stack-asset-transfer-guide/applications/frontend/src/main.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-import { enableProdMode } from '@angular/core';
-import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
-
-import { AppModule } from './app/app.module';
-import { environment } from './environments/environment';
-
-if (environment.production) {
- enableProdMode();
-}
-
-platformBrowserDynamic().bootstrapModule(AppModule)
- .catch(err => console.error(err));
diff --git a/full-stack-asset-transfer-guide/applications/frontend/src/polyfills.ts b/full-stack-asset-transfer-guide/applications/frontend/src/polyfills.ts
deleted file mode 100644
index 429bb9ef..00000000
--- a/full-stack-asset-transfer-guide/applications/frontend/src/polyfills.ts
+++ /dev/null
@@ -1,53 +0,0 @@
-/**
- * This file includes polyfills needed by Angular and is loaded before the app.
- * You can add your own extra polyfills to this file.
- *
- * This file is divided into 2 sections:
- * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers.
- * 2. Application imports. Files imported after ZoneJS that should be loaded before your main
- * file.
- *
- * The current setup is for so-called "evergreen" browsers; the last versions of browsers that
- * automatically update themselves. This includes recent versions of Safari, Chrome (including
- * Opera), Edge on the desktop, and iOS and Chrome on mobile.
- *
- * Learn more in https://angular.io/guide/browser-support
- */
-
-/***************************************************************************************************
- * BROWSER POLYFILLS
- */
-
-/**
- * By default, zone.js will patch all possible macroTask and DomEvents
- * user can disable parts of macroTask/DomEvents patch by setting following flags
- * because those flags need to be set before `zone.js` being loaded, and webpack
- * will put import in the top of bundle, so user need to create a separate file
- * in this directory (for example: zone-flags.ts), and put the following flags
- * into that file, and then add the following code before importing zone.js.
- * import './zone-flags';
- *
- * The flags allowed in zone-flags.ts are listed here.
- *
- * The following flags will work for all browsers.
- *
- * (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame
- * (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick
- * (window as any).__zone_symbol__UNPATCHED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames
- *
- * in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js
- * with the following flag, it will bypass `zone.js` patch for IE/Edge
- *
- * (window as any).__Zone_enable_cross_context_check = true;
- *
- */
-
-/***************************************************************************************************
- * Zone JS is required by default for Angular itself.
- */
-import 'zone.js'; // Included with Angular CLI.
-
-
-/***************************************************************************************************
- * APPLICATION IMPORTS
- */
diff --git a/full-stack-asset-transfer-guide/applications/frontend/src/styles.scss b/full-stack-asset-transfer-guide/applications/frontend/src/styles.scss
deleted file mode 100644
index 7e7239a2..00000000
--- a/full-stack-asset-transfer-guide/applications/frontend/src/styles.scss
+++ /dev/null
@@ -1,4 +0,0 @@
-/* You can add global styles to this file, and also import other style files */
-
-html, body { height: 100%; }
-body { margin: 0; font-family: Roboto, "Helvetica Neue", sans-serif; }
diff --git a/full-stack-asset-transfer-guide/applications/frontend/src/test.ts b/full-stack-asset-transfer-guide/applications/frontend/src/test.ts
deleted file mode 100644
index c04c8760..00000000
--- a/full-stack-asset-transfer-guide/applications/frontend/src/test.ts
+++ /dev/null
@@ -1,26 +0,0 @@
-// This file is required by karma.conf.js and loads recursively all the .spec and framework files
-
-import 'zone.js/testing';
-import { getTestBed } from '@angular/core/testing';
-import {
- BrowserDynamicTestingModule,
- platformBrowserDynamicTesting
-} from '@angular/platform-browser-dynamic/testing';
-
-declare const require: {
- context(path: string, deep?: boolean, filter?: RegExp): {
- (id: string): T;
- keys(): string[];
- };
-};
-
-// First, initialize the Angular testing environment.
-getTestBed().initTestEnvironment(
- BrowserDynamicTestingModule,
- platformBrowserDynamicTesting(),
-);
-
-// Then we find all the tests.
-const context = require.context('./', true, /\.spec\.ts$/);
-// And load the modules.
-context.keys().forEach(context);
diff --git a/full-stack-asset-transfer-guide/applications/frontend/tsconfig.app.json b/full-stack-asset-transfer-guide/applications/frontend/tsconfig.app.json
deleted file mode 100644
index 82d91dc4..00000000
--- a/full-stack-asset-transfer-guide/applications/frontend/tsconfig.app.json
+++ /dev/null
@@ -1,15 +0,0 @@
-/* To learn more about this file see: https://angular.io/config/tsconfig. */
-{
- "extends": "./tsconfig.json",
- "compilerOptions": {
- "outDir": "./out-tsc/app",
- "types": []
- },
- "files": [
- "src/main.ts",
- "src/polyfills.ts"
- ],
- "include": [
- "src/**/*.d.ts"
- ]
-}
diff --git a/full-stack-asset-transfer-guide/applications/frontend/tsconfig.json b/full-stack-asset-transfer-guide/applications/frontend/tsconfig.json
deleted file mode 100644
index ff06eae1..00000000
--- a/full-stack-asset-transfer-guide/applications/frontend/tsconfig.json
+++ /dev/null
@@ -1,32 +0,0 @@
-/* To learn more about this file see: https://angular.io/config/tsconfig. */
-{
- "compileOnSave": false,
- "compilerOptions": {
- "baseUrl": "./",
- "outDir": "./dist/out-tsc",
- "forceConsistentCasingInFileNames": true,
- "strict": true,
- "noImplicitOverride": true,
- "noPropertyAccessFromIndexSignature": true,
- "noImplicitReturns": true,
- "noFallthroughCasesInSwitch": true,
- "sourceMap": true,
- "declaration": false,
- "downlevelIteration": true,
- "experimentalDecorators": true,
- "moduleResolution": "node",
- "importHelpers": true,
- "target": "es2020",
- "module": "es2020",
- "lib": [
- "es2020",
- "dom"
- ]
- },
- "angularCompilerOptions": {
- "enableI18nLegacyMessageIdFormat": false,
- "strictInjectionParameters": true,
- "strictInputAccessModifiers": true,
- "strictTemplates": true
- }
-}
diff --git a/full-stack-asset-transfer-guide/applications/frontend/tsconfig.spec.json b/full-stack-asset-transfer-guide/applications/frontend/tsconfig.spec.json
deleted file mode 100644
index 092345b0..00000000
--- a/full-stack-asset-transfer-guide/applications/frontend/tsconfig.spec.json
+++ /dev/null
@@ -1,18 +0,0 @@
-/* To learn more about this file see: https://angular.io/config/tsconfig. */
-{
- "extends": "./tsconfig.json",
- "compilerOptions": {
- "outDir": "./out-tsc/spec",
- "types": [
- "jasmine"
- ]
- },
- "files": [
- "src/test.ts",
- "src/polyfills.ts"
- ],
- "include": [
- "src/**/*.spec.ts",
- "src/**/*.d.ts"
- ]
-}
diff --git a/full-stack-asset-transfer-guide/applications/ping-chaincode/.gitignore b/full-stack-asset-transfer-guide/applications/ping-chaincode/.gitignore
deleted file mode 100644
index 76add878..00000000
--- a/full-stack-asset-transfer-guide/applications/ping-chaincode/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-node_modules
-dist
\ No newline at end of file
diff --git a/full-stack-asset-transfer-guide/applications/ping-chaincode/app.env b/full-stack-asset-transfer-guide/applications/ping-chaincode/app.env
deleted file mode 100644
index 0bbde31a..00000000
--- a/full-stack-asset-transfer-guide/applications/ping-chaincode/app.env
+++ /dev/null
@@ -1,7 +0,0 @@
-CHANNEL_NAME=mychannel
-CHAINCODE_NAME=asset-transfer
-CONN_PROFILE_FILE=/home/matthew/github.com/hyperledgendary/full-stack-asset-transfer-guide/_cfg/Org1_gateway.json
-ID_FILE=asset-transfer_appid.json
-ID_DIR=/home/matthew/github.com/hyperledgendary/full-stack-asset-transfer-guide/_cfg/
-TLS_ENABLED=true
-MSPID=Org1MSP
diff --git a/full-stack-asset-transfer-guide/applications/ping-chaincode/package.json b/full-stack-asset-transfer-guide/applications/ping-chaincode/package.json
deleted file mode 100644
index a9ee2571..00000000
--- a/full-stack-asset-transfer-guide/applications/ping-chaincode/package.json
+++ /dev/null
@@ -1,36 +0,0 @@
-{
- "name": "asset-transfer-basic",
- "version": "1.0.0",
- "description": "Asset Transfer Basic Application implemented in typeScript using fabric-gateway",
- "main": "dist/app.js",
- "engines": {
- "node": ">=18"
- },
- "scripts": {
- "build": "tsc",
- "build:watch": "tsc -w",
- "lint": "eslint . --ext .ts",
- "prepare": "npm run build",
- "pretest": "npm run lint",
- "start": "node dist/app.js"
- },
- "engineStrict": true,
- "author": "Hyperledger",
- "license": "Apache-2.0",
- "dependencies": {
- "@grpc/grpc-js": "^1.12.2",
- "@hyperledger/fabric-gateway": "^1.7.0",
- "dotenv": "^16.4.5",
- "env-var": "^7.5.0",
- "js-yaml": "^4.1.0"
- },
- "devDependencies": {
- "@tsconfig/node18": "^18.2.2",
- "@types/js-yaml": "^4.0.5",
- "@types/node": "^18.18.6",
- "@typescript-eslint/eslint-plugin": "^6.9.0",
- "@typescript-eslint/parser": "^6.9.0",
- "eslint": "^8.52.0",
- "typescript": "~5.2.2"
- }
-}
diff --git a/full-stack-asset-transfer-guide/applications/ping-chaincode/src/app.ts b/full-stack-asset-transfer-guide/applications/ping-chaincode/src/app.ts
deleted file mode 100644
index 2c8916fe..00000000
--- a/full-stack-asset-transfer-guide/applications/ping-chaincode/src/app.ts
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Copyright IBM Corp. All Rights Reserved.
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-
-import { connect, Contract, hash } from '@hyperledger/fabric-gateway';
-import * as path from 'path';
-import { TextDecoder } from 'util';
-import { ConnectionHelper } from './fabric-connection-profile';
-import JSONIDAdapter from './jsonid-adapter';
-
-import { dump } from 'js-yaml';
-
-import { config } from 'dotenv';
-import * as env from 'env-var';
-config({path:'app.env'});
-
-const channelName = env.get('CHANNEL_NAME').default('mychannel').asString();
-const chaincodeName = env.get('CHAINCODE_NAME').default('conga-nft-contract').asString();
-
-const connectionProfile = env.get('CONN_PROFILE_FILE').required().asString();
-const identityFile = env.get('ID_FILE').required().asString()
-const identityDir = env.get('ID_DIR').required().asString()
-const mspID = env.get('MSPID').required().asString()
-const tls = env.get('TLS_ENABLED').default("false").asBool();
-
-const utf8Decoder = new TextDecoder();
-
-
-async function main(): Promise {
-
- const cp = await ConnectionHelper.loadProfile(connectionProfile);
-
-
- // The gRPC client connection should be shared by all Gateway connections to this endpoint.
- const client = await ConnectionHelper.newGrpcConnection(cp,tls);
- console.log("Created GRPC Connection")
-
- const jsonAdapter: JSONIDAdapter = new JSONIDAdapter(path.resolve(identityDir),mspID);
- const identity = await jsonAdapter.getIdentity(identityFile);
- const signer = await jsonAdapter.getSigner(identityFile);
-
- console.log("Loaded Identity")
- const gateway = connect({
- client,
- identity,
- signer,
- hash: hash.sha256,
- // Default timeouts for different gRPC calls
- evaluateOptions: () => {
- return { deadline: Date.now() + 5000 }; // 5 seconds
- },
- endorseOptions: () => {
- return { deadline: Date.now() + 15000 }; // 15 seconds
- },
- submitOptions: () => {
- return { deadline: Date.now() + 5000 }; // 5 seconds
- },
- commitStatusOptions: () => {
- return { deadline: Date.now() + 60000 }; // 1 minute
- },
- });
-
- try {
- // Get a network instance representing the channel where the smart contract is deployed.
- const network = gateway.getNetwork(channelName);
-
- // Get the smart contract from the network.
- const contract = network.getContract(chaincodeName);
-
- // Return all the current assets on the ledger.
- await ping(contract);
-
- } finally {
- gateway.close();
- client.close();
- }
-}
-
-main().catch(error => {
- console.error('******** FAILED to run the application:', error);
- process.exitCode = 1;
-});
-
-/**
- * Evaluate a transaction to query ledger state.
- */
-async function ping(contract: Contract): Promise {
- console.log('\n--> Evaluate Transaction: Get Contract Metdata from : org.hyperledger.fabric:GetMetadata');
-
- const resultBytes = await contract.evaluateTransaction('org.hyperledger.fabric:GetMetadata');
-
- const resultJson = utf8Decoder.decode(resultBytes);
- const result = JSON.parse(resultJson);
- console.log('*** Result:');
- console.log(dump(result));
-}
diff --git a/full-stack-asset-transfer-guide/applications/ping-chaincode/src/fabric-connection-profile.ts b/full-stack-asset-transfer-guide/applications/ping-chaincode/src/fabric-connection-profile.ts
deleted file mode 100644
index cd4f9364..00000000
--- a/full-stack-asset-transfer-guide/applications/ping-chaincode/src/fabric-connection-profile.ts
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * SPDX-License-Identifier: Apache-2.0
- */
-
-import * as fs from 'fs';
-import * as path from 'path';
-
-import * as grpc from '@grpc/grpc-js';
-import yaml from 'js-yaml';
-
-const JSON_EXT = /json/gi;
-const YAML_EXT = /ya?ml/gi;
-
-export interface ConnectionProfile {
- display_name: string;
- id: string;
- name: string;
- type: string;
- version: string;
- //
- certificateAuthorities: any;
- client: any;
- oprganizations: any;
- peers: { [key: string]: Peer };
-}
-
-export interface Peer {
- grpcOptions: grpcOptions;
- url: string;
- tlsCACerts: any
-}
-
-export interface grpcOptions {
- 'ssl-Target-Name-Override'?: string;
- hostnameOverride?: string;
- 'grpc.ssl_target_name_override'?: string;
- 'grpc.default_authority'?: string;
-}
-
-export class ConnectionHelper {
- /**
- * Loads the profile at the given filename.
- *
- * File can either by yaml or json, error is thrown is the file does
- * not exist at the location given.
- *
- * @param profilename filename of the gateway connection profile
- * @return Gateway profile as an object
- */
- static loadProfile(profilename: string): ConnectionProfile {
- const ccpPath = path.resolve(profilename);
- if (!fs.existsSync(ccpPath)) {
- throw new Error(`Profile file ${ccpPath} does not exist`);
- }
-
- const type = path.extname(ccpPath);
-
- if (JSON_EXT.exec(type)) {
- return JSON.parse(fs.readFileSync(ccpPath, 'utf8'));
- } else if (YAML_EXT.exec(type)) {
- return yaml.load(fs.readFileSync(ccpPath, 'utf8')) as ConnectionProfile;
- } else {
- throw new Error(`Extension of ${ccpPath} not recognised`);
- }
- }
-
-
- static async newGrpcConnection(cp: ConnectionProfile, tls: boolean): Promise {
- const peerEndpointURL = new URL(cp.peers[Object.keys(cp.peers)[0]].url);
- const peerEndpoint = `${peerEndpointURL.hostname}:${peerEndpointURL.port}`;
-
- if (tls){
- const tlsRootCert = cp.peers[Object.keys(cp.peers)[0]].tlsCACerts.pem;
- const tlsCredentials = grpc.credentials.createSsl(Buffer.from(tlsRootCert));
-
- return new grpc.Client(peerEndpoint, tlsCredentials);
-
- } else {
- console.log(peerEndpoint);
- return new grpc.Client(peerEndpoint, grpc.ChannelCredentials.createInsecure());
-
- }
- }
-
-}
diff --git a/full-stack-asset-transfer-guide/applications/ping-chaincode/src/jsonid-adapter.ts b/full-stack-asset-transfer-guide/applications/ping-chaincode/src/jsonid-adapter.ts
deleted file mode 100644
index 9ffa9f91..00000000
--- a/full-stack-asset-transfer-guide/applications/ping-chaincode/src/jsonid-adapter.ts
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * Copyright IBM Corp. All Rights Reserved.
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-
-import { Identity, Signer, signers } from '@hyperledger/fabric-gateway';
-import * as crypto from 'crypto';
-import { promises as fs } from 'fs';
-import * as path from 'path';
-
-/** Internal interface used to describe all the possible components
- * of the identity
- */
-interface JSONID {
- name: string;
- cert: string;
- ca: string;
- hsm: boolean;
- private_key?: string;
- privateKey?: string;
- mspId: string;
-}
-
-/**
- * This class can be used to map identities in a variety of JSON formats to the Identity and Signers required
- * for the gateway. For example if you have an application wallet, or have exported IDs from SaaS
- *
- * ```
- * const jsonAdapter: JSONIDAdapter = new JSONIDAdapter(path.resolve(__dirname,'..','wallet'))
- *
- * const gateway = connect({
- * client,
- * identity: await jsonAdapter.getIdentity("appuser"),
- * signer: await jsonAdapter.getSigner("appuser"),
- * });
- * ```
- *
- * Though they are JSON files, typically they files will have the .id extension. Therefore
- * if no extension is provided `.id` is added
- */
-export default class JSONIDAdapter {
- private idFilesDir: string;
- private mspId = '';
-
- /**
- * @param idFilesDir Directory to load the files from
- * @param mspId optional MSPID to apply to all identities returned if they are missing it
- */
- public constructor(idFilesDir: string, mspId?: string) {
- this.idFilesDir = path.resolve(idFilesDir);
-
- if (mspId) {
- this.mspId = mspId;
- }
- }
-
- private async readIDFile(idFile: string): Promise {
- let idJsonFile = path.resolve(path.join(this.idFilesDir, idFile));
-
- // check if there's no extension probably means it's a waller id file
- if (path.extname(idJsonFile) === '') {
- idJsonFile = `${idJsonFile}.id`;
- }
-
- let id: JSONID;
- const json = JSON.parse(await fs.readFile(idJsonFile, 'utf-8'));
-
- // look for the nested credentials element
- const credentials = json['credentials'];
-
- if (credentials) {
- // v2 SDK Wallet format
- id = {
- name: idFile,
- cert: credentials['certificate'],
- ca: '',
- hsm: false,
- private_key: credentials['privateKey'],
- mspId: json.mspId,
- };
- } else {
- // IBP exported ID style format
- id = {
- name: json.name,
- cert: Buffer.from(json.cert, 'base64').toString(),
- ca: Buffer.from(json.ca, 'base64').toString(),
- hsm: json.js,
- private_key: Buffer.from(json.private_key, 'base64').toString(),
- mspId: this.mspId,
- };
- }
- return id;
- }
-
- /**
- *
- * @param idFile the name of the identity to load (if no extension is provided `.id` is added)
- * @returns Identity to use with the GatewayBuilder
- */
- public async getIdentity(idFile: string): Promise {
- const id = await this.readIDFile(idFile);
-
- const identity: Identity = {
- credentials: Buffer.from(id.cert),
- mspId: id.mspId,
- };
-
- return identity;
- }
-
- /**
- *
- * @param idFile the name of the identity to load (if no extension is provided `.id` is added)
- * @returns Signer to use with the GatewayBuilder
- */
- public async getSigner(idFile: string): Promise {
- const id = await this.readIDFile(idFile);
- let pk;
- if (id.private_key) {
- pk = id.private_key;
- } else if ('privateKey' in id) {
- pk = id['privateKey'];
- } else {
- throw new Error('Unable to parse the identity json file');
- }
- const privateKey = crypto.createPrivateKey(pk as string);
- return signers.newPrivateKeySigner(privateKey);
- }
-}
diff --git a/full-stack-asset-transfer-guide/applications/ping-chaincode/tsconfig.json b/full-stack-asset-transfer-guide/applications/ping-chaincode/tsconfig.json
deleted file mode 100644
index d088f396..00000000
--- a/full-stack-asset-transfer-guide/applications/ping-chaincode/tsconfig.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "extends":"@tsconfig/node18/tsconfig.json",
- "compilerOptions": {
- "experimentalDecorators": true,
- "emitDecoratorMetadata": true,
- "outDir": "dist",
- "declaration": true,
- "sourceMap": true,
- "noImplicitAny": true
- },
- "include": [
- "./src/**/*"
- ],
- "exclude": [
- "./src/**/*.spec.ts"
- ]
-}
diff --git a/full-stack-asset-transfer-guide/applications/rest-api/.gitignore b/full-stack-asset-transfer-guide/applications/rest-api/.gitignore
deleted file mode 100644
index 04c01ba7..00000000
--- a/full-stack-asset-transfer-guide/applications/rest-api/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-node_modules/
-dist/
\ No newline at end of file
diff --git a/full-stack-asset-transfer-guide/applications/rest-api/Dockerfile b/full-stack-asset-transfer-guide/applications/rest-api/Dockerfile
deleted file mode 100644
index 07e5896e..00000000
--- a/full-stack-asset-transfer-guide/applications/rest-api/Dockerfile
+++ /dev/null
@@ -1,6 +0,0 @@
-FROM node:14-alpine3.14 AS build
-WORKDIR /app
-COPY package.json /app
-RUN npm install
-COPY . /app
-CMD [ "npm","run","prod" ]
\ No newline at end of file
diff --git a/full-stack-asset-transfer-guide/applications/rest-api/LICENSE b/full-stack-asset-transfer-guide/applications/rest-api/LICENSE
deleted file mode 100644
index 898e232d..00000000
--- a/full-stack-asset-transfer-guide/applications/rest-api/LICENSE
+++ /dev/null
@@ -1,17 +0,0 @@
-#
-# Copyright contributors to the Hyperledger Full Stack Asset Transfer project
-#
-# SPDX-License-Identifier: Apache-2.0
-#
-# 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:
-#
-# http://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.
-#
\ No newline at end of file
diff --git a/full-stack-asset-transfer-guide/applications/rest-api/README.md b/full-stack-asset-transfer-guide/applications/rest-api/README.md
deleted file mode 100644
index 5dcdf7fa..00000000
--- a/full-stack-asset-transfer-guide/applications/rest-api/README.md
+++ /dev/null
@@ -1,37 +0,0 @@
-Make sure all the certificates are generated as per the documentation in the below link
-https://github.com/hyperledgendary/full-stack-asset-transfer-guide/blob/main/docs/CloudReady/40-bananas.md
-
-
-#Local development
-
-npm install
-npm run prod
-
-Import the postman collections and test the apis
-
-
-#Kubernetes development
-
-Step-1 Build docker image & Tag
-
-docker build -t localhost:5000/rest-api .
-
-Step-2 Push docker image to local registary
-
-docker push localhost:5000/rest-api
-
-Step-3 Create secrets for the certicates
-
- kubectl create secret generic client-secret --from-file=keyPath=/home/ramdisk/my-full-stack/infrastructure/sample-network/temp/enrollments/org1/users/org1user/msp/keystore/key.pem --from-file=certPath=/home/ramdisk/my-full-stack/infrastructure/sample-network/temp/enrollments/org1/users/org1user/msp/signcerts/cert.pem --from-file=tlsCertPath=/home/ramdisk/my-full-stack/infrastructure/sample-network/temp/channel-msp/peerOrganizations/org1/msp/tlscacerts/tlsca-signcert.pem -n test-network
-
-please replace the path of /home/ramdisk/my-full-stack/infrastructure/sample-network/temp with your system path
-
-Step-4 Deploy the pods to k8s
-
-kubectl apply -f deployment.yaml -n test-network
-
-Step-5 Testing API's
-
-Import the apis into postman and test the apis
-
-create & list apis are tested.reminaing apis need be implemented
diff --git a/full-stack-asset-transfer-guide/applications/rest-api/asset-transfer.postman_collection.json b/full-stack-asset-transfer-guide/applications/rest-api/asset-transfer.postman_collection.json
deleted file mode 100644
index 40f6b142..00000000
--- a/full-stack-asset-transfer-guide/applications/rest-api/asset-transfer.postman_collection.json
+++ /dev/null
@@ -1,145 +0,0 @@
-{
- "info": {
- "_postman_id": "56cf175c-ca6b-453a-b950-3d057e19d391",
- "name": "asset-transfer",
- "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
- "_exporter_id": "101085"
- },
- "item": [
- {
- "name": "http://localhost:8081/pokemons",
- "request": {
- "method": "GET",
- "header": [],
- "url": {
- "raw": "http://localhost:8081/pokemons",
- "protocol": "http",
- "host": [
- "localhost"
- ],
- "port": "8081",
- "path": [
- "pokemons"
- ]
- }
- },
- "response": []
- },
- {
- "name": "http://localhost:8081/get",
- "request": {
- "method": "GET",
- "header": [],
- "url": {
- "raw": "http://localhost:8081/list",
- "protocol": "http",
- "host": [
- "localhost"
- ],
- "port": "8081",
- "path": [
- "list"
- ]
- }
- },
- "response": []
- },
- {
- "name": "http://localhost:8081/get/1",
- "request": {
- "method": "GET",
- "header": [],
- "url": {
- "raw": "http://localhost:8081/get/1",
- "protocol": "http",
- "host": [
- "localhost"
- ],
- "port": "8081",
- "path": [
- "get",
- "1"
- ]
- }
- },
- "response": []
- },
- {
- "name": "http://localhost:8081/create",
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\n \"appraisedValue\":2,\n \"color\": \"color\",\n \"owner\": \"Ramesh\",\n \"size\": 1\n}",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "http://localhost:8081/create",
- "protocol": "http",
- "host": [
- "localhost"
- ],
- "port": "8081",
- "path": [
- "create"
- ]
- }
- },
- "response": []
- },
- {
- "name": "Create",
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\n \"appraisedValue\":2,\n \"color\": \"color\",\n \"owner\": \"Ramesh\",\n \"size\": 1\n}",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "http://restapi.localho.st/create",
- "protocol": "http",
- "host": [
- "restapi",
- "localho",
- "st"
- ],
- "path": [
- "create"
- ]
- }
- },
- "response": []
- },
- {
- "name": "List",
- "request": {
- "method": "GET",
- "header": [],
- "url": {
- "raw": "http://restapi.localho.st/list",
- "protocol": "http",
- "host": [
- "restapi",
- "localho",
- "st"
- ],
- "path": [
- "list"
- ]
- }
- },
- "response": []
- }
- ]
-}
\ No newline at end of file
diff --git a/full-stack-asset-transfer-guide/applications/rest-api/deployment.yaml b/full-stack-asset-transfer-guide/applications/rest-api/deployment.yaml
deleted file mode 100644
index d18d9a0c..00000000
--- a/full-stack-asset-transfer-guide/applications/rest-api/deployment.yaml
+++ /dev/null
@@ -1,81 +0,0 @@
-apiVersion: apps/v1
-kind: Deployment
-metadata:
- name: rest-api
- labels:
- app: rest-api
-spec:
- replicas: 1
- selector:
- matchLabels:
- app: rest-api
- template:
- metadata:
- labels:
- app: rest-api
- spec:
- volumes:
- - name: secret-volume
- secret:
- secretName: client-secret
- containers:
- - name: rest-api
- image: localhost:5000/rest-api:latest
- ports:
- - containerPort: 8080
- env:
- - name: rest-certs
- valueFrom:
- secretKeyRef:
- name: rest-certs
- key: key.pem
- volumeMounts:
- - name: secret-volume
- readOnly: true
- mountPath: "/etc/secret-volume"
----
-kind: Service
-apiVersion: v1
-metadata:
- name: rest-api
-spec:
- selector:
- app: rest-api
- ports:
- - protocol: TCP
- port: 80
- targetPort: 8080
-
-
- # kubectl create secret generic client-secret --from-file=keyPath=/home/ramdisk/my-full-stack/infrastructure/sample-network/temp/enrollments/org1/users/org1user/msp/keystore/key.pem --from-file=certPath=/home/ramdisk/my-full-stack/infrastructure/sample-network/temp/enrollments/org1/users/org1user/msp/signcerts/cert.pem --from-file=tlsCertPath=/home/ramdisk/my-full-stack/infrastructure/sample-network/temp/channel-msp/peerOrganizations/org1/msp/tlscacerts/tlsca-signcert.pem -n test-network
----
-apiVersion: networking.k8s.io/v1
-kind: Ingress
-metadata:
- name: rest-api
- annotations:
- nginx.ingress.kubernetes.io/proxy-connect-timeout: 60s
- # nginx.ingress.kubernetes.io/ssl-passthrough: "true"
- # labels:
- # app: rest-api
- # app.kubernetes.io/instance: fabricpeer
- # app.kubernetes.io/managed-by: fabric-operator
- # app.kubernetes.io/name: fabric
- # creator: fabric
- # orgname: Org1MSP
-spec:
- ingressClassName: nginx
- rules:
- - host: restapi.localho.st
- http:
- paths:
- - backend:
- service:
- name: rest-api
- port:
- number: 80
- path: /
- pathType: ImplementationSpecific
- tls:
- - hosts:
- - restapi.localho.st
\ No newline at end of file
diff --git a/full-stack-asset-transfer-guide/applications/rest-api/package.json b/full-stack-asset-transfer-guide/applications/rest-api/package.json
deleted file mode 100644
index 487127ab..00000000
--- a/full-stack-asset-transfer-guide/applications/rest-api/package.json
+++ /dev/null
@@ -1,38 +0,0 @@
-{
- "name": "asset-transfer-restapi",
- "version": "1.0.0",
- "description": "",
- "main": "index.js",
- "engines": {
- "node": ">=18"
- },
- "scripts": {
- "build": "tsc",
- "dev": "ts-node ./src/server.ts",
- "start": "nodemon ./dist/server.js",
- "prod": "npm run build && npm run start",
- "test": "echo \"Error: no test specified\" && exit 1"
- },
- "keywords": [],
- "author": "",
- "license": "ISC",
- "devDependencies": {
- "@tsconfig/node18": "^18.2.2",
- "@types/body-parser": "^1.17.0",
- "@types/express": "^4.16.0",
- "@types/node": "^18.18.6",
- "@typescript-eslint/eslint-plugin": "^6.9.0",
- "@typescript-eslint/parser": "^6.9.0",
- "eslint": "^8.52.0",
- "nodemon": "^1.18.3",
- "ts-node": "^7.0.0",
- "typescript": "~5.2.2"
- },
- "dependencies": {
- "@grpc/grpc-js": "^1.12.2",
- "@hyperledger/fabric-gateway": "^1.7.0",
- "body-parser": "^1.20.3",
- "cors": "^2.8.5",
- "express": "^4.21.0"
- }
-}
diff --git a/full-stack-asset-transfer-guide/applications/rest-api/renovate.json b/full-stack-asset-transfer-guide/applications/rest-api/renovate.json
deleted file mode 100644
index f45d8f11..00000000
--- a/full-stack-asset-transfer-guide/applications/rest-api/renovate.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "extends": [
- "config:base"
- ]
-}
diff --git a/full-stack-asset-transfer-guide/applications/rest-api/src/app.ts b/full-stack-asset-transfer-guide/applications/rest-api/src/app.ts
deleted file mode 100644
index 30b61561..00000000
--- a/full-stack-asset-transfer-guide/applications/rest-api/src/app.ts
+++ /dev/null
@@ -1,27 +0,0 @@
-import * as express from 'express';
-import * as bodyParser from 'body-parser';
-import { Connection } from './connection';
-import { AssetRouter } from './assets.router';
-var cors = require('cors');
-
-class App {
- public app: express.Application;
- public routes: AssetRouter = new AssetRouter();
- constructor() {
- new Connection().init();
- this.app = express();
- this.app.use(cors());
- this.config();
- this.routes.routes(this.app);
- }
-
- private config(): void {
- // support application/json type post data
- this.app.use(bodyParser.json());
- //support application/x-www-form-urlencoded post data
- this.app.use(bodyParser.urlencoded({
- extended: false
- }));
- }
-}
-export default new App().app;
\ No newline at end of file
diff --git a/full-stack-asset-transfer-guide/applications/rest-api/src/assets.router.ts b/full-stack-asset-transfer-guide/applications/rest-api/src/assets.router.ts
deleted file mode 100644
index bc9ad912..00000000
--- a/full-stack-asset-transfer-guide/applications/rest-api/src/assets.router.ts
+++ /dev/null
@@ -1,110 +0,0 @@
-import { Request, Response } from "express";
-const utf8Decoder = new TextDecoder();
-import { Connection } from "./connection";
-export class AssetRouter {
- public routes(app): void {
- app.route('/list')
- .get(async (req: Request, res: Response) => {
- const resultBytes = Connection.contract.evaluateTransaction('GetAllAssets');
- const resultJson = utf8Decoder.decode(await resultBytes);
- const result = JSON.parse(resultJson);
- res.status(200).send(result);
- })
- app.route('/create')
- .post((req: Request, res: Response) => {
- console.log(req.body)
- var Id = Date.now();
- var json = JSON.stringify({
- ID: Id + "",
- Owner: req.body.Owner,
- Color: req.body.Color,
- Size: req.body.Size,
- AppraisedValue: req.body.AppraisedValue,
- })
- Connection.contract.submitTransaction('CreateAsset', json);
- var response = ({ "AssetId": Id })
- res.status(200).send(response);
- })
- app.route('/update')
- .post((req: Request, res: Response) => {
- console.log(req.body)
- var Id = Date.now();
- var json = JSON.stringify({
- ID: req.body.ID,
- Owner: req.body.Owner,
- Color: req.body.Color,
- Size: req.body.Size,
- AppraisedValue: req.body.AppraisedValue,
- })
- var response;
- try {
- Connection.contract.submitTransaction('UpdateAsset', json);
- response = ({ "status": 0, "message": "Update success" })
- } catch (error) {
- response = ({ "status": -1, "message": "Something went wrong" })
- }
- res.status(200).send(response);
- })
- app.route('/delete')
- .post((req: Request, res: Response) => {
- console.log(req.body)
- var response;
- try {
- Connection.contract.submitTransaction('DeleteAsset', req.body.id);
- response = ({ "status": 0, "message": "Delete success" })
- } catch (error) {
- response = ({ "status": -1, "message": "Something went wrong" })
- }
- res.status(200).send(response);
- })
- app.route('/transfer')
- .post(async (req: Request, res: Response) => {
- console.log(req.body)
-
- console.log('\n--> Async Submit Transaction: TransferAsset, updates existing asset owner');
-
- const commit = Connection.contract.submitAsync('TransferAsset', {
- arguments: [req.body.assetId, 'Saptha'],
- });
- const oldOwner = utf8Decoder.decode((await commit).getResult());
-
- console.log(`*** Successfully submitted transaction to transfer ownership from ${oldOwner} to Saptha`);
- console.log('*** Waiting for transaction commit');
-
- const status = await (await commit).getStatus();
- if (!status.successful) {
- throw new Error(`Transaction ${status.transactionId} failed to commit with status code ${status.code}`);
- }
- console.log('*** Transaction committed successfully');
- res.status(200).send(status);
- })
- app.route('/updateNonExistentAsset')
- .post(async (req: Request, res: Response) => {
- try {
- await Connection.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);
- }
- res.status(200).send("Success");
- })
- app.route('/get/:id')
- .get(async (req: Request, res: Response) => {
- let id = req.params.id;
- console.log('\n--> Evaluate Transaction: ReadAsset, function returns asset attributes');
- const resultBytes = Connection.contract.evaluateTransaction('ReadAsset', id);
- const resultJson = utf8Decoder.decode(await resultBytes);
- const result = JSON.parse(resultJson);
- console.log('*** Result:', result);
- res.status(200).send(result);
- })
- }
-
-}
diff --git a/full-stack-asset-transfer-guide/applications/rest-api/src/connection.ts b/full-stack-asset-transfer-guide/applications/rest-api/src/connection.ts
deleted file mode 100644
index 44f2c008..00000000
--- a/full-stack-asset-transfer-guide/applications/rest-api/src/connection.ts
+++ /dev/null
@@ -1,102 +0,0 @@
-import * as grpc from '@grpc/grpc-js';
-import { connect, Contract, hash, Identity, Signer, signers } from '@hyperledger/fabric-gateway';
-import * as crypto from 'crypto';
-import * as path from 'path';
-
-import { promises as fs } from 'fs';
-const channelName = envOrDefault('CHANNEL_NAME', 'mychannel');
-const chaincodeName = envOrDefault('CHAINCODE_NAME', 'asset-transfer');
-const mspId = envOrDefault('MSP_ID', 'Org1MSP');
-//Local development and testing uncomment below code
-// const WORKSHOP_CRYPTO =envOrDefault('CRYPTO_PATH', path.resolve(__dirname, '..','..', '..', 'infrastructure', 'sample-network', 'temp'));
-// const keyPath = WORKSHOP_CRYPTO + "/enrollments/org1/users/org1user/msp/keystore/key.pem";
-// const certPath = WORKSHOP_CRYPTO + "/enrollments/org1/users/org1user/msp/signcerts/cert.pem"
-// const tlsCertPath = WORKSHOP_CRYPTO + "/channel-msp/peerOrganizations/org1/msp/tlscacerts/tlsca-signcert.pem";
-
-// //kubenetes certificates file path
-const WORKSHOP_CRYPTO = "/etc/secret-volume/"
-const keyPath = WORKSHOP_CRYPTO + "keyPath";
-const certPath = WORKSHOP_CRYPTO + "certPath"
-const tlsCertPath = WORKSHOP_CRYPTO + "tlsCertPath";
-console.log("keyPath " + keyPath);
-console.log("certPath " + certPath);
-console.log("tlsCertPath " + tlsCertPath);
-const peerEndpoint = "test-network-org1-peer1-peer.localho.st:443";
-const peerHostAlias = "test-network-org1-peer1-peer.localho.st";
-export class Connection {
- public static contract: Contract;
- public init() {
- initFabric();
- }
-}
-async function initFabric(): Promise {
- // The gRPC client connection should be shared by all Gateway connections to this endpoint.
- const client = await newGrpcConnection();
-
- const gateway = connect({
- client,
- identity: await newIdentity(),
- signer: await newSigner(),
- hash: hash.sha256,
- // Default timeouts for different gRPC calls
- evaluateOptions: () => {
- return { deadline: Date.now() + 5000 }; // 5 seconds
- },
- endorseOptions: () => {
- return { deadline: Date.now() + 15000 }; // 15 seconds
- },
- submitOptions: () => {
- return { deadline: Date.now() + 5000 }; // 5 seconds
- },
- commitStatusOptions: () => {
- return { deadline: Date.now() + 60000 }; // 1 minute
- },
- });
-
- try {
- // Get a network instance representing the channel where the smart contract is deployed.
- const network = gateway.getNetwork(channelName);
-
- // Get the smart contract from the network.
- const contract = network.getContract(chaincodeName);
- Connection.contract = contract;
-
- // Initialize a set of asset data on the ledger using the chaincode 'InitLedger' function.
- // await initLedger(contract);
-
-
- } catch (e: any) {
- console.log('sample log');
- console.log(e.message);
- } finally {
- console.log('error log ');
- // gateway.close();
- // client.close();
- }
-}
-async function newGrpcConnection(): Promise {
- const tlsRootCert = await fs.readFile(tlsCertPath);
- const tlsCredentials = grpc.credentials.createSsl(tlsRootCert);
- return new grpc.Client(peerEndpoint, tlsCredentials, {
- 'grpc.ssl_target_name_override': peerHostAlias,
- });
-}
-
-async function newIdentity(): Promise {
- const credentials = await fs.readFile(certPath);
- return { mspId, credentials };
-}
-
-async function newSigner(): Promise {
- //const files = await fs.readdir(keyDirectoryPath);
- // path.resolve(keyDirectoryPath, files[0]);
- const privateKeyPem = await fs.readFile(keyPath);
- const privateKey = crypto.createPrivateKey(privateKeyPem);
- return signers.newPrivateKeySigner(privateKey);
-}
-/**
- * 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;
-}
diff --git a/full-stack-asset-transfer-guide/applications/rest-api/src/server.ts b/full-stack-asset-transfer-guide/applications/rest-api/src/server.ts
deleted file mode 100644
index 3d0c4b19..00000000
--- a/full-stack-asset-transfer-guide/applications/rest-api/src/server.ts
+++ /dev/null
@@ -1,6 +0,0 @@
-import app from "./app";
-const PORT = process.env.PORT || 8080;
-
-app.listen(PORT, () => {
- console.log('listening on port ' + PORT);
-})
diff --git a/full-stack-asset-transfer-guide/applications/rest-api/tsconfig.json b/full-stack-asset-transfer-guide/applications/rest-api/tsconfig.json
deleted file mode 100644
index bab355bb..00000000
--- a/full-stack-asset-transfer-guide/applications/rest-api/tsconfig.json
+++ /dev/null
@@ -1,13 +0,0 @@
-{
- "extends": "@tsconfig/node18/tsconfig.json",
- "compilerOptions": {
- "outDir": "dist", //change the output directory
- "resolveJsonModule": true //to import out json database
- },
- "include": [
- "src/**/*.ts" //which kind of files to compile
- ],
- "exclude": [
- "node_modules" //which files or directories to ignore
- ]
-}
\ No newline at end of file
diff --git a/full-stack-asset-transfer-guide/applications/trader-typescript/.gitignore b/full-stack-asset-transfer-guide/applications/trader-typescript/.gitignore
deleted file mode 100644
index 1276eb3b..00000000
--- a/full-stack-asset-transfer-guide/applications/trader-typescript/.gitignore
+++ /dev/null
@@ -1,18 +0,0 @@
-#
-# SPDX-License-Identifier: Apache-2.0
-#
-
-# Coverage directory used by tools like istanbul
-coverage
-
-# Dependencies
-node_modules/
-jspm_packages/
-package-lock.json
-
-# Compiled TypeScript files
-dist
-
-# Files generated by the application at runtime
-checkpoint.json
-store.log
diff --git a/full-stack-asset-transfer-guide/applications/trader-typescript/.npmrc b/full-stack-asset-transfer-guide/applications/trader-typescript/.npmrc
deleted file mode 100644
index b6f27f13..00000000
--- a/full-stack-asset-transfer-guide/applications/trader-typescript/.npmrc
+++ /dev/null
@@ -1 +0,0 @@
-engine-strict=true
diff --git a/full-stack-asset-transfer-guide/applications/trader-typescript/README.md b/full-stack-asset-transfer-guide/applications/trader-typescript/README.md
deleted file mode 100644
index ab584847..00000000
--- a/full-stack-asset-transfer-guide/applications/trader-typescript/README.md
+++ /dev/null
@@ -1,43 +0,0 @@
-# Trader sample client application
-
-This is a simple client application for the [asset-transfer](../../contracts/asset-transfer-typescript/) smart contract, built using the [Fabric Gateway client API](https://hyperledger.github.io/fabric-gateway/) for Fabric v2.4+.
-
-## Prerequisites
-
-The client application requires Node.js 16 or later.
-
-## Set up
-
-The following steps prepare the client application for execution:
-
-1. Ensure the [asset-transfer](../../contracts/asset-transfer-typescript/) smart contract is deployed to a running Fabric network.
-1. Run `npm install` to download dependencies and compile the application code.
-
-> **Note:** After making any code changes to the application, be sure to recompile the application code. This can be done by explicitly running `npm install` again, or you can leave `npm run build:watch` running in a terminal window to automatically rebuild the application on any code change.
-
-
-The client application uses environment variables to supply configuration options. You must set the following environment variables when running the application:
-
-- `ENDPOINT` - endpoint address for the Gateway service to which the client will connect in the form **hostname:port**. Depending on your environment, this can be the address of a specific peer within the user's organization, or an ingress endpoint that dispatches to any available peer in the user's organization.
-- `MSP_ID` - member service provider ID for the user's organization.
-- `CERTIFICATE` - PEM file containing the user's X.509 certificate.
-- `PRIVATE_KEY` - PEM file containing the user's private key.
-
-The following environment variables are optional and can be set if required by your environment:
-
-- `CHANNEL_NAME` - Channel to which the chaincode is deployed. (Default: `mychannel`)
-- `CHAINCODE_NAME` - Channel to which the chaincode is deployed. (Default: `asset-transfer`)
-- `TLS_CERT` - PEM file containing the CA certificate used to authenticate the TLS connection to the Gateway peer. *Only required if using a TLS connection and a private CA.*
-- `HOST_ALIAS` - the name of the Gateway peer as it appears in its TLS certificate. *Only required if the endpoint address used by the client does not match the address in the Gateway peer's TLS certificate.*
-
-# Run
-
-The sample application is run as a command-line application, and is lauched using `npm start [ ...]`. The following commands are available:
-
-- `npm start create ` to create a new asset.
-- `npm start delete ` to delete an existing asset.
-- `npm start getAllAssets` to list all assets.
-- `npm start listen` to listen for chaincode events emitted by transaction functions. Interrupt the listener using Control-C.
-- `npm start read ` to view an existing asset.
-- `npm start transact` to create some random assets and perform some random operations on those assets.
-- `npm start transfer ` to transfer an asset to a new owner within an organization MSP ID.
diff --git a/full-stack-asset-transfer-guide/applications/trader-typescript/eslint.config.mjs b/full-stack-asset-transfer-guide/applications/trader-typescript/eslint.config.mjs
deleted file mode 100644
index 9ef6b243..00000000
--- a/full-stack-asset-transfer-guide/applications/trader-typescript/eslint.config.mjs
+++ /dev/null
@@ -1,13 +0,0 @@
-import js from '@eslint/js';
-import tseslint from 'typescript-eslint';
-
-export default tseslint.config(js.configs.recommended, ...tseslint.configs.strictTypeChecked, {
- languageOptions: {
- ecmaVersion: 2023,
- sourceType: 'module',
- parserOptions: {
- project: 'tsconfig.json',
- tsconfigRootDir: import.meta.dirname,
- },
- },
-});
diff --git a/full-stack-asset-transfer-guide/applications/trader-typescript/package.json b/full-stack-asset-transfer-guide/applications/trader-typescript/package.json
deleted file mode 100644
index 25351959..00000000
--- a/full-stack-asset-transfer-guide/applications/trader-typescript/package.json
+++ /dev/null
@@ -1,33 +0,0 @@
-{
- "name": "trader",
- "version": "1.0.0",
- "description": "Asset transfer client application",
- "main": "dist/index.js",
- "typings": "dist/index.d.ts",
- "engines": {
- "node": ">=18"
- },
- "scripts": {
- "build": "tsc",
- "build:watch": "tsc -w",
- "lint": "eslint src",
- "prepare": "npm run build",
- "pretest": "npm run lint",
- "start": "node ./dist/app",
- "test": ""
- },
- "author": "Hyperledger",
- "license": "Apache-2.0",
- "dependencies": {
- "@grpc/grpc-js": "^1.12.2",
- "@hyperledger/fabric-gateway": "^1.7.0"
- },
- "devDependencies": {
- "@eslint/js": "^9.3.0",
- "@tsconfig/node18": "^18.2.4",
- "@types/node": "^18.19.33",
- "eslint": "^8.57.0",
- "typescript": "~5.4.5",
- "typescript-eslint": "^7.11.0"
- }
-}
diff --git a/full-stack-asset-transfer-guide/applications/trader-typescript/src/app.ts b/full-stack-asset-transfer-guide/applications/trader-typescript/src/app.ts
deleted file mode 100644
index 3d25d14d..00000000
--- a/full-stack-asset-transfer-guide/applications/trader-typescript/src/app.ts
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright IBM Corp. All Rights Reserved.
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-
-import { Command, commands } from './commands';
-import { newGatewayConnection, newGrpcConnection } from './connect';
-import { ExpectedError } from './expectedError';
-
-async function main(): Promise {
- const commandName = process.argv[2];
- const args = process.argv.slice(3);
-
- const command = commandName && commands[commandName];
- if (!command) {
- printUsage();
- throw new Error(`Unknown command: ${String(commandName)}`);
- }
-
- await runCommand(command, args);
-}
-
-async function runCommand(command: Command, args: string[]): Promise {
- const client = await newGrpcConnection();
- try {
- const gateway = await newGatewayConnection(client);
- try {
- await command(gateway, args);
- } finally {
- gateway.close();
- }
- } finally {
- client.close();
- }
-}
-
-function printUsage(): void {
- console.log('Arguments: [ ...]');
- console.log('Available commands:');
- console.log(`\t${Object.keys(commands).sort().join('\n\t')}`);
-}
-
-main().catch((error: unknown) => {
- if (error instanceof ExpectedError) {
- console.log(error);
- } else {
- console.error('\nUnexpected application error:', error);
- process.exitCode = 1;
- }
-});
diff --git a/full-stack-asset-transfer-guide/applications/trader-typescript/src/commands/create.ts b/full-stack-asset-transfer-guide/applications/trader-typescript/src/commands/create.ts
deleted file mode 100644
index 423a7968..00000000
--- a/full-stack-asset-transfer-guide/applications/trader-typescript/src/commands/create.ts
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright IBM Corp. All Rights Reserved.
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-
-import { Gateway } from '@hyperledger/fabric-gateway';
-import { CHAINCODE_NAME, CHANNEL_NAME } from '../config';
-import { AssetTransfer } from '../contract';
-import { assertDefined } from '../utils';
-
-const usage = 'Arguments: ';
-
-export default async function main(gateway: Gateway, args: string[]): Promise {
- const assetId = assertDefined(args[0], usage);
- const owner = assertDefined(args[1], usage);
- const color = assertDefined(args[2], usage);
-
- const network = gateway.getNetwork(CHANNEL_NAME);
- const contract = network.getContract(CHAINCODE_NAME);
-
- const smartContract = new AssetTransfer(contract);
- await smartContract.createAsset({
- ID: assetId,
- Owner: owner,
- Color: color,
- Size: 1,
- AppraisedValue: 1,
- });
-}
diff --git a/full-stack-asset-transfer-guide/applications/trader-typescript/src/commands/delete.ts b/full-stack-asset-transfer-guide/applications/trader-typescript/src/commands/delete.ts
deleted file mode 100644
index 4cd5df34..00000000
--- a/full-stack-asset-transfer-guide/applications/trader-typescript/src/commands/delete.ts
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright IBM Corp. All Rights Reserved.
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-
-import { Gateway } from '@hyperledger/fabric-gateway';
-import { CHAINCODE_NAME, CHANNEL_NAME } from '../config';
-import { AssetTransfer } from '../contract';
-import { assertDefined } from '../utils';
-
-export default async function main(gateway: Gateway, args: string[]): Promise {
- const assetId = assertDefined(args[0], 'Arguments: ');
-
- const network = gateway.getNetwork(CHANNEL_NAME);
- const contract = network.getContract(CHAINCODE_NAME);
-
- const smartContract = new AssetTransfer(contract);
- await smartContract.deleteAsset(assetId);
-}
diff --git a/full-stack-asset-transfer-guide/applications/trader-typescript/src/commands/getAllAssets.ts b/full-stack-asset-transfer-guide/applications/trader-typescript/src/commands/getAllAssets.ts
deleted file mode 100644
index c849363c..00000000
--- a/full-stack-asset-transfer-guide/applications/trader-typescript/src/commands/getAllAssets.ts
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright IBM Corp. All Rights Reserved.
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-
-import { Gateway } from '@hyperledger/fabric-gateway';
-import { CHAINCODE_NAME, CHANNEL_NAME } from '../config';
-import { AssetTransfer } from '../contract';
-
-export default async function main(gateway: Gateway): Promise {
- const network = gateway.getNetwork(CHANNEL_NAME);
- const contract = network.getContract(CHAINCODE_NAME);
-
- const smartContract = new AssetTransfer(contract);
- const assets = await smartContract.getAllAssets();
-
- const assetsJson = JSON.stringify(assets, undefined, 2);
- // Write line-by-line to avoid truncation
- assetsJson.split('\n').forEach((line) => {
- console.log(line);
- });
-}
diff --git a/full-stack-asset-transfer-guide/applications/trader-typescript/src/commands/index.ts b/full-stack-asset-transfer-guide/applications/trader-typescript/src/commands/index.ts
deleted file mode 100644
index 1293ff64..00000000
--- a/full-stack-asset-transfer-guide/applications/trader-typescript/src/commands/index.ts
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Copyright IBM Corp. All Rights Reserved.
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-
-import { Gateway } from '@hyperledger/fabric-gateway';
-import create from './create';
-import deleteCommand from './delete';
-import getAllAssets from './getAllAssets';
-import listen from './listen';
-import read from './read';
-import transact from './transact';
-import transfer from './transfer';
-
-export type Command = (gateway: Gateway, args: string[]) => Promise;
-
-export const commands: Record = {
- create,
- delete: deleteCommand,
- getAllAssets,
- listen,
- read,
- transact,
- transfer,
-};
diff --git a/full-stack-asset-transfer-guide/applications/trader-typescript/src/commands/listen.ts b/full-stack-asset-transfer-guide/applications/trader-typescript/src/commands/listen.ts
deleted file mode 100644
index 488bef99..00000000
--- a/full-stack-asset-transfer-guide/applications/trader-typescript/src/commands/listen.ts
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright IBM Corp. All Rights Reserved.
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-
-import { ChaincodeEvent, checkpointers, Gateway } from '@hyperledger/fabric-gateway';
-import * as path from 'path';
-import { CHAINCODE_NAME, CHANNEL_NAME } from '../config';
-import { ExpectedError } from '../expectedError';
-import { printable } from '../utils';
-
-const checkpointFile = path.resolve(process.env.CHECKPOINT_FILE ?? 'checkpoint.json');
-const simulatedFailureCount = getSimulatedFailureCount();
-
-const startBlock = BigInt(0);
-
-export default async function main(gateway: Gateway): Promise {
- const network = gateway.getNetwork(CHANNEL_NAME);
- const checkpointer = await checkpointers.file(checkpointFile);
-
- console.log('Starting event listening from block', checkpointer.getBlockNumber() ?? startBlock);
- console.log('Last processed transaction ID within block:', checkpointer.getTransactionId());
- if (simulatedFailureCount > 0) {
- console.log('Simulating a write failure every', simulatedFailureCount, 'transactions');
- }
-
- const events = await network.getChaincodeEvents(CHAINCODE_NAME, {
- startBlock, // Used only if there is no checkpoint block number
- });
-
- try {
- for await (const event of events) {
- onEvent(event);
- }
- } finally {
- events.close();
- }
-}
-
-function onEvent(event: ChaincodeEvent): void {
- simulateFailureIfRequired();
-
- console.log(printable(event));
-}
-
-function getSimulatedFailureCount(): number {
- const value = process.env.SIMULATED_FAILURE_COUNT ?? '0';
- const count = Math.floor(Number(value));
- if (isNaN(count) || count < 0) {
- throw new Error(`Invalid SIMULATED_FAILURE_COUNT value: ${String(value)}`);
- }
-
- return count;
-}
-
-let eventCount = 0; // Used only to simulate failures
-
-function simulateFailureIfRequired(): void {
- if (simulatedFailureCount > 0 && eventCount++ >= simulatedFailureCount) {
- eventCount = 0;
- throw new ExpectedError('Simulated write failure');
- }
-}
diff --git a/full-stack-asset-transfer-guide/applications/trader-typescript/src/commands/read.ts b/full-stack-asset-transfer-guide/applications/trader-typescript/src/commands/read.ts
deleted file mode 100644
index 57ac9280..00000000
--- a/full-stack-asset-transfer-guide/applications/trader-typescript/src/commands/read.ts
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright IBM Corp. All Rights Reserved.
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-
-import { Gateway } from '@hyperledger/fabric-gateway';
-import { CHAINCODE_NAME, CHANNEL_NAME } from '../config';
-import { AssetTransfer } from '../contract';
-import { assertDefined } from '../utils';
-
-export default async function main(gateway: Gateway, args: string[]): Promise {
- const assetId = assertDefined(args[0], 'Arguments: ');
-
- const network = gateway.getNetwork(CHANNEL_NAME);
- const contract = network.getContract(CHAINCODE_NAME);
-
- const smartContract = new AssetTransfer(contract);
- const asset = await smartContract.readAsset(assetId);
-
- const assetsJson = JSON.stringify(asset, undefined, 2);
- console.log(assetsJson);
-}
diff --git a/full-stack-asset-transfer-guide/applications/trader-typescript/src/commands/transact.ts b/full-stack-asset-transfer-guide/applications/trader-typescript/src/commands/transact.ts
deleted file mode 100644
index 591c26d7..00000000
--- a/full-stack-asset-transfer-guide/applications/trader-typescript/src/commands/transact.ts
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright IBM Corp. All Rights Reserved.
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-
-import { Gateway } from '@hyperledger/fabric-gateway';
-import * as crypto from 'crypto';
-import { CHAINCODE_NAME, CHANNEL_NAME } from '../config';
-import { AssetCreate, AssetTransfer } from '../contract';
-import { allFulfilled, differentElement, randomElement, randomInt } from '../utils';
-
-export default async function main(gateway: Gateway): Promise