diff --git a/high-throughput/README.md b/high-throughput/README.md index 0badf673..d952a23e 100644 --- a/high-throughput/README.md +++ b/high-throughput/README.md @@ -96,11 +96,6 @@ must be verified before approval and admittance to the chain. ## How This sample provides the chaincode and scripts required to run a high-throughput application on the Fabric test network. -### Vendor the chaincode dependencies -1. Change into the chaincode directory, e.g. `cd ~/fabric-samples/high-throughput/chaincode` -2. Vendor the Go dependencies by running the following command: `GO111MODULE=on go mod vendor` -3. The chaincode directory will now contain a `vendor` directory. - ### Start the network You can use the `startFabric.sh` script to create an instance of the Fabric test network with a single channel named `mychannel`. The script then deploys the `high-throughput` chaincode to the channel by installing it on the test network peers and committing the chaincode definition to the channel. diff --git a/high-throughput/scripts/approve-commit-chaincode.sh b/high-throughput/scripts/approve-commit-chaincode.sh deleted file mode 100755 index 054ddb53..00000000 --- a/high-throughput/scripts/approve-commit-chaincode.sh +++ /dev/null @@ -1,44 +0,0 @@ -# -# Copyright IBM Corp All Rights Reserved -# -# SPDX-License-Identifier: Apache-2.0 -# - -export CORE_PEER_TLS_ENABLED=true - -echo "========== Query chaincode package ID ==========" -export CORE_PEER_MSPCONFIGPATH=../test-network/organizations/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp -export CORE_PEER_ADDRESS=localhost:7051 -export CORE_PEER_LOCALMSPID="Org1MSP" -export CORE_PEER_TLS_ROOTCERT_FILE=../test-network/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt -peer lifecycle chaincode queryinstalled >&log.txt -export PACKAGE_ID=`sed -n '/Package/{s/^Package ID: //; s/, Label:.*$//; p;}' log.txt` - -echo "========== Approve definition for Org1 ==========" -export CORE_PEER_MSPCONFIGPATH=../test-network/organizations/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp -export CORE_PEER_ADDRESS=localhost:7051 -export CORE_PEER_LOCALMSPID="Org1MSP" -export CORE_PEER_TLS_ROOTCERT_FILE=../test-network/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt -peer lifecycle chaincode install bigdatacc.tar.gz - -peer lifecycle chaincode approveformyorg -o localhost:7050 --ordererTLSHostnameOverride orderer.example.com --tls --cafile ../test-network/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem --channelID mychannel --signature-policy "OR('Org1MSP.peer', 'Org2MSP.peer')" --name bigdatacc --version 0 --init-required --package-id ${PACKAGE_ID} --sequence 1 - -echo "========== Approve definition for Org2 ==========" -export CORE_PEER_MSPCONFIGPATH=../test-network/organizations/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp -export CORE_PEER_ADDRESS=localhost:9051 -export CORE_PEER_LOCALMSPID="Org2MSP" -export CORE_PEER_TLS_ROOTCERT_FILE=../test-network/organizations/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt -peer lifecycle chaincode approveformyorg -o localhost:7050 --ordererTLSHostnameOverride orderer.example.com --tls --cafile ../test-network/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem --channelID mychannel --signature-policy "OR('Org1MSP.peer', 'Org2MSP.peer')" --name bigdatacc --version 0 --init-required --package-id ${PACKAGE_ID} --sequence 1 - -. scripts/check-commit-readiness.sh - -checkCommitReadiness 1 "\"Org1MSP\": true" "\"Org2MSP\": true" -checkCommitReadiness 2 "\"Org1MSP\": true" "\"Org2MSP\": true" - - -echo "========== Commit the definition the mychannel ==========" -peer lifecycle chaincode commit -o localhost:7050 --ordererTLSHostnameOverride orderer.example.com --tls --cafile ../test-network/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem --channelID mychannel --signature-policy "OR('Org1MSP.peer', 'Org2MSP.peer')" --name bigdatacc --version 0 --init-required --sequence 1 --waitForEvent --peerAddresses localhost:7051 --tlsRootCertFiles ../test-network/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt --peerAddresses localhost:9051 --tlsRootCertFiles ../test-network/organizations/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt - - -echo "========== Invoke the Init function ==========" -peer chaincode invoke -o localhost:7050 --ordererTLSHostnameOverride orderer.example.com --tls --cafile ../test-network/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem -C mychannel -n bigdatacc --isInit -c '{"Args":["Init"]}' diff --git a/high-throughput/scripts/install-chaincode.sh b/high-throughput/scripts/install-chaincode.sh deleted file mode 100755 index cac7f4ac..00000000 --- a/high-throughput/scripts/install-chaincode.sh +++ /dev/null @@ -1,28 +0,0 @@ -# -# Copyright IBM Corp All Rights Reserved -# -# SPDX-License-Identifier: Apache-2.0 -# -export CORE_PEER_TLS_ENABLED=true - -echo "========== Package a chaincode ==========" -export CORE_PEER_MSPCONFIGPATH=../test-network/organizations/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp -export CORE_PEER_ADDRESS=localhost:7051 -export CORE_PEER_LOCALMSPID="Org1MSP" -export CORE_PEER_TLS_ROOTCERT_FILE=../test-network/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt -peer lifecycle chaincode package bigdatacc.tar.gz --path chaincode/ --lang golang --label bigdatacc_0 - -echo "========== Installing chaincode on peer0.org1 ==========" -export CORE_PEER_MSPCONFIGPATH=../test-network/organizations/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp -export CORE_PEER_ADDRESS=localhost:7051 -export CORE_PEER_LOCALMSPID="Org1MSP" -export CORE_PEER_TLS_ROOTCERT_FILE=../test-network/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt -peer lifecycle chaincode install bigdatacc.tar.gz - - -echo "========== Installing chaincode on peer0.org2 ==========" -export CORE_PEER_MSPCONFIGPATH=../test-network/organizations/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp -export CORE_PEER_ADDRESS=localhost:9051 -export CORE_PEER_LOCALMSPID="Org2MSP" -export CORE_PEER_TLS_ROOTCERT_FILE=../test-network/organizations/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt -peer lifecycle chaincode install bigdatacc.tar.gz diff --git a/high-throughput/startFabric.sh b/high-throughput/startFabric.sh index eb4dd8ef..20bec562 100755 --- a/high-throughput/startFabric.sh +++ b/high-throughput/startFabric.sh @@ -18,20 +18,9 @@ pushd ../test-network ./network.sh down echo "Bring up test network" -./network.sh up createChannel +./network.sh up createChannel -ca +./network.sh deployCC -ccn bigdatacc -ccp ../high-throughput/chaincode/ -ccep "OR('Org1MSP.peer','Org2MSP.peer')" -cci Init popd - -#set enviroment varialbes -export PATH=${PWD}/../bin:${PWD}:$PATH -export FABRIC_CFG_PATH=$PWD/../config/ - -echo "Install high throughput chaincode on test network peers" -./scripts/install-chaincode.sh - -echo "Deploy high throughput chaincode to the channel" -./scripts/approve-commit-chaincode.sh - - cat <