github.com/kaituanwang/hyperledger@v2.0.1+incompatible/docs/source/commands/peercommand.md (about) 1 # peer 2 3 ## Description 4 5 The `peer` command has five different subcommands, each of which allows 6 administrators to perform a specific set of tasks related to a peer. For 7 example, you can use the `peer channel` subcommand to join a peer to a channel, 8 or the `peer chaincode` command to deploy a smart contract chaincode to a 9 peer. 10 11 ## Syntax 12 13 The `peer` command has five different subcommands within it: 14 15 ``` 16 peer chaincode [option] [flags] 17 peer channel [option] [flags] 18 peer node [option] [flags] 19 peer version [option] [flags] 20 ``` 21 22 Each subcommand has different options available, and these are described in 23 their own dedicated topic. For brevity, we often refer to a command (`peer`), a 24 subcommand (`channel`), or subcommand option (`fetch`) simply as a **command**. 25 26 If a subcommand is specified without an option, then it will return some high 27 level help text as described in the `--help` flag below. 28 29 ## Flags 30 31 Each `peer` subcommand has a specific set of flags associated with it, many of 32 which are designated *global* because they can be used in all subcommand 33 options. These flags are described with the relevant `peer` subcommand. 34 35 The top level `peer` command has the following flag: 36 37 * `--help` 38 39 Use `--help` to get brief help text for any `peer` command. The `--help` flag 40 is very useful -- it can be used to get command help, subcommand help, and 41 even option help. 42 43 For example 44 ``` 45 peer --help 46 peer channel --help 47 peer channel list --help 48 49 ``` 50 See individual `peer` subcommands for more detail. 51 52 ## Usage 53 54 Here is an example using the available flag on the `peer` command. 55 56 * Using the `--help` flag on the `peer channel join` command. 57 58 ``` 59 peer channel join --help 60 61 Joins the peer to a channel. 62 63 Usage: 64 peer channel join [flags] 65 66 Flags: 67 -b, --blockpath string Path to file containing genesis block 68 -h, --help help for join 69 70 Global Flags: 71 --cafile string Path to file containing PEM-encoded trusted certificate(s) for the ordering endpoint 72 --certfile string Path to file containing PEM-encoded X509 public key to use for mutual TLS communication with the orderer endpoint 73 --clientauth Use mutual TLS when communicating with the orderer endpoint 74 --connTimeout duration Timeout for client to connect (default 3s) 75 --keyfile string Path to file containing PEM-encoded private key to use for mutual TLS communication with the orderer endpoint 76 -o, --orderer string Ordering service endpoint 77 --ordererTLSHostnameOverride string The hostname override to use when validating the TLS connection to the orderer. 78 --tls Use TLS when communicating with the orderer endpoint 79 80 ``` 81 This shows brief help syntax for the `peer channel join` command.