auto-node run --clean --fast-sync
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
AutoNode allows you to spin up a node seamlessly and automate common validator actions.
Want to add a feature to AutoNode? Feel free to contribute to the open-sourced repo here!
Quick start to running a Harmony Validator.
This option is deprecated and is not supported anymore. Please setup your node Using Node Binary.
All commands for auto-node
have a help message that describes its usage. Just append --help
to the command you wish to learn more about. For example: auto-node --help.
It is recommended to go with Ubuntu 18+ or Red Hat Enterprise Linux 8+ as your operating system.
You can choose any <new-user-name>
you want. The command below will ask for a passphrase for the user, choose one and keep track of this password for future use! The command below will also add the user to the sudo group for convenience.
Answer the prompts, then execute:
Next, if you wish to use the same SSH credentials as your current user to log into your new user, execute the following commands:
Command above assumes you use the default home directory for your new user
Otherwise, you can create your own SSH key for your user following this documentation.
Lastly, exit your SSH session and re-SSH back into your machine under your new user. Your ssh command may look something like this:
Alternatively, you can swap users when SSH-ed in as your default user with the following command:
If you choose to swap users, you must export 2 environment variables to install AutoNode. Do so with the following command:
It may be convient to add this command to your
~/.bashrc
profile.
sudo
access for your user is needed for installation.
Make sure to answer the prompts!
You will need to have access to systemd
in user mode. This may require SSH-ing in as the user running AutoNode, or upgrading systemd.
It may be easier to choose another Operating System if you have to upgrade systemd
, Ubuntu 18+ is known to work.
If you created a user just for AutoNode, make sure to follow all parts of step 2.
You can reload your shell by exiting your SSH session and SSH-ing back into the machine, or you can execute the following command:
This step is only needed if the command:
auto-node
does not work.
This is the recommended way to run AutoNode.
You can send 10,100 ONE from your 'main' wallet to your AutoNode validator wallet (generated with the above command). This way, AutoNode can automate common validator commands for this new wallet, like create the validator for you. Once AutoNode creates the validator, you can delegate from your 'main' wallet to your AutoNode validator to increase its stake.
Note that you can transfer files to your remote machine with the scp
command. Documetation to do so can be found here.
BE CAREFULL WITH RAW WALLET PRIVATE KEYS!!!
You can use the following command to list all of the loaded wallets:
Use --clean
to start fresh/remove old node files (if present)
Use --fast-sync
option to rclone the correct Harmony DB to reduce sync time. One can choose to sync from scratch by removing the --fast-sync
option
Use --expose-rpc
if you wish to expose RPC for your node to enable endpoint functionality
Use --shard
(your shard number here) to run a node for a specific shard
Use --archival
to run in archival mode. Make sure your machine has enough space. We expect around 500GB is needed to run an Archival node (Jun 2020)
Use --auto-active
to automatically activate your validator on next epoch in case it gets deactivated
Make sure to respond to the prompts. If you are unable to create a validator (but started your node) don't worry! Follow the next step on how to create your validator.
Once the monitor has started and you see repeated prints of the node information & headers, you can exit with ctrl+C.
From here, you are free to do whatever on the machine, or you can exit the machine. Your Harmony node will keep running!
You can go through the create validator flow again by executing the following command:
Note that this can only be done if you failed to create a validator on the inital run of auto-node
Get your ONEs for validating!
You can simply collect rewards for your validator with the following command:
If you have followed the recommended method of creating a wallet just for running a validator, you can send funds to your 'main' wallet with the following steps.
First, get the balance of your validator wallet with the following command:
Note the shard 0
balance, this is where the rewards get deposited.
Next, transfer the funds to your 'main' wallet with the following command:
Substitute
<main-wallet-address>
with the ONE address of your main wallet. Substitute<amount>
with how much you want to transfer from your validator wallet.
Run the latest AutoNode!
AutoNode will quickly check for an update on each execution of the auto-node
command. If there is an update you will see the following message:
You will need to briefly stop your node to execute an update. Updates should be fast.
Kill your AutoNode with the following command:
Note that if you are still elected and signing, AutoNode will ask for you to confirm before killing your node.
You can start the update with the following command:
Note that AutoNode will check to make sure the harmony node is stopped. If it detects that the harmony node is still running, It will ask to kill itself before starting the update.
You can also re-run the install script from step 3 of the Install & Run script to update AutoNode
Make sure to restart your AutoNode after the update to resume validating or operations. For a validator, it will most likely be:
DO NOT restart AutoNode with the
--clean
or--fast-sync
as it will probably regress your block hight (since it edits the DB files).
hmy
CLIFor your convenience, AutoNode wraps the hmy
CLI. You can update it with the following command:
Track your node's status with AutoNode.
If any of the commands activates a monitoring screen, you can always exit using Ctrl+C
.
View live updates (at 8 seconds intervals) of your node's status (block height, EPOS status, etc..) with the following command:
View an overview of your validator and node with a text-based user interface. You can start it with the following command:
You can view the status of the harmony node with the following command:
You can also view the logs from the node as it was initialized with the following command:
Should the monitor crash or timeout, you can restart it with the following command:
You can update the TUI to the latest release with the following command:
Some optional extras that you may find useful.
We do not recommend storing your passphrase in plain text. If you choose to, you can have AutoNode import your wallets passphrase from a file. First, save the passphrase using the following convention:
Then, move the saved passphrase into the harmony wallet passphrase directory using the following command:
Then, when you run AutoNode with auto-node run
it will automatically pick up the passphrase.
Manage & re-use your BLS keys.
Currently, all BLS keys MUST have the same passphrase. A feature to improve this is in the works.
You can find the path to your BLS keys directory (used by the harmony node) with the following command:
By default, this should be
~/.hmy/blskeys
Any BLS key present in that directory will be attempted to be used when launching the node. This means that all BLS keys in the said directory need to be for the same shard. Moreover, any .pass
files will also be attempted to be used when launching a node
This assumes AutoNode has been initialized.
You can find which shard a public BLS key belongs to with the following command:
You can automatically cleanse your validator of BLS key(s) that have not signed any blocks in the current epoch with the following command:
You can cleanse all BLS key(s) that are not on the same shard as the BLS key(s) used by the current harmony node's shard with the following command:
You can also cleanse the BLS key(s) that are not being used by the current harmony node with the following command:
You can remove an explicit BLS key from your validator with the following command:
Steps for maintaining your node with AutoNode.
After your validator is created, you can edit your validator config with the following command:
This will open up a Nano session to edit the config. After you do your edits, save it by pressing
Ctrl+X
thenY
.
After you finish editing, you will be asked to update the config on-chain. If you say yes, AutoNode will send an edit validator transaction to update your validator.
Note that the following are the ONLY fields that can be edited on-chain:
"details", "identity", "name", "security-contact", "website", "max-total-delegation", "min-self-delegation", "rate"
You can deactivate your validator if you would like to not get elected the following epoch. You can do so with the following command:
When you are ready to get elected and sign the following epoch, you can activate your validator with the following command:
Node logs are saved in the following directory: $HOME/harmony_node/latest
You can view the logs with the following command:
Similar to the Harmony Node, the monitor is ran as a service and you can inspect the logs for the service with the following command:
Some steps for troubleshooting your AutoNode.
If you encounter any issue you cannot solve, feel free to reach out to us at autonode@harmony.one. Alternatively you can open a Github issue .
All AutoNode generated logs are saved in $HOME/.hmy
when you execute the following command:
You should see 2 files, autonode_monitor.log
and autonode_node.log
. Inspect those two files with your favorite command-line editor (i.e: vim
) to see where things might have gone wrong.
You might also find it useful to inspect the Harmony Node logs. You can do so with the following command:
You can change the
vim
part of the command for your favorite text editor.
A symptom of this is seeing an error to connect to http://localhost:9500/
.
You can inspect what went wrong with the following command:
A common issue is that your machine will not have enough disk space. You can check your disk space usage with the following command:
If your
use%
is at 95-100% and your node failed to start, you probably have insufficient disk space. Look into how to increase your disk space on your cloud provider.
You can also try to reboot your AutoNode with:
Substitute
<params>
with whatever run params you want to use.
Sometimes the Harmony Node may have some signing issues. In this case, we have found it best to just restart the Node. You can do so by first killing AutoNode:
Then restarting AutoNode with whatever your initial run command was. For example, one could run it with:
DO NOT re-run with the --clean
or --fast-sync
options as they will most likely regress your block height to the last snapshotted DB.
You can restart the Harmony Node service with the following command:
You can check the status of the service with the following command:
You can fetch the Harmony Node version with the following command:
You can restart the monitor service with the following command:
You can check the status of the service with the following command:
If your encrypted passphrase for your validator is ever invalidated, you can re-encrypt and save it with the following command:
You can choose to optimize your operating system for running a harmony node. The optimizations, or tunes, are made to keep your node safe but also lifts some default restrictions. Here is the command to tune your OS with AutoNode:
This will tune the kernel and the
--save
option will make it persistant. If you do not have the--save
option, the tunes will only last untill the system is rebooted (by you or your VPS). Note that all the tunes will be displayed and confirmation asked before applying the tunes.
You can also tune/optimize your network settings with the following command:
If you want to revert the optimization/tune applied by AutoNode, you can do so by running the following command:
Note that you can run the command muliple times to restore previous tunes chronologically. Moveover, the restored tunes will be displayed and a confirmation will be asked before applying the restoreation.
First, remove all of the AutoNode files. You can do so with the following command:
After, you can re-install AutoNode from fresh using the steps in the Install & Run section.
The Harmony Node is ran as a , you can inspect the logs for the service with the following command: