mirror of
https://github.com/hyperledger/fabric-samples.git
synced 2026-06-22 09:35:10 +00:00
Merge "FAB-9294 eliminate excess noise in BYFN"
This commit is contained in:
commit
54b071bfdc
11 changed files with 38 additions and 15 deletions
|
|
@ -18,7 +18,7 @@ services:
|
||||||
- FABRIC_CA_SERVER_CA_KEYFILE=/etc/hyperledger/fabric-ca-server-config/4239aa0dcd76daeeb8ba0cda701851d14504d31aad1b2ddddbac6a57365e497c_sk
|
- FABRIC_CA_SERVER_CA_KEYFILE=/etc/hyperledger/fabric-ca-server-config/4239aa0dcd76daeeb8ba0cda701851d14504d31aad1b2ddddbac6a57365e497c_sk
|
||||||
ports:
|
ports:
|
||||||
- "7054:7054"
|
- "7054:7054"
|
||||||
command: sh -c 'fabric-ca-server start -b admin:adminpw -d'
|
command: sh -c 'fabric-ca-server start -b admin:adminpw'
|
||||||
volumes:
|
volumes:
|
||||||
- ./crypto-config/peerOrganizations/org1.example.com/ca/:/etc/hyperledger/fabric-ca-server-config
|
- ./crypto-config/peerOrganizations/org1.example.com/ca/:/etc/hyperledger/fabric-ca-server-config
|
||||||
container_name: ca.example.com
|
container_name: ca.example.com
|
||||||
|
|
@ -29,7 +29,7 @@ services:
|
||||||
container_name: orderer.example.com
|
container_name: orderer.example.com
|
||||||
image: hyperledger/fabric-orderer
|
image: hyperledger/fabric-orderer
|
||||||
environment:
|
environment:
|
||||||
- ORDERER_GENERAL_LOGLEVEL=debug
|
- ORDERER_GENERAL_LOGLEVEL=info
|
||||||
- ORDERER_GENERAL_LISTENADDRESS=0.0.0.0
|
- ORDERER_GENERAL_LISTENADDRESS=0.0.0.0
|
||||||
- ORDERER_GENERAL_GENESISMETHOD=file
|
- ORDERER_GENERAL_GENESISMETHOD=file
|
||||||
- ORDERER_GENERAL_GENESISFILE=/etc/hyperledger/configtx/genesis.block
|
- ORDERER_GENERAL_GENESISFILE=/etc/hyperledger/configtx/genesis.block
|
||||||
|
|
@ -52,8 +52,8 @@ services:
|
||||||
environment:
|
environment:
|
||||||
- CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
|
- CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
|
||||||
- CORE_PEER_ID=peer0.org1.example.com
|
- CORE_PEER_ID=peer0.org1.example.com
|
||||||
- CORE_LOGGING_PEER=debug
|
- CORE_LOGGING_PEER=info
|
||||||
- CORE_CHAINCODE_LOGGING_LEVEL=DEBUG
|
- CORE_CHAINCODE_LOGGING_LEVEL=info
|
||||||
- CORE_PEER_LOCALMSPID=Org1MSP
|
- CORE_PEER_LOCALMSPID=Org1MSP
|
||||||
- CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/msp/peer/
|
- CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/msp/peer/
|
||||||
- CORE_PEER_ADDRESS=peer0.org1.example.com:7051
|
- CORE_PEER_ADDRESS=peer0.org1.example.com:7051
|
||||||
|
|
@ -105,7 +105,7 @@ services:
|
||||||
environment:
|
environment:
|
||||||
- GOPATH=/opt/gopath
|
- GOPATH=/opt/gopath
|
||||||
- CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
|
- CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
|
||||||
- CORE_LOGGING_LEVEL=DEBUG
|
- CORE_LOGGING_LEVEL=info
|
||||||
- CORE_PEER_ID=cli
|
- CORE_PEER_ID=cli
|
||||||
- CORE_PEER_ADDRESS=peer0.org1.example.com:7051
|
- CORE_PEER_ADDRESS=peer0.org1.example.com:7051
|
||||||
- CORE_PEER_LOCALMSPID=Org1MSP
|
- CORE_PEER_LOCALMSPID=Org1MSP
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@ docker-compose -f docker-compose.yml kill && docker-compose -f docker-compose.ym
|
||||||
rm -f ~/.hfc-key-store/*
|
rm -f ~/.hfc-key-store/*
|
||||||
|
|
||||||
# remove chaincode docker images
|
# remove chaincode docker images
|
||||||
|
docker rm $(docker ps -aq)
|
||||||
docker rmi $(docker images dev-* -q)
|
docker rmi $(docker images dev-* -q)
|
||||||
|
|
||||||
# Your system is now clean
|
# Your system is now clean
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,7 @@
|
||||||
# this may be commented out to resolve installed version of tools if desired
|
# this may be commented out to resolve installed version of tools if desired
|
||||||
export PATH=${PWD}/../bin:${PWD}:$PATH
|
export PATH=${PWD}/../bin:${PWD}:$PATH
|
||||||
export FABRIC_CFG_PATH=${PWD}
|
export FABRIC_CFG_PATH=${PWD}
|
||||||
|
export VERBOSE=false
|
||||||
|
|
||||||
# Print the usage message
|
# Print the usage message
|
||||||
function printHelp () {
|
function printHelp () {
|
||||||
|
|
@ -49,6 +50,7 @@ function printHelp () {
|
||||||
echo " -s <dbtype> - the database backend to use: goleveldb (default) or couchdb"
|
echo " -s <dbtype> - the database backend to use: goleveldb (default) or couchdb"
|
||||||
echo " -l <language> - the chaincode language: golang (default) or node"
|
echo " -l <language> - the chaincode language: golang (default) or node"
|
||||||
echo " -i <imagetag> - the tag to be used to launch the network (defaults to \"latest\")"
|
echo " -i <imagetag> - the tag to be used to launch the network (defaults to \"latest\")"
|
||||||
|
echo " -v - verbose mode"
|
||||||
echo
|
echo
|
||||||
echo "Typically, one would first generate the required certificates and "
|
echo "Typically, one would first generate the required certificates and "
|
||||||
echo "genesis block, then bring up the network. e.g.:"
|
echo "genesis block, then bring up the network. e.g.:"
|
||||||
|
|
@ -163,7 +165,7 @@ function networkUp () {
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
# now run the end to end script
|
# now run the end to end script
|
||||||
docker exec cli scripts/script.sh $CHANNEL_NAME $CLI_DELAY $LANGUAGE $CLI_TIMEOUT
|
docker exec cli scripts/script.sh $CHANNEL_NAME $CLI_DELAY $LANGUAGE $CLI_TIMEOUT $VERBOSE
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "ERROR !!!! Test failed"
|
echo "ERROR !!!! Test failed"
|
||||||
exit 1
|
exit 1
|
||||||
|
|
@ -222,7 +224,7 @@ function upgradeNetwork () {
|
||||||
docker-compose $COMPOSE_FILES up -d --no-deps $PEER
|
docker-compose $COMPOSE_FILES up -d --no-deps $PEER
|
||||||
done
|
done
|
||||||
|
|
||||||
docker exec cli scripts/upgrade_to_v11.sh $CHANNEL_NAME $CLI_DELAY $LANGUAGE $CLI_TIMEOUT
|
docker exec cli scripts/upgrade_to_v11.sh $CHANNEL_NAME $CLI_DELAY $LANGUAGE $CLI_TIMEOUT $VERBOSE
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "ERROR !!!! Test failed"
|
echo "ERROR !!!! Test failed"
|
||||||
exit 1
|
exit 1
|
||||||
|
|
@ -470,7 +472,7 @@ else
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
while getopts "h?m:c:t:d:f:s:l:i:" opt; do
|
while getopts "h?m:c:t:d:f:s:l:i:v" opt; do
|
||||||
case "$opt" in
|
case "$opt" in
|
||||||
h|\?)
|
h|\?)
|
||||||
printHelp
|
printHelp
|
||||||
|
|
@ -490,6 +492,8 @@ while getopts "h?m:c:t:d:f:s:l:i:" opt; do
|
||||||
;;
|
;;
|
||||||
i) IMAGETAG=`uname -m`"-"$OPTARG
|
i) IMAGETAG=`uname -m`"-"$OPTARG
|
||||||
;;
|
;;
|
||||||
|
v) VERBOSE=true
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@
|
||||||
# this may be commented out to resolve installed version of tools if desired
|
# this may be commented out to resolve installed version of tools if desired
|
||||||
export PATH=${PWD}/../bin:${PWD}:$PATH
|
export PATH=${PWD}/../bin:${PWD}:$PATH
|
||||||
export FABRIC_CFG_PATH=${PWD}
|
export FABRIC_CFG_PATH=${PWD}
|
||||||
|
export VERBOSE=false
|
||||||
|
|
||||||
# Print the usage message
|
# Print the usage message
|
||||||
function printHelp () {
|
function printHelp () {
|
||||||
|
|
@ -32,6 +33,7 @@ function printHelp () {
|
||||||
echo " -s <dbtype> - the database backend to use: goleveldb (default) or couchdb"
|
echo " -s <dbtype> - the database backend to use: goleveldb (default) or couchdb"
|
||||||
echo " -l <language> - the chaincode language: golang (default) or node"
|
echo " -l <language> - the chaincode language: golang (default) or node"
|
||||||
echo " -i <imagetag> - the tag to be used to launch the network (defaults to \"latest\")"
|
echo " -i <imagetag> - the tag to be used to launch the network (defaults to \"latest\")"
|
||||||
|
echo " -v - verbose mode"
|
||||||
echo
|
echo
|
||||||
echo "Typically, one would first generate the required certificates and "
|
echo "Typically, one would first generate the required certificates and "
|
||||||
echo "genesis block, then bring up the network. e.g.:"
|
echo "genesis block, then bring up the network. e.g.:"
|
||||||
|
|
@ -80,7 +82,7 @@ function clearContainers () {
|
||||||
# specifically the following images are often left behind:
|
# specifically the following images are often left behind:
|
||||||
# TODO list generated image naming patterns
|
# TODO list generated image naming patterns
|
||||||
function removeUnwantedImages() {
|
function removeUnwantedImages() {
|
||||||
DOCKER_IMAGE_IDS=$(docker images | grep "dev\|none\|test-vp\|peer[0-9]-" | awk '{print $3}')
|
DOCKER_IMAGE_IDS=$(docker images|awk '($1 ~ /dev-peer.*.mycc.*/) {print $3}')
|
||||||
if [ -z "$DOCKER_IMAGE_IDS" -o "$DOCKER_IMAGE_IDS" == " " ]; then
|
if [ -z "$DOCKER_IMAGE_IDS" -o "$DOCKER_IMAGE_IDS" == " " ]; then
|
||||||
echo "---- No images available for deletion ----"
|
echo "---- No images available for deletion ----"
|
||||||
else
|
else
|
||||||
|
|
@ -110,7 +112,7 @@ function networkUp () {
|
||||||
echo "###############################################################"
|
echo "###############################################################"
|
||||||
echo "############### Have Org3 peers join network ##################"
|
echo "############### Have Org3 peers join network ##################"
|
||||||
echo "###############################################################"
|
echo "###############################################################"
|
||||||
docker exec Org3cli ./scripts/step2org3.sh $CHANNEL_NAME $CLI_DELAY $LANGUAGE $CLI_TIMEOUT
|
docker exec Org3cli ./scripts/step2org3.sh $CHANNEL_NAME $CLI_DELAY $LANGUAGE $CLI_TIMEOUT $VERBOSE
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "ERROR !!!! Unable to have Org3 peers join network"
|
echo "ERROR !!!! Unable to have Org3 peers join network"
|
||||||
exit 1
|
exit 1
|
||||||
|
|
@ -119,13 +121,13 @@ function networkUp () {
|
||||||
echo "###############################################################"
|
echo "###############################################################"
|
||||||
echo "##### Upgrade chaincode to have Org3 peers on the network #####"
|
echo "##### Upgrade chaincode to have Org3 peers on the network #####"
|
||||||
echo "###############################################################"
|
echo "###############################################################"
|
||||||
docker exec cli ./scripts/step3org3.sh $CHANNEL_NAME $CLI_DELAY $LANGUAGE $CLI_TIMEOUT
|
docker exec cli ./scripts/step3org3.sh $CHANNEL_NAME $CLI_DELAY $LANGUAGE $CLI_TIMEOUT $VERBOSE
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "ERROR !!!! Unable to add Org3 peers on network"
|
echo "ERROR !!!! Unable to add Org3 peers on network"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
# finish by running the test
|
# finish by running the test
|
||||||
docker exec Org3cli ./scripts/testorg3.sh $CHANNEL_NAME $CLI_DELAY $LANGUAGE $CLI_TIMEOUT
|
docker exec Org3cli ./scripts/testorg3.sh $CHANNEL_NAME $CLI_DELAY $LANGUAGE $CLI_TIMEOUT $VERBOSE
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "ERROR !!!! Unable to run test"
|
echo "ERROR !!!! Unable to run test"
|
||||||
exit 1
|
exit 1
|
||||||
|
|
@ -160,7 +162,7 @@ function createConfigTx () {
|
||||||
echo "###############################################################"
|
echo "###############################################################"
|
||||||
echo "####### Generate and submit config tx to add Org3 #############"
|
echo "####### Generate and submit config tx to add Org3 #############"
|
||||||
echo "###############################################################"
|
echo "###############################################################"
|
||||||
docker exec cli scripts/step1org3.sh $CHANNEL_NAME $CLI_DELAY $LANGUAGE $CLI_TIMEOUT
|
docker exec cli scripts/step1org3.sh $CHANNEL_NAME $CLI_DELAY $LANGUAGE $CLI_TIMEOUT $VERBOSE
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "ERROR !!!! Unable to create config tx"
|
echo "ERROR !!!! Unable to create config tx"
|
||||||
exit 1
|
exit 1
|
||||||
|
|
@ -271,7 +273,7 @@ else
|
||||||
printHelp
|
printHelp
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
while getopts "h?c:t:d:f:s:l:i:" opt; do
|
while getopts "h?c:t:d:f:s:l:i:v" opt; do
|
||||||
case "$opt" in
|
case "$opt" in
|
||||||
h|\?)
|
h|\?)
|
||||||
printHelp
|
printHelp
|
||||||
|
|
@ -291,6 +293,8 @@ while getopts "h?c:t:d:f:s:l:i:" opt; do
|
||||||
;;
|
;;
|
||||||
i) IMAGETAG=$OPTARG
|
i) IMAGETAG=$OPTARG
|
||||||
;;
|
;;
|
||||||
|
v) VERBOSE=true
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,10 +13,12 @@ CHANNEL_NAME="$1"
|
||||||
DELAY="$2"
|
DELAY="$2"
|
||||||
LANGUAGE="$3"
|
LANGUAGE="$3"
|
||||||
TIMEOUT="$4"
|
TIMEOUT="$4"
|
||||||
|
VERBOSE="$5"
|
||||||
: ${CHANNEL_NAME:="mychannel"}
|
: ${CHANNEL_NAME:="mychannel"}
|
||||||
: ${DELAY:="3"}
|
: ${DELAY:="3"}
|
||||||
: ${LANGUAGE:="golang"}
|
: ${LANGUAGE:="golang"}
|
||||||
: ${TIMEOUT:="10"}
|
: ${TIMEOUT:="10"}
|
||||||
|
: ${VERBOSE:="false"}
|
||||||
LANGUAGE=`echo "$LANGUAGE" | tr [:upper:] [:lower:]`
|
LANGUAGE=`echo "$LANGUAGE" | tr [:upper:] [:lower:]`
|
||||||
COUNTER=1
|
COUNTER=1
|
||||||
MAX_RETRY=5
|
MAX_RETRY=5
|
||||||
|
|
|
||||||
|
|
@ -15,10 +15,12 @@ CHANNEL_NAME="$1"
|
||||||
DELAY="$2"
|
DELAY="$2"
|
||||||
LANGUAGE="$3"
|
LANGUAGE="$3"
|
||||||
TIMEOUT="$4"
|
TIMEOUT="$4"
|
||||||
|
VERBOSE="$5"
|
||||||
: ${CHANNEL_NAME:="mychannel"}
|
: ${CHANNEL_NAME:="mychannel"}
|
||||||
: ${DELAY:="3"}
|
: ${DELAY:="3"}
|
||||||
: ${LANGUAGE:="golang"}
|
: ${LANGUAGE:="golang"}
|
||||||
: ${TIMEOUT:="10"}
|
: ${TIMEOUT:="10"}
|
||||||
|
: ${VERBOSE:="false"}
|
||||||
LANGUAGE=`echo "$LANGUAGE" | tr [:upper:] [:lower:]`
|
LANGUAGE=`echo "$LANGUAGE" | tr [:upper:] [:lower:]`
|
||||||
COUNTER=1
|
COUNTER=1
|
||||||
MAX_RETRY=5
|
MAX_RETRY=5
|
||||||
|
|
|
||||||
|
|
@ -18,10 +18,12 @@ CHANNEL_NAME="$1"
|
||||||
DELAY="$2"
|
DELAY="$2"
|
||||||
LANGUAGE="$3"
|
LANGUAGE="$3"
|
||||||
TIMEOUT="$4"
|
TIMEOUT="$4"
|
||||||
|
VERBOSE="$5"
|
||||||
: ${CHANNEL_NAME:="mychannel"}
|
: ${CHANNEL_NAME:="mychannel"}
|
||||||
: ${DELAY:="3"}
|
: ${DELAY:="3"}
|
||||||
: ${LANGUAGE:="golang"}
|
: ${LANGUAGE:="golang"}
|
||||||
: ${TIMEOUT:="10"}
|
: ${TIMEOUT:="10"}
|
||||||
|
: ${VERBOSE:="false"}
|
||||||
LANGUAGE=`echo "$LANGUAGE" | tr [:upper:] [:lower:]`
|
LANGUAGE=`echo "$LANGUAGE" | tr [:upper:] [:lower:]`
|
||||||
COUNTER=1
|
COUNTER=1
|
||||||
MAX_RETRY=5
|
MAX_RETRY=5
|
||||||
|
|
|
||||||
|
|
@ -19,10 +19,12 @@ CHANNEL_NAME="$1"
|
||||||
DELAY="$2"
|
DELAY="$2"
|
||||||
LANGUAGE="$3"
|
LANGUAGE="$3"
|
||||||
TIMEOUT="$4"
|
TIMEOUT="$4"
|
||||||
|
VERBOSE="$5"
|
||||||
: ${CHANNEL_NAME:="mychannel"}
|
: ${CHANNEL_NAME:="mychannel"}
|
||||||
: ${DELAY:="3"}
|
: ${DELAY:="3"}
|
||||||
: ${LANGUAGE:="golang"}
|
: ${LANGUAGE:="golang"}
|
||||||
: ${TIMEOUT:="10"}
|
: ${TIMEOUT:="10"}
|
||||||
|
: ${VERBOSE:="false"}
|
||||||
LANGUAGE=`echo "$LANGUAGE" | tr [:upper:] [:lower:]`
|
LANGUAGE=`echo "$LANGUAGE" | tr [:upper:] [:lower:]`
|
||||||
COUNTER=1
|
COUNTER=1
|
||||||
MAX_RETRY=5
|
MAX_RETRY=5
|
||||||
|
|
|
||||||
|
|
@ -24,9 +24,11 @@ CHANNEL_NAME="$1"
|
||||||
DELAY="$2"
|
DELAY="$2"
|
||||||
LANGUAGE="$3"
|
LANGUAGE="$3"
|
||||||
TIMEOUT="$4"
|
TIMEOUT="$4"
|
||||||
|
VERBOSE="$5"
|
||||||
: ${CHANNEL_NAME:="mychannel"}
|
: ${CHANNEL_NAME:="mychannel"}
|
||||||
: ${TIMEOUT:="10"}
|
: ${TIMEOUT:="10"}
|
||||||
: ${LANGUAGE:="golang"}
|
: ${LANGUAGE:="golang"}
|
||||||
|
: ${VERBOSE:="false"}
|
||||||
LANGUAGE=`echo "$LANGUAGE" | tr [:upper:] [:lower:]`
|
LANGUAGE=`echo "$LANGUAGE" | tr [:upper:] [:lower:]`
|
||||||
COUNTER=1
|
COUNTER=1
|
||||||
MAX_RETRY=5
|
MAX_RETRY=5
|
||||||
|
|
|
||||||
|
|
@ -13,10 +13,12 @@ CHANNEL_NAME="$1"
|
||||||
DELAY="$2"
|
DELAY="$2"
|
||||||
LANGUAGE="$3"
|
LANGUAGE="$3"
|
||||||
TIMEOUT="$4"
|
TIMEOUT="$4"
|
||||||
|
VERBOSE="$5"
|
||||||
: ${CHANNEL_NAME:="mychannel"}
|
: ${CHANNEL_NAME:="mychannel"}
|
||||||
: ${DELAY:="5"}
|
: ${DELAY:="5"}
|
||||||
: ${LANGUAGE:="golang"}
|
: ${LANGUAGE:="golang"}
|
||||||
: ${TIMEOUT:="10"}
|
: ${TIMEOUT:="10"}
|
||||||
|
: ${VERBOSE:="false"}
|
||||||
LANGUAGE=`echo "$LANGUAGE" | tr [:upper:] [:lower:]`
|
LANGUAGE=`echo "$LANGUAGE" | tr [:upper:] [:lower:]`
|
||||||
COUNTER=1
|
COUNTER=1
|
||||||
MAX_RETRY=5
|
MAX_RETRY=5
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,9 @@ setGlobals () {
|
||||||
echo "================== ERROR !!! ORG Unknown =================="
|
echo "================== ERROR !!! ORG Unknown =================="
|
||||||
fi
|
fi
|
||||||
|
|
||||||
env |grep CORE
|
if [ "$VERBOSE" == "true" ]; then
|
||||||
|
env |grep CORE
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue