Skip to content

Commit

Permalink
v1.1.3 release
Browse files Browse the repository at this point in the history
  • Loading branch information
Trekkiii committed Oct 7, 2018
1 parent 2fc2abb commit a242108
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 17 deletions.
1 change: 1 addition & 0 deletions fabric-ca/ica-bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ dowait "the docker 'ica' container to start" 60 ${SDIR}/${INT_CA_LOGFILE} ${SDIR

tail -f ${SDIR}/${INT_CA_LOGFILE}&
TAIL_PID=$!
sleep 5
# 等待'ica'容器执行完成
waitPort "$INT_CA_NAME to start" 90 $INT_CA_LOGFILE $INT_CA_HOST 7054
sleep 5
Expand Down
1 change: 1 addition & 0 deletions fabric-ca/orderer-bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ dowait "the docker 'orderer' container to start" 60 ${SDIR}/${ORDERER_LOGFILE} $

tail -f ${SDIR}/${ORDERER_LOGFILE}&
TAIL_PID=$!
sleep 5
# 等待'orderer'容器执行完成
# Usage: waitPort <what> <timeoutInSecs> <errorLogFile> <host> <port>
waitPort "Orderer $ORDERER_HOST to start" 90 $ORDERER_LOGFILE $ORDERER_HOST 7050
Expand Down
1 change: 1 addition & 0 deletions fabric-ca/peer-bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ dowait "the docker 'peer' container to start" 60 ${SDIR}/${PEER_LOGFILE} ${SDIR}

tail -f ${SDIR}/${PEER_LOGFILE}&
TAIL_PID=$!
sleep 5
# 等待'peer'容器执行完成
# Usage: waitPort <what> <timeoutInSecs> <errorLogFile> <host> <port>
waitPort "Peer $PEER_HOST to start" 1800 $PEER_LOGFILE $PEER_HOST 7051
Expand Down
1 change: 1 addition & 0 deletions fabric-ca/rca-bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ dowait "the docker 'rca' container to start" 60 ${SDIR}/${ROOT_CA_LOGFILE} ${SDI

tail -f ${SDIR}/${ROOT_CA_LOGFILE}&
TAIL_PID=$!
sleep 5
# 等待'rca'容器执行完成
waitPort "$ROOT_CA_NAME to start" 90 $ROOT_CA_LOGFILE $ROOT_CA_HOST 7054
sleep 5
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,19 @@ done
shift $opts

if [ $# -lt 5 ]; then
echo "Usage: upgrade_cc.sh <-o <ORDERER_ORG>> <-n <ORDERER_NUM>> <CC_NAME> <CC_VERSION> <CC_PATH> <ORG> <NUM>"
echo "Usage: upgrade_cc.sh <-o <ORDERER_ORG>> <-n <ORDERER_NUM>> <ORG> <NUM> <CC_NAME> <CC_VERSION> <CC_PATH> [<CC_CTOR>]"
echo "Eg, ./install_cc.sh -u -o org0 -n 1 org1 1 mycc 1.1 github.com/hyperledger/fabric-web/chaincode/go/chaincode_example03 '{\"Args\":[\"init\",\"a\",\"90\",\"b\",\"210\"]}'"
exit 1
fi

CC_NAME="$1" # 链码名称
CC_VERSION="$2" # 链码版本
CC_PATH="$3" # 链码路径
PEER_ORG="$4" # Peer组织
PEER_NUM="$5" # Peer节点索引
PEER_ORG="$1" # Peer组织
PEER_NUM="$2" # Peer节点索引
CC_NAME="$3" # 链码名称
CC_VERSION="$4" # 链码版本
CC_PATH="$5" # 链码路径
CC_CTOR="$6" # 链码的具体执行参数信息,json格式,默认为"{}"

: ${CC_CTOR:="{}"}

initOrdererVars $ORDERER_ORG $ORDERER_NUM
export ORDERER_PORT_ARGS="-o $ORDERER_HOST:7050 --tls --cafile $CA_CHAINFILE --clientauth"
Expand All @@ -58,7 +62,7 @@ if $CC_UPGRADE; then
set -x
set +e
makePolicy
peer chaincode upgrade -C $CHANNEL_NAME -n $CC_NAME -v $CC_VERSION -c '{"Args":["init","a","90","b","210"]}' -P "$POLICY" $ORDERER_CONN_ARGS >&log.txt
peer chaincode upgrade -C $CHANNEL_NAME -n $CC_NAME -v $CC_VERSION -c $CC_CTOR -P "$POLICY" $ORDERER_CONN_ARGS >&log.txt
res=$?
set +x
set -e
Expand Down
35 changes: 32 additions & 3 deletions fabric-ca/scripts/invoke_cc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,39 @@ set -e

source $(dirname "$0")/env.sh

initOrdererVars org0 1
opts=0
while getopts "o:n:" opt; do
case "$opt" in
o)
opts=$((opts+2))
ORDERER_ORG=$OPTARG
;;
n)
opts=$((opts+2))
ORDERER_NUM=$OPTARG
;;
esac
done

shift $opts

if [ $# -lt 5 ]; then
echo "Usage: invoke_cc.sh <-o <ORDERER_ORG>> <-n <ORDERER_NUM>> <ORG> <NUM> <CC_NAME> <CC_VERSION> <CC_CTOR>"
echo "Eg, ./invoke_cc.sh -o org0 -n 1 org1 1 mycc 1.4 '{\"Args\":[\"invoke\",\"a\",\"b\",\"10\"]}'"
exit 1
fi

PEER_ORG="$1" # Peer组织
PEER_NUM="$2" # Peer节点索引
CC_NAME="$3" # 链码名称
CC_VERSION="$4" # 链码版本
CC_CTOR="$5" # 链码的具体执行参数信息,json格式

initOrdererVars $ORDERER_ORG $ORDERER_NUM
export ORDERER_PORT_ARGS="-o $ORDERER_HOST:7050 --tls --cafile $CA_CHAINFILE --clientauth"

initPeerVars org2 1
initPeerVars $PEER_ORG $PEER_NUM
switchToUserIdentity

peer chaincode invoke -C mychannel -n mycc -c '{"Args":["select", "a"]}'
log "Sending invoke transaction to $PEER_HOST ..."
peer chaincode invoke -C $CHANNEL_NAME -n $CC_NAME -c $CC_CTOR $ORDERER_CONN_ARGS
16 changes: 9 additions & 7 deletions fabric-ca/setup-bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,14 @@ startRun() {

docker-compose up -d --no-deps run

tail -f ${SDIR}/${RUN_SUMFILE}&
TAIL_PID=$!

sleep 5
# 等待'run'容器启动,随后tail -f run.sum
dowait "the docker 'run' container to start" 60 ${SDIR}/${RUN_LOGFILE} ${SDIR}/${RUN_SUMFILE}

tail -f ${SDIR}/${RUN_SUMFILE}&
TAIL_PID=$!
sleep 5

# 等待'run'容器执行完成
while true; do
if [ -f ${SDIR}/${RUN_SUCCESS_FILE} ]; then
Expand Down Expand Up @@ -92,15 +94,15 @@ done

: ${DOWN_REMOTE_BIN:="false"}

SDIR=$(dirname "$0")
source ${SDIR}/scripts/env.sh
cd ${SDIR}

if [ $(whoami) != "root" ]; then
log "Please use root to execute this sh"
exit 1
fi

SDIR=$(dirname "$0")
source ${SDIR}/scripts/env.sh
cd ${SDIR}

installJQ
# 校验fabric.config配置是否是合法性JSON
cat fabric.config | jq . >& /dev/null
Expand Down

0 comments on commit a242108

Please sign in to comment.