The peer
command allows administrators to interact with a peer. Use this command when you want to perform peer operations such as deploying a smart contract chaincode or joining a channel.
The peer
command has different subcommands within it:
peer [subcommand]
as follows
peer chaincode
peer channel
peer logging
peer node
peer version
peer
These subcommands separate the different functions provided by a peer into their own category. For example, use the peer chaincode
command to perform smart contract chaincode operations on the peer, or the peer channel
command to perform channel related operations.
Within each subcommand there are many different options available and because of this, each is described in its own topic. Follow the links below to understand these individual commands in more detail.
If a command option is not specified then peer
will return some high level help text as described in in the --help
flag below.
The peer
command also has a set of associated flags :
peer [flags]
as follows
peer --help
peer channel --help
peer channel list --help
These flags provide more information about a peer, and are designated global because they can be used at any command level. For example the --help
flag can provide help on the peer
command, the peer channel
command, as well as their respective options.
-
--help
Use
help
to get brief help text for thepeer
command. Thehelp
flag can often be used at different levels to get individual command help, or even a help on a command option. See individual commands for more detail. -
--logging-level <string>
This flag sets the log level for the single peer command it is supplied with. Once the command has been executed, the log level will not persist. There are six possible log levels:
debug
,info
,notice
,warning
,error
, andcritical
. Note that there is no single logging level for the peer. You can find the current logging level for a specific component on the peer by runningpeer logging getlevel <component-name
. The defaults are defined in sampleconfig/core.yaml if you'd like to take a look at what logging levels are set if the system admin doesn't modify anything.This command is overridden by the
CORE_LOGGING_LEVEL
environment variable if it is set. A full list of peer environment variables is described in the peer environment variables reference topic. -
--version
Use this flag to determine the build version for the peer. This flag provides a set of detailed information on how the peer was built.
See the reference topic Peer version information to understand the version information in detail.
Here's some examples using the different available flags on the peer
command.
-
--help
flagpeer --help Usage: peer [flags] peer [command] Available Commands: chaincode Operate a chaincode: install|instantiate|invoke|package|query|signpackage|upgrade. channel Operate a channel: create|fetch|join|list|update. logging Log levels: getlevel|setlevel|revertlevels. node Operate a peer node: start|status. version Print fabric peer version. Flags: --logging-level string Default logging level and overrides, see core.yaml for full syntax -v, --version Display current version of fabric peer server Use "peer [command] --help" for more information about a command.
-
--version
flagpeer --version peer: Version: 1.0.4 Go version: go1.7.5 OS/Arch: linux/amd64 Chaincode: Base Image Version: 0.3.2 Base Docker Namespace: hyperledger Base Docker Label: org.hyperledger.fabric Docker Namespace: hyperledger