Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install chaincode from docker image #445

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Original file line number Diff line number Diff line change
Expand Up @@ -1724,12 +1724,13 @@ installChaincodes() {
if [ -n \\"$(ls \\"$CHAINCODES_BASE_DIR/./chaincodes/chaincode-kv-node\\")\\" ]; then
local version=\\"0.0.1\\"
printHeadline \\"Packaging chaincode 'chaincode1'\\" \\"U1F60E\\"
chaincodeBuild \\"chaincode1\\" \\"node\\" \\"$CHAINCODES_BASE_DIR/./chaincodes/chaincode-kv-node\\" \\"12\\"
chaincodeBuildDirPath \\"chaincode1\\" \\"node\\" \\"$CHAINCODES_BASE_DIR/./chaincodes/chaincode-kv-node\\" \\"12\\"
chaincodePackage \\"cli.org1.example.com\\" \\"peer0.org1.example.com:7041\\" \\"chaincode1\\" \\"$version\\" \\"node\\" printHeadline \\"Installing 'chaincode1' for Org1\\" \\"U1F60E\\"
chaincodeInstall \\"cli.org1.example.com\\" \\"peer0.org1.example.com:7041\\" \\"chaincode1\\" \\"$version\\" \\"crypto-orderer/tlsca.orderer.example.com-cert.pem\\"
chaincodeApprove \\"cli.org1.example.com\\" \\"peer0.org1.example.com:7041\\" \\"my-channel1\\" \\"chaincode1\\" \\"$version\\" \\"orderer0.group1.orderer.example.com:7030\\" \\"\\" \\"false\\" \\"crypto-orderer/tlsca.orderer.example.com-cert.pem\\" \\"\\"
printItalics \\"Committing chaincode 'chaincode1' on channel 'my-channel1' as 'Org1'\\" \\"U1F618\\"
chaincodeCommit \\"cli.org1.example.com\\" \\"peer0.org1.example.com:7041\\" \\"my-channel1\\" \\"chaincode1\\" \\"$version\\" \\"orderer0.group1.orderer.example.com:7030\\" \\"\\" \\"false\\" \\"crypto-orderer/tlsca.orderer.example.com-cert.pem\\" \\"peer0.org1.example.com:7041\\" \\"crypto-peer/peer0.org1.example.com/tls/ca.crt\\" \\"\\"

else
echo \\"Warning! Skipping chaincode 'chaincode1' installation. Chaincode directory is empty.\\"
echo \\"Looked in dir: '$CHAINCODES_BASE_DIR/./chaincodes/chaincode-kv-node'\\"
Expand All @@ -1753,14 +1754,15 @@ installChaincode() {
if [ \\"$chaincodeName\\" = \\"chaincode1\\" ]; then
if [ -n \\"$(ls \\"$CHAINCODES_BASE_DIR/./chaincodes/chaincode-kv-node\\")\\" ]; then
printHeadline \\"Packaging chaincode 'chaincode1'\\" \\"U1F60E\\"
chaincodeBuild \\"chaincode1\\" \\"node\\" \\"$CHAINCODES_BASE_DIR/./chaincodes/chaincode-kv-node\\" \\"12\\"
chaincodeBuildDirPath \\"chaincode1\\" \\"node\\" \\"$CHAINCODES_BASE_DIR/./chaincodes/chaincode-kv-node\\" \\"12\\"
chaincodePackage \\"cli.org1.example.com\\" \\"peer0.org1.example.com:7041\\" \\"chaincode1\\" \\"$version\\" \\"node\\" printHeadline \\"Installing 'chaincode1' for Org1\\" \\"U1F60E\\"
chaincodeInstall \\"cli.org1.example.com\\" \\"peer0.org1.example.com:7041\\" \\"chaincode1\\" \\"$version\\" \\"crypto-orderer/tlsca.orderer.example.com-cert.pem\\"
chaincodeApprove \\"cli.org1.example.com\\" \\"peer0.org1.example.com:7041\\" \\"my-channel1\\" \\"chaincode1\\" \\"$version\\" \\"orderer0.group1.orderer.example.com:7030\\" \\"\\" \\"false\\" \\"crypto-orderer/tlsca.orderer.example.com-cert.pem\\" \\"\\"
printItalics \\"Committing chaincode 'chaincode1' on channel 'my-channel1' as 'Org1'\\" \\"U1F618\\"
chaincodeCommit \\"cli.org1.example.com\\" \\"peer0.org1.example.com:7041\\" \\"my-channel1\\" \\"chaincode1\\" \\"$version\\" \\"orderer0.group1.orderer.example.com:7030\\" \\"\\" \\"false\\" \\"crypto-orderer/tlsca.orderer.example.com-cert.pem\\" \\"peer0.org1.example.com:7041\\" \\"crypto-peer/peer0.org1.example.com/tls/ca.crt\\" \\"\\"

else

echo \\"Warning! Skipping chaincode 'chaincode1' install. Chaincode directory is empty.\\"
echo \\"Looked in dir: '$CHAINCODES_BASE_DIR/./chaincodes/chaincode-kv-node'\\"
fi
Expand Down Expand Up @@ -1800,14 +1802,15 @@ upgradeChaincode() {
if [ \\"$chaincodeName\\" = \\"chaincode1\\" ]; then
if [ -n \\"$(ls \\"$CHAINCODES_BASE_DIR/./chaincodes/chaincode-kv-node\\")\\" ]; then
printHeadline \\"Packaging chaincode 'chaincode1'\\" \\"U1F60E\\"
chaincodeBuild \\"chaincode1\\" \\"node\\" \\"$CHAINCODES_BASE_DIR/./chaincodes/chaincode-kv-node\\" \\"12\\"
chaincodeBuildDirPath \\"chaincode1\\" \\"node\\" \\"$CHAINCODES_BASE_DIR/./chaincodes/chaincode-kv-node\\" \\"12\\"
chaincodePackage \\"cli.org1.example.com\\" \\"peer0.org1.example.com:7041\\" \\"chaincode1\\" \\"$version\\" \\"node\\" printHeadline \\"Installing 'chaincode1' for Org1\\" \\"U1F60E\\"
chaincodeInstall \\"cli.org1.example.com\\" \\"peer0.org1.example.com:7041\\" \\"chaincode1\\" \\"$version\\" \\"crypto-orderer/tlsca.orderer.example.com-cert.pem\\"
chaincodeApprove \\"cli.org1.example.com\\" \\"peer0.org1.example.com:7041\\" \\"my-channel1\\" \\"chaincode1\\" \\"$version\\" \\"orderer0.group1.orderer.example.com:7030\\" \\"\\" \\"false\\" \\"crypto-orderer/tlsca.orderer.example.com-cert.pem\\" \\"\\"
printItalics \\"Committing chaincode 'chaincode1' on channel 'my-channel1' as 'Org1'\\" \\"U1F618\\"
chaincodeCommit \\"cli.org1.example.com\\" \\"peer0.org1.example.com:7041\\" \\"my-channel1\\" \\"chaincode1\\" \\"$version\\" \\"orderer0.group1.orderer.example.com:7030\\" \\"\\" \\"false\\" \\"crypto-orderer/tlsca.orderer.example.com-cert.pem\\" \\"peer0.org1.example.com:7041\\" \\"crypto-peer/peer0.org1.example.com/tls/ca.crt\\" \\"\\"

else

echo \\"Warning! Skipping chaincode 'chaincode1' upgrade. Chaincode directory is empty.\\"
echo \\"Looked in dir: '$CHAINCODES_BASE_DIR/./chaincodes/chaincode-kv-node'\\"
fi
Expand Down Expand Up @@ -2469,14 +2472,16 @@ exports[`samples/fablo-config-hlf2-1org-1chaincode-raft-explorer.json should cre
# phrase \\"\${CA_CERT_PARAMS[@]+\\"\${CA_CERT_PARAMS[@]}\\"}\\" is needed in older bash versions ( <4 ) for array expansion.
# see: https://stackoverflow.com/questions/7577052/bash-empty-array-expansion-with-set-u

CC_PACKAGE_ID=\\"\\"

dockerPullIfMissing() {
local IMAGE=\\"$1\\"
if [[ \\"$(docker images -q \\"$IMAGE\\" 2>/dev/null)\\" == \\"\\" ]]; then
docker pull --platform linux/x86_64 \\"$IMAGE\\"
fi
}

chaincodeBuild() {
chaincodeBuildDirPath() {
local CHAINCODE_NAME=$1
local CHAINCODE_LANG=$2
local CHAINCODE_DIR_PATH=$3
Expand Down Expand Up @@ -2541,6 +2546,80 @@ chaincodeBuild() {
fi
}

chaincodeBuildCCAASImage() {
local CHAINCODE_NAME=$1
local CHAINCODE_DIR_PATH=$2
# build the docker container
echo \\"Building Chaincode-as-a-Service docker image '\${CHAINCODE_NAME}' '\${CHAINCODE_DIR_PATH}'\\"
echo \\"This may take several minutes...\\"
docker build -f \\"$CHAINCODE_DIR_PATH\\"/Dockerfile -t \\"\${CHAINCODE_NAME}\\"_ccaas_image:latest --build-arg CC_SERVER_PORT=9999 \\"$CHAINCODE_DIR_PATH\\" >&log.txt
}

chaincodeExternalPackage() {
local CLI_NAME=$1
local PEER_ADDRESS=$2
local CHAINCODE_NAME=$3
local CHAINCODE_VERSION=$4
local CHAINCODE_LABEL=\\"\${CHAINCODE_NAME}_$CHAINCODE_VERSION\\"
local CHAINCODE_LANG=$5
local CCAAS_SERVER_PORT=9999

echo \\"Packaging external chaincode $CHAINCODE_NAME...\\"
inputLog \\"CHAINCODE_VERSION: $CHAINCODE_VERSION\\"
inputLog \\"CHAINCODE_LANG: $CHAINCODE_LANG\\"
inputLog \\"PEER_ADDRESS: $PEER_ADDRESS\\"
inputLog \\"CLI_NAME: $CLI_NAME\\"
inputLog \\"CCAAS_SERVER_PORT: $CCAAS_SERVER_PORT\\"

local address=\\"\${CHAINCODE_NAME}_ccaas:\${CCAAS_SERVER_PORT}\\"

docker exec \\"$CLI_NAME\\" mktemp -d -t 'chaincode.XXXXXXXX' >tempdir.txt
TEMP_DIR=$(cat tempdir.txt)

docker exec \\"$CLI_NAME\\" mkdir -p \\"$TEMP_DIR\\"/src
docker exec \\"$CLI_NAME\\" mkdir -p \\"$TEMP_DIR\\"/pkg

docker exec \\"$CLI_NAME\\" sh -c \\"echo '{
\\\\\\"address\\\\\\": \\\\\\"\${address}\\\\\\",
\\\\\\"dial_timeout\\\\\\": \\\\\\"10s\\\\\\",
\\\\\\"tls_required\\\\\\": false
}' > $TEMP_DIR/src/connection.json\\"

docker exec \\"$CLI_NAME\\" sh -c \\"echo '{
\\\\\\"type\\\\\\": \\\\\\"ccaas\\\\\\",
\\\\\\"label\\\\\\": \\\\\\"$CHAINCODE_LABEL\\\\\\"
}' > $TEMP_DIR/pkg/metadata.json\\"

docker exec \\"$CLI_NAME\\" tar -C \\"$TEMP_DIR\\"/src -czf \\"$TEMP_DIR\\"/pkg/code.tar.gz .

docker exec \\"$CLI_NAME\\" tar -C \\"$TEMP_DIR\\"/pkg -czf /var/hyperledger/cli/chaincode-packages/\\"$CHAINCODE_LABEL\\".tar.gz metadata.json code.tar.gz

docker exec \\"$CLI_NAME\\" rm -Rf \\"$TEMP_DIR\\"

# Calculate package ID
docker exec \\"$CLI_NAME\\" peer lifecycle chaincode calculatepackageid /var/hyperledger/cli/chaincode-packages/\\"$CHAINCODE_LABEL\\".tar.gz

# Clean up local temp file
rm tempdir.txt

docker exec \\"$CLI_NAME\\" chown \\"$(id -u):$(id -g)\\" \\"/var/hyperledger/cli/chaincode-packages/$CHAINCODE_LABEL.tar.gz\\"
inputLog \\"$CHAINCODE_LABEL\\"

inputLog \\"Chaincode is packaged \${address}\\"
}

chaincodeRunCCAASContainers() {
echo \\"Running Chaincode-as-a-Service container\\"
local CHAINCODE_NAME=$1
local CCAAS_SERVER_PORT=9999

docker run --rm -d --name \\"\${CHAINCODE_NAME}\\"_ccaas --network \\"\${COMPOSE_PROJECT_NAME}_basic\\" \\\\
-e CHAINCODE_SERVER_ADDRESS=0.0.0.0:\${CCAAS_SERVER_PORT} \\\\
-e CHAINCODE_ID=\\"$CC_PACKAGE_ID\\" -e CORE_CHAINCODE_ID_NAME=\\"$CC_PACKAGE_ID\\" \\\\
\\"\${CHAINCODE_NAME}\\"_ccaas_image:latest

}

chaincodePackage() {
local CLI_NAME=$1
local PEER_ADDRESS=$2
Expand Down Expand Up @@ -2634,7 +2713,6 @@ chaincodeApprove() {
fi

local QUERYINSTALLED_RESPONSE
local CC_PACKAGE_ID

QUERYINSTALLED_RESPONSE=\\"$(
docker exec -e CORE_PEER_ADDRESS=\\"$PEER_ADDRESS\\" \\"$CLI_NAME\\" peer lifecycle chaincode queryinstalled \\\\
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1676,13 +1676,14 @@ installChaincodes() {
if [ -n \\"$(ls \\"$CHAINCODES_BASE_DIR/./chaincodes/chaincode-kv-node\\")\\" ]; then
local version=\\"0.0.1\\"
printHeadline \\"Packaging chaincode 'chaincode1'\\" \\"U1F60E\\"
chaincodeBuild \\"chaincode1\\" \\"node\\" \\"$CHAINCODES_BASE_DIR/./chaincodes/chaincode-kv-node\\" \\"16\\"
chaincodeBuildDirPath \\"chaincode1\\" \\"node\\" \\"$CHAINCODES_BASE_DIR/./chaincodes/chaincode-kv-node\\" \\"16\\"
chaincodePackage \\"cli.org1.example.com\\" \\"peer0.org1.example.com:7041\\" \\"chaincode1\\" \\"$version\\" \\"node\\" printHeadline \\"Installing 'chaincode1' for Org1\\" \\"U1F60E\\"
chaincodeInstall \\"cli.org1.example.com\\" \\"peer0.org1.example.com:7041\\" \\"chaincode1\\" \\"$version\\" \\"\\"
chaincodeInstall \\"cli.org1.example.com\\" \\"peer1.org1.example.com:7042\\" \\"chaincode1\\" \\"$version\\" \\"\\"
chaincodeApprove \\"cli.org1.example.com\\" \\"peer0.org1.example.com:7041\\" \\"my-channel1\\" \\"chaincode1\\" \\"$version\\" \\"orderer0.group1.orderer.example.com:7030\\" \\"\\" \\"false\\" \\"\\" \\"\\"
printItalics \\"Committing chaincode 'chaincode1' on channel 'my-channel1' as 'Org1'\\" \\"U1F618\\"
chaincodeCommit \\"cli.org1.example.com\\" \\"peer0.org1.example.com:7041\\" \\"my-channel1\\" \\"chaincode1\\" \\"$version\\" \\"orderer0.group1.orderer.example.com:7030\\" \\"\\" \\"false\\" \\"\\" \\"peer0.org1.example.com:7041\\" \\"\\" \\"\\"

else
echo \\"Warning! Skipping chaincode 'chaincode1' installation. Chaincode directory is empty.\\"
echo \\"Looked in dir: '$CHAINCODES_BASE_DIR/./chaincodes/chaincode-kv-node'\\"
Expand All @@ -1706,7 +1707,7 @@ installChaincode() {
if [ \\"$chaincodeName\\" = \\"chaincode1\\" ]; then
if [ -n \\"$(ls \\"$CHAINCODES_BASE_DIR/./chaincodes/chaincode-kv-node\\")\\" ]; then
printHeadline \\"Packaging chaincode 'chaincode1'\\" \\"U1F60E\\"
chaincodeBuild \\"chaincode1\\" \\"node\\" \\"$CHAINCODES_BASE_DIR/./chaincodes/chaincode-kv-node\\" \\"16\\"
chaincodeBuildDirPath \\"chaincode1\\" \\"node\\" \\"$CHAINCODES_BASE_DIR/./chaincodes/chaincode-kv-node\\" \\"16\\"
chaincodePackage \\"cli.org1.example.com\\" \\"peer0.org1.example.com:7041\\" \\"chaincode1\\" \\"$version\\" \\"node\\" printHeadline \\"Installing 'chaincode1' for Org1\\" \\"U1F60E\\"
chaincodeInstall \\"cli.org1.example.com\\" \\"peer0.org1.example.com:7041\\" \\"chaincode1\\" \\"$version\\" \\"\\"
chaincodeInstall \\"cli.org1.example.com\\" \\"peer1.org1.example.com:7042\\" \\"chaincode1\\" \\"$version\\" \\"\\"
Expand All @@ -1715,6 +1716,7 @@ installChaincode() {
chaincodeCommit \\"cli.org1.example.com\\" \\"peer0.org1.example.com:7041\\" \\"my-channel1\\" \\"chaincode1\\" \\"$version\\" \\"orderer0.group1.orderer.example.com:7030\\" \\"\\" \\"false\\" \\"\\" \\"peer0.org1.example.com:7041\\" \\"\\" \\"\\"

else

echo \\"Warning! Skipping chaincode 'chaincode1' install. Chaincode directory is empty.\\"
echo \\"Looked in dir: '$CHAINCODES_BASE_DIR/./chaincodes/chaincode-kv-node'\\"
fi
Expand Down Expand Up @@ -1754,7 +1756,7 @@ upgradeChaincode() {
if [ \\"$chaincodeName\\" = \\"chaincode1\\" ]; then
if [ -n \\"$(ls \\"$CHAINCODES_BASE_DIR/./chaincodes/chaincode-kv-node\\")\\" ]; then
printHeadline \\"Packaging chaincode 'chaincode1'\\" \\"U1F60E\\"
chaincodeBuild \\"chaincode1\\" \\"node\\" \\"$CHAINCODES_BASE_DIR/./chaincodes/chaincode-kv-node\\" \\"16\\"
chaincodeBuildDirPath \\"chaincode1\\" \\"node\\" \\"$CHAINCODES_BASE_DIR/./chaincodes/chaincode-kv-node\\" \\"16\\"
chaincodePackage \\"cli.org1.example.com\\" \\"peer0.org1.example.com:7041\\" \\"chaincode1\\" \\"$version\\" \\"node\\" printHeadline \\"Installing 'chaincode1' for Org1\\" \\"U1F60E\\"
chaincodeInstall \\"cli.org1.example.com\\" \\"peer0.org1.example.com:7041\\" \\"chaincode1\\" \\"$version\\" \\"\\"
chaincodeInstall \\"cli.org1.example.com\\" \\"peer1.org1.example.com:7042\\" \\"chaincode1\\" \\"$version\\" \\"\\"
Expand All @@ -1763,6 +1765,7 @@ upgradeChaincode() {
chaincodeCommit \\"cli.org1.example.com\\" \\"peer0.org1.example.com:7041\\" \\"my-channel1\\" \\"chaincode1\\" \\"$version\\" \\"orderer0.group1.orderer.example.com:7030\\" \\"\\" \\"false\\" \\"\\" \\"peer0.org1.example.com:7041\\" \\"\\" \\"\\"

else

echo \\"Warning! Skipping chaincode 'chaincode1' upgrade. Chaincode directory is empty.\\"
echo \\"Looked in dir: '$CHAINCODES_BASE_DIR/./chaincodes/chaincode-kv-node'\\"
fi
Expand Down Expand Up @@ -2333,14 +2336,16 @@ exports[`samples/fablo-config-hlf2-1org-1chaincode.json should create proper e2e
# phrase \\"\${CA_CERT_PARAMS[@]+\\"\${CA_CERT_PARAMS[@]}\\"}\\" is needed in older bash versions ( <4 ) for array expansion.
# see: https://stackoverflow.com/questions/7577052/bash-empty-array-expansion-with-set-u

CC_PACKAGE_ID=\\"\\"

dockerPullIfMissing() {
local IMAGE=\\"$1\\"
if [[ \\"$(docker images -q \\"$IMAGE\\" 2>/dev/null)\\" == \\"\\" ]]; then
docker pull --platform linux/x86_64 \\"$IMAGE\\"
fi
}

chaincodeBuild() {
chaincodeBuildDirPath() {
local CHAINCODE_NAME=$1
local CHAINCODE_LANG=$2
local CHAINCODE_DIR_PATH=$3
Expand Down Expand Up @@ -2405,6 +2410,80 @@ chaincodeBuild() {
fi
}

chaincodeBuildCCAASImage() {
local CHAINCODE_NAME=$1
local CHAINCODE_DIR_PATH=$2
# build the docker container
echo \\"Building Chaincode-as-a-Service docker image '\${CHAINCODE_NAME}' '\${CHAINCODE_DIR_PATH}'\\"
echo \\"This may take several minutes...\\"
docker build -f \\"$CHAINCODE_DIR_PATH\\"/Dockerfile -t \\"\${CHAINCODE_NAME}\\"_ccaas_image:latest --build-arg CC_SERVER_PORT=9999 \\"$CHAINCODE_DIR_PATH\\" >&log.txt
}

chaincodeExternalPackage() {
local CLI_NAME=$1
local PEER_ADDRESS=$2
local CHAINCODE_NAME=$3
local CHAINCODE_VERSION=$4
local CHAINCODE_LABEL=\\"\${CHAINCODE_NAME}_$CHAINCODE_VERSION\\"
local CHAINCODE_LANG=$5
local CCAAS_SERVER_PORT=9999

echo \\"Packaging external chaincode $CHAINCODE_NAME...\\"
inputLog \\"CHAINCODE_VERSION: $CHAINCODE_VERSION\\"
inputLog \\"CHAINCODE_LANG: $CHAINCODE_LANG\\"
inputLog \\"PEER_ADDRESS: $PEER_ADDRESS\\"
inputLog \\"CLI_NAME: $CLI_NAME\\"
inputLog \\"CCAAS_SERVER_PORT: $CCAAS_SERVER_PORT\\"

local address=\\"\${CHAINCODE_NAME}_ccaas:\${CCAAS_SERVER_PORT}\\"

docker exec \\"$CLI_NAME\\" mktemp -d -t 'chaincode.XXXXXXXX' >tempdir.txt
TEMP_DIR=$(cat tempdir.txt)

docker exec \\"$CLI_NAME\\" mkdir -p \\"$TEMP_DIR\\"/src
docker exec \\"$CLI_NAME\\" mkdir -p \\"$TEMP_DIR\\"/pkg

docker exec \\"$CLI_NAME\\" sh -c \\"echo '{
\\\\\\"address\\\\\\": \\\\\\"\${address}\\\\\\",
\\\\\\"dial_timeout\\\\\\": \\\\\\"10s\\\\\\",
\\\\\\"tls_required\\\\\\": false
}' > $TEMP_DIR/src/connection.json\\"

docker exec \\"$CLI_NAME\\" sh -c \\"echo '{
\\\\\\"type\\\\\\": \\\\\\"ccaas\\\\\\",
\\\\\\"label\\\\\\": \\\\\\"$CHAINCODE_LABEL\\\\\\"
}' > $TEMP_DIR/pkg/metadata.json\\"

docker exec \\"$CLI_NAME\\" tar -C \\"$TEMP_DIR\\"/src -czf \\"$TEMP_DIR\\"/pkg/code.tar.gz .

docker exec \\"$CLI_NAME\\" tar -C \\"$TEMP_DIR\\"/pkg -czf /var/hyperledger/cli/chaincode-packages/\\"$CHAINCODE_LABEL\\".tar.gz metadata.json code.tar.gz

docker exec \\"$CLI_NAME\\" rm -Rf \\"$TEMP_DIR\\"

# Calculate package ID
docker exec \\"$CLI_NAME\\" peer lifecycle chaincode calculatepackageid /var/hyperledger/cli/chaincode-packages/\\"$CHAINCODE_LABEL\\".tar.gz

# Clean up local temp file
rm tempdir.txt

docker exec \\"$CLI_NAME\\" chown \\"$(id -u):$(id -g)\\" \\"/var/hyperledger/cli/chaincode-packages/$CHAINCODE_LABEL.tar.gz\\"
inputLog \\"$CHAINCODE_LABEL\\"

inputLog \\"Chaincode is packaged \${address}\\"
}

chaincodeRunCCAASContainers() {
echo \\"Running Chaincode-as-a-Service container\\"
local CHAINCODE_NAME=$1
local CCAAS_SERVER_PORT=9999

docker run --rm -d --name \\"\${CHAINCODE_NAME}\\"_ccaas --network \\"\${COMPOSE_PROJECT_NAME}_basic\\" \\\\
-e CHAINCODE_SERVER_ADDRESS=0.0.0.0:\${CCAAS_SERVER_PORT} \\\\
-e CHAINCODE_ID=\\"$CC_PACKAGE_ID\\" -e CORE_CHAINCODE_ID_NAME=\\"$CC_PACKAGE_ID\\" \\\\
\\"\${CHAINCODE_NAME}\\"_ccaas_image:latest

}

chaincodePackage() {
local CLI_NAME=$1
local PEER_ADDRESS=$2
Expand Down Expand Up @@ -2498,7 +2577,6 @@ chaincodeApprove() {
fi

local QUERYINSTALLED_RESPONSE
local CC_PACKAGE_ID

QUERYINSTALLED_RESPONSE=\\"$(
docker exec -e CORE_PEER_ADDRESS=\\"$PEER_ADDRESS\\" \\"$CLI_NAME\\" peer lifecycle chaincode queryinstalled \\\\
Expand Down
Loading
Loading