Install headless wallet from source code
Goal
This article will guide you to install Hathor headless wallet from source code.
Installing from source code is recommended only for the development of Hathor headless wallet or derived wallet applications. For production environments or for developing and testing other components, it is recommended to install the headless wallet via Docker or together with the full node using Docker Compose.
Requirements
Requirements for operating Hathor headless wallet.
Hardware
For production environment:
- CPU: 2 vCPU
- Memory: 0.5 GB
- Bandwidth: 5 Gbps
Reference machine: AWS EC2 type t3.nano.
Software
- Platform: Linux, macOS, or WSL
- Node.js v20.0.0
Environment
This article was created using the following environments:
Environment 1:
- Ubuntu 24.04 LTS
- Node.js v20.16.0
Environment 2:
- macOS 10.15.7
- Node.js v20.16.0
Different environments may require different steps, or may not work at all.
Step-by-step
- Download the latest release of Hathor headless wallet.
- Install dependencies.
- Set up configurations.
- Launch the application.
Step 1: download the latest release of Hathor headless wallet
- Start a shell session.
- Change the working directory to where you want to store the application — namely, source code and database.
- Download the latest release of Hathor headless wallet:
git clone -b release https://github.com/HathorNetwork/hathor-wallet-headless.git
Step 2: install dependencies
- Change the working directory (the one you chose to store the application) to its child
hathor-wallet-headless
:
cd hathor-wallet-headless
- Install dependencies:
npm install
Step 3: set up configurations
- Copy the
config.js.template
file tosrc/
, renaming it toconfig.js
:
cp config.js.template src/config.js
Once you have Hathor headless wallet running, there will be three alternatives to start a wallet in the application: (1) by its seed phrase; (2) by its seed key; or (3) by its extended public key (in case of a read-only wallet). To start a wallet by its seed key, you must had previously added such seed key with an associated seed phrase into the config.js
file.
If you already have a previously generated seed phrase (i.e., wallet), you may use it. Otherwise, you must generate a new seed phrase.
- (Optional) If you don't have a wallet seed phrase, generate a new one:
make words
The output will be a string of 24 random words.
Anyone with access to a seed phrase can manage the funds of the associated wallet. Also, you cannot manage your wallet without access to the seed phrase or the private keys generated from it. Thus, we strongly recommend storing a backup file (either digital or physical or both) of the seed phrase and keeping the backup and the chosen installation directory secure against unauthorized access.
- Open the
config.js
file. - (Optional) Change the default configuration values of the application.
- (Optional) To be able to start a wallet by its seed key, add a key/value pair
my_seed_nr_1: <24_words_seed_phrase_string>
into theseeds
object, replacing themy_seed_nr_1
with the desired key and the<24_words_seed_phrase_string>
placeholder with its associated seed phrase:
module.exports = {
...
seeds: {
my_seed_nr_1: '<24_words_seed_phrase_string>',
},
...
};
- (Optional) You may repeat the last step as many times you want. In other words, you may define multiple seed keys in the
seeds
object, in order to start multiple wallets using them.
Step 4: launch the application
Start the wallet application:
npm start
By default, the application starts listening to port 8000 and connects to a public full node of the Hathor Network mainnet.
Task completed
You now have a running instance of Hathor headless wallet. To know how to operate and use this application, see Hathor headless wallet pathway.