Command Line Interface

This document is a prettier output of the documentation produced by the command line client’s man command. You can obtain similar pages using the following shell commands.

tezos-client -protocol ProtoALphaALph man -verbosity 3
tezos-admin-client man -verbosity 3

Command line client

Administration command line client

Usage

  • tezos-admin-client [global options] command [command options]
  • tezos-admin-client --help (for global options)
  • tezos-admin-client [global options] command --help (for command options)

To browse the documentation

  • tezos-admin-client [global options] man (for a list of commands)
  • tezos-admin-client [global options] man -v 3 (for the full manual)

Global options (must come before the command)

-d --base-dir <path>: client data directory The directory where the Tezos client will store all its data. By default: '/home/opam/.tezos-client'. -c --config-file <path>: configuration file -t --timings: show RPC request times -b --block <hash|tag>: block on which to apply contextual commands Defaults to `head`. -w --wait <none|<int>>: how many confirmation blocks before to consider an operation as included -p --protocol <hash>: use commands of a specific protocol -l --log-requests: log all requests to the node -A --addr <IP addr|host>: IP address of the node -P --port <number>: RPC port of the node -S --tls: use TLS to connect to node. -R --remote-signer <uri>: URI of the remote signer

Access the documentation

  • man [keyword...] [-v --verbosity <0|1|2|3>] [--format <plain|colors|html>]
    Print documentation of commands. Add search keywords to narrow list. Will display only the commands by default, unless [-verbosity <2|3>] is passed or the list of matching commands if less than 3. keyword: keyword to search for If several are given they must all appear in the command. -v --verbosity <0|1|2|3>: level of details 0. Only shows command mnemonics, without documentation. 1. Shows command mnemonics with short descriptions. 2. Show commands and arguments with short descriptions 3. Show everything --format <plain|colors|html>: the manual's output format Defaults to `plain`.

Commands for the low level RPC layer

  • rpc list url
    List RPCs under a given URL prefix. Some parts of the RPC service hierarchy depend on parameters, they are marked by a suffix `<dynamic>`. You can list these sub-hierarchies by providing a concrete URL prefix whose arguments are set to a valid value. url: the URL prefix
  • rpc list
    Alias to `rpc list /`.
  • rpc schema HTTP method url
    Get the input and output JSON schemas of an RPC. HTTP method: url: the RPC url
  • rpc format HTTP method url [-b --binary]
    Get the humanoid readable input and output formats of an RPC. HTTP method: url: the RPC URL -b --binary: Binary format
  • rpc get url
    Call an RPC with the GET method. url: the RPC URL
  • rpc post url
    Call an RPC with the POST method. If input data is needed, a text editor will be popped up. url: the RPC URL
  • rpc post url with input
    Call an RPC with the POST method, providing input data via the command line. url: the RPC URL input: the raw JSON input to the RPC For instance, use `{}` to send the empty document. Alternatively, use `file:path` to read the JSON data from a file.

Commands for managing protocols

  • list protocols
    List protocols known by the node.
  • inject protocol dir
    Inject a new protocol into the node. dir: directory containing a protocol
  • dump protocol protocol hash
    Dump a protocol from the node's record of protocol. protocol hash:

Commands for monitoring and controlling p2p-layer state

  • p2p stat
    show global network status
  • connect address address [--port <IP port>]
    Connect to a new point. address: IPv4 or IPV6 address --port <IP port>: peer-to-peer port of the node Defaults to `9732`.
  • forget address address
    Remove an IP address from the blacklist and whitelist. address: IPv4 or IPV6 address
  • ban address address
    Add an IP address to the blacklist. address: IPv4 or IPV6 address
  • trust address address
    Add an IP address to the whitelist. address: IPv4 or IPV6 address
  • is address banned address
    Check if an IP address is banned. address: IPv4 or IPV6 address
  • forget peer peer
    Remove a peer ID from the blacklist and whitelist. peer: peer network identity
  • ban peer peer
    Add a peer ID to the blacklist. peer: peer network identity
  • trust peer peer
    Add a peer ID to the whitelist. peer: peer network identity
  • is peer banned peer
    Check if a peer ID is banned. peer: peer network identity
  • clear acls
    Clear all ACLs.

Commands to perform privileged operations on the node

  • unmark invalid [block...]
    Make the node forget its decision of rejecting a block. block: block to remove from invalid list

Commands to report the node's status

  • list heads [-o --output <path>]
    The last heads that have been considered by the node. -o --output <path>: write to a file Defaults to `-`.
  • list rejected blocks [-o --output <path>]
    The blocks that have been marked invalid by the node. -o --output <path>: write to a file Defaults to `-`.

Commands for editing and viewing the client's config file

  • config show
    Show the config file.
  • config reset
    Reset the config file to the factory defaults.
  • config update
    Update the config based on the current cli values. Loads the current configuration (default or as specified with `-config-file`), applies alterations from other command line arguments (such as the node's address, etc.), and overwrites the updated configuration file.
  • config init [-o --output <path>]
    Create a config file based on the current CLI values. If the `-file` option is not passed, this will initialize the default config file, based on default parameters, altered by other command line options (such as the node's address, etc.). Otherwise, it will create a new config file, based on the default parameters (or the the ones specified with `-config-file`), altered by other command line options. The command will always fail if the file already exists. -o --output <path>: path at which to create the file Defaults to `/home/opam/.tezos-client/config`.

Miscellaneous commands

  • list understood protocols
    List the protocol versions that this client understands.