github.com/true-sqn/fabric@v2.1.1+incompatible/internal/peer/node/node.go (about)

     1  /*
     2  Copyright IBM Corp. 2016 All Rights Reserved.
     3  SPDX-License-Identifier: Apache-2.0
     4  */
     5  
     6  package node
     7  
     8  import (
     9  	"fmt"
    10  
    11  	"github.com/hyperledger/fabric/common/flogging"
    12  	"github.com/hyperledger/fabric/internal/peer/common"
    13  	"github.com/spf13/cobra"
    14  )
    15  
    16  const (
    17  	nodeFuncName = "node"
    18  	nodeCmdDes   = "Operate a peer node: start|reset|rollback|pause|resume|rebuild-dbs|upgrade-dbs."
    19  )
    20  
    21  var logger = flogging.MustGetLogger("nodeCmd")
    22  
    23  // Cmd returns the cobra command for Node
    24  func Cmd() *cobra.Command {
    25  	nodeCmd.AddCommand(startCmd())
    26  	nodeCmd.AddCommand(resetCmd())
    27  	nodeCmd.AddCommand(rollbackCmd())
    28  	nodeCmd.AddCommand(pauseCmd())
    29  	nodeCmd.AddCommand(resumeCmd())
    30  	nodeCmd.AddCommand(rebuildDBsCmd())
    31  	nodeCmd.AddCommand(upgradeDBsCmd())
    32  	return nodeCmd
    33  }
    34  
    35  var nodeCmd = &cobra.Command{
    36  	Use:              nodeFuncName,
    37  	Short:            fmt.Sprint(nodeCmdDes),
    38  	Long:             fmt.Sprint(nodeCmdDes),
    39  	PersistentPreRun: common.InitCmd,
    40  }