Using Node Binary
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 harmonycurl -LO https://harmony.one/binary && mv binary harmony && chmod +x harmonycurl -LO https://harmony.one/binary-arm64 && mv binary-arm64 harmony && chmod +x harmonyCheck the node binary version that was downloaded:
./harmony -VThe 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
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**:**
Dump the default config.
Customize the config file.
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
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 here for Explorer Node requirements.
Check here for instructions on how to sync your node in archival mode.
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
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
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?