Connect headless wallet to testnet
Goal
This article will guide you to connect Hathor headless wallet to testnet.
Requirement
Hathor headless wallet v0.26.0
Step-by-step
- Configure headless wallet to connect to testnet.
- Obtain HTR tokens on testnet.
Step 1: configure headless wallet to connect to testnet
- Source code
- Docker container
- Docker compose
If you installed your headless wallet from source code, follow these substeps:
- Start a shell session.
- Change the working directory to <absolute_path_headless>/hathor-wallet-headless/srcreplacing the<absolute_path_headless>to where you installed the application.
- Open the config.jsfile.
- Set testnetas the value for thenetworkkey, and'https://node1.testnet.hathor.network/v1a/'as the value for theserverkey:
module.exports = {
  ...
  network: 'testnet',
  server: 'https://node1.testnet.hathor.network/v1a/',
  ...
};
- Restart the application as usual.
Note that your headless wallet will connect to a public full node on testnet. Now, if you want to operate your own full node see Installation of Hathor full node, and set server with your full node's URL.
If you installed your headless wallet as a Docker container, follow these substeps:
- Start a shell session.
- Start the headless wallet as usual, setting --networkand--serveras follows:
docker run \
  -it -p 8000:8000 \
  hathornetwork/hathor-wallet-headless \
  --seed_default '<24_words_seed_phrase_string>' \
  --network testnet \
  --server https://node1.testnet.hathor.network/v1a/
Note that your headless wallet will connect to a public full node on testnet. Now, if you want to operate your own full node see Installation of Hathor full node, and set --server with your full node's URL.
If you installed Hathor headless wallet along Hathor full node with Docker compose, follow these substeps:
- Start a shell session.
- Change the working directory to where you installed the applications.
- Open the docker-compose.ymlfile.
- Set the environment variables HATHOR_TESTNETandHEADLESS_NETWORKtotrue:
services:
  hathor-core:
    image: <docker_image_id>
    ...
    environment:
      - HATHOR_TESTNET=true
      ...
  hathor-wallet-headless:
    image: <docker_image_id>
    ...
    environment:
      ...
      - HEADLESS_NETWORK=testnet
      ...
- Restart the applications as usual.
Step 2: obtain HTR tokens on testnet
Currently, the faucet for Hathor Network's testnet is unavailable. As a result, to obtain HTR tokens for testing your use case on testnet, please send a private message to a Hathor team member on Hathor Discord server.
In your message, say "Hello, I have a use case and need HTR tokens for testing it on testnet. Could you please send X HTR tokens to <your_address>?", replacing <your_address> with the address on testnet you want to receive the tokens.
Task completed
You now have a running instance of Hathor headless wallet on testnet. For how to operate and use this application, see Hathor headless wallet pathway.