Skip to main content

Configure a Wallet (Testnet)

You’ll need an owner wallet to:

  • Stake your Testnet Network Tokens (TNT)
  • Receive validator node consensus group rewards
note

You can have a single wallet for multiple validator nodes. However multiple wallets for a single validator node is not supported.

To download the wallet go here.

Wallet Commands

At any time use -h or --help to get more help for a command.

Create a Wallet

./helium-wallet create basic --network testnet

Create or Use Wallet without Password Input

For security reasons, it is generally recommended that you type in your password every time. Storing the password in an environmental variable makes it very easy for the password to get compromised. Sometimes though, despite the security risks, you may want to interact with the CLI without inputting the password. In this case, using the environmental variable HELIUM_WALLET_PASSWORD enables this.

HELIUM_WALLET_PASSWORD=p4ssw0rd ./helium-wallet create basic --network testnet

View wallet balance and public key

./helium-wallet info view public key and TNT balance. You’ll need this public key address to obtain TNT needed for staking.

To obtain TNT tokens visit faucet.helium.wtf.

warning

Always make sure to inspect the transaction before adding the --commit option to sign and submit it to the api. There is no undo.

Stake Tokens

After you have received your TNT you need to stake these tokens.

As part of the staking process the validator node address needs to be in the staking transaction and also needs to sign the transaction. After a wallet stakes a validator node, the wallet becomes that node’s owner, has control over that validator node, and receives rewards.

To stake tokens perform the following:

  • Obtain the validator node address:

    • On the validator, run miner peer addr. This will produce something like: /p2p/112sSfUCQrVNAfFKVZWUSCeLs67wH8o1xz4yj4nKSPJKBT8bUkXi

    In this example the part following the final slash is the validator node's public address: 112sSfUCQrVNAfFKVZWUSCeLs67wH8o1xz4yj4nKSPJKBT8bUkXi.

  • Stake single Validator with the TNT:

    • ./helium-wallet validators stake one <public-address> 10000

Use --commit after preview to submit the transaction to network.

Unstake Tokens

If you unstake tokens the validator node enters a cooldown period. During this cooldown period the validator node will not earn rewards and at the end of the cooldown period (currently 250,000 blocks or approximately 5 months in mainnet) your initial staking amount will be returned to the wallet.

You need to include the stake release block height which should be at least the current block height plus the cooldown period, and 5-10 blocks to allow for chain processing delays.

For example, if the current block height was 5000, you'd add 250,000 for a stake release height plus an additional 10 to allow for chain processing delays. Therefore the stake-release-height is 5000 + 250000 + 10 or 255010.

info

For testnet, the cooldown period is shortened to 360 blocks (approx. an hour). In the above calculation, replace 250000 with 360.

To unstake tokens from a validator node perform the following:

Obtain the validator node public address as described in the stake command and calculate the stake-release-height as defined above.

./helium-wallet validators unstake <public-address> --stake-release-height <stake release height>

Use --commit after previewing to submit the transaction to network. If you wait too long to commit, you may need to recalculate the stake-release-height value.

warning

Once the unstake command is committed, this cannot be reversed. The validator will cease earning rewards and the stake amount will not be returned to the staking wallet until the 250,000 block cooldown period has completed.

info

Once a validator has been unstaked, it cannot be staked again. The validator may be deleted, including the swarm_key. Wallet commands to stake this validator's public address again will fail.

Transfer stake

A validator node's stake can be transferred to other validator nodes in the same wallet or a different one.

If the stake is transferred to a validator node in a different wallet, the owner of the other wallet must accept the transfer to complete the transaction.

To transfer stake to a new validator node in the same wallet:

./helium-wallet validators transfer create --new-address <new-public-address> --old-address <old-public-address>

Use --commit after previewing to submit the transaction to network.

This will produce an output similar to the following:


{
  "amount": 0.0,
  "fee": 55000,
  "hash": "q4Q7WTT0lD-EyjVFsW8hhdIw8Js339TgZpwTdA8_uPs",
  "new_address": "1ZFavPP8drcqAXJPT6mLuZQqwjWNhWGr9vJ3Ajs3uJyFGW7sUMX",
  "new_owner": "current",
  "old_address": "1YpifvrQWUFoHDGyYZoA2FAxmXPNcMNjnRd27uv81t8CzBBNW85",
  "old_owner": "1aXQ6WyNkibzhHXCFYiJQAa3BEkJnbZFsuezo4qjpW7FAgDw9Xx",
  "txn": "8gGvAQohEF7t+Kbveqj9hsmO9c/3krgGUVnL8rHv8Eg29JMiE8IGEiEQl2RGoxd+aznItHIVxL7Qizw0ng3t4tcA2kZA7mPqJMcaIRE+/nQNU16ZXpbzMmszzlSw+AiGAXeKg0q7kx1DdLlY7ypAM4Zz4UOX4tKcg2y079UGPhQ99hi8lSZwAwAUjxNMO9jGk5pGA1wP1BqidFWqtcPrIGuom+mdrOQLdEuBU0rFBDjYrQM="
}

To transfer stake to a new validator node in a different wallet:

./helium-wallet --format json validators transfer create --new-address <new-public-address> --old-address <old-public-address> --new-owner <new-owner-wallet-public-address>

Note: you must transfer the stake to a new validator node.

This will produce an output similar to the following:

{
  "amount": 0.0,
  "fee": 60000,
  "hash": null,
  "new_address": "1YeCAsuBq3fDTv8x4iB1fJn9zBbopHhjhXGpvVwN43JDptqMT11",
  "new_owner": "1bBTWn843DwTXTyH3hbSMmDoJXHCU1D1U8cAYRdVE5rDnaS7fLb",
  "old_address": "1ZFavPP8drcqAXJPT6mLuZQqwjWNhWGr9vJ3Ajs3uJyFGW7sUMX",
  "old_owner": "1aXQ6WyNkibzhHXCFYiJQAa3BEkJnbZFsuezo4qjpW7FAgDw9Xx",
  "txn": "8gHSAQohEJdkRqMXfms5yLRyFcS+0Is8NJ4N7eLXANpGQO5j6iTHEiEQRwd/IDnFy67A2NbC3IyYvLZUrsAojyJH85aeNi3SLA0aIRE+/nQNU16ZXpbzMmszzlSw+AiGAXeKg0q7kx1DdLlY7yIhEZVpU2QzwJ1SmikaTlSEyKCQ5mCRx/xOIUAsw5MYPIsWKkD3+X75w1+267InX30CD077Y8X3JK31FEg/X1bSpFehIQa6eY/DqfDEfDjLyq6UHpxsfBEE8M0zGs9okipefnAOOODUAw=="
}

You'll then need to send the txn value (a base64 string) to the new owner to be accepted.

To accept the transfer the new owner performs the following:

./helium-wallet validators transfer accept --commit <txn>

info

Once a validator has had a stake transferred from it, it cannot be staked again. The validator may be deleted, including the swarm_key. Wallet commands to stake this validator's public address again will fail.

More general wallet commands here.