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 root of the project. 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
,postgresql
,mysql
ormongodb
(experimental). Thesqlite
is the default option. You can also define details about your database in this section.The
nodes
section contains theprotocol
option which can be set toarc
ormapi
(arc is default). Theapis
section contains the list of apis used for getting and broadcasting transactions. Theuse_fee_quotes
option is used for transaction fee calculation. Thefee_unit
option is used as the fee value ifuse_fee_quotes
is set to false.In the
nodes
section, thecallback
section contains thecallback_host
option which is used to define the callback host. The_callback_token
option is used to authenticate callback calls. 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.
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 theenabled
option which is used to enable or disable paymail. Thedomains
option is used to define the list of domains.The
beef
section contains theuse_beef
option which is used to enable or disable beef. Theblock_headers_service_url
option is used to define the url to Block Headers Service, used for merkle root verification. Theblock_headers_service_auth_token
option is used to authenticate the Block Headers Service calls.
You can read more about the SPV and BEEF in the SPV and BEEF section.
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