Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
AutoNode allows you to spin up a node seamlessly and automate common validator actions.
Quick start to running a Harmony Validator.
auto-node killauto-node updateauto-node runauto-node hmy-updatepython3 -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>--helpauto-node --help.auto-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 0new_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 create-validatorauto-node edit-configauto-node deactivateauto-node activatevim $HOME/harmony_node/latest/zero*.logauto-node node journal -eauto-node monitor journal -e./hmy utility metadata./hmy --node="https://api.s0.t.hmny.io" blockchain latest-headers./hmy --node="https://api.s0.b.hmny.io" blockchain latest-headers./hmy blockchain latest-headerscurl -LO https://harmony.one/node.sh && chmod +x node.sh
curl -LO https://harmony.one/node.sh && chmod +x node.sh
./node.sh -D -S -znode.sh -D -S -z -N testnetcurl -LO https://harmony.one/node.sh && chmod +x node.sh
curl -LO https://harmony.one/node.sh && chmod +x node.sh
sudo service harmony restartsudo service harmony stop./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 stopmkdir -p backupcp {node.sh,harmony} backup./harmony -V
./node.sh -vsudo service harmony restartauto-node run<ONE-address>.passmv ./path/to/<ONE-address>.pass ~/harmony_wallet_pass/<ONE-address>.passauto-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> --passphrasebackupcurl -LO https://harmony.one/binary && mv binary harmony curl -LO https://harmony.one/binary_testnet && mv binary_testnet harmony mkdir -p backupcp harmony backup./harmony -Vsudo service harmony restartauto-node monitor logauto-node tui runauto-node node statusauto-node node logauto-node monitor restartauto-node tui updatecurl -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
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.py