mirror of
https://github.com/hyperledger/fabric-samples.git
synced 2026-06-17 07:25:10 +00:00
Delete commercial paper and fabcar tests from Azure
Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
This commit is contained in:
parent
0ce94bbb9b
commit
156f6d42fb
14 changed files with 163 additions and 594 deletions
53
.github/actions/test-network-setup/action.yaml
vendored
Normal file
53
.github/actions/test-network-setup/action.yaml
vendored
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
name: Set up Test Network Runner
|
||||
description: Set up the Test Network Runtime
|
||||
inputs:
|
||||
go-version:
|
||||
description: Version of go
|
||||
default: 1.18.3
|
||||
node-version:
|
||||
description: Version of node
|
||||
default: 16.x
|
||||
java-version:
|
||||
description: Version of JDK
|
||||
default: 11.x
|
||||
# todo : set fabric target version ...
|
||||
# fabric-version:
|
||||
# description: Version of Fabric
|
||||
# default: 2.5
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: ${{ inputs.go-version }}
|
||||
cache: true
|
||||
cache-dependency-path: '**/go.sum'
|
||||
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: ${{ inputs.node-version }}
|
||||
cache: 'npm'
|
||||
cache-dependency-path: '**/package-lock.json'
|
||||
|
||||
- uses: actions/setup-java@v3
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: ${{ inputs.java-version }}
|
||||
# todo: how to cache both gradle and maven? (Better: port maven -> gradle)
|
||||
cache: gradle
|
||||
|
||||
- name: Install fabric CLI
|
||||
shell: bash
|
||||
run: |
|
||||
curl -sSL https://raw.githubusercontent.com/hyperledger/fabric/main/scripts/install-fabric.sh | bash -s -- binary
|
||||
echo ${PWD}/bin >> $GITHUB_PATH
|
||||
|
||||
- name: Pull Fabric Docker Images
|
||||
shell: bash
|
||||
run: curl -sSL https://raw.githubusercontent.com/hyperledger/fabric/main/scripts/install-fabric.sh | bash -s -- docker
|
||||
|
||||
- name: Install retry CLI
|
||||
shell: bash
|
||||
run: curl -sSL https://raw.githubusercontent.com/kadwanev/retry/master/retry -o ./bin/retry && chmod +x ./bin/retry
|
||||
|
||||
45
.github/workflows/test-network-basic.yaml
vendored
45
.github/workflows/test-network-basic.yaml
vendored
|
|
@ -1,45 +0,0 @@
|
|||
name: Test Network Basic
|
||||
run-name: ${{ github.actor }} is running the test-network basic tests
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
basic:
|
||||
runs-on: ubuntu-20.04
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
chaincode-language:
|
||||
- go
|
||||
- javascript
|
||||
- typescript
|
||||
- java
|
||||
|
||||
steps:
|
||||
- name: checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Install fabric CLI
|
||||
run: |
|
||||
curl -sSL https://raw.githubusercontent.com/hyperledger/fabric/main/scripts/install-fabric.sh | bash -s -- binary
|
||||
echo ${PWD}/bin >> $GITHUB_PATH
|
||||
|
||||
- name: Pull Fabric Docker Images
|
||||
run: curl -sSL https://raw.githubusercontent.com/hyperledger/fabric/main/scripts/install-fabric.sh | bash -s -- docker
|
||||
|
||||
- name: Install retry CLI
|
||||
run: curl -sSL https://raw.githubusercontent.com/kadwanev/retry/master/retry -o ./bin/retry && chmod +x ./bin/retry
|
||||
|
||||
- name: Run Test Network Basic
|
||||
working-directory: test-network
|
||||
env:
|
||||
CHAINCODE_LANGUAGE: ${{ matrix.chaincode-language }}
|
||||
run: ../ci/scripts/run-test-network-basic.sh
|
||||
|
||||
45
.github/workflows/test-network-gateway.yaml
vendored
45
.github/workflows/test-network-gateway.yaml
vendored
|
|
@ -1,45 +0,0 @@
|
|||
name: Test Network Gateway
|
||||
run-name: ${{ github.actor }} is running the test-network gateway tests
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
gateway:
|
||||
runs-on: ubuntu-20.04
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
chaincode-language:
|
||||
- go
|
||||
- javascript
|
||||
- typescript
|
||||
- java
|
||||
|
||||
steps:
|
||||
- name: checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Install fabric CLI
|
||||
run: |
|
||||
curl -sSL https://raw.githubusercontent.com/hyperledger/fabric/main/scripts/install-fabric.sh | bash -s -- binary
|
||||
echo ${PWD}/bin >> $GITHUB_PATH
|
||||
|
||||
- name: Pull Fabric Docker Images
|
||||
run: curl -sSL https://raw.githubusercontent.com/hyperledger/fabric/main/scripts/install-fabric.sh | bash -s -- docker
|
||||
|
||||
- name: Install retry CLI
|
||||
run: curl -sSL https://raw.githubusercontent.com/kadwanev/retry/master/retry -o ./bin/retry && chmod +x ./bin/retry
|
||||
|
||||
- name: Run Test Network Off Chain
|
||||
working-directory: test-network
|
||||
env:
|
||||
CHAINCODE_LANGUAGE: ${{ matrix.chaincode-language }}
|
||||
run: ../ci/scripts/run-test-network-gateway.sh
|
||||
|
||||
54
.github/workflows/test-network-hsm.yaml
vendored
54
.github/workflows/test-network-hsm.yaml
vendored
|
|
@ -1,54 +0,0 @@
|
|||
name: Test Network HSM
|
||||
run-name: ${{ github.actor }} is running the test-network HSM tests
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
hsm:
|
||||
runs-on: ubuntu-20.04
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
chaincode-language:
|
||||
- go
|
||||
- javascript
|
||||
- typescript
|
||||
- java
|
||||
|
||||
steps:
|
||||
- name: checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Install fabric CLI
|
||||
run: |
|
||||
curl -sSL https://raw.githubusercontent.com/hyperledger/fabric/main/scripts/install-fabric.sh | bash -s -- binary
|
||||
echo ${PWD}/bin >> $GITHUB_PATH
|
||||
|
||||
- name: Pull Fabric Docker Images
|
||||
run: curl -sSL https://raw.githubusercontent.com/hyperledger/fabric/main/scripts/install-fabric.sh | bash -s -- docker
|
||||
|
||||
- name: Install retry CLI
|
||||
run: curl -sSL https://raw.githubusercontent.com/kadwanev/retry/master/retry -o ./bin/retry && chmod +x ./bin/retry
|
||||
|
||||
- name: Install SoftHSM
|
||||
run: sudo apt install -y softhsm2
|
||||
|
||||
- name: Set up SoftHSM
|
||||
run: |
|
||||
echo directories.tokendir = /tmp > $HOME/softhsm2.conf
|
||||
export SOFTHSM2_CONF=$HOME/softhsm2.conf
|
||||
softhsm2-util --init-token --slot 0 --label "ForFabric" --pin 98765432 --so-pin 1234
|
||||
|
||||
- name: Run Test Network HSM
|
||||
working-directory: test-network
|
||||
env:
|
||||
CHAINCODE_LANGUAGE: ${{ matrix.chaincode-language }}
|
||||
run: ../ci/scripts/run-test-network-hsm.sh
|
||||
|
||||
|
|
@ -1,45 +0,0 @@
|
|||
name: Test Network Off Chain
|
||||
run-name: ${{ github.actor }} is running the test-network off chain data tests
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
off-chain:
|
||||
runs-on: ubuntu-20.04
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
chaincode-language:
|
||||
- go
|
||||
- javascript
|
||||
- typescript
|
||||
- java
|
||||
|
||||
steps:
|
||||
- name: checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Install fabric CLI
|
||||
run: |
|
||||
curl -sSL https://raw.githubusercontent.com/hyperledger/fabric/main/scripts/install-fabric.sh | bash -s -- binary
|
||||
echo ${PWD}/bin >> $GITHUB_PATH
|
||||
|
||||
- name: Pull Fabric Docker Images
|
||||
run: curl -sSL https://raw.githubusercontent.com/hyperledger/fabric/main/scripts/install-fabric.sh | bash -s -- docker
|
||||
|
||||
- name: Install retry CLI
|
||||
run: curl -sSL https://raw.githubusercontent.com/kadwanev/retry/master/retry -o ./bin/retry && chmod +x ./bin/retry
|
||||
|
||||
- name: Run Test Network Off Chain
|
||||
working-directory: test-network
|
||||
env:
|
||||
CHAINCODE_LANGUAGE: ${{ matrix.chaincode-language }}
|
||||
run: ../ci/scripts/run-test-network-off-chain.sh
|
||||
|
||||
110
.github/workflows/test-network.yaml
vendored
Normal file
110
.github/workflows/test-network.yaml
vendored
Normal file
|
|
@ -0,0 +1,110 @@
|
|||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
name: Test Network
|
||||
run-name: ${{ github.actor }} is testing the Test Network
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches: [ "main" ]
|
||||
pull_request:
|
||||
branches: [ "main" ]
|
||||
|
||||
jobs:
|
||||
basic:
|
||||
runs-on: ubuntu-20.04
|
||||
strategy:
|
||||
matrix:
|
||||
chaincode-language:
|
||||
- go
|
||||
- javascript
|
||||
- typescript
|
||||
- java
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set up the test network runtime
|
||||
uses: ./.github/actions/test-network-setup
|
||||
|
||||
- name: Run Test Network Basic
|
||||
working-directory: test-network
|
||||
run: ../ci/scripts/run-test-network-basic.sh
|
||||
env:
|
||||
CHAINCODE_LANGUAGE: ${{ matrix.chaincode-language }}
|
||||
|
||||
off-chain:
|
||||
runs-on: ubuntu-20.04
|
||||
strategy:
|
||||
matrix:
|
||||
chaincode-language:
|
||||
- go
|
||||
- javascript
|
||||
- typescript
|
||||
- java
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set up the test network runtime
|
||||
uses: ./.github/actions/test-network-setup
|
||||
|
||||
- name: Run Test Network Off Chain
|
||||
working-directory: test-network
|
||||
env:
|
||||
CHAINCODE_LANGUAGE: ${{ matrix.chaincode-language }}
|
||||
run: ../ci/scripts/run-test-network-off-chain.sh
|
||||
|
||||
hsm:
|
||||
runs-on: ubuntu-20.04
|
||||
strategy:
|
||||
matrix:
|
||||
chaincode-language:
|
||||
- go
|
||||
- javascript
|
||||
- typescript
|
||||
- java
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set up the test network runtime
|
||||
uses: ./.github/actions/test-network-setup
|
||||
|
||||
- name: Install SoftHSM
|
||||
run: sudo apt install -y softhsm2
|
||||
|
||||
- name: Set up SoftHSM
|
||||
run: |
|
||||
echo directories.tokendir = /tmp > $HOME/softhsm2.conf
|
||||
export SOFTHSM2_CONF=$HOME/softhsm2.conf
|
||||
softhsm2-util --init-token --slot 0 --label "ForFabric" --pin 98765432 --so-pin 1234
|
||||
|
||||
- name: Run Test Network HSM
|
||||
working-directory: test-network
|
||||
env:
|
||||
CHAINCODE_LANGUAGE: ${{ matrix.chaincode-language }}
|
||||
run: ../ci/scripts/run-test-network-hsm.sh
|
||||
|
||||
gateway:
|
||||
runs-on: ubuntu-20.04
|
||||
strategy:
|
||||
matrix:
|
||||
chaincode-language:
|
||||
- go
|
||||
- javascript
|
||||
- typescript
|
||||
- java
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set up the test network runtime
|
||||
uses: ./.github/actions/test-network-setup
|
||||
|
||||
- name: Run Test Network Off Chain
|
||||
working-directory: test-network
|
||||
env:
|
||||
CHAINCODE_LANGUAGE: ${{ matrix.chaincode-language }}
|
||||
run: ../ci/scripts/run-test-network-gateway.sh
|
||||
|
|
@ -31,62 +31,6 @@ jobs:
|
|||
steps:
|
||||
- template: templates/asset-transfer-basic/azure-pipelines-rest.yml
|
||||
|
||||
- job: CommercialPaper_Go
|
||||
displayName: Commercial Paper (Go)
|
||||
pool:
|
||||
vmImage: ubuntu-20.04
|
||||
steps:
|
||||
- template: templates/install-deps.yml
|
||||
- template: templates/commercial-paper/azure-pipelines-go.yml
|
||||
|
||||
- job: CommercialPaper_Java
|
||||
displayName: Commercial Paper (Java)
|
||||
pool:
|
||||
vmImage: ubuntu-20.04
|
||||
steps:
|
||||
- template: templates/install-deps.yml
|
||||
- template: templates/commercial-paper/azure-pipelines-java.yml
|
||||
|
||||
- job: CommercialPaper_JavaScript
|
||||
displayName: Commercial Paper (JavaScript)
|
||||
pool:
|
||||
vmImage: ubuntu-20.04
|
||||
steps:
|
||||
- template: templates/install-deps.yml
|
||||
- template: templates/commercial-paper/azure-pipelines-javascript.yml
|
||||
|
||||
- job: FabCar_Go
|
||||
displayName: FabCar (Go)
|
||||
pool:
|
||||
vmImage: ubuntu-20.04
|
||||
steps:
|
||||
- template: templates/install-deps.yml
|
||||
- template: templates/fabcar/azure-pipelines-go.yml
|
||||
|
||||
- job: FabCar_Java
|
||||
displayName: FabCar (Java)
|
||||
pool:
|
||||
vmImage: ubuntu-20.04
|
||||
steps:
|
||||
- template: templates/install-deps.yml
|
||||
- template: templates/fabcar/azure-pipelines-java.yml
|
||||
|
||||
- job: FabCar_JavaScript
|
||||
displayName: FabCar (JavaScript)
|
||||
pool:
|
||||
vmImage: ubuntu-20.04
|
||||
steps:
|
||||
- template: templates/install-deps.yml
|
||||
- template: templates/fabcar/azure-pipelines-javascript.yml
|
||||
|
||||
- job: Fabcar_TypeScript
|
||||
displayName: FabCar (TypeScript)
|
||||
pool:
|
||||
vmImage: ubuntu-20.04
|
||||
steps:
|
||||
- template: templates/install-deps.yml
|
||||
- template: templates/fabcar/azure-pipelines-typescript.yml
|
||||
|
||||
- job: KubeTestNetworkBasic
|
||||
displayName: Kube Test Network
|
||||
pool:
|
||||
|
|
|
|||
|
|
@ -1,97 +0,0 @@
|
|||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
steps:
|
||||
- script: go test ./...
|
||||
workingDirectory: commercial-paper/organization/magnetocorp/contract-go
|
||||
displayName: Unit Test MagnetoCorp Chaincode
|
||||
- script: go test ./...
|
||||
workingDirectory: commercial-paper/organization/digibank/contract-go
|
||||
displayName: Unit Test DigiBank Chaincode
|
||||
|
||||
- script: go mod vendor
|
||||
workingDirectory: commercial-paper/organization/magnetocorp/contract-go
|
||||
displayName: Vendor MagnetoCorp Dependencies
|
||||
- script: go mod vendor
|
||||
workingDirectory: commercial-paper/organization/digibank/contract-go
|
||||
displayName: Vendor DigiBank Dependencies
|
||||
|
||||
- script: |
|
||||
./network.sh up createChannel -ca -s couchdb
|
||||
|
||||
# Copy the connection profiles so they are in the correct organizations.
|
||||
cp "./organizations/peerOrganizations/org1.example.com/connection-org1.yaml" "../commercial-paper/organization/digibank/gateway/"
|
||||
cp "./organizations/peerOrganizations/org2.example.com/connection-org2.yaml" "../commercial-paper/organization/magnetocorp/gateway/"
|
||||
workingDirectory: test-network
|
||||
displayName: Start Fabric
|
||||
- script: |
|
||||
source <(./magnetocorp.sh)
|
||||
peer lifecycle chaincode package cp.tar.gz --lang golang --path ./contract-go --label cp_0
|
||||
peer lifecycle chaincode install cp.tar.gz
|
||||
|
||||
export PACKAGE_ID=$(peer lifecycle chaincode queryinstalled --output json | jq -r '.installed_chaincodes[0].package_id')
|
||||
echo $PACKAGE_ID
|
||||
|
||||
peer lifecycle chaincode approveformyorg --orderer localhost:7050 --ordererTLSHostnameOverride orderer.example.com \
|
||||
--channelID mychannel \
|
||||
--name papercontract \
|
||||
-v 0 \
|
||||
--package-id $PACKAGE_ID \
|
||||
--sequence 1 \
|
||||
--tls \
|
||||
--cafile "$ORDERER_CA"
|
||||
|
||||
peer lifecycle chaincode checkcommitreadiness --channelID mychannel --name papercontract -v 0 --sequence 1
|
||||
workingDirectory: commercial-paper/organization/magnetocorp
|
||||
displayName: Setup Commercial Paper Contract
|
||||
- script: |
|
||||
source <(./digibank.sh)
|
||||
peer lifecycle chaincode package cp.tar.gz --lang golang --path ./contract-go --label cp_0
|
||||
peer lifecycle chaincode install cp.tar.gz
|
||||
|
||||
export PACKAGE_ID=$(peer lifecycle chaincode queryinstalled --output json | jq -r '.installed_chaincodes[0].package_id')
|
||||
echo $PACKAGE_ID
|
||||
|
||||
peer lifecycle chaincode approveformyorg --orderer localhost:7050 --ordererTLSHostnameOverride orderer.example.com \
|
||||
--channelID mychannel \
|
||||
--name papercontract \
|
||||
-v 0 \
|
||||
--package-id $PACKAGE_ID \
|
||||
--sequence 1 \
|
||||
--tls \
|
||||
--cafile "$ORDERER_CA"
|
||||
|
||||
peer lifecycle chaincode checkcommitreadiness --channelID mychannel --name papercontract -v 0 --sequence 1
|
||||
|
||||
peer lifecycle chaincode commit -o localhost:7050 \
|
||||
--peerAddresses localhost:7051 --tlsRootCertFiles "${PEER0_ORG1_CA}" \
|
||||
--peerAddresses localhost:9051 --tlsRootCertFiles "${PEER0_ORG2_CA}" \
|
||||
--ordererTLSHostnameOverride orderer.example.com \
|
||||
--channelID mychannel --name papercontract -v 0 \
|
||||
--sequence 1 \
|
||||
--tls --cafile "$ORDERER_CA" --waitForEvent
|
||||
|
||||
workingDirectory: commercial-paper/organization/digibank
|
||||
displayName: Setup Commercial Paper Contract
|
||||
|
||||
- script: retry -- npm install
|
||||
workingDirectory: commercial-paper/organization/magnetocorp/application
|
||||
displayName: Install Magnetocorp Application
|
||||
- script: |
|
||||
set -ex
|
||||
node enrollUser.js
|
||||
node issue.js
|
||||
workingDirectory: commercial-paper/organization/magnetocorp/application
|
||||
displayName: MagnetoCorp Issue Paper
|
||||
|
||||
- script: retry -- npm install
|
||||
workingDirectory: commercial-paper/organization/digibank/application
|
||||
displayName: Install DigiBank Application
|
||||
- script: |
|
||||
set -ex
|
||||
node enrollUser.js
|
||||
node buy.js
|
||||
node redeem.js
|
||||
workingDirectory: commercial-paper/organization/digibank/application
|
||||
displayName: Digibank Issue Paper
|
||||
|
|
@ -1,92 +0,0 @@
|
|||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
steps:
|
||||
- script: |
|
||||
./gradlew build
|
||||
workingDirectory: commercial-paper/organization/digibank/contract-java
|
||||
displayName: Build DigiBank Java Contract
|
||||
- script: |
|
||||
./gradlew build
|
||||
workingDirectory: commercial-paper/organization/magnetocorp/contract-java
|
||||
displayName: Build MagnetoCorp Java Contract
|
||||
|
||||
- script: |
|
||||
./network.sh up createChannel -ca -s couchdb
|
||||
|
||||
# Copy the connection profiles so they are in the correct organizations.
|
||||
cp "./organizations/peerOrganizations/org1.example.com/connection-org1.yaml" "../commercial-paper/organization/digibank/gateway/"
|
||||
cp "./organizations/peerOrganizations/org2.example.com/connection-org2.yaml" "../commercial-paper/organization/magnetocorp/gateway/"
|
||||
workingDirectory: test-network
|
||||
displayName: Start Fabric
|
||||
- script: |
|
||||
source <(./magnetocorp.sh)
|
||||
peer lifecycle chaincode package cp.tar.gz --lang java --path ./contract-java --label cp_0
|
||||
peer lifecycle chaincode install cp.tar.gz
|
||||
|
||||
export PACKAGE_ID=$(peer lifecycle chaincode queryinstalled --output json | jq -r '.installed_chaincodes[0].package_id')
|
||||
echo $PACKAGE_ID
|
||||
|
||||
peer lifecycle chaincode approveformyorg --orderer localhost:7050 --ordererTLSHostnameOverride orderer.example.com \
|
||||
--channelID mychannel \
|
||||
--name papercontract \
|
||||
-v 0 \
|
||||
--package-id $PACKAGE_ID \
|
||||
--sequence 1 \
|
||||
--tls \
|
||||
--cafile "$ORDERER_CA"
|
||||
|
||||
peer lifecycle chaincode checkcommitreadiness --channelID mychannel --name papercontract -v 0 --sequence 1
|
||||
workingDirectory: commercial-paper/organization/magnetocorp
|
||||
displayName: Setup Commercial Paper Contract
|
||||
- script: |
|
||||
source <(./digibank.sh)
|
||||
peer lifecycle chaincode package cp.tar.gz --lang java --path ./contract-java --label cp_0
|
||||
peer lifecycle chaincode install cp.tar.gz
|
||||
|
||||
export PACKAGE_ID=$(peer lifecycle chaincode queryinstalled --output json | jq -r '.installed_chaincodes[0].package_id')
|
||||
echo $PACKAGE_ID
|
||||
|
||||
peer lifecycle chaincode approveformyorg --orderer localhost:7050 --ordererTLSHostnameOverride orderer.example.com \
|
||||
--channelID mychannel \
|
||||
--name papercontract \
|
||||
-v 0 \
|
||||
--package-id $PACKAGE_ID \
|
||||
--sequence 1 \
|
||||
--tls \
|
||||
--cafile "$ORDERER_CA"
|
||||
|
||||
peer lifecycle chaincode checkcommitreadiness --channelID mychannel --name papercontract -v 0 --sequence 1
|
||||
|
||||
peer lifecycle chaincode commit -o localhost:7050 \
|
||||
--peerAddresses localhost:7051 --tlsRootCertFiles "${PEER0_ORG1_CA}" \
|
||||
--peerAddresses localhost:9051 --tlsRootCertFiles "${PEER0_ORG2_CA}" \
|
||||
--ordererTLSHostnameOverride orderer.example.com \
|
||||
--channelID mychannel --name papercontract -v 0 \
|
||||
--sequence 1 \
|
||||
--tls --cafile "$ORDERER_CA" --waitForEvent
|
||||
|
||||
workingDirectory: commercial-paper/organization/digibank
|
||||
displayName: Setup Commercial Paper Contract
|
||||
|
||||
- script: retry -- npm install
|
||||
workingDirectory: commercial-paper/organization/magnetocorp/application
|
||||
displayName: Install MagnetoCorp Application
|
||||
- script: |
|
||||
set -ex
|
||||
node enrollUser.js
|
||||
node issue.js
|
||||
workingDirectory: commercial-paper/organization/magnetocorp/application
|
||||
displayName: MagnetoCorp Issue Paper
|
||||
|
||||
- script: retry -- npm install
|
||||
workingDirectory: commercial-paper/organization/digibank/application
|
||||
displayName: Install DigiBank Application
|
||||
- script: |
|
||||
set -ex
|
||||
node enrollUser.js
|
||||
node buy.js
|
||||
node redeem.js
|
||||
workingDirectory: commercial-paper/organization/digibank/application
|
||||
displayName: DigiBank Issue Paper
|
||||
|
|
@ -1,82 +0,0 @@
|
|||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
steps:
|
||||
- script: |
|
||||
./network.sh up createChannel -ca -s couchdb
|
||||
|
||||
# Copy the connection profiles so they are in the correct organizations.
|
||||
cp "./organizations/peerOrganizations/org1.example.com/connection-org1.yaml" "../commercial-paper/organization/digibank/gateway/"
|
||||
cp "./organizations/peerOrganizations/org2.example.com/connection-org2.yaml" "../commercial-paper/organization/magnetocorp/gateway/"
|
||||
workingDirectory: test-network
|
||||
displayName: Start Fabric
|
||||
- script: |
|
||||
source <(./magnetocorp.sh)
|
||||
peer lifecycle chaincode package cp.tar.gz --lang node --path ./contract --label cp_0
|
||||
peer lifecycle chaincode install cp.tar.gz
|
||||
|
||||
export PACKAGE_ID=$(peer lifecycle chaincode queryinstalled --output json | jq -r '.installed_chaincodes[0].package_id')
|
||||
echo $PACKAGE_ID
|
||||
|
||||
peer lifecycle chaincode approveformyorg --orderer localhost:7050 --ordererTLSHostnameOverride orderer.example.com \
|
||||
--channelID mychannel \
|
||||
--name papercontract \
|
||||
-v 0 \
|
||||
--package-id $PACKAGE_ID \
|
||||
--sequence 1 \
|
||||
--tls \
|
||||
--cafile "$ORDERER_CA"
|
||||
|
||||
peer lifecycle chaincode checkcommitreadiness --channelID mychannel --name papercontract -v 0 --sequence 1
|
||||
workingDirectory: commercial-paper/organization/magnetocorp
|
||||
displayName: Setup Commercial Paper Contract
|
||||
- script: |
|
||||
source <(./digibank.sh)
|
||||
peer lifecycle chaincode package cp.tar.gz --lang node --path ./contract --label cp_0
|
||||
peer lifecycle chaincode install cp.tar.gz
|
||||
|
||||
export PACKAGE_ID=$(peer lifecycle chaincode queryinstalled --output json | jq -r '.installed_chaincodes[0].package_id')
|
||||
echo $PACKAGE_ID
|
||||
|
||||
peer lifecycle chaincode approveformyorg --orderer localhost:7050 --ordererTLSHostnameOverride orderer.example.com \
|
||||
--channelID mychannel \
|
||||
--name papercontract \
|
||||
-v 0 \
|
||||
--package-id $PACKAGE_ID \
|
||||
--sequence 1 \
|
||||
--tls \
|
||||
--cafile "$ORDERER_CA"
|
||||
|
||||
peer lifecycle chaincode checkcommitreadiness --channelID mychannel --name papercontract -v 0 --sequence 1
|
||||
|
||||
peer lifecycle chaincode commit -o localhost:7050 \
|
||||
--peerAddresses localhost:7051 --tlsRootCertFiles "${PEER0_ORG1_CA}" \
|
||||
--peerAddresses localhost:9051 --tlsRootCertFiles "${PEER0_ORG2_CA}" \
|
||||
--ordererTLSHostnameOverride orderer.example.com \
|
||||
--channelID mychannel --name papercontract -v 0 \
|
||||
--sequence 1 \
|
||||
--tls --cafile "$ORDERER_CA" --waitForEvent
|
||||
|
||||
workingDirectory: commercial-paper/organization/digibank
|
||||
displayName: Setup Commercial Paper Contract
|
||||
- script: retry -- npm install
|
||||
workingDirectory: commercial-paper/organization/magnetocorp/application
|
||||
displayName: Install MagnetoCorp Application
|
||||
- script: |
|
||||
set -ex
|
||||
node enrollUser.js
|
||||
node issue.js
|
||||
workingDirectory: commercial-paper/organization/magnetocorp/application
|
||||
displayName: MagnetoCorp Issue Paper
|
||||
|
||||
- script: retry -- npm install
|
||||
workingDirectory: commercial-paper/organization/digibank/application
|
||||
displayName: Install DigiBank Application
|
||||
- script: |
|
||||
set -ex
|
||||
node enrollUser.js
|
||||
node buy.js
|
||||
node redeem.js
|
||||
workingDirectory: commercial-paper/organization/digibank/application
|
||||
displayName: DigiBank Issue Paper
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
steps:
|
||||
- script: ./startFabric.sh go
|
||||
workingDirectory: fabcar
|
||||
displayName: Start Fabric
|
||||
- task: GoTool@0
|
||||
displayName: 'Use Go 1.16.7'
|
||||
inputs:
|
||||
version: '1.16.7'
|
||||
- task: Go@0
|
||||
displayName: 'go build'
|
||||
inputs:
|
||||
command: build
|
||||
arguments: '-o "fabcar"'
|
||||
workingDirectory: fabcar/go
|
||||
- script: DISCOVERY_AS_LOCALHOST=TRUE ./fabcar
|
||||
workingDirectory: fabcar/go
|
||||
displayName: Run FabCar Application
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
steps:
|
||||
- script: ./startFabric.sh java
|
||||
workingDirectory: fabcar
|
||||
displayName: Start Fabric
|
||||
- script: retry -- mvn dependency:go-offline
|
||||
workingDirectory: fabcar/java
|
||||
displayName: Install FabCar Application Dependencies
|
||||
- script: mvn test
|
||||
workingDirectory: fabcar/java
|
||||
displayName: Run FabCar Application
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
steps:
|
||||
- script: ./startFabric.sh javascript
|
||||
workingDirectory: fabcar
|
||||
displayName: Start Fabric
|
||||
- script: |
|
||||
retry -- npm install
|
||||
npm ls
|
||||
workingDirectory: fabcar/javascript
|
||||
displayName: Install FabCar Application Dependencies
|
||||
- script: |
|
||||
set -ex
|
||||
node enrollAdmin
|
||||
node registerUser
|
||||
node invoke
|
||||
node query
|
||||
workingDirectory: fabcar/javascript
|
||||
displayName: Run FabCar Application
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
steps:
|
||||
- script: ./startFabric.sh typescript
|
||||
workingDirectory: fabcar
|
||||
displayName: Start Fabric
|
||||
- script: retry -- npm install
|
||||
workingDirectory: fabcar/typescript
|
||||
displayName: Install FabCar Application Dependencies
|
||||
- script: npm run build
|
||||
workingDirectory: fabcar/typescript
|
||||
displayName: Build FabCar application
|
||||
- script: |
|
||||
set -ex
|
||||
node dist/enrollAdmin
|
||||
node dist/registerUser
|
||||
node dist/invoke
|
||||
node dist/query
|
||||
workingDirectory: fabcar/typescript
|
||||
displayName: Run FabCar Application
|
||||
Loading…
Reference in a new issue