mirror of
https://github.com/hyperledger/fabric-samples.git
synced 2026-06-17 23:45:10 +00:00
options on the network script to deploy chaincode
-ccn The name to be used as the deployed name and used as
the short name of known chaincodes when the -ccp is not included.
known short names
'basic' - asset-transfer-basic
'secure' - asset-transfer-secured-agreement
'ledger' - asset-transfer-ledger-queries
'private' - asset-transfer-private-data
-ccl the language of the chaincode
-ccv the version
-ccs the sequence
-ccp [optional] the path to the chaincode, when provided
the -ccn will be the deployed name
-cci [optional] the chaincode function to call during deployment
that will perform an initialization of the channel state
required for this chaincode
Signed-off-by: Bret Harrison <beharrison@nc.rr.com>
54 lines
2.5 KiB
Bash
54 lines
2.5 KiB
Bash
#
|
|
# Copyright IBM Corp All Rights Reserved
|
|
#
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
#
|
|
|
|
# This is a collection of bash functions used by different scripts
|
|
|
|
ORDERER_CA=/opt/gopath/src/github.com/hyperledger/fabric/peer/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem
|
|
PEER0_ORG1_CA=/opt/gopath/src/github.com/hyperledger/fabric/peer/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt
|
|
PEER0_ORG2_CA=/opt/gopath/src/github.com/hyperledger/fabric/peer/organizations/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt
|
|
PEER0_ORG3_CA=/opt/gopath/src/github.com/hyperledger/fabric/peer/organizations/peerOrganizations/org3.example.com/peers/peer0.org3.example.com/tls/ca.crt
|
|
|
|
# Set OrdererOrg.Admin globals
|
|
setOrdererGlobals() {
|
|
CORE_PEER_LOCALMSPID="OrdererMSP"
|
|
CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem
|
|
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/organizations/ordererOrganizations/example.com/users/Admin@example.com/msp
|
|
}
|
|
|
|
# Set environment variables for the peer org
|
|
setGlobals() {
|
|
ORG=$1
|
|
if [ $ORG -eq 1 ]; then
|
|
CORE_PEER_LOCALMSPID="Org1MSP"
|
|
CORE_PEER_TLS_ROOTCERT_FILE=$PEER0_ORG1_CA
|
|
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/organizations/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp
|
|
CORE_PEER_ADDRESS=peer0.org1.example.com:7051
|
|
elif [ $ORG -eq 2 ]; then
|
|
CORE_PEER_LOCALMSPID="Org2MSP"
|
|
CORE_PEER_TLS_ROOTCERT_FILE=$PEER0_ORG2_CA
|
|
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/organizations/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp
|
|
CORE_PEER_ADDRESS=peer0.org2.example.com:9051
|
|
elif [ $ORG -eq 3 ]; then
|
|
CORE_PEER_LOCALMSPID="Org3MSP"
|
|
CORE_PEER_TLS_ROOTCERT_FILE=$PEER0_ORG3_CA
|
|
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/organizations/peerOrganizations/org3.example.com/users/Admin@org3.example.com/msp
|
|
CORE_PEER_ADDRESS=peer0.org3.example.com:11051
|
|
else
|
|
echo "================== ERROR !!! ORG Unknown =================="
|
|
fi
|
|
|
|
if [ "$VERBOSE" == "true" ]; then
|
|
env | grep CORE
|
|
fi
|
|
}
|
|
|
|
verifyResult() {
|
|
if [ $1 -ne 0 ]; then
|
|
echo $'\e[1;31m'!!!!!!!!!!!!!!! $2 !!!!!!!!!!!!!!!!$'\e[0m'
|
|
echo
|
|
exit 1
|
|
fi
|
|
}
|