From 00bd6aa65c68f4f55b22c40cbe5b93946bf9e571 Mon Sep 17 00:00:00 2001 From: munapower Date: Fri, 10 Jan 2025 18:53:10 -0300 Subject: [PATCH] Fix issue 1289 with missing parameter in peer chaincode lifecycle command Signed-off-by: munapower --- .../SmartContractDev/01-Exercise-Getting-Started-ES.md | 4 ++-- .../docs/SmartContractDev/01-Exercise-Getting-Started.md | 4 ++-- full-stack-asset-transfer-guide/justfile | 7 +++++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/full-stack-asset-transfer-guide/docs/SmartContractDev/01-Exercise-Getting-Started-ES.md b/full-stack-asset-transfer-guide/docs/SmartContractDev/01-Exercise-Getting-Started-ES.md index 4d8553504..115191f0f 100644 --- a/full-stack-asset-transfer-guide/docs/SmartContractDev/01-Exercise-Getting-Started-ES.md +++ b/full-stack-asset-transfer-guide/docs/SmartContractDev/01-Exercise-Getting-Started-ES.md @@ -192,8 +192,8 @@ export CHAINCODE_ID=$(peer lifecycle chaincode calculatepackageid asset-transfer Paso siguiente, define el chaincode en el channel de blockchain aprobándolo y asignándoselo. Si ya lo has implementado utilizando la receta `just` de mas arriba, debes incrementar el número de `--sequence` a `2`. ```bash -peer lifecycle chaincode approveformyorg --channelID mychannel --name asset-transfer -v 0 --package-id $CHAINCODE_ID --sequence 2 --connTimeout 15s -peer lifecycle chaincode commit --channelID mychannel --name asset-transfer -v 0 --sequence 2 --connTimeout 15s +peer lifecycle chaincode approveformyorg --channelID mychannel -o $ORDERER_ENDPOINT --name asset-transfer -v 0 --package-id $CHAINCODE_ID --sequence 2 --connTimeout 15s +peer lifecycle chaincode commit --channelID mychannel -o $ORDERER_ENDPOINT --name asset-transfer -v 0 --sequence 2 --connTimeout 15s ``` ## Ejecuta el chaincode localmente diff --git a/full-stack-asset-transfer-guide/docs/SmartContractDev/01-Exercise-Getting-Started.md b/full-stack-asset-transfer-guide/docs/SmartContractDev/01-Exercise-Getting-Started.md index e5beb01a2..a9e7aab4c 100644 --- a/full-stack-asset-transfer-guide/docs/SmartContractDev/01-Exercise-Getting-Started.md +++ b/full-stack-asset-transfer-guide/docs/SmartContractDev/01-Exercise-Getting-Started.md @@ -192,8 +192,8 @@ export CHAINCODE_ID=$(peer lifecycle chaincode calculatepackageid asset-transfer Next, define the chaincode on the blockchain channel by approving it and committing it. If you have already deployed the chaincode using the `just` recipe above, then increment the `--sequence` number to `2`. ```bash -peer lifecycle chaincode approveformyorg --channelID mychannel --name asset-transfer -v 0 --package-id $CHAINCODE_ID --sequence 2 --connTimeout 15s -peer lifecycle chaincode commit --channelID mychannel --name asset-transfer -v 0 --sequence 2 --connTimeout 15s +peer lifecycle chaincode approveformyorg --channelID mychannel -o $ORDERER_ENDPOINT --name asset-transfer -v 0 --package-id $CHAINCODE_ID --sequence 2 --connTimeout 15s +peer lifecycle chaincode commit --channelID mychannel -o $ORDERER_ENDPOINT --name asset-transfer -v 0 --sequence 2 --connTimeout 15s ``` ## Run the chaincode locally diff --git a/full-stack-asset-transfer-guide/justfile b/full-stack-asset-transfer-guide/justfile index c3ba63aec..c89438c07 100644 --- a/full-stack-asset-transfer-guide/justfile +++ b/full-stack-asset-transfer-guide/justfile @@ -187,6 +187,7 @@ microfab: microfab-down export FABRIC_CFG_PATH=$CWDIR/config export CORE_PEER_CLIENT_CONNTIMEOUT=15s export CORE_PEER_DELIVERYCLIENT_CONNTIMEOUT=15s + export ORDERER_ENDPOINT=orderer-api.127-0-0-1.nip.io:8080 EOF cat << EOF > $CFG/org2admin.env @@ -196,6 +197,7 @@ microfab: microfab-down export FABRIC_CFG_PATH=$CWDIR/config export CORE_PEER_CLIENT_CONNTIMEOUT=15s export CORE_PEER_DELIVERYCLIENT_CONNTIMEOUT=15s + export ORDERER_ENDPOINT=orderer-api.127-0-0-1.nip.io:8080 EOF echo @@ -221,14 +223,15 @@ debugcc: export CORE_PEER_ADDRESS=org1peer-api.127-0-0-1.nip.io:8080 export CORE_PEER_CLIENT_CONNTIMEOUT=15s export CORE_PEER_DELIVERYCLIENT_CONNTIMEOUT=15s + export ORDERER_ENDPOINT=orderer-api.127-0-0-1.nip.io:8080 echo "CHAINCODE_ID=${CHAINCODE_ID}" set -x && peer lifecycle chaincode install asset-transfer.tgz && { set +x; } 2>/dev/null echo - set -x && peer lifecycle chaincode approveformyorg --channelID mychannel -o orderer-api.127-0-0-1.nip.io:8080 --name asset-transfer -v 0 --package-id $CHAINCODE_ID --sequence 1 --connTimeout 15s && { set +x; } 2>/dev/null + set -x && peer lifecycle chaincode approveformyorg --channelID mychannel -o $ORDERER_ENDPOINT --name asset-transfer -v 0 --package-id $CHAINCODE_ID --sequence 1 --connTimeout 15s && { set +x; } 2>/dev/null echo - set -x && peer lifecycle chaincode commit --channelID mychannel -o orderer-api.127-0-0-1.nip.io:8080 --name asset-transfer -v 0 --sequence 1 --connTimeout 15s && { set +x; } 2>/dev/null + set -x && peer lifecycle chaincode commit --channelID mychannel -o $ORDERER_ENDPOINT --name asset-transfer -v 0 --sequence 1 --connTimeout 15s && { set +x; } 2>/dev/null echo set -x && peer lifecycle chaincode querycommitted --channelID=mychannel && { set +x; } 2>/dev/null echo