Client Configuration¶
The Mavkit client can be configured in flexible ways to control various aspects of its behavior, such as running in different running modes (Sandboxed mode, Mockup mode, …), connecting to a public Mavryk node, selecting the directory for storing data, and so on.
All these aspects can be customized by supplying options on the command line when running the client. Refer to :ref`the client manual <client_manual>` for details.
A subset of these aspects can be customized by specifying parameters in a configuration file for the client. These include, for example:
the address and port of a Mavryk node to connect to, as an RPC endpoint (by default, the local node)
the directory where the client stores data
the number of confirmation blocks needed before an operation is considered included
the files defining bootstrap accounts and protocol constants, when running in mockup mode.
When the same parameter is set both in the configuration file and using a command line option, the value on the command line is taken into account (and the configuration file is not updated).
Finally, a few aspects of the client behavior can be customized by a set of environment variables.
Client configuration file¶
Note
The format of the client configuration file (and the associated commands to manipulate it) is understood not only by the Mavkit client, but also by several other Mavkit executables, such as mavkit-admin-client
, the baker, and the accuser. For details, refer to the manual of each tool.
Parameters in the configuration file can be specified in two different ways:
by creating and updating the configuration file using the
config
command ofmavkit-client
.by directly editing the configuration file.
The config command¶
./mavkit-client config init
This will initialize a configuration file for the client in
$HOME/.mavryk-client/config
, using default values. For instance, it
specifies that the client will use the local node as an RPC endpoint.
The easiest way to amend this default configuration is to use commands such as:
# Update the config file:
mavkit-client <options...> config update
# Check your new values:
mavkit-client config show
# If you want to restart from an empty cfg file:
mavkit-client config reset
Editing the configuration file¶
You may also edit the configuration file directly ($HOME/.mavryk-client/config
by default).
To run the client in multiple configurations on the same machine, you can duplicate and edit
$HOME/.mavryk-client/config
while making sure they don’t share
the same base-dir
. Then run your client with ./mavkit-client run --base-dir=</path/to/alternate_cfg>
.
Environment variables for the client¶
The behavior of the client can be configured using the following environment variables:
MAVRYK_CLIENT_UNSAFE_DISABLE_DISCLAIMER
: Setting this variable to “YES” (or: “yes”, “Y”, “y”) disables the warning displayed by the client at startup when it is not launched on Mainnet.MAVRYK_CLIENT_DIR
: This variable may be used to supply the client data directory (by default,~/.mavryk-client
). Its value is overridden by option-d
.MAVRYK_SIGNER_*
: These variables are used for connecting the client to a remote signer (see there for details).MAVRYK_CLIENT_RPC_TIMEOUT_SECONDS
: This variable controls how long (in seconds, as an integer) the client will wait for a response from the node, for each of the two RPC calls made during startup. If this variable is not set, or otherwise cannot be parsed as a positive integer, a default value of10
seconds is used for each call. The two RPC calls this variable affects are queries that the client makes to the node in order to determine: (1) the protocol version of the node it connects to, and (2) the commands supported in that version.MAVRYK_CLIENT_REMOTE_OPERATIONS_POOL_HTTP_HEADERS
: This variable specifies custom HTTP headers to use with the--operations-pool
option. Only the Host header is supported as of now (see description in rfc2616, section 14.23