Knowee
Questions
Features
Study Tools

While deploying chaincode for two organisations in GoLang, a user needs to commit the chaincode definition to a channel named myVehicle.What is the correct way of doing so?Consider that we are using the port 7050.He needs to execute the following command:<br /> Peer lifecycle chaincode commit -o localhost:7050 --ordererTLSHostnameOverride orderer.example.com -tls $CORE_PEER_TLS_ENABLED --cafile $ORDERER_CA --channelID $CHANNEL_NAME --name myVehicle $PEER_CONN_PARMS --version ${VERSION} --sequence ${version} --init-requiredThe chaincode definition is committed by default after a peer address is set successfully, and the user does not need to do anythingHe needs to execute the following command:<br /> Peer lifecycle chaincode commit -o localhost:7050 --ordererTLSHostnameOverride orderer.example.com --cafile $ORDERER_CA --channelID $CHANNEL_NAME --name myVehicle $PEER_CONN_PARMS --tls $CORE_PEER_TLS_ENABLED --version ${VERSION} --sequence ${version} --init-requiredHe needs to execute the following command:<br /> Peer lifecycle chaincode commit -p localhost:7050 --ordererTLSHostnameOverride orderer.example.com --cafile $ORDERER_CA -tls $CORE_PEER_TLS_ENABLED --channelID $CHANNEL_NAME --name myVehicle $PEER_CONN_PARMS --version ${VERSION} --sequence ${version} --init-required

Question

While deploying chaincode for two organisations in GoLang, a user needs to commit the chaincode definition to a channel named myVehicle.What is the correct way of doing so?Consider that we are using the port 7050.He needs to execute the following command:<br /> Peer lifecycle chaincode commit -o localhost:7050 --ordererTLSHostnameOverride orderer.example.com -tls COREPEERTLSENABLEDcafileCORE_PEER_TLS_ENABLED --cafile ORDERER_CA --channelID CHANNELNAMEnamemyVehicleCHANNEL_NAME --name myVehicle PEER_CONN_PARMS --version VERSIONsequence{VERSION} --sequence {version} --init-requiredThe chaincode definition is committed by default after a peer address is set successfully, and the user does not need to do anythingHe needs to execute the following command:<br /> Peer lifecycle chaincode commit -o localhost:7050 --ordererTLSHostnameOverride orderer.example.com --cafile ORDERERCAchannelIDORDERER_CA --channelID CHANNEL_NAME --name myVehicle PEERCONNPARMStlsPEER_CONN_PARMS --tls CORE_PEER_TLS_ENABLED --version VERSIONsequence{VERSION} --sequence {version} --init-requiredHe needs to execute the following command:<br /> Peer lifecycle chaincode commit -p localhost:7050 --ordererTLSHostnameOverride orderer.example.com --cafile ORDERERCAtlsORDERER_CA -tls CORE_PEER_TLS_ENABLED --channelID CHANNELNAMEnamemyVehicleCHANNEL_NAME --name myVehicle PEER_CONN_PARMS --version VERSIONsequence{VERSION} --sequence {version} --init-required

...expand
🧐 Not the exact question you are looking for?Go ask a question

Solution

The correct way to commit the chaincode definition to a channel named myVehicle is by executing the following command:

Peer lifecycle chaincode commit -o localhost:7050 --ordererTLSHostnameOverride orderer.example.com --cafile ORDERERCAchannelIDORDERER_CA --channelID CHANNEL_NAME --name myVehicle PEERCONNPARMStlsPEER_CONN_PARMS --tls CORE_PEER_TLS_ENABLED --version VERSIONsequence{VERSION} --sequence {version} --init-required

This command will commit the chaincode definition to the channel. The -o flag specifies the orderer endpoint, --ordererTLSHostnameOverride is used when the hostname of the orderer doesn't match the TLS certificate, --cafile is used to specify the orderer's TLS certificate, --channelID specifies the channel, --name specifies the name of the chaincode, $PEER_CONN_PARMS is used to specify the peers that the command will be sent to, --tls is used to enable TLS, --version specifies the version of the chaincode, --sequence is used to keep track of the number of times the chaincode has been defined or updated, and --init-required is used to specify that the chaincode needs to be initialized before it can be invoked.

This problem has been solved

Similar Questions

A user has created a channel named test1 and added peers to it for the example application "Fabric-Example". Now he wants to deploy the GoLang chaincode named "myVehicle". He has updated the environment variable to configure use of GoLang chaincode using the script "setMyVehicleGolangContext". Now, he wants to package the chaincode for org1 with the script setOrgPeerContext.sh 1.Which of the following commands can he use for that?source ./scripts/setOrgPeerCotext.sh 1<br /> Peer lifecycle package chaincode myvehicle.tar.gaz SET --path $(CC_SRC_PATH) --lang $(CC_RUNTIME_LANGUAGE) –label myvehicle_$(VERSION)source ./script/setOrgPeerContext.sh 1<br /> Peer set --lifecycle --package chaincode myvehicle.tar.gaz --path $(CC_SRC_PATH) --lang $(CC_RUNTIME_LANGUAGE) --label myvehicle_$(VERSION)source ./scripts/setOrgPeerContext.sh 1<br /> Peer lifecycle chaincode package myvehicle.tar.gaz --path $(CC_SRC_PATH) --lang $(CC_RUNTIME_LANGUAGE) --label myvehicle_$(VERSION)source ./script/setOrgPeerContext.sh 1<br /> Peer lifecycle chaincode package myvehicle.tar.gaz SET --path $(CC_SRC_PATH) --language $(CC_RUNTIME_LANG) --label myvehicle_$(VERSION)

A user set up the network and created the channel for an Hyperledger application named "Sales_Fabric". Then he writes the required chaincode. After writing the chaincode, he needs to deploy it.Which of the following commands can he use for it?Consider that the chaincode name is sac, he is using GoLang, and the init function is InitSales../network.sh deployCC -ccname sac -ccp ../chaincode -ccl go -cci InitSales./network.sh deployCC -ccname sac -ccp --chaincode -language go -cci InitSales./network.sh deploy CC sac -ccl go -ccp ../chaincode -cci InitSales./network.sh deployCC -ccn sac -ccl go -ccp ../chaincode -cci InitSales

While deploying chaincode for two organisations in GoLang, a user just installed the chaincode on the peer of Org1 and the peer of Org2.What is the correct next step in the process?He needs to query for installed packages using the following command:<br /> Peer lifecycle chaincode query installed 2>$1 | outfile teeHe needs to query for installed packages using the following command:<br /> Peer lifecycle chaincode queryinstllaed 2>&1 | tee outfileHe needs to set the PACKAGE_ID value using the following command:<br /> Source./set/scripts/PackageID.sh outfile teeHe needs to set the PACKAGE_ID value using the following command:<br /> Source./scripts/setPackageID.sh outfile

While deploying GoLang chaincode in Hyperledger Fabric a user has approved the Chaincode as Org1. Now he is required to verify the commitreadiness in Org1.Which of the commands can he use to do so?peer lifecycle chaincode verifycommitreadiness --channelID --Channlename myvehicle --version ${VERSION} --sequence ${VERSION} --OUTPUT binary --init-requiredpeer lifecycle chaincode checkcommitreadiness --channelID $CHANNEL_NAME --name myvehicle --version ${VERSION} --sequence ${VERSION} --OUTPUT json --init-requiredpeer lifecycle chaincode verifycommitreadiness $CHANNEL_ID --channelID $CHANNEL_NAME --name myvehicle --version ${VERSION} --sequence ${VERSION} --OUTPUT json --init-setpeer lifecycle chaincode checkcommitreadiness --channelID --channelName myvehicle --version ${VERSION} --sequence ${VERSION} --OUTPUT binary --init-required

While deploying GoLang chaincode in Hyperledger Fabric, which of the following commands will you use to install the chaincode on peer of Org1?Consider that you need to install “myvechicle.tar.gz”.run peer chaincode install myvehicle.tar.gzrun lifecycle install chaincode myvehicle.tar.gzpeer lifecycle chaincode install myvehicle.tar.gzpeer run lifecycle install chaincode myvehicle.tar.gz

1/2

Upgrade your grade with Knowee

Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.