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:

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

Check the node binary version that was downloaded:

./harmony -V

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

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)

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.

Non-Validating/Explorer Nodes

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

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:

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 Checking A Node.

Last updated

Was this helpful?