Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
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.
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
vimpart 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
--saveoption will make it persistant. If you do not have the--saveoption, 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.
ls $HOME/.hmy/*.logvim $HOME/harmony_node/latest/zero*.logauto-node node log
auto-node node statusdf -H auto-node kill
auto-node run <params>auto-node killauto-node run --expose-rpcauto-node node restartauto-node node statusauto-node node versionauto-node monitor restartauto-node monitor statusauto-node auth-walletauto-node tune kernel --saveauto-node tune network --saveauto-node tune restoreauto-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.pyThis 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.
Quick start to running a Harmony Validator.
This option is deprecated and is not supported anymore. Please setup your node Using Node Binary.
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 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
~/.bashrcprofile.
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-nodedoes 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 .
BE CAREFULL WITH RAW WALLET PRIVATE KEYS!!!
You can use the following command to list all of the loaded wallets:
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
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 .passfiles will also be attempted to be used when launching a node
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:
--shard (your shard number here) to run a node for a specific shardUse --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
new_user_name=<new-user-name>
sudo adduser $new_user_namesudo adduser $new_user_name sudo
sudo loginctl enable-linger $new_user_namesudo 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_keysssh -i "key.pem" <new-user-name>@your-server.comsu - <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:~/binauto-node hmy keys add example-validator-wallet-nameauto-node hmy keys import-ks <path-to-keystore-file>auto-node hmy keys import-private-key <private-key-string>auto-node hmy keys listauto-node run --clean --fast-syncauto-node run --clean --fast-sync --auto-active \
--network testnet --beacon-endpoint https://api.s0.b.hmny.io/ --shard 0auto-node create-validatorpython3 -c "from AutoNode import common; print(common.bls_key_dir)"auto-node bls-shard <public-bls-key>auto-node cleanse-blsauto-node cleanse-bls --keep-shardauto-node cleanse-bls --hardauto-node remove-bls <public-bls-key>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 .
sudo service harmony stopcurl -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 backupcp {node.sh,harmony} backup./harmony -V
./node.sh -vsudo service harmony restartYou 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
--cleanor--fast-syncas it will probably regress your block hight (since it edits the DB files).
For your convenience, AutoNode wraps the hmy CLI. You can update it 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:
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+XthenY.
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:
The Harmony Node is ran as a , you can inspect the logs for the service 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:
Get your ONEs for validating!
You can simply collect rewards for your validator with the following command:
auto-node collect-rewardsIf 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.
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.
auto-node killauto-node updateauto-node runauto-node hmy-updateauto-node monitor logauto-node tui runauto-node node statusauto-node node logauto-node monitor restartauto-node tui updateauto-node edit-configAutoNode 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!
auto-node balancesvalidator_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>.passmv ./path/to/<ONE-address>.pass ~/harmony_wallet_pass/<ONE-address>.passBackup the harmony binary file:
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_testnet && mv binary_testnet harmony && chmod +x harmonyCheck the node binary version that was downloaded:
To check your node follow instructions on Checking A Node.
The upgrade process is the same as above
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-headersFor 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 deactivateauto-node activatevim $HOME/harmony_node/latest/zero*.logauto-node node journal -eauto-node monitor journal -emkdir -p backupcp harmony backup./harmony -Vsudo service harmony restart./hmy utility metadata./hmy blockchain latest-headersThis option is deprecated and is not supported anymore. Please setup your node Using Node Binary.
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:
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 testnetcurl -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 --helpUsage: 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 -Csudo 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.targetsudo chmod 755 /etc/systemd/system/harmony.service
sudo systemctl enable harmony.service
sudo service harmony startsudo service harmony statussudo service harmony restartsudo service harmony stop
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 ().
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:
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 for Explorer Node requirements.
Check 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:
Alternatively, you can also run it using flag parsing:
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 .
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 harmony./harmony -V./harmony config dump harmony.conf./harmony config dump --network testnet harmony.confVersion = "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 --helpExamples 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.targetsudo chmod 755 /etc/systemd/system/harmony.service
sudo systemctl enable harmony.service
sudo service harmony startsudo service harmony statussudo service harmony restartsudo service harmony stop