Skip to main content

Hathor headless wallet configuration


You can enable a simple API Key verification in the config.js file. In this case, your requests must include the header X-API-KEY with the correct key.

If you are using cURL to test, you can include the header using the -H parameter:

curl -H "X-API-Key: YourKey" http://localhost:8000/wallet/balance.

It follows the Swagger Specification for API Keys.

Config Parameters

All parameters described below are in the config.js file.

ParameterDescriptionSet up
http_bind_addressIP Address of the host where the wallet is running.Required
http_portPort in which the wallet is listening to HTTP requests.Required
http_api_keyAPI key authentication.Optional
networkNetwork the wallet will connect. Options: mainnet, testnet.Required
serverThe address of the full node server.Required
txMiningUrlThe address of the transaction mining server. If it is not set, the wallet lib's default is used.Optional
default (from object seeds)Seed of 24 words. Default value is an empty string.Optional
httpLogFormatLog format for HTTP Requests. Common choices: combined, common, dev, short, tiny. Default: combined.Optional
consoleLevelConsole logging level. Levels: error, warn, info, http, verbose, debug, silly. Default: info.Optional
filename (from object logging.debug)Filename where the logging information is stored.Optional
level (from object logging.debug)Log level that will be stored in the file.Optional
tokenUidOptional config to set the token to be used in the wallet. If this parameter is set, it doesn't need to pass the token when getting balance or sending tokens.Optional
[gapLimit](/hathor/guides/headless-wallet/custom-configuration#notes)The maximum number of addresses to be generated in sequence without usage (no transactions). If not set the default value 20 will be used.Optional
connectionTimeoutTimeout of the websocket connection in milliseconds. If not set the default value 5000 will be used.Optional
allowPassphraseThis allows the user to set a passphrase when starting the wallet. This value is false by default and, starting a wallet with a passphrase will only be allowed if it's set to true.Optional
confirmFirstAddressEnabling this requires all requests to have the X-First-Address header to confirm that the client is connected to the right wallet. The primary purpose of this parameter is to avoid operational mistakes and loss of funds.Optional


Gap Limit

Increasing the gap limit value to avoid potential errors with addresses generation may impact the headless wallet performance and its memory consumption. Since the wallet holds all addresses in memory (even those ones set as mark_as_used), a large gap limit value (e.g. in the order of tens of thousands) will force the wallet to load and keep a huge volume of data in memory. As a consequence, its loading time may also be affected increasing from seconds to tens of minutes easily.