// The main command describes the service and defaults to printing the help message.varmainCmd=&cobra.Command{Use:"peer",PersistentPreRunE:func(cmd*cobra.Command,args[]string)error{peerCommand:=getPeerCommandFromCobraCommand(cmd)flogging.LoggingInit(peerCommand)returncore.CacheConfiguration()},Run:func(cmd*cobra.Command,args[]string){ifversionFlag{version.Print()}else{cmd.HelpFunc()(cmd,args)}},}
chaincodeInvokeOrQuery invokes or queries the chaincode. If successful, the INVOKE form prints the transaction ID on STDOUT, and the QUERY form prints the query result on STDOUT.
func startCmd() *cobra.Command {
// Set the flags on the node start command.
flags := nodeStartCmd.Flags()
flags.BoolVarP(&chaincodeDevMode, "peer-chaincodedev", "", false,
"Whether peer in chaincode development mode")
return nodeStartCmd
}
var nodeStartCmd = &cobra.Command{
Use: "start",
Short: "Starts the node.",
Long: `Starts a node that interacts with the network.`,
RunE: func(cmd *cobra.Command, args []string) error {
return serve(args)
},
}