Configuration
This guide will help you to know the most important configuration options for SPV Wallet.
Order of resolving configuration
The configuration is resolved in the following priority
Environment variables - the environment variables are prefixed with
SPVWALLET_
and are in uppercase. They have the highest priority when resolving the configuration.Configuration file - the configuration file is resolved next. The default configuration file is
config.yaml
in the working directory. You can also specify custom configuration file path using C flag in the command line.If you don't specify the configuration file and environment variables, the default configuration will be used - it's resolved in
defaults.go
file in theconfig
package. Default configuration fromdefaults.go
is the same as the configuration fromconfig.example.yaml
.
Configuration File
We store the configuration in a file called config.example.yaml
in the root of the project. You can copy this file to config.yaml
and modify it to your needs.
The most important configuration options are:
Going throught highlighted options:
The
auth
section contains theadmin_key
which is used for admin api authentication. This key is used to authenticate the admin api calls.The
cache
section contains theengine
option which can be set tofreecache
orredis
. Thefreecache
is the default option.The
db
section contains thedatastore
section which contains theengine
option which can be set tosqlite
orpostgresql
. Thesqlite
is the default option. You can also define details about your database in this section.The
arc
section contains:the
url
andtoken
which are used for getting and broadcasting transactions.the
callback
section which is used to receive notifications about broadcasted transactions from ARC.the
deployment_id
option is used to define the deployment id used annotating api calls in XDeployment-ID header. This value will be randomly generated if not set.
The
custom_fee_unit
option is used for transaction fee calculation. Thefee_unit
option is used as the fee value ifcustom_fee_unit
is configured.The
block_headers_service
section contains theauth_token
andurl
options used to communicate with Block Headers Service to make SPV.
Callback is an Arc feature that allows the wallet to receive notifications about broadcasted transactions. It is useful because it limits the need for polling the node for transaction status.
The
paymail
section contains thedomains
option which is used to define the list of domains.The
beef
section with theuse_beef
option is used to enable or disable beef paymail capability support.
You can read more about the SPV and BEEF in the SPV and BEEF section.
The
metrics
section allows to enable or disable Prometheus metrics.
Environment Variables
You can also set the configuration options using environment variables. The environment variables are prefixed with SPVWALLET_
and are in uppercase. For example, the auth.admin_key
can be set using the SPVWALLET_AUTH_ADMIN_KEY
environment variable.
Last updated
Was this helpful?