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