mirror of
https://github.com/hyperledger/fabric-samples.git
synced 2026-06-26 11:35:10 +00:00
Merge branch 'hyperledger:main' into feature/test-network-k8s
This commit is contained in:
commit
05aa40789a
16 changed files with 81 additions and 19 deletions
|
|
@ -6,11 +6,18 @@
|
||||||
"node": ">=12",
|
"node": ">=12",
|
||||||
"npm": ">=5"
|
"npm": ">=5"
|
||||||
},
|
},
|
||||||
|
"scripts": {
|
||||||
|
"lint": "eslint *.js",
|
||||||
|
"pretest": "npm run lint"
|
||||||
|
},
|
||||||
"engineStrict": true,
|
"engineStrict": true,
|
||||||
"author": "Hyperledger",
|
"author": "Hyperledger",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"fabric-ca-client": "^2.2.4",
|
"fabric-ca-client": "^2.2.4",
|
||||||
"fabric-network": "^2.2.4"
|
"fabric-network": "^2.2.4"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"eslint": "^7.32.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@
|
||||||
"npm": ">=5"
|
"npm": ">=5"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"lint": "eslint .",
|
"lint": "eslint *.js */**.js",
|
||||||
"pretest": "npm run lint",
|
"pretest": "npm run lint",
|
||||||
"test": "nyc mocha --recursive",
|
"test": "nyc mocha --recursive",
|
||||||
"start": "fabric-chaincode-node start"
|
"start": "fabric-chaincode-node start"
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,9 @@
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*/
|
||||||
// Deterministic JSON.stringify()
|
// Deterministic JSON.stringify()
|
||||||
|
import {Context, Contract, Info, Returns, Transaction} from 'fabric-contract-api';
|
||||||
import * as stringify from 'json-stringify-deterministic';
|
import * as stringify from 'json-stringify-deterministic';
|
||||||
import * as sortKeysRecursive from 'sort-keys-recursive';
|
import * as sortKeysRecursive from 'sort-keys-recursive';
|
||||||
import {Context, Contract, Info, Returns, Transaction} from 'fabric-contract-api';
|
|
||||||
import {Asset} from './asset';
|
import {Asset} from './asset';
|
||||||
|
|
||||||
@Info({title: 'AssetTransfer', description: 'Smart contract for trading assets'})
|
@Info({title: 'AssetTransfer', description: 'Smart contract for trading assets'})
|
||||||
|
|
|
||||||
|
|
@ -9,8 +9,14 @@
|
||||||
"engineStrict": true,
|
"engineStrict": true,
|
||||||
"author": "Hyperledger",
|
"author": "Hyperledger",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
|
"scripts": {
|
||||||
|
"lint": "eslint *.js"
|
||||||
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"fabric-ca-client": "^2.2.2",
|
"fabric-ca-client": "^2.2.2",
|
||||||
"fabric-network": "^2.2.2"
|
"fabric-network": "^2.2.2"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"eslint": "^7.32.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,8 +9,14 @@
|
||||||
"engineStrict": true,
|
"engineStrict": true,
|
||||||
"author": "Hyperledger",
|
"author": "Hyperledger",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
|
"scripts": {
|
||||||
|
"lint": "eslint *.js"
|
||||||
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"fabric-ca-client": "^2.2.4",
|
"fabric-ca-client": "^2.2.4",
|
||||||
"fabric-network": "^2.2.4"
|
"fabric-network": "^2.2.4"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"eslint": "^7.32.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,12 +8,16 @@
|
||||||
"npm": ">=5.3.0"
|
"npm": ">=5.3.0"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "fabric-chaincode-node start"
|
"start": "fabric-chaincode-node start",
|
||||||
|
"lint": "eslint *.js */**.js"
|
||||||
},
|
},
|
||||||
"engine-strict": true,
|
"engine-strict": true,
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"fabric-contract-api": "^2.0.0",
|
"fabric-contract-api": "^2.0.0",
|
||||||
"fabric-shim": "^2.0.0"
|
"fabric-shim": "^2.0.0"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"eslint": "^7.32.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,8 +9,14 @@
|
||||||
"engineStrict": true,
|
"engineStrict": true,
|
||||||
"author": "Hyperledger",
|
"author": "Hyperledger",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
|
"scripts": {
|
||||||
|
"lint": "eslint *.js"
|
||||||
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"fabric-ca-client": "^2.2.4",
|
"fabric-ca-client": "^2.2.4",
|
||||||
"fabric-network": "^2.2.4"
|
"fabric-network": "^2.2.4"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"eslint": "^7.32.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,8 +9,14 @@
|
||||||
"engineStrict": true,
|
"engineStrict": true,
|
||||||
"author": "Hyperledger",
|
"author": "Hyperledger",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
|
"scripts": {
|
||||||
|
"lint": "eslint *.js"
|
||||||
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"fabric-ca-client": "^2.2.4",
|
"fabric-ca-client": "^2.2.4",
|
||||||
"fabric-network": "^2.2.4"
|
"fabric-network": "^2.2.4"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"eslint": "^7.32.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,10 @@
|
||||||
"engineStrict": true,
|
"engineStrict": true,
|
||||||
"author": "Hyperledger",
|
"author": "Hyperledger",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
|
"scripts": {
|
||||||
|
"lint": "eslint *.js"
|
||||||
|
|
||||||
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"fabric-ca-client": "^2.2.4",
|
"fabric-ca-client": "^2.2.4",
|
||||||
"fabric-network": "^2.2.4"
|
"fabric-network": "^2.2.4"
|
||||||
|
|
|
||||||
|
|
@ -9,8 +9,14 @@
|
||||||
"engineStrict": true,
|
"engineStrict": true,
|
||||||
"author": "Hyperledger",
|
"author": "Hyperledger",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
|
"scripts": {
|
||||||
|
"lint": "eslint *.js"
|
||||||
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"fabric-ca-client": "^2.2.4",
|
"fabric-ca-client": "^2.2.4",
|
||||||
"fabric-network": "^2.2.4"
|
"fabric-network": "^2.2.4"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"eslint": "^7.32.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -85,8 +85,6 @@ jobs:
|
||||||
inputs:
|
inputs:
|
||||||
versionSpec: $(NODE_VER)
|
versionSpec: $(NODE_VER)
|
||||||
displayName: Install Node.js
|
displayName: Install Node.js
|
||||||
- script: npm install -g typescript eslint tslint
|
|
||||||
displayName: Install Javascript Linting Deps
|
|
||||||
- script: ./ci/scripts/lint.sh
|
- script: ./ci/scripts/lint.sh
|
||||||
displayName: Lint Code
|
displayName: Lint Code
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,13 +29,11 @@ for dir in $dirs; do
|
||||||
print "The following files contain import errors, please run 'goimports -l -w <path>' to fix these issues:"
|
print "The following files contain import errors, please run 'goimports -l -w <path>' to fix these issues:"
|
||||||
echo "${output}"
|
echo "${output}"
|
||||||
fi
|
fi
|
||||||
elif [[ "$dir" =~ "-javascript" ]]; then
|
elif [[ "$dir" =~ "-javascript" || "$dir" =~ "-typescript" ]]; then
|
||||||
print "Running ESLint"
|
print "Installing node modules"
|
||||||
if [[ "$dir" =~ "chaincode" ]]; then
|
npm install
|
||||||
eslint *.js */**.js
|
print "Running Lint"
|
||||||
else
|
npm run lint
|
||||||
eslint *.js
|
|
||||||
fi
|
|
||||||
elif [[ "$dir" =~ "-java" ]]; then
|
elif [[ "$dir" =~ "-java" ]]; then
|
||||||
if [[ -f "pom.xml" ]]; then
|
if [[ -f "pom.xml" ]]; then
|
||||||
print "Running Maven Build"
|
print "Running Maven Build"
|
||||||
|
|
@ -44,9 +42,6 @@ for dir in $dirs; do
|
||||||
print "Running Gradle Build"
|
print "Running Gradle Build"
|
||||||
./gradlew build
|
./gradlew build
|
||||||
fi
|
fi
|
||||||
elif [[ "$dir" =~ "-typescript" ]]; then
|
|
||||||
print "Running TSLint"
|
|
||||||
tslint --project .
|
|
||||||
fi
|
fi
|
||||||
popd
|
popd
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,12 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
|
if [ "$(uname)" == "Linux" ] ; then
|
||||||
|
CCADDR="127.0.0.1"
|
||||||
|
else
|
||||||
|
CCADDR="host.docker.internal"
|
||||||
|
fi
|
||||||
|
|
||||||
# look for binaries in local dev environment /build/bin directory and then in local samples /bin directory
|
# look for binaries in local dev environment /build/bin directory and then in local samples /bin directory
|
||||||
export PATH="${PWD}"/../../fabric/build/bin:"${PWD}"/../bin:"$PATH"
|
export PATH="${PWD}"/../../fabric/build/bin:"${PWD}"/../bin:"$PATH"
|
||||||
export FABRIC_CFG_PATH="${PWD}"/../config
|
export FABRIC_CFG_PATH="${PWD}"/../config
|
||||||
|
|
@ -13,7 +19,7 @@ export CORE_PEER_TLS_ROOTCERT_FILE="${PWD}"/crypto-config/peerOrganizations/org1
|
||||||
export CORE_PEER_ID=peer0.org1.example.com
|
export CORE_PEER_ID=peer0.org1.example.com
|
||||||
export CORE_PEER_ADDRESS=127.0.0.1:7051
|
export CORE_PEER_ADDRESS=127.0.0.1:7051
|
||||||
export CORE_PEER_LISTENADDRESS=127.0.0.1:7051
|
export CORE_PEER_LISTENADDRESS=127.0.0.1:7051
|
||||||
export CORE_PEER_CHAINCODEADDRESS=host.docker.internal:7052
|
export CORE_PEER_CHAINCODEADDRESS="${CCADDR}":7052
|
||||||
export CORE_PEER_CHAINCODELISTENADDRESS=127.0.0.1:7052
|
export CORE_PEER_CHAINCODELISTENADDRESS=127.0.0.1:7052
|
||||||
# bootstrap peer is the other peer in the same org
|
# bootstrap peer is the other peer in the same org
|
||||||
export CORE_PEER_GOSSIP_BOOTSTRAP=127.0.0.1:7053
|
export CORE_PEER_GOSSIP_BOOTSTRAP=127.0.0.1:7053
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,12 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
|
if [ "$(uname)" == "Linux" ] ; then
|
||||||
|
CCADDR="127.0.0.1"
|
||||||
|
else
|
||||||
|
CCADDR="host.docker.internal"
|
||||||
|
fi
|
||||||
|
|
||||||
# look for binaries in local dev environment /build/bin directory and then in local samples /bin directory
|
# look for binaries in local dev environment /build/bin directory and then in local samples /bin directory
|
||||||
export PATH="${PWD}"/../../fabric/build/bin:"${PWD}"/../bin:"$PATH"
|
export PATH="${PWD}"/../../fabric/build/bin:"${PWD}"/../bin:"$PATH"
|
||||||
export FABRIC_CFG_PATH="${PWD}"/../config
|
export FABRIC_CFG_PATH="${PWD}"/../config
|
||||||
|
|
@ -13,7 +19,7 @@ export CORE_PEER_TLS_ROOTCERT_FILE="${PWD}"/crypto-config/peerOrganizations/org1
|
||||||
export CORE_PEER_ID=peer1.org1.example.com
|
export CORE_PEER_ID=peer1.org1.example.com
|
||||||
export CORE_PEER_ADDRESS=127.0.0.1:7053
|
export CORE_PEER_ADDRESS=127.0.0.1:7053
|
||||||
export CORE_PEER_LISTENADDRESS=127.0.0.1:7053
|
export CORE_PEER_LISTENADDRESS=127.0.0.1:7053
|
||||||
export CORE_PEER_CHAINCODEADDRESS=host.docker.internal:7054
|
export CORE_PEER_CHAINCODEADDRESS="${CCADDR}":7054
|
||||||
export CORE_PEER_CHAINCODELISTENADDRESS=127.0.0.1:7054
|
export CORE_PEER_CHAINCODELISTENADDRESS=127.0.0.1:7054
|
||||||
# bootstrap peer is the other peer in the same org
|
# bootstrap peer is the other peer in the same org
|
||||||
export CORE_PEER_GOSSIP_BOOTSTRAP=127.0.0.1:7051
|
export CORE_PEER_GOSSIP_BOOTSTRAP=127.0.0.1:7051
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,12 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
|
if [ "$(uname)" == "Linux" ] ; then
|
||||||
|
CCADDR="127.0.0.1"
|
||||||
|
else
|
||||||
|
CCADDR="host.docker.internal"
|
||||||
|
fi
|
||||||
|
|
||||||
# look for binaries in local dev environment /build/bin directory and then in local samples /bin directory
|
# look for binaries in local dev environment /build/bin directory and then in local samples /bin directory
|
||||||
export PATH="${PWD}"/../../fabric/build/bin:"${PWD}"/../bin:"$PATH"
|
export PATH="${PWD}"/../../fabric/build/bin:"${PWD}"/../bin:"$PATH"
|
||||||
export FABRIC_CFG_PATH="${PWD}"/../config
|
export FABRIC_CFG_PATH="${PWD}"/../config
|
||||||
|
|
@ -13,7 +19,7 @@ export CORE_PEER_TLS_ROOTCERT_FILE="${PWD}"/crypto-config/peerOrganizations/org2
|
||||||
export CORE_PEER_ID=peer0.org2.example.com
|
export CORE_PEER_ID=peer0.org2.example.com
|
||||||
export CORE_PEER_ADDRESS=127.0.0.1:7055
|
export CORE_PEER_ADDRESS=127.0.0.1:7055
|
||||||
export CORE_PEER_LISTENADDRESS=127.0.0.1:7055
|
export CORE_PEER_LISTENADDRESS=127.0.0.1:7055
|
||||||
export CORE_PEER_CHAINCODEADDRESS=host.docker.internal:7056
|
export CORE_PEER_CHAINCODEADDRESS="${CCADDR}":7056
|
||||||
export CORE_PEER_CHAINCODELISTENADDRESS=127.0.0.1:7056
|
export CORE_PEER_CHAINCODELISTENADDRESS=127.0.0.1:7056
|
||||||
# bootstrap peer is the other peer in the same org
|
# bootstrap peer is the other peer in the same org
|
||||||
export CORE_PEER_GOSSIP_BOOTSTRAP=127.0.0.1:7057
|
export CORE_PEER_GOSSIP_BOOTSTRAP=127.0.0.1:7057
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,12 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
|
if [ "$(uname)" == "Linux" ] ; then
|
||||||
|
CCADDR="127.0.0.1"
|
||||||
|
else
|
||||||
|
CCADDR="host.docker.internal"
|
||||||
|
fi
|
||||||
|
|
||||||
# look for binaries in local dev environment /build/bin directory and then in local samples /bin directory
|
# look for binaries in local dev environment /build/bin directory and then in local samples /bin directory
|
||||||
export PATH="${PWD}"/../../fabric/build/bin:"${PWD}"/../bin:"$PATH"
|
export PATH="${PWD}"/../../fabric/build/bin:"${PWD}"/../bin:"$PATH"
|
||||||
export FABRIC_CFG_PATH="${PWD}"/../config
|
export FABRIC_CFG_PATH="${PWD}"/../config
|
||||||
|
|
@ -13,7 +19,7 @@ export CORE_PEER_TLS_ROOTCERT_FILE="${PWD}"/crypto-config/peerOrganizations/org2
|
||||||
export CORE_PEER_ID=peer0.org2.example.com
|
export CORE_PEER_ID=peer0.org2.example.com
|
||||||
export CORE_PEER_ADDRESS=127.0.0.1:7057
|
export CORE_PEER_ADDRESS=127.0.0.1:7057
|
||||||
export CORE_PEER_LISTENADDRESS=127.0.0.1:7057
|
export CORE_PEER_LISTENADDRESS=127.0.0.1:7057
|
||||||
export CORE_PEER_CHAINCODEADDRESS=host.docker.internal:7058
|
export CORE_PEER_CHAINCODEADDRESS="${CCADDR}":7058
|
||||||
export CORE_PEER_CHAINCODELISTENADDRESS=127.0.0.1:7058
|
export CORE_PEER_CHAINCODELISTENADDRESS=127.0.0.1:7058
|
||||||
# bootstrap peer is the other peer in the same org
|
# bootstrap peer is the other peer in the same org
|
||||||
export CORE_PEER_GOSSIP_BOOTSTRAP=127.0.0.1:7055
|
export CORE_PEER_GOSSIP_BOOTSTRAP=127.0.0.1:7055
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue