[Not passed] Use new lifecycle cmd
parent
b3758c72b8
commit
b852fafdad
|
@ -57,7 +57,7 @@ ready: # create/join channel, install/instantiate cc
|
|||
|
||||
make update_anchors
|
||||
|
||||
make cc_test # test_cc_install test_cc_approve test_cc_queryapprove test_cc_commit test_cc_querycommit test_cc_invoke_query
|
||||
make cc_test # test_cc_install test_cc_approveformyorg test_cc_checkcommitreadiness test_cc_commit test_cc_querycommitted test_cc_invoke_query
|
||||
|
||||
# make test_lscc # test lscc operations, in v2.0, legacy lscc won't work
|
||||
make test_qscc # test qscc operations
|
||||
|
@ -84,7 +84,7 @@ ready: # create/join channel, install/instantiate cc
|
|||
channel_test: test_channel_create test_channel_join test_channel_list test_channel_getinfo
|
||||
|
||||
# chaincode related operations
|
||||
cc_test: test_cc_install test_cc_approve test_cc_queryapprove test_cc_commit test_cc_querycommit test_cc_invoke_query
|
||||
cc_test: test_cc_install test_cc_approveformyorg test_cc_checkcommitreadiness test_cc_commit test_cc_querycommitted test_cc_invoke_query
|
||||
|
||||
restart: stop start
|
||||
|
||||
|
@ -147,21 +147,25 @@ test_cc_install: # Install the chaincode
|
|||
@echo "Install chaincode to all peers"
|
||||
@docker exec -it fabric-cli bash -c "cd /tmp; bash scripts/test_cc_install.sh"
|
||||
|
||||
test_cc_approve: # Approve the chaincode definition
|
||||
@echo "Approve the chaincode by all orgs"
|
||||
@docker exec -it fabric-cli bash -c "cd /tmp; bash scripts/test_cc_approve.sh"
|
||||
test_cc_queryinstalled: # Query the installed chaincodes
|
||||
@echo "Query the installed chaincode"
|
||||
@docker exec -it fabric-cli bash -c "cd /tmp; bash scripts/test_cc_queryinstalled.sh"
|
||||
|
||||
test_cc_queryapprove: # Query the approval status of chaincode
|
||||
test_cc_approveformyorg: # Approve the chaincode definition
|
||||
@echo "Approve the chaincode by all orgs"
|
||||
@docker exec -it fabric-cli bash -c "cd /tmp; bash scripts/test_cc_approveformyorg.sh"
|
||||
|
||||
test_cc_checkcommitreadiness: # Query the approval status of chaincode
|
||||
@echo "Query the chaincode approval status by all orgs"
|
||||
@docker exec -it fabric-cli bash -c "cd /tmp; bash scripts/test_cc_queryapprove.sh"
|
||||
@docker exec -it fabric-cli bash -c "cd /tmp; bash scripts/test_cc_checkcommitreadiness.sh"
|
||||
|
||||
test_cc_commit: # Commit the chaincode definition
|
||||
@echo "Commit the chaincode by any org"
|
||||
@docker exec -it fabric-cli bash -c "cd /tmp; bash scripts/test_cc_commit.sh"
|
||||
|
||||
test_cc_querycommit: # Query the commit status of the chaincode definition
|
||||
test_cc_querycommitted: # Query the commit status of the chaincode definition
|
||||
@echo "Query the commit status of chaincode"
|
||||
@docker exec -it fabric-cli bash -c "cd /tmp; bash scripts/test_cc_querycommit.sh"
|
||||
@docker exec -it fabric-cli bash -c "cd /tmp; bash scripts/test_cc_querycommitted.sh"
|
||||
|
||||
test_cc_instantiate: # Instantiate the chaincode
|
||||
@echo "Instantiate chaincode on the fabric network"
|
||||
|
|
|
@ -195,4 +195,5 @@ services:
|
|||
- ./crypto-config:/etc/hyperledger/fabric/crypto-config
|
||||
- ./raft/channel-artifacts:/tmp/channel-artifacts
|
||||
- ./raft/configtx.yaml:/etc/hyperledger/fabric/configtx.yaml
|
||||
- ./examples:/opt/gopath/src/examples
|
||||
- ./examples:/go/src/examples
|
||||
#- $GOPATH/src/github.com/hyperledger/fabric:/go/src/github.com/hyperledger/fabric
|
||||
|
|
|
@ -102,7 +102,7 @@ services:
|
|||
- FABRIC_LOGGING_FORMAT=%{color}[%{id:03x} %{time:01-02 15:04:05.00 MST}] [%{module}] %{shortfunc} -> %{level:.4s}%{color:reset} %{message}
|
||||
- CORE_PEER_TLS_ENABLED=true # to enable TLS, change to true
|
||||
- ORDERER_CA=/etc/hyperledger/fabric/crypto-config/ordererOrganizations/example.com/orderers/orderer0.example.com/msp/tlscacerts/tlsca.example.com-cert.pem
|
||||
working_dir: /opt/gopath/src/github.com/hyperledger/fabric/peer
|
||||
working_dir: /opt/gopath/src/github.com/hyperledger/fabric
|
||||
command: bash -c 'cd /tmp; source scripts/func.sh; while true; do sleep 20170504; done'
|
||||
|
||||
prometheus: # prometheus will pull metrics from fabric
|
||||
|
|
|
@ -26,8 +26,8 @@ import (
|
|||
"fmt"
|
||||
"strconv"
|
||||
|
||||
"github.com/hyperledger/fabric/core/chaincode/shim"
|
||||
pb "github.com/hyperledger/fabric/protos/peer"
|
||||
"github.com/hyperledger/fabric-chaincode-go/shim"
|
||||
pb "github.com/hyperledger/fabric-protos-go/peer"
|
||||
)
|
||||
|
||||
// SimpleChaincode example simple Chaincode implementation
|
||||
|
|
|
@ -21,7 +21,8 @@ import (
|
|||
"strconv"
|
||||
|
||||
"github.com/hyperledger/fabric/core/chaincode/shim"
|
||||
pb "github.com/hyperledger/fabric/protos/peer"
|
||||
pb "github.com/hyperledger/fabric-protos-go/peer"
|
||||
|
||||
)
|
||||
|
||||
// SimpleChaincode example simple Chaincode implementation
|
||||
|
|
|
@ -20,8 +20,8 @@ import (
|
|||
"fmt"
|
||||
"strconv"
|
||||
|
||||
"github.com/hyperledger/fabric/core/chaincode/shim"
|
||||
pb "github.com/hyperledger/fabric/protos/peer"
|
||||
"github.com/hyperledger/fabric-chaincode-go/shim"
|
||||
pb "github.com/hyperledger/fabric-protos-go/peer"
|
||||
)
|
||||
|
||||
// SimpleChaincode example simple Chaincode implementation
|
||||
|
|
|
@ -19,7 +19,8 @@ import (
|
|||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/hyperledger/fabric/core/chaincode/shim"
|
||||
"github.com/hyperledger/fabric-chaincode-go/shim"
|
||||
|
||||
)
|
||||
|
||||
func checkInit(t *testing.T, stub *shim.MockStub, args [][]byte) {
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
module examples/chaincode/go/chaincode_example02
|
||||
|
||||
go 1.13
|
||||
|
||||
require (
|
||||
github.com/hyperledger/fabric-chaincode-go v0.0.0-20190823162523-04390e015b85
|
||||
github.com/hyperledger/fabric-protos-go v0.0.0-20190823190507-26c33c998676
|
||||
google.golang.org/grpc v1.24.0 // indirect
|
||||
)
|
|
@ -0,0 +1,61 @@
|
|||
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
|
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/gogo/protobuf v1.2.1 h1:/s5zKNz0uPFCZ5hddgPdo2TK2TVrUNMn0OOX8/aZMTE=
|
||||
github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4=
|
||||
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58=
|
||||
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
|
||||
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
|
||||
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs=
|
||||
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
|
||||
github.com/hyperledger/fabric-chaincode-go v0.0.0-20190823162523-04390e015b85 h1:VEm3tPRTCzq3J/1XpVERh1PbOSnshUVwx2G5s3cLiTw=
|
||||
github.com/hyperledger/fabric-chaincode-go v0.0.0-20190823162523-04390e015b85/go.mod h1:HZK6PKLWrvdD/t0oSLiyaRaUM6fZ7qjJuOlb0zrn0mo=
|
||||
github.com/hyperledger/fabric-protos-go v0.0.0-20190821214336-621b908d5022/go.mod h1:xVYTjK4DtZRBxZ2D9aE4y6AbLaPwue2o/criQyQbVD0=
|
||||
github.com/hyperledger/fabric-protos-go v0.0.0-20190823190507-26c33c998676 h1:35/AU/6kOZgrblvSjglQ6yoz3opCKTpfoMjQygtCD/U=
|
||||
github.com/hyperledger/fabric-protos-go v0.0.0-20190823190507-26c33c998676/go.mod h1:xVYTjK4DtZRBxZ2D9aE4y6AbLaPwue2o/criQyQbVD0=
|
||||
github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q=
|
||||
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
|
||||
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
|
||||
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
||||
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
|
||||
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
|
||||
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
||||
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190522155817-f3200d17e092 h1:4QSRKanuywn15aTZvI/mIDEgPQpswuFndXpOj3rKEco=
|
||||
golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
|
||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190710143415-6ec70d6a5542 h1:6ZQFf1D2YYDDI7eSwW8adlkkavTB9sw5I24FVtEvNUQ=
|
||||
golang.org/x/sys v0.0.0-20190710143415-6ec70d6a5542/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||
golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
|
||||
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
|
||||
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
|
||||
google.golang.org/genproto v0.0.0-20180831171423-11092d34479b h1:lohp5blsw53GBXtLyLNaTXPXS9pJ1tiTw61ZHUoE9Qw=
|
||||
google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
|
||||
google.golang.org/grpc v1.23.0 h1:AzbTB6ux+okLTzP8Ru1Xs41C303zdcfEht7MQnYJt5A=
|
||||
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
|
||||
google.golang.org/grpc v1.24.0 h1:vb/1TCsVn3DcJlQ0Gs1yB1pKI6Do2/QNwxdKqmc/b0s=
|
||||
google.golang.org/grpc v1.24.0/go.mod h1:XDChyiUovWa60DnaeDeZmSW86xtLtjtZbwvSiRnRtcA=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
|
||||
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
|
||||
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
|
@ -68,6 +68,9 @@ setEnvs () {
|
|||
t="\${ORG${org}_PEER${peer}_TLS_ROOTCERT}" && export CORE_PEER_TLS_ROOTCERT_FILE=`eval echo $t`
|
||||
|
||||
#env |grep CORE
|
||||
export FABRIC_LOGGING_SPEC="INFO"
|
||||
#export GOCACHE=/root/.cache/go-build
|
||||
#go get
|
||||
}
|
||||
|
||||
# Internal func called by channelCreate
|
||||
|
@ -341,9 +344,8 @@ channelUpdate() {
|
|||
sleep 2
|
||||
}
|
||||
|
||||
# Install chaincode on the peer node
|
||||
# In v2.x it will package, install and approve
|
||||
# chaincodeInstall peer cc_name version path
|
||||
# Package and Install chaincode on the peer node
|
||||
# chaincodeInstall org peer peer_url peer_tls cc_name version path
|
||||
chaincodeInstall () {
|
||||
if [ "$#" -ne 7 ]; then
|
||||
echo_r "Wrong param number for chaincode install"
|
||||
|
@ -364,16 +366,23 @@ chaincodeInstall () {
|
|||
echo "packaging chaincode into tar.gz package"
|
||||
local label=${name}
|
||||
#local label=${name}_${version}
|
||||
|
||||
echo "packaging chaincode ${name} with path ${path} and label ${label}"
|
||||
set -x
|
||||
peer lifecycle chaincode package ${name}.tar.gz \
|
||||
--path ${path} \
|
||||
--lang golang \
|
||||
--label ${label}
|
||||
--path ${path} \
|
||||
--lang golang \
|
||||
--label ${label}
|
||||
set +x
|
||||
|
||||
rc=$?
|
||||
[ $rc -ne 0 ] && echo "Error in packaging chaincode ${name}" && exit -1
|
||||
|
||||
echo "installing chaincode to peer${peer}/org${org}"
|
||||
peer lifecycle chaincode install \
|
||||
--peerAddresses ${peer_url} \
|
||||
--tlsRootCertFiles ${peer_tls_root_cert} \
|
||||
${name}.tar.gz | tee >&log.txt
|
||||
${name}.tar.gz | tee >&log.txt
|
||||
|
||||
# v1.x action
|
||||
#peer chaincode install \
|
||||
|
@ -387,9 +396,34 @@ chaincodeInstall () {
|
|||
echo "=== Chaincode is installed on org ${org}/peer $peer === "
|
||||
}
|
||||
|
||||
# Query the installed chaincode
|
||||
# chaincodeQueryCommitted org peer peer_url peer_tls_root_cert
|
||||
chaincodeQueryInstalled () {
|
||||
if [ "$#" -ne 4 ]; then
|
||||
echo_r "Wrong param number for chaincode query installed"
|
||||
exit -1
|
||||
fi
|
||||
local org=$1
|
||||
local peer=$2
|
||||
local peer_url=$3
|
||||
local peer_tls_root_cert=$4
|
||||
|
||||
setEnvs $org $peer
|
||||
|
||||
echo "Query the installed chaincode on peer $peer at $peer_url "
|
||||
peer lifecycle chaincode queryinstalled \
|
||||
--peerAddresses ${peer_url} \
|
||||
--tlsRootCertFiles ${peer_tls_root_cert} \
|
||||
--connTimeout "3s"
|
||||
rc=$?
|
||||
[ $rc -ne 0 ] && cat log.txt
|
||||
cat log.txt
|
||||
verifyResult $rc "ChaincodeQueryInstalled Failed: org ${org}/peer$peer"
|
||||
}
|
||||
|
||||
# Approve the chaincode definition
|
||||
# chaincodeApprove channel org peer peer_url peer_tls_root_cert orderer_url orderer_tls_rootcert channel name version
|
||||
chaincodeApprove () {
|
||||
# chaincodeApproveForMyOrg channel org peer peer_url peer_tls_root_cert orderer_url orderer_tls_rootcert channel name version
|
||||
chaincodeApproveForMyOrg () {
|
||||
if [ "$#" -ne 9 -a "$#" -ne 11 ]; then
|
||||
echo_r "Wrong param number for chaincode approve"
|
||||
exit -1
|
||||
|
@ -431,7 +465,7 @@ chaincodeApprove () {
|
|||
--name ${name} \
|
||||
--version ${version} \
|
||||
--init-required \
|
||||
--package-id ${package_id} \
|
||||
--package-id ${package_id} \
|
||||
--sequence 1 \
|
||||
--signature-policy "${policy}" \
|
||||
--waitForEvent \
|
||||
|
@ -460,8 +494,8 @@ chaincodeApprove () {
|
|||
}
|
||||
|
||||
# Query the Approve the chaincode definition
|
||||
# chaincodeQueryApprove channel org peer name version
|
||||
chaincodeQueryApprove () {
|
||||
# chaincodeCheckCommitReadiness channel org peer name version
|
||||
chaincodeCheckCommitReadiness () {
|
||||
if [ "$#" -ne 7 ]; then
|
||||
echo_r "Wrong param number for chaincode queryapproval"
|
||||
exit -1
|
||||
|
@ -477,7 +511,7 @@ chaincodeQueryApprove () {
|
|||
setEnvs $org $peer
|
||||
|
||||
echo "Query the approval status of the chaincode $name $version"
|
||||
peer lifecycle chaincode queryapprovalstatus \
|
||||
peer lifecycle chaincode checkcommitreadiness \
|
||||
--peerAddresses ${peer_url} \
|
||||
--tlsRootCertFiles ${peer_tls_root_cert} \
|
||||
--channelID ${channel} \
|
||||
|
@ -562,8 +596,8 @@ chaincodeCommit () {
|
|||
}
|
||||
|
||||
# Query the Commit the chaincode definition
|
||||
# chaincodeQueryCommit channel org peer name version
|
||||
chaincodeQueryCommit () {
|
||||
# chaincodeQueryCommitted org peer peer_url peer_tls_root_cert channel cc_name
|
||||
chaincodeQueryCommitted () {
|
||||
if [ "$#" -ne 6 ]; then
|
||||
echo_r "Wrong param number for chaincode querycommit"
|
||||
exit -1
|
||||
|
@ -580,7 +614,7 @@ chaincodeQueryCommit () {
|
|||
echo "Query the committed status of chaincode $name with ${ORG1_PEER0_URL} "
|
||||
peer lifecycle chaincode querycommitted \
|
||||
--peerAddresses ${peer_url} \
|
||||
--tlsRootCertFiles ${peer_tls_root_cert} \
|
||||
--tlsRootCertFiles ${peer_tls_root_cert} \
|
||||
--channelID ${channel} \
|
||||
--name ${name}
|
||||
rc=$?
|
||||
|
|
|
@ -17,7 +17,7 @@ for org in "${ORGS[@]}"
|
|||
do
|
||||
t="\${ORG${org}_PEER0_URL}" && peer_url=`eval echo $t`
|
||||
t="\${ORG${org}_PEER0_TLS_ROOTCERT}" && peer_tls_rootcert=`eval echo $t`
|
||||
chaincodeApprove "$org" 0 ${peer_url} ${peer_tls_rootcert} ${ORDERER0_URL} ${ORDERER0_TLS_ROOTCERT} "${APP_CHANNEL}" ${CC_NAME} ${CC_INIT_VERSION}
|
||||
chaincodeApproveForMyOrg "$org" 0 ${peer_url} ${peer_tls_rootcert} ${ORDERER0_URL} ${ORDERER0_TLS_ROOTCERT} "${APP_CHANNEL}" ${CC_NAME} ${CC_INIT_VERSION}
|
||||
done
|
||||
|
||||
echo_g "=== Approve chaincode done ==="
|
|
@ -17,7 +17,7 @@ for org in "${ORGS[@]}"
|
|||
do
|
||||
t="\${ORG${org}_PEER0_URL}" && peer_url=`eval echo $t`
|
||||
t="\${ORG${org}_PEER0_TLS_ROOTCERT}" && peer_tls_rootcert=`eval echo $t`
|
||||
chaincodeQueryApprove "$org" 0 ${peer_url} ${peer_tls_rootcert} "${APP_CHANNEL}" ${CC_NAME} ${CC_INIT_VERSION}
|
||||
chaincodeCheckCommitReadiness "$org" 0 ${peer_url} ${peer_tls_rootcert} "${APP_CHANNEL}" ${CC_NAME} ${CC_INIT_VERSION}
|
||||
done
|
||||
|
||||
echo_g "=== Query Chaincode approve status done ==="
|
|
@ -17,7 +17,7 @@ for org in "${ORGS[@]}"
|
|||
do
|
||||
t="\${ORG${org}_PEER0_URL}" && peer_url=`eval echo $t`
|
||||
t="\${ORG${org}_PEER0_TLS_ROOTCERT}" && peer_tls_rootcert=`eval echo $t`
|
||||
chaincodeQueryCommit "$org" 0 ${peer_url} ${peer_tls_rootcert} "${APP_CHANNEL}" ${CC_NAME}
|
||||
chaincodeQueryCommitted "$org" 0 ${peer_url} ${peer_tls_rootcert} "${APP_CHANNEL}" ${CC_NAME}
|
||||
done
|
||||
|
||||
echo_g "=== Query Chaincode commit status done ==="
|
|
@ -0,0 +1,22 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Importing useful functions for cc testing
|
||||
if [ -f ./func.sh ]; then
|
||||
source ./func.sh
|
||||
elif [ -f scripts/func.sh ]; then
|
||||
source scripts/func.sh
|
||||
fi
|
||||
|
||||
## Query the installed chaincode on all peers
|
||||
echo_b "=== Query Chaincode installed on all organizations ... ==="
|
||||
|
||||
for org in "${ORGS[@]}"
|
||||
do
|
||||
t="\${ORG${org}_PEER0_URL}" && peer_url=`eval echo $t`
|
||||
t="\${ORG${org}_PEER0_TLS_ROOTCERT}" && peer_tls_rootcert=`eval echo $t`
|
||||
chaincodeQueryInstalled "$org" 0 ${peer_url} ${peer_tls_rootcert}
|
||||
done
|
||||
|
||||
echo_g "=== Query Chaincode installed status done ==="
|
||||
|
||||
echo
|
Loading…
Reference in New Issue