How to install Hathor headless wallet from source code
Objective
This article will guide you to install Hathor headless wallet from source code.
Prerequisite
Before you begin, make sure you meet this prerequisite:
- Have Node.js v20.0.0 or later.
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
- Choose a directory to store the application.
- Open the command line from that directory.
- Run the command to clone the application repository:
git clone https://github.com/HathorNetwork/hathor-wallet-headless.git
Step 2: Install dependencies
- Open the command line from the
hathor-wallet-headless
directory. - Run the command to install the dependencies:
npm install
Step 3: Set up configurations
- Open the command line from the
hathor-wallet-headless
directory. - Run the command to 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, run the command to generate a new one:
npm run generate_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
- Open the command line from the
hathor-wallet-headless
directory. - Run the command to 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.