mirror of
https://github.com/hyperledger/fabric-samples.git
synced 2026-06-27 20:15:10 +00:00
FAB-10801 format and styling for shell artifacts
formatting for existing shell scripts Change-Id: I7e067730558bc55edc74b73e59195af7c825d8b2 Signed-off-by: Naga Pemmara <naga.pemmaraju@ibm.com>
This commit is contained in:
parent
e95210e9bc
commit
20ad472356
2 changed files with 277 additions and 268 deletions
|
|
@ -231,7 +231,6 @@ function upgradeNetwork () {
|
|||
fi
|
||||
}
|
||||
|
||||
|
||||
# Tear down running network
|
||||
function networkDown() {
|
||||
# stop org3 containers also in addition to org1 and org2, in case we were running sample to add org3
|
||||
|
|
@ -259,7 +258,7 @@ function networkDown () {
|
|||
function replacePrivateKey() {
|
||||
# sed on MacOSX does not support -i flag with a null extension. We will use
|
||||
# 't' for our back-up's extension and delete it at the end of the function
|
||||
ARCH=`uname -s | grep Darwin`
|
||||
ARCH=$(uname -s | grep Darwin)
|
||||
if [ "$ARCH" == "Darwin" ]; then
|
||||
OPTS="-it"
|
||||
else
|
||||
|
|
@ -454,7 +453,8 @@ IMAGETAG="latest"
|
|||
if [ "$1" = "-m" ]; then # supports old usage, muscle memory is powerful!
|
||||
shift
|
||||
fi
|
||||
MODE=$1;shift
|
||||
MODE=$1
|
||||
shift
|
||||
# Determine whether starting, stopping, restarting, generating or upgrading
|
||||
if [ "$MODE" == "up" ]; then
|
||||
EXPMODE="Starting"
|
||||
|
|
@ -477,21 +477,29 @@ while getopts "h?c:t:d:f:s:l:i:v" opt; do
|
|||
printHelp
|
||||
exit 0
|
||||
;;
|
||||
c) CHANNEL_NAME=$OPTARG
|
||||
c)
|
||||
CHANNEL_NAME=$OPTARG
|
||||
;;
|
||||
t) CLI_TIMEOUT=$OPTARG
|
||||
t)
|
||||
CLI_TIMEOUT=$OPTARG
|
||||
;;
|
||||
d) CLI_DELAY=$OPTARG
|
||||
d)
|
||||
CLI_DELAY=$OPTARG
|
||||
;;
|
||||
f) COMPOSE_FILE=$OPTARG
|
||||
f)
|
||||
COMPOSE_FILE=$OPTARG
|
||||
;;
|
||||
s) IF_COUCHDB=$OPTARG
|
||||
s)
|
||||
IF_COUCHDB=$OPTARG
|
||||
;;
|
||||
l) LANGUAGE=$OPTARG
|
||||
l)
|
||||
LANGUAGE=$OPTARG
|
||||
;;
|
||||
i) IMAGETAG=`uname -m`"-"$OPTARG
|
||||
i)
|
||||
IMAGETAG=$(uname -m)"-"$OPTARG
|
||||
;;
|
||||
v) VERBOSE=true
|
||||
v)
|
||||
VERBOSE=true
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
|
|
|||
|
|
@ -68,7 +68,6 @@ setGlobals () {
|
|||
fi
|
||||
}
|
||||
|
||||
|
||||
updateAnchorPeers() {
|
||||
PEER=$1
|
||||
ORG=$2
|
||||
|
|
@ -104,7 +103,7 @@ joinChannelWithRetry () {
|
|||
set +x
|
||||
cat log.txt
|
||||
if [ $res -ne 0 -a $COUNTER -lt $MAX_RETRY ]; then
|
||||
COUNTER=` expr $COUNTER + 1`
|
||||
COUNTER=$(expr $COUNTER + 1)
|
||||
echo "peer${PEER}.org${ORG} failed to join the channel, Retry after $DELAY seconds"
|
||||
sleep $DELAY
|
||||
joinChannelWithRetry $PEER $ORG
|
||||
|
|
@ -181,7 +180,8 @@ chaincodeQuery () {
|
|||
|
||||
# continue to poll
|
||||
# we either get a successful response, or reach TIMEOUT
|
||||
while test "$(($(date +%s)-starttime))" -lt "$TIMEOUT" -a $rc -ne 0
|
||||
while
|
||||
test "$(($(date +%s) - starttime))" -lt "$TIMEOUT" -a $rc -ne 0
|
||||
do
|
||||
sleep $DELAY
|
||||
echo "Attempting to Query peer${PEER}.org${ORG} ...$(($(date +%s) - starttime)) secs"
|
||||
|
|
@ -285,7 +285,8 @@ parsePeerConnectionParameters() {
|
|||
PEER_CONN_PARMS="$PEER_CONN_PARMS $TLSINFO"
|
||||
fi
|
||||
# shift by two to get the next pair of peer/org parameters
|
||||
shift; shift
|
||||
shift
|
||||
shift
|
||||
done
|
||||
# remove leading space for output
|
||||
PEERS="$(echo -e "$PEERS" | sed -e 's/^[[:space:]]*//')"
|
||||
|
|
|
|||
Loading…
Reference in a new issue