While setting up a new Hyper-Ledger project, a user created a new directory and changed into that.What does the user need to do now, and what is the correct command that he should use?Now he needs to enable the contractapi with the following command:<br /> go get -u github.com/Hyperledger/fabric-contract-api-goNow he needs to init a new Go module with the following command:<br /> go init my-sales-application chaincodeNow he needs to init a new Go module with the following command:<br /> go mod init my-sales-application-chaincodeNow he needs to enable the contractapi with the following command:<br /> go use -u github.com/Hyperledger/fabric-contract-api-go
Question
While setting up a new Hyper-Ledger project, a user created a new directory and changed into that.What does the user need to do now, and what is the correct command that he should use?Now he needs to enable the contractapi with the following command:<br /> go get -u github.com/Hyperledger/fabric-contract-api-goNow he needs to init a new Go module with the following command:<br /> go init my-sales-application chaincodeNow he needs to init a new Go module with the following command:<br /> go mod init my-sales-application-chaincodeNow he needs to enable the contractapi with the following command:<br /> go use -u github.com/Hyperledger/fabric-contract-api-go
Solution
After creating a new directory and changing into it, the user needs to initialize a new Go module and enable the contractapi. Here are the steps and the corresponding commands:
-
Initialize a new Go module: The user should use the command
go mod init my-sales-application-chaincode. This command will initialize a new Go module in the current directory. -
Enable the contractapi: The user should use the command
go get -u github.com/Hyperledger/fabric-contract-api-go. This command will download and install the latest version of the contractapi package from the Hyperledger Fabric repository.
Please note that the command go init my-sales-application chaincode and go use -u github.com/Hyperledger/fabric-contract-api-go are not valid Go commands. The correct commands are go mod init my-sales-application-chaincode and go get -u github.com/Hyperledger/fabric-contract-api-go respectively.
Similar Questions
While setting up a new Hyper-Ledger project, a user created a new directory and changed into that.What does the user need to do now, and what is the correct command that he should use
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 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
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)
Which of the following commands can be used for installing the Fabric network in Hyperledger?npm install -n fabricnpm install network.fabricnpm install Network --fabricnpm install fabric-network
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.