From 146f7bc19342e88b14ca53581dac17fa2c459505 Mon Sep 17 00:00:00 2001 From: Arnaud J Le Hors Date: Tue, 24 Apr 2018 18:23:43 +0200 Subject: [PATCH] [FAB-9572] Fix README to match new version of BYFN Changed README.md to instruct user to edit byfn.sh instead of docker-compose-cli file since this is where the standard BFYN script is now run. Also added missing Copyright notices. Change-Id: Ib18afe8a23cc3874729031a82480aac5b0a2b555 Signed-off-by: Arnaud J Le Hors --- high-throughput/README.md | 12 +++++++++--- high-throughput/chaincode/high-throughput.go | 4 ++++ high-throughput/scripts/channel-setup.sh | 6 ++++++ high-throughput/scripts/delete-invoke.sh | 6 ++++++ high-throughput/scripts/get-invoke.sh | 6 ++++++ high-throughput/scripts/get-traditional.sh | 6 ++++++ high-throughput/scripts/install-chaincode.sh | 6 ++++++ high-throughput/scripts/instantiate-chaincode.sh | 6 ++++++ high-throughput/scripts/many-updates-traditional.sh | 6 ++++++ high-throughput/scripts/many-updates.sh | 6 ++++++ high-throughput/scripts/prunefast-invoke.sh | 6 ++++++ high-throughput/scripts/prunesafe-invoke.sh | 6 ++++++ high-throughput/scripts/setclienv.sh | 6 ++++++ high-throughput/scripts/update-invoke.sh | 6 ++++++ high-throughput/scripts/upgrade-chaincode.sh | 6 ++++++ 15 files changed, 91 insertions(+), 3 deletions(-) diff --git a/high-throughput/README.md b/high-throughput/README.md index 0956f99d80..a899792fef 100644 --- a/high-throughput/README.md +++ b/high-throughput/README.md @@ -1,3 +1,9 @@ + + # High-Throughput Network ## Purpose @@ -106,9 +112,9 @@ and run some invocations are provided below. `./scripts:/opt/gopath/src/github.com/hyperledger/fabric/peer/scripts/` --> `./../high-throughput/scripts/:/opt/gopath/src/github.com/hyperledger/fabric/peer/scripts/` - * Finally, comment out the `command` section by placing a `#` before it, e.g. - - `#command: /bin/bash -c './scripts/script.sh ${CHANNEL_NAME}; sleep $TIMEOUT'` + * Finally, comment out the `docker exec cli scripts/script.sh` command from the `byfn.sh` script by placing a `#` before it so that the standard BYFN end to end script doesn't run, e.g. + + `# docker exec cli scripts/script.sh $CHANNEL_NAME $CLI_DELAY $LANGUAGE $CLI_TIMEOUT $VERBOSE` 3. We can now bring our network up by typing in `./byfn.sh -m up -c mychannel` 4. Open a new terminal window and enter the CLI container using `docker exec -it cli bash`, all operations on the network will happen within diff --git a/high-throughput/chaincode/high-throughput.go b/high-throughput/chaincode/high-throughput.go index 9088820874..252c980548 100644 --- a/high-throughput/chaincode/high-throughput.go +++ b/high-throughput/chaincode/high-throughput.go @@ -1,4 +1,8 @@ /* + * Copyright IBM Corp All Rights Reserved + * + * SPDX-License-Identifier: Apache-2.0 + * * Demonstrates how to handle data in an application with a high transaction volume where the transactions * all attempt to change the same key-value pair in the ledger. Such an application will have trouble * as multiple transactions may read a value at a certain version, which will then be invalid when the first diff --git a/high-throughput/scripts/channel-setup.sh b/high-throughput/scripts/channel-setup.sh index b92326024d..2843ffe82a 100755 --- a/high-throughput/scripts/channel-setup.sh +++ b/high-throughput/scripts/channel-setup.sh @@ -1,3 +1,9 @@ +# +# Copyright IBM Corp All Rights Reserved +# +# SPDX-License-Identifier: Apache-2.0 +# + ORDERER_CA=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem # Channel creation diff --git a/high-throughput/scripts/delete-invoke.sh b/high-throughput/scripts/delete-invoke.sh index be892a47a0..ec08035e9d 100755 --- a/high-throughput/scripts/delete-invoke.sh +++ b/high-throughput/scripts/delete-invoke.sh @@ -1,2 +1,8 @@ +# +# Copyright IBM Corp All Rights Reserved +# +# SPDX-License-Identifier: Apache-2.0 +# + peer chaincode invoke -o orderer.example.com:7050 --tls $CORE_PEER_TLS_ENABLED --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem -C $CHANNEL_NAME -n $CC_NAME -c '{"Args":["delete","'$1'"]}' diff --git a/high-throughput/scripts/get-invoke.sh b/high-throughput/scripts/get-invoke.sh index aae4eee7bf..f89bbb2da3 100755 --- a/high-throughput/scripts/get-invoke.sh +++ b/high-throughput/scripts/get-invoke.sh @@ -1,2 +1,8 @@ +# +# Copyright IBM Corp All Rights Reserved +# +# SPDX-License-Identifier: Apache-2.0 +# + peer chaincode invoke -o orderer.example.com:7050 --tls $CORE_PEER_TLS_ENABLED --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem -C $CHANNEL_NAME -n $CC_NAME -c '{"Args":["get","'$1'"]}' diff --git a/high-throughput/scripts/get-traditional.sh b/high-throughput/scripts/get-traditional.sh index c532790902..bb0fe52291 100755 --- a/high-throughput/scripts/get-traditional.sh +++ b/high-throughput/scripts/get-traditional.sh @@ -1 +1,7 @@ +# +# Copyright IBM Corp All Rights Reserved +# +# SPDX-License-Identifier: Apache-2.0 +# + peer chaincode invoke -o orderer.example.com:7050 --tls $CORE_PEER_TLS_ENABLED --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem -C $CHANNEL_NAME -n $CC_NAME -c '{"Args":["getstandard","'$1'"]}' diff --git a/high-throughput/scripts/install-chaincode.sh b/high-throughput/scripts/install-chaincode.sh index 014ad0fd76..7817ae64cf 100755 --- a/high-throughput/scripts/install-chaincode.sh +++ b/high-throughput/scripts/install-chaincode.sh @@ -1,3 +1,9 @@ +# +# Copyright IBM Corp All Rights Reserved +# +# SPDX-License-Identifier: Apache-2.0 +# + echo "========== Installing chaincode on peer0.org1 ==========" export CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp export CORE_PEER_ADDRESS=peer0.org1.example.com:7051 diff --git a/high-throughput/scripts/instantiate-chaincode.sh b/high-throughput/scripts/instantiate-chaincode.sh index 45eacbc3a4..25fe046c33 100755 --- a/high-throughput/scripts/instantiate-chaincode.sh +++ b/high-throughput/scripts/instantiate-chaincode.sh @@ -1,3 +1,9 @@ +# +# Copyright IBM Corp All Rights Reserved +# +# SPDX-License-Identifier: Apache-2.0 +# + echo "========== Instantiating chaincode v$1 ==========" peer chaincode instantiate -o orderer.example.com:7050 --tls $CORE_PEER_TLS_ENABLED --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem -C $CHANNEL_NAME -n $CC_NAME -c '{"Args": []}' -v $1 -P "OR ('Org1MSP.member','Org2MSP.member')" diff --git a/high-throughput/scripts/many-updates-traditional.sh b/high-throughput/scripts/many-updates-traditional.sh index 3f57e57de7..921edc622f 100755 --- a/high-throughput/scripts/many-updates-traditional.sh +++ b/high-throughput/scripts/many-updates-traditional.sh @@ -1,3 +1,9 @@ +# +# Copyright IBM Corp All Rights Reserved +# +# SPDX-License-Identifier: Apache-2.0 +# + for (( i = 0; i < 1000; ++i )) do peer chaincode invoke -o orderer.example.com:7050 --tls $CORE_PEER_TLS_ENABLED --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem -C $CHANNEL_NAME -n $CC_NAME -c '{"Args":["putstandard","'$1'","'$i'"]}' diff --git a/high-throughput/scripts/many-updates.sh b/high-throughput/scripts/many-updates.sh index ffedb7c9bd..13aaf0267f 100755 --- a/high-throughput/scripts/many-updates.sh +++ b/high-throughput/scripts/many-updates.sh @@ -1,3 +1,9 @@ +# +# Copyright IBM Corp All Rights Reserved +# +# SPDX-License-Identifier: Apache-2.0 +# + for (( i = 0; i < 1000; ++i )) do peer chaincode invoke -o orderer.example.com:7050 --tls $CORE_PEER_TLS_ENABLED --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem -C $CHANNEL_NAME -n $CC_NAME -c '{"Args":["update","'$1'","'$2'","'$3'"]}' & diff --git a/high-throughput/scripts/prunefast-invoke.sh b/high-throughput/scripts/prunefast-invoke.sh index 0db2d9bcf7..bd7b168c5f 100755 --- a/high-throughput/scripts/prunefast-invoke.sh +++ b/high-throughput/scripts/prunefast-invoke.sh @@ -1,2 +1,8 @@ +# +# Copyright IBM Corp All Rights Reserved +# +# SPDX-License-Identifier: Apache-2.0 +# + peer chaincode invoke -o orderer.example.com:7050 --tls $CORE_PEER_TLS_ENABLED --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem -C $CHANNEL_NAME -n $CC_NAME -c '{"Args":["prunefast","'$1'"]}' diff --git a/high-throughput/scripts/prunesafe-invoke.sh b/high-throughput/scripts/prunesafe-invoke.sh index 8c39e422c7..e42019e8d8 100755 --- a/high-throughput/scripts/prunesafe-invoke.sh +++ b/high-throughput/scripts/prunesafe-invoke.sh @@ -1,2 +1,8 @@ +# +# Copyright IBM Corp All Rights Reserved +# +# SPDX-License-Identifier: Apache-2.0 +# + peer chaincode invoke -o orderer.example.com:7050 --tls $CORE_PEER_TLS_ENABLED --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem -C $CHANNEL_NAME -n $CC_NAME -c '{"Args":["prunesafe","'$1'"]}' diff --git a/high-throughput/scripts/setclienv.sh b/high-throughput/scripts/setclienv.sh index 9e7e8bc861..8e95350059 100644 --- a/high-throughput/scripts/setclienv.sh +++ b/high-throughput/scripts/setclienv.sh @@ -1,2 +1,8 @@ +# +# Copyright IBM Corp All Rights Reserved +# +# SPDX-License-Identifier: Apache-2.0 +# + export CHANNEL_NAME=mychannel export CC_NAME=bigdatacc diff --git a/high-throughput/scripts/update-invoke.sh b/high-throughput/scripts/update-invoke.sh index 7f51f9baf8..d49b2ccc43 100755 --- a/high-throughput/scripts/update-invoke.sh +++ b/high-throughput/scripts/update-invoke.sh @@ -1,2 +1,8 @@ +# +# Copyright IBM Corp All Rights Reserved +# +# SPDX-License-Identifier: Apache-2.0 +# + peer chaincode invoke -o orderer.example.com:7050 --tls $CORE_PEER_TLS_ENABLED --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem -C $CHANNEL_NAME -n $CC_NAME -c '{"Args":["update","'$1'","'$2'","'$3'"]}' diff --git a/high-throughput/scripts/upgrade-chaincode.sh b/high-throughput/scripts/upgrade-chaincode.sh index 78d0b83fa3..add1b8c73c 100755 --- a/high-throughput/scripts/upgrade-chaincode.sh +++ b/high-throughput/scripts/upgrade-chaincode.sh @@ -1,3 +1,9 @@ +# +# Copyright IBM Corp All Rights Reserved +# +# SPDX-License-Identifier: Apache-2.0 +# + echo "========== Upgrade chaincode to version $1 ==========" peer chaincode upgrade -o orderer.example.com:7050 --tls $CORE_PEER_TLS_ENABLED --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem -C $CHANNEL_NAME -n $CC_NAME -c '{"Args": []}' -v $1 -P "OR ('Org1MSP.member','Org2MSP.member')"