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.yamlin 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.gofile in theconfigpackage. Default configuration fromdefaults.gois 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:
auth:
# xpub used for admin api authentication
admin_key: xpub661MyMwAqRbcFgfmdkPgE2m5UjHXu9dj124DbaGLSjaqVESTWfCD4VuNmEbVPkbYLCkykwVZvmA8Pbf8884TQr1FgdG2nPoHR8aB36YdDQh
# ...
# other auth options
cache:
# cache engine - freecache/redis
engine: freecache
# ...
# other cache options
db:
datastore:
# enable datastore debug mode
debug: false
# datastore engine - sqlite/postgresql/mysql/mongodb (experimental)
engine: sqlite
# in this section you can define details about your database
# ...
arc:
url: https://arc.taal.com
token: mainnet_06770f425eb00298839a24a49cbdc02c
# deployment id used annotating api calls in XDeployment-ID header - this value will be randomly generated if not set
_deployment_id: spv-wallet-deployment-id
callback:
enabled: false
host: https://example.com
# token to authenticate callback calls - default callback token will be generated from the Admin Key
_token: 44a82509
# custom fee unit used for calculating fees (if not set, a unit from ARC policy will be used)
_custom_fee_unit:
satoshis: 1
bytes: 1000
block_headers_service:
auth_token: mQZQ6WmxURxWz5ch
# URL used to communicate with Block Headers Service (BHS)
url: http://localhost:8080
paymail:
beef:
use_beef: true
domains:
- localhost
# Prometheus metrics configuration
metrics:
enabled: falseGoing throught highlighted options:
The
authsection contains theadmin_keywhich is used for admin api authentication. This key is used to authenticate the admin api calls.The
cachesection contains theengineoption which can be set tofreecacheorredis. Thefreecacheis the default option.The
dbsection contains thedatastoresection which contains theengineoption which can be set tosqliteorpostgresql. Thesqliteis the default option. You can also define details about your database in this section.The
arcsection contains:the
urlandtokenwhich are used for getting and broadcasting transactions.the
callbacksection which is used to receive notifications about broadcasted transactions from ARC.the
deployment_idoption 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_unitoption is used for transaction fee calculation. Thefee_unitoption is used as the fee value ifcustom_fee_unitis configured.The
block_headers_servicesection contains theauth_tokenandurloptions 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
paymailsection contains thedomainsoption which is used to define the list of domains.The
beefsection with theuse_beefoption 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
metricssection 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?

