All pages
Powered by GitBook
1 of 18

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

4. Installing & Updating

Installing A Node

Troubleshoot

Some steps for troubleshooting your AutoNode.

If you encounter any issue you cannot solve, feel free to reach out to us at [email protected]. Alternatively you can open a Github issue here.

Inspect AutoNode logs

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.

Node failed to start

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.

Fixing Signing Issues

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.

Restart the Harmony Node

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:

Restart the AutoNode Monitor

You can restart the monitor service with the following command:

You can check the status of the service with the following command:

Re-Authenticating your validator wallet

If your encrypted passphrase for your validator is ever invalidated, you can re-encrypt and save it with the following command:

Optimize Operating System

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:

Restoring Operating System from Optimization

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.

Fresh Install

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.

ls $HOME/.hmy/*.log
vim $HOME/harmony_node/latest/zero*.log
auto-node node log
auto-node node status
df -H 
auto-node kill
auto-node run <params>
auto-node kill
auto-node run --expose-rpc
auto-node node restart
auto-node node status
auto-node node version
auto-node monitor restart
auto-node monitor status
auto-node auth-wallet
auto-node tune kernel --save
auto-node tune network --save
auto-node tune restore
auto-node kill
systemctl --user disable [email protected]
systemctl --user disable [email protected]
rm -rf ~/.hmy
rm -rf ~/harmony_node
rm -rf ~/harmony_wallet_pass
rm -f ~/harmony_validator_config.json
rm -f ~/bin/auto-node
rm -f ~/bin/autonode-service.py

Using AutoNode (deprecated)

This option is deprecated and is not supported anymore. Please update your node Using Node Binary.

For instructions on how to update Using AutoNode click here.

Upgrading A Node

Install & Run

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.

Step 1: Spin up your instance on or

It is recommended to go with Ubuntu 18+ or Red Hat Enterprise Linux 8+ as your operating system.

Step 2: SSH into the machine

Step 2.5: (Optional) Create a new user

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 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.

Step 3: Install AutoNode

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.

Step 3.5: (Optional) Update your shell

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.

Step 4: Add or import a Validator Key

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 .

BE CAREFULL WITH RAW WALLET PRIVATE KEYS!!!

You can use the following command to list all of the loaded wallets:

Step 5: Run AutoNode & start your Validator

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 for your node to enable endpoint functionality

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!

Step 5.5: (Optional) Create your validator after the initial run

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

BLS Key Management

Manage & re-use your BLS keys.

Currently, all BLS keys MUST have the same passphrase. A feature to improve this is in the works.

BLS key(s) location

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 .passfiles will also be attempted to be used when launching a node

BLS key for shard

This assumes AutoNode has been initialized.

You can find which shard a public BLS key belongs to with the following command:

Cleanse BLS key(s) from Validator

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:

Remove BLS key from Validator

You can remove an explicit BLS key from your validator with the following command:

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

AWS
other providers
this
here
RPC
new_user_name=<new-user-name>
sudo adduser $new_user_name
sudo adduser $new_user_name sudo
sudo loginctl enable-linger $new_user_name
sudo mkdir -p /home/$new_user_name/.ssh
sudo cp ~/.ssh/authorized_keys /home/$new_user_name/.ssh/authorized_keys
sudo chown $new_user_name:$new_user_name /home/$new_user_name/.ssh/authorized_keys
ssh -i "key.pem" <new-user-name>@your-server.com
su - <new-user-name>
export XDG_RUNTIME_DIR="/run/user/$UID"
export DBUS_SESSION_BUS_ADDRESS="unix:path=${XDG_RUNTIME_DIR}/bus"
install_file_source="https://raw.githubusercontent.com/harmony-one/auto-node/master/scripts/first-install.sh"
tmp_install_file="/tmp/autonode-first-install.$(date +'%s').sh"
curl -o "$tmp_install_file" "$install_file_source" && bash "$tmp_install_file" && rm -f "$tmp_install_file"
export PATH=$PATH:~/bin
auto-node hmy keys add example-validator-wallet-name
auto-node hmy keys import-ks <path-to-keystore-file>
auto-node hmy keys import-private-key <private-key-string>
auto-node hmy keys list
auto-node run --clean --fast-sync
auto-node run --clean --fast-sync --auto-active \
    --network testnet --beacon-endpoint https://api.s0.b.hmny.io/ --shard 0
auto-node create-validator
python3 -c "from AutoNode import common; print(common.bls_key_dir)"
auto-node bls-shard <public-bls-key>
auto-node cleanse-bls
auto-node cleanse-bls --keep-shard
auto-node cleanse-bls --hard
auto-node remove-bls <public-bls-key>

Using Node.sh (deprecated)

This option is deprecated and is not supported anymore. Please update your node Using Node Binary.

1. Stop Systemd Service

2. Backup Files

Create a folder called "backup" in case it does not exist:

Backup both node.sh and harmony binary file:

3. Download Node.sh

Before we proceed to next steps we need to download the necessary files:

Check the Binary CLI and node.sh version that was downloaded:

4. Restart Systemd Service

To check your node follow instructions on .

Update

Run the latest AutoNode!

Checking for AutoNode updates

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:

Monitor

Track your node's status with AutoNode.

If any of the commands activates a monitoring screen, you can always exit using Ctrl+C.

1) Harmony Monitor

sudo service harmony stop
Checking A Node
curl -LO https://harmony.one/node.sh && chmod +x node.sh
./node.sh -d && mv staging/* ./
curl -LO https://harmony.one/node.sh && chmod +x node.sh
./node.sh -d -N testnet && mv staging/* ./
mkdir -p backup
cp {node.sh,harmony} backup
./harmony -V
./node.sh -v
sudo service harmony restart
Updating AutoNode

You will need to briefly stop your node to execute an update. Updates should be fast.

Step 0: (Optional) Stop Auto

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.

Step 1: Start the update

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

Step 2: Restart/Rerun your 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).

Updating hmy CLI

For your convenience, AutoNode wraps the hmy CLI. You can update it with the following command:

View live updates (at 8 seconds intervals) of your node's status (block height, EPOS status, etc..) with the following command:

2) TUI

View an overview of your validator and node with a text-based user interface. You can start it with the following command:

Sample of TUI

3) Harmony Node

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:

Extra

1. Restart monitor

Should the monitor crash or timeout, you can restart it with the following command:

2. Update TUI

You can update the TUI to the latest release with the following command:

Maintenance

Steps for maintaining your node with AutoNode.

Edit Validator config

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 then Y.

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"

Deactivate Validator

You can deactivate your validator if you would like to not get elected the following epoch. You can do so with the following command:

Activate Validator

When you are ready to get elected and sign the following epoch, you can activate your validator with the following command:

Inspect the Harmon Node logs

Node logs are saved in the following directory: $HOME/harmony_node/latest

You can view the logs with the following command:

Inspect the Harmony Node service logs

The Harmony Node is ran as a , you can inspect the logs for the service with the following command:

Inspect the AutoNode monitor service logs

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:

Collect Rewards

Get your ONEs for validating!

1. Sending a Collect Rewards Transaction

You can simply collect rewards for your validator with the following command:

auto-node collect-rewards

2. (Optional) Send funds to your 'main' wallet

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.

Using Node Binary

Validator Nodes

1. Backup Files

Create a folder called "backup

Checking A Node

1. Check Node Running Version

To check the node version that is running, run the command below:

2. Check if Node is Syncing

Extra

Some optional extras that you may find useful.

Using wallet passphrase from file

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.

auto-node kill
auto-node update
auto-node run
auto-node hmy-update
auto-node monitor log
auto-node tui run
auto-node node status
auto-node node log
auto-node monitor restart
auto-node tui update
auto-node edit-config

(Deprecated) Using AutoNode

AutoNode allows you to spin up a node seamlessly and automate common validator actions.

Install & RunUpdateMonitorBLS Key ManagementCollect RewardsMaintenanceTroubleshootExtra

Contribute!

Want to add a feature to AutoNode? Feel free to contribute to the open-sourced repo here!

service
auto-node balances
validator_addr=$(auto-node config | jq '.["validator-addr"]' -r)
auto-node hmy transfer -n https://api.s0.t.hmny.io/ --from-shard 0 --to-shard 0 \
  --from $validator_addr --to <main-wallet-address> --amount <amount> --passphrase
<ONE-address>.pass
mv ./path/to/<ONE-address>.pass ~/harmony_wallet_pass/<ONE-address>.pass
" in case it does not exist:

Backup the harmony binary file:

2. Download Node Binary

Before we proceed to next steps we need to download the node binary first:

curl -LO https://harmony.one/binary && mv binary harmony && chmod +x harmony
curl -LO https://harmony.one/binary_testnet && mv binary_testnet harmony && chmod +x harmony

Check the node binary version that was downloaded:

3. Restart Systemd Service

To check your node follow instructions on Checking A Node.

Non-Validating/Explorer Nodes

The upgrade process is the same as above

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.

./hmy --node="https://api.s0.t.hmny.io" blockchain latest-headers
./hmy --node="https://api.s0.b.hmny.io" blockchain latest-headers

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!

auto-node deactivate
auto-node activate
vim $HOME/harmony_node/latest/zero*.log
auto-node node journal -e
auto-node monitor journal -e
mkdir -p backup
cp harmony backup
./harmony -V
sudo service harmony restart
./hmy utility metadata
./hmy blockchain latest-headers

(deprecated) Using Node.sh

This option is deprecated and is not supported anymore. Please setup your node Using Node Binary.

1. Download Node.sh

Before we proceed to next steps we need to download the necessary files:

Check the node binary and node.sh version that was downloaded:

2. Setup Node.sh

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:

3. Setup Systemd

On this example, we will be installing the harmony daemon for user harmony on its home directory. Daemon will be configured with sudobut it will run with the harmonyuser 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:

To check your node follow instructions on .

node.sh -D -S -z -N testnet
Checking A Node
curl -LO https://harmony.one/node.sh && chmod +x node.sh
./node.sh -d && mv staging/* ./
curl -LO https://harmony.one/node.sh && chmod +x node.sh
./node.sh -d -N testnet && mv staging/* ./
./node.sh -D -S -z
./harmony -V
./node.sh -v
./node.sh --help
Usage: node.sh [options]

Options:
   -c             back up database/logs and start clean (not for mainnet)
                  (use only when directed by Harmony)
   -C             disable interactive console for bls passphrase (default: enabled)
   -1             do not loop; run once and exit
   -h             print this help and exit
   -k KEYFILE     use the given BLS key files
   -s             run setup env only (must run as root)
   -S             run the node.sh as non-root user (default: run as root)
   -p passfile    use the given BLS passphrase file
   -d             just download the Harmony binaries (default: off)
   -D             do not download Harmony binaries (default: download when start)
   -N network     join the given network (mainnet, testnet, staking, partner, stress, devnet, tnet; default: mainnet)
   -n port        specify the public base port of the node (default: 9000)
   -T nodetype    specify the node type (validator, explorer; default: validator)
   -i shardid     specify the shard id (valid only with explorer node; default: 1)
   -a dbfile      specify the db file to download (default:off)
   -U FOLDER      specify the upgrade folder to download binaries
   -P             enable public rpc end point (default:off)
   -v             print out the version of the node.sh
   -V             print out the version of the Harmony binary
   -z             run in staking mode
   -y             run in legacy, foundational-node mode (default)
   -Y             verify the signature of the downloaded binaries (default: off)
   -m minpeer     specify minpeers for bootstrap (default: 6)
   -f blsfolder   folder that stores the bls keys and corresponding passphrases (default: ./.hmy/blskeys)
   -A             enable archival node mode (default: off)
   -B blacklist   specify file containing blacklisted accounts as a newline delimited file (default: ./.hmy/blacklist.txt)
   -r address     start a pprof profiling server listening on the specified address
   -I             use statically linked Harmony binary (default: true)
   -R tracefile   enable p2p trace using tracefile (default: off)
   -l             limit broadcasting of invalid transactions (default: off)
   -L log_level   logging verbosity: 0=silent, 1=error, 2=warn, 3=info, 4=debug, 5=detail (default: 3)
   
Examples:

# start node program with all key/passphrase under .hmy/blskeys
# first try to unlock account with .pass file. If pass file not exist or cannot decrypt, prompt to get passphrase.
   node.sh -S 

# start node program w/o accounts
   node.sh -S -k mybls1.key,mybls2.key

# download beacon chain (shard0) db snapshot
   node.sh -i 0 -b

# just re-download the harmony binaries
   node.sh -d

# start a non-validating node in shard 1
# you need to have a dummy BLSKEY/pass file using 'touch BLSKEY; touch blspass'
   node.sh -S -k BLSKEY -p blspass -T explorer -i 1

# upgrade harmony binaries from specified repo
   node.sh -1 -U upgrade

# start the node in a different port 9010
   node.sh -n 9010

# multi-bls: specify folder that contains bls keys
   node.sh -S -f /home/xyz/myfolder

# multi-bls using default passphrase: place all keys under .hmy/blskeys
# supply passphrase file using -p option (single passphrase will be used for all bls keys)
   node.sh -S -p blspass.txt

# disable interactive console for passphrase (prepare .pass file before running command)
   node.sh -S -C
sudo vi /etc/systemd/system/harmony.service
[Unit]
Description=Harmony daemon
After=network-online.target

[Service]
Type=simple
Restart=always
RestartSec=1
User=harmony
WorkingDirectory=/home/harmony
ExecStart=/home/harmony/node.sh -D -S -z
SyslogIdentifier=harmony
StartLimitInterval=0
LimitNOFILE=65536
LimitNPROC=65536

[Install]
WantedBy=multi-user.target
sudo chmod 755 /etc/systemd/system/harmony.service
sudo systemctl enable harmony.service
sudo service harmony start
sudo service harmony status
sudo service harmony restart
sudo service harmony stop

Using Node Binary

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.

1. Download Node Binary

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 ().

If you choose another method make sure to use the correct command line

Option 1: Setup Using Config File (recommended)

All the start options can be persisted and loaded from a single config file. To start a node, the following steps are also available**:**

  1. Dump the default config.

  2. Customize the config file.

  3. Run harmony node with the config file.

Dump the Default 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

Start the node with Config File

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.

Option 2: Setup Using Flag Parsing

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:

Option 3: Setup Using Flag Parsing and a Config file combined

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.

Non-Validating/Explorer Nodes

A Non-validating Node is a node that does not join the consensus.

Check for Explorer Node requirements.

Check 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:

7. Start Systemd Service

Alternatively, you can also run it using flag parsing:

2. Setup Systemd

On this example, we will be installing the harmony daemon for user harmony on its home directory. Daemon will be configured with sudobut it will run with the harmonyuser 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 .

at step 2
here
here
Checking A Node
curl -LO https://harmony.one/binary && mv binary harmony && chmod +x harmony
curl -LO https://harmony.one/binary && mv binary harmony && chmod +x harmony
curl -LO https://harmony.one/binary-arm64 && mv binary-arm64 harmony && chmod +x harmony
./harmony -V
./harmony config dump harmony.conf
./harmony config dump --network testnet harmony.conf
Version = "2.5.7"

[BLSKeys]
  KMSConfigFile = ""
  KMSConfigSrcType = "shared"
  KMSEnabled = false
  KeyDir = "./.hmy/blskeys"
  KeyFiles = []
  MaxKeys = 10
  PassEnabled = true
  PassFile = ""
  PassSrcType = "auto"
  SavePassphrase = false

[DNSSync]
  Client = true
  LegacySyncing = false
  Port = 6000
  Server = true
  ServerPort = 6000
  Zone = "t.hmny.io"

[General]
  DataDir = "./"
  EnablePruneBeaconChain = false
  IsArchival = false
  IsBackup = false
  IsBeaconArchival = false
  IsOffline = false
  NoStaking = false
  NodeType = "validator"
  RunElasticMode = false
  ShardID = -1
  TraceEnable = false

[HTTP]
  AuthPort = 9501
  Enabled = true
  IP = "127.0.0.1"
  Port = 9500
  RosettaEnabled = false
  RosettaPort = 9700

[Log]
  Console = false
  FileName = "harmony.log"
  Folder = "./latest"
  RotateCount = 0
  RotateMaxAge = 0
  RotateSize = 100
  Verbosity = 3

  [Log.VerbosePrints]
    Config = true

[Network]
  BootNodes = ["/dnsaddr/bootstrap.t.hmny.io"]
  NetworkType = "mainnet"

[P2P]
  DisablePrivateIPScan = false
  DiscConcurrency = 0
  IP = "0.0.0.0"
  KeyFile = "./.hmykey"
  MaxConnsPerIP = 10
  MaxPeers = 0
  Port = 9000

[Pprof]
  Enabled = false
  Folder = "./profiles"
  ListenAddr = "127.0.0.1:6060"
  ProfileDebugValues = [0]
  ProfileIntervals = [600]
  ProfileNames = []

[RPCOpt]
  DebugEnabled = false
  EthRPCsEnabled = true
  LegacyRPCsEnabled = true
  RateLimterEnabled = true
  RequestsPerSecond = 1000
  RpcFilterFile = "./.hmy/rpc_filter.txt"
  StakingRPCsEnabled = true

[ShardData]
  CacheSize = 512
  CacheTime = 10
  DiskCount = 8
  EnableShardData = false
  ShardCount = 4

[Sync]
  Concurrency = 6
  DiscBatch = 8
  DiscHardLowCap = 6
  DiscHighCap = 128
  DiscSoftLowCap = 8
  Downloader = false
  Enabled = false
  InitStreams = 8
  MinPeers = 6

[TxPool]
  AccountSlots = 16
  AllowedTxsFile = "./.hmy/allowedtxs.txt"
  BlacklistFile = "./.hmy/blacklist.txt"
  GlobalSlots = 5120
  LocalAccountsFile = "./.hmy/locals.txt"
  RosettaFixFile = ""

[WS]
  AuthPort = 9801
  Enabled = true
  IP = "127.0.0.1"
  Port = 9800
[HTTP]
  Enabled = true
  IP = "0.0.0.0"
  Port = 9500
  RosettaEnabled = false
  RosettaPort = 9700
[General]
  DataDir = "./"
  IsArchival = false
  IsBeaconArchival = false
  IsOffline = false
  NoStaking = true
  NodeType = "validator"
  ShardID = -1
[DNSSync]
  Client = false
  LegacySyncing = false
  Port = 6000
  Server = true
  ServerPort = 6000
  Zone = "b.hmny.io"
  
[Sync]
  Concurrency = 4
  DiscBatch = 8
  DiscHardLowCap = 4
  DiscHighCap = 1024
  DiscSoftLowCap = 4
  Downloader = true
  InitStreams = 4
  MinPeers = 4
./harmony -c harmony.conf
./harmony
./harmony --network testnet
./harmony --help
Examples usage:

# start a validator node with default bls folder (default bls key files in ./.hmy/blskeys)
    ./harmony

# start a validator node with customized bls key folder
    ./harmony --bls.dir [bls_folder]

# start a validator node with open RPC endpoints and customized ports
    ./harmony --http.ip=0.0.0.0 --http.port=[http_port] --ws.ip=0.0.0.0 --ws.port=[ws_port]

# start an explorer node
    ./harmony --run=explorer --run.shard=[shard_id]

# start a harmony internal node on testnet
    ./harmony --run.legacy --network testnet

Usage:
  harmony [flags]
  harmony [command]

Available Commands:
  config      dump or update config
  dumpdb      dump a snapshot db.
  help        Help about any command
  version     print version of the harmony binary

Flags:
      --bls.dir string                     directory for BLS keys (default "./.hmy/blskeys")
      --bls.keys strings                   a list of BLS key files (separated by ,)
      --bls.kms                            enable BLS key decryption with AWS KMS service
      --bls.kms.config string              json config file for KMS service (region and credentials)
      --bls.kms.src string                 the AWS config source (region and credentials) for KMS service (shared, prompt, file) (default "shared")
      --bls.pass                           enable BLS key decryption with passphrase (default true)
      --bls.pass.file string               the pass file used for BLS decryption. If specified, this pass file will be used for all BLS keys
      --bls.pass.save                      after input the BLS passphrase from console, whether to persist the input passphrases in .pass file
      --bls.pass.src string                source for BLS passphrase (auto, file, prompt) (default "auto")
      --bootnodes strings                  a list of bootnode multiaddress (delimited by ,)
  -c, --config string                      load node config from the config toml file.
      --consensus.aggregate-sig            (multi-key) aggregate bls signatures before sending (default true)
      --datadir string                     directory of chain database (default "./")
      --dns.port int                       dns sync remote server port (default 6000)
      --dns.server-port int                dns sync local server port (default 6000)
      --dns.zone string                    use customized peers from the zone for state syncing
  -h, --help                               help for harmony
      --http                               enable HTTP / RPC requests (default true)
      --http.auth-port int                 rpc port to listen for auth HTTP requests (default 9501)
      --http.ip string                     ip address to listen for RPC calls. Use 0.0.0.0 for public endpoint (default "127.0.0.1")
      --http.port int                      rpc port to listen for HTTP requests (default 9500)
      --http.rosetta                       enable HTTP / Rosetta requests
      --http.rosetta.port int              rosetta port to listen for HTTP requests (default 9700)
      --log.console                        output log to console only
      --log.dir string                     directory path to put rotation logs (default "./latest")
      --log.max-size int                   rotation log size in megabytes (default 100)
      --log.name string                    log file name (e.g. harmony.log) (default "harmony.log")
      --log.rotate-count int               maximum number of old log files to retain
      --log.rotate-max-age int             maximum number of days to retain old log files
  -v, --log.verb int                       logging verbosity: 0=silent, 1=error, 2=warn, 3=info, 4=debug, 5=detail (default 3)
      --log.verbose-prints strings         debugging feature. to print verbose internal objects as JSON in log file. available internal objects: config (default [config])
      --metrics                            flag required to enable the eth metrics
      --metrics.expensive                  flag required to enable the expensive eth metrics
  -n, --network string                     network to join (mainnet, testnet, pangaea, localnet, partner, stressnet, devnet) (default "mainnet")
      --p2p.disc.concurrency int           the pubsub's DHT discovery concurrency num (default with raw libp2p dht option)
      --p2p.ip string                      ip to listen for p2p protocols (default "0.0.0.0")
      --p2p.keyfile string                 the p2p key file of the harmony node (default "./.hmykey")
      --p2p.no-private-ip-scan             disable scanning of private ip4/6 addresses by DHT
      --p2p.port int                       port to listen for p2p protocols (default 9000)
      --p2p.security.max-conn-per-ip int   maximum number of connections allowed per remote node, 0 means no limit (default 10)
      --p2p.security.max-peers int         maximum number of peers allowed, 0 means no limit (default 10)
      --pprof                              enable pprof profiling
      --pprof.addr string                  listen address for pprof (default "127.0.0.1:6060")
      --pprof.profile.names strings        a list of pprof profile names (separated by ,) e.g. cpu,heap,goroutine
      --prometheus                         enable HTTP / Prometheus requests (default true)
      --prometheus.ip string               ip address to listen for prometheus service (default "0.0.0.0")
      --prometheus.port int                prometheus port to listen for HTTP requests (default 9900)
      --prometheus.push                    enable prometheus pushgateway
      --prometheus.pushgateway string      prometheus pushgateway URL (default "https://gateway.harmony.one")
      --rpc.ratelimit int                  the number of requests per second for RPCs (default 1000)
      --rpc.ratelimiter                    enable rate limiter for RPCs (default true)
      --run string                         run node type (validator, explorer) (default "validator")
      --run.archive                        run shard chain in archive mode
      --run.beacon-archive                 run beacon chain in archive mode
      --run.legacy                         whether to run node in legacy mode
      --run.offline                        run node in offline mode
      --run.shard int                      run node on the given shard ID (-1 automatically configured by BLS keys) (default -1)
      --sharddata.cache_size int           local cache storage size (MB) (default 512)
      --sharddata.cache_time int           local cache save time (minute) (default 10)
      --sharddata.disk_count int           the count of disks you want to storage block data (default 8)
      --sharddata.enable                   whether use multi-database mode of levelDB
      --sharddata.shard_count int          the count of shards you want to split in each disk (default 4)
      --sync                               Enable the stream sync protocol (experimental feature)
      --tracing                            indicates if full transaction tracing should be enabled
      --txpool.accountslots int            number of executable transaction slots guaranteed per account (default 16)
      --txpool.allowedtxs string           file of allowed transactions (default "./.hmy/allowedtxs.txt")
      --txpool.blacklist string            file of blacklisted wallet addresses (default "./.hmy/blacklist.txt")
      --txpool.globalslots int             maximum global number of non-executable transactions in the pool (default 5120)
      --txpool.locals string               file of local wallet addresses (default "./.hmy/locals.txt")
      --txpool.rosettafixfile string       file of rosetta fix file
  -V, --version                            display version info
      --ws                                 enable websocket endpoint (default true)
      --ws.auth-port int                   port for websocket auth endpoint (default 9801)
      --ws.ip string                       ip endpoint for websocket. Use 0.0.0.0 for public endpoint (default "127.0.0.1")
      --ws.port int                        port for websocket endpoint (default 9800)

Use "harmony [command] --help" for more information about a command.
[HTTP]
  Enabled = true
  IP = "0.0.0.0"
  Port = 9500
  RosettaEnabled = false
  RosettaPort = 9700
./harmony -c harmony.conf --http=false
> curl localhost:9500
curl: (7) Failed to connect to localhost port 9500: Connection refused
 [General]
  DataDir = "./"
  IsArchival = true
  IsBeaconArchival = false
  IsOffline = false
  NoStaking = true
  NodeType = "explorer"
  ShardID = 0
# remove all keys, save it before if necessary
rm -f .hmy/blskeys/*
# create dummy files
touch .hmy/blskeys/bls.key
touch .hmy/blskeys/bls.pass
[RPCOpt]
  RequestsPerSecond = 50000
./harmony --run=explorer --run.archive --run.shard=0 --db_dir=./
sudo vi /etc/systemd/system/harmony.service
[Unit]
Description=Harmony daemon
After=network-online.target

[Service]
Type=simple
Restart=always
RestartSec=1
User=harmony
WorkingDirectory=/home/harmony
ExecStart=/home/harmony/harmony -c harmony.conf
SyslogIdentifier=harmony
StartLimitInterval=0
LimitNOFILE=65536
LimitNPROC=65536

[Install]
WantedBy=multi-user.target
sudo chmod 755 /etc/systemd/system/harmony.service
sudo systemctl enable harmony.service
sudo service harmony start
sudo service harmony status
sudo service harmony restart
sudo service harmony stop