auto-node run --clean --fast-sync
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
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:
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.
As per instructions on the cloud guides, the host needs to open up port 9000 for blockchain consensus messages and port 6000 for blockchain state syncing. Other ports are NOT necessary for syncing and should NOT be opened to the internet if you are staking only.
9000 port is used for blockchain consensus messages (base port)
6000 port is used for blockchain state syncing (base port - 3000)
9500 port is used for SDK RPC service (base port + 500)
9800 port is used for Websocket service (base port + 800)
The 9500, 9800 ports are only listened by localhost 127.0.0.1 by default.
Before we proceed to next steps we need to download the node binary first:
Check the node binary version that was downloaded:
The below explain the different method the node binary can be used. Option 1 is what being used when setting up systemd (at step 2).
If you choose another method make sure to use the correct command line
All the start options can be persisted and loaded from a single config file. To start a node, the following steps are also available**:**
Dump the default config.
Customize the config file.
Run harmony node with the config file.
A file harmony.conf
is created and the default node options are set in the file in TOML formatting. Here is an example:
The content of the config file can be modified for custom node start up command.
For example, to open the public HTTP RPCs, change the field IP
under [HTTP]
tag to "0.0.0.0"
:
To run harmony internal nodes (or Foundational Node FN), under legacy mode instead of staking mode, change the field NoStaking
under [General]
tag to true
:
To enable streamsync, modify the below two sections (Experimental. use at your own risk)
Stream Sync is the new harmony P2P syncing method allowing to get rid of the previous sync via DNS causing issue when the DNS
Harmony node binary is able to start with options provided by the config file:
The values stored in the config file will be read and parsed to harmony as node start options.
You can run your node binary using flag parsing:
A full list of active flags as well as examples can be accessed through running the binary with --help
option:
Output:
If both config file and flag is provided, the node option stored in config file will be override by the values given in flag.
For example, In config file harmony.conf
, HTTP server is enabled, and is open to public:
And a flag is also provided during the node start command to disable the HTTP server:
In this case, the command line flags will override the settings in the config file and thus the HTTP server is disabled.
The above steps would have you started the node, please CTRL+C, so you can continue with step 2.
A Non-validating Node is a node that does not join the consensus.
Check here for Explorer Node requirements.
Check here for instructions on how to sync your node in archival mode.
Keep in mind that the storage space used increases around ~50+ GB per month on s0 due to staking transaction being stored. Other shard should take around 25GB per month. Please plan your storage space accordingly.
The following steps assume the node is connected to mainnet on shard 0, which is required for all exchanges.
If you are using the config file, which is the recommended way to configure your node, change the settings to the ones below:
NoStaking = true
will verify if the BLS keys in your .hmy/blskeys folder are part of the original Foundational Node (FN) keys. For explorer, you will need to add in the folder dummy BLS/pass files and remove all others
IsBeaconArchival flag is applicable to explorer node only. For shard 1/2/3 the beacon shard 0 doesn't need to be in archival mode. So to save space, the recommendation is to set to false. For shard 0 explorer node, IsArchival flag will determine if the database is in archival mode or not.
DataDir (or --db_dir below for cli flag) is the folder where the blockchain data will be store (ie location of harmony_db_0)
Change harmony.conf
file and update the RPC Rate Limit to 50000:
Alternatively, you can also run it using flag parsing:
On this example, we will be installing the harmony daemon for user harmony
on its home directory. Daemon will be configured with sudo
but it will run with the harmony
user at the end.
Create the harmony.service
file:
Add the content below to the file and save it. Change User
to the local user you will be running the daemon and also WorkingDirectory
to the home directory where you downloaded the harmony binary file previously. Parameter ExecStart
needs to point to this same directory. On the example below we will be running the harmony binary using the harmony.conf
file.
Give the necessary permissions to run the daemon service, enable it and start it:
If you want to check the status of the daemon you can use:
To restart, or stop the service daemon you can run:
To check your node follow instructions on Checking A Node.
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!
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:
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:
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.
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.
This option is deprecated and is not supported anymore. Please update your node .
For instructions on how to update Using AutoNode click .
Create a folder called "backup
" in case it does not exist:
Backup the harmony
binary file:
Before we proceed to next steps we need to download the node binary first:
Check the node binary version that was downloaded:
To check your node follow instructions on .
The upgrade process is the same as above
This option is deprecated and is not supported anymore. Please setup your node .
Before we proceed to next steps we need to download the necessary files:
Check the node binary and node.sh version that was downloaded:
You can run your the node using flags parsing:
A full list of active flags as well as examples can be access through running node.sh
with --help
option:
Output:
On this example, we will be installing the harmony daemon for user harmony
on its home directory. Daemon will be configured with sudo
but it will run with the harmony
user at the end.
Create the harmony.service
file:
Add the content below to the file and save it. Change User
to the local user you will be running the daemon and also WorkingDirectory
to the home directory where you downloaded the harmony binary file previously. Parameter ExecStart
needs to point to this same directory. On the example below we will be running node.sh
using parameters -S
and -z
.
Give the necessary permissions to run the daemon service, enable it and start it:
If you want to check the status of the daemon you can use:
To restart, or stop the service daemon you can run:
The Harmony Node is ran as a , you can inspect the logs for the service with the following command:
To check your node follow instructions on .
To check the node version that is running, run the command below:
1. To check if your node is syncing properly, run the command below and check that the block height of the shard(s).
Harmony relies on a beacon shard chain (aka shard 0) to facilitate cross shard transaction. For the node to be fully working both your non shard 0 and shard 0 needs to be fully synced.
2. Before continuing, check if your node is fully synced using an external endpoint. Replace parameter --node
with the enpoint you want to compare with. Check the examples below for shard 0 on mainnet and testnet. Just change the edpoints to do the comparison with other shards.
For a complete reference of all available enpoints on both mainnet and testnet, please click here. Alternatively you can use the Block Explorers for a visual comparison.
3. Verify if blocks shown on steps 1 and 2 are closer or equal to each other. If so, your node should have caught up!
This option is deprecated and is not supported anymore. Please update your node Using Node Binary.
Create a folder called "backup
" in case it does not exist:
Backup both node.sh
and harmony
binary file:
Before we proceed to next steps we need to download the necessary files:
Check the Binary CLI and node.sh version that was downloaded:
To check your node follow instructions on Checking A Node.