(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:
Mainnet
Testnet
1
curl -LO https://harmony.one/node.sh && chmod +x node.sh
2
./node.sh -d && mv staging/* ./
Copied!
1
curl -LO https://harmony.one/node.sh && chmod +x node.sh
2
./node.sh -d -N testnet && mv staging/* ./
Copied!
Check the node binary and node.sh version that was downloaded:
1
./harmony -V
2
./node.sh -v
Copied!

2. Setup Node.sh

You can run your the node using flags parsing:
Mainnet
Testnet
1
./node.sh -D -S -z
Copied!
1
node.sh -D -S -z -N testnet
Copied!
A full list of active flags as well as examples can be access through running node.sh with --help option:
1
./node.sh --help
Copied!
Output:
1
Usage: node.sh [options]
2
3
Options:
4
-c back up database/logs and start clean (not for mainnet)
5
(use only when directed by Harmony)
6
-C disable interactive console for bls passphrase (default: enabled)
7
-1 do not loop; run once and exit
8
-h print this help and exit
9
-k KEYFILE use the given BLS key files
10
-s run setup env only (must run as root)
11
-S run the node.sh as non-root user (default: run as root)
12
-p passfile use the given BLS passphrase file
13
-d just download the Harmony binaries (default: off)
14
-D do not download Harmony binaries (default: download when start)
15
-N network join the given network (mainnet, testnet, staking, partner, stress, devnet, tnet; default: mainnet)
16
-n port specify the public base port of the node (default: 9000)
17
-T nodetype specify the node type (validator, explorer; default: validator)
18
-i shardid specify the shard id (valid only with explorer node; default: 1)
19
-a dbfile specify the db file to download (default:off)
20
-U FOLDER specify the upgrade folder to download binaries
21
-P enable public rpc end point (default:off)
22
-v print out the version of the node.sh
23
-V print out the version of the Harmony binary
24
-z run in staking mode
25
-y run in legacy, foundational-node mode (default)
26
-Y verify the signature of the downloaded binaries (default: off)
27
-m minpeer specify minpeers for bootstrap (default: 6)
28
-f blsfolder folder that stores the bls keys and corresponding passphrases (default: ./.hmy/blskeys)
29
-A enable archival node mode (default: off)
30
-B blacklist specify file containing blacklisted accounts as a newline delimited file (default: ./.hmy/blacklist.txt)
31
-r address start a pprof profiling server listening on the specified address
32
-I use statically linked Harmony binary (default: true)
33
-R tracefile enable p2p trace using tracefile (default: off)
34
-l limit broadcasting of invalid transactions (default: off)
35
-L log_level logging verbosity: 0=silent, 1=error, 2=warn, 3=info, 4=debug, 5=detail (default: 3)
36
37
Examples:
38
39
# start node program with all key/passphrase under .hmy/blskeys
40
# first try to unlock account with .pass file. If pass file not exist or cannot decrypt, prompt to get passphrase.
41
node.sh -S
42
43
# start node program w/o accounts
44
node.sh -S -k mybls1.key,mybls2.key
45
46
# download beacon chain (shard0) db snapshot
47
node.sh -i 0 -b
48
49
# just re-download the harmony binaries
50
node.sh -d
51
52
# start a non-validating node in shard 1
53
# you need to have a dummy BLSKEY/pass file using 'touch BLSKEY; touch blspass'
54
node.sh -S -k BLSKEY -p blspass -T explorer -i 1
55
56
# upgrade harmony binaries from specified repo
57
node.sh -1 -U upgrade
58
59
# start the node in a different port 9010
60
node.sh -n 9010
61
62
# multi-bls: specify folder that contains bls keys
63
node.sh -S -f /home/xyz/myfolder
64
65
# multi-bls using default passphrase: place all keys under .hmy/blskeys
66
# supply passphrase file using -p option (single passphrase will be used for all bls keys)
67
node.sh -S -p blspass.txt
68
69
# disable interactive console for passphrase (prepare .pass file before running command)
70
node.sh -S -C
Copied!

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:
1
sudo vi /etc/systemd/system/harmony.service
Copied!
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.
1
[Unit]
2
Description=Harmony daemon
3
After=network-online.target
4
5
[Service]
6
Type=simple
7
Restart=always
8
RestartSec=1
9
User=harmony
10
WorkingDirectory=/home/harmony
11
ExecStart=/home/harmony/node.sh -D -S -z
12
SyslogIdentifier=harmony
13
StartLimitInterval=0
14
LimitNOFILE=65536
15
LimitNPROC=65536
16
17
[Install]
18
WantedBy=multi-user.target
Copied!
Give the necessary permissions to run the daemon service, enable it and start it:
1
sudo chmod 755 /etc/systemd/system/harmony.service
2
sudo systemctl enable harmony.service
3
sudo service harmony start
Copied!
If you want to check the status of the daemon you can use:
1
sudo service harmony status
Copied!
To restart, or stop the service daemon you can run:
Restart
Stop
1
sudo service harmony restart
Copied!
1
sudo service harmony stop
Copied!
To check your node follow instructions on Checking A Node.