peer

Description

The peer command has five different subcommands, each of which allows administrators to perform a specific set of tasks related to a peer. For example, you can use the peer channel subcommand to join a peer to a channel, or the peer chaincode command to deploy a smart contract chaincode to a peer.

Syntax

The peer command has five different subcommands within it:

  1. peer chaincode [option] [flags]
  2. peer channel [option] [flags]
  3. peer node [option] [flags]
  4. peer version [option] [flags]

Each subcommand has different options available, and these are described in their own dedicated topic. For brevity, we often refer to a command (peer), a subcommand (channel), or subcommand option (fetch) simply as a command.

If a subcommand is specified without an option, then it will return some high level help text as described in the --help flag below.

Flags

Each peer subcommand has a specific set of flags associated with it, many of which are designated global because they can be used in all subcommand options. These flags are described with the relevant peer subcommand.

The top level peer command has the following flag:

  • --help

    Use --help to get brief help text for any peer command. The --help flag is very useful – it can be used to get command help, subcommand help, and even option help.

    For example

    1. peer --help
    2. peer channel --help
    3. peer channel list --help

    See individual peer subcommands for more detail.

Usage

Here is an example using the available flag on the peer command.

  • Using the --help flag on the peer channel join command.

    1. peer channel join --help
    2. Joins the peer to a channel.
    3. Usage:
    4. peer channel join [flags]
    5. Flags:
    6. -b, --blockpath string Path to file containing genesis block
    7. -h, --help help for join
    8. Global Flags:
    9. --cafile string Path to file containing PEM-encoded trusted certificate(s) for the ordering endpoint
    10. --certfile string Path to file containing PEM-encoded X509 public key to use for mutual TLS communication with the orderer endpoint
    11. --clientauth Use mutual TLS when communicating with the orderer endpoint
    12. --connTimeout duration Timeout for client to connect (default 3s)
    13. --keyfile string Path to file containing PEM-encoded private key to use for mutual TLS communication with the orderer endpoint
    14. -o, --orderer string Ordering service endpoint
    15. --ordererTLSHostnameOverride string The hostname override to use when validating the TLS connection to the orderer.
    16. --tls Use TLS when communicating with the orderer endpoint

    This shows brief help syntax for the peer channel join command.