Skip to main content

Hathor core (full node) CLI

Usage

run_node [OPTIONS] [ARGS] --status [HTTP_API_PORT]

The command is callable from a docker environment as well as through the hathor-cli. The HTTP API port must be informed to --status parameter.

Options

info

Wallet parameters bold-highlighted have been created for testing purposes. It is not recommended to use them in a production environment.

TextDescription
--cacheUse cache for storing transactions.
--cache-sizeNumber of transactions to keep on cache.
--cache-intervalCache flush interval.
--stratum [port]Stratum server. Inform the stratum server port as an argument.
--memory-storageStore the full-node data in memory.
--data [dir]Directory where the full node will store all data (blocks and transactions) synchronized with the Hathor network.
--testnetConnect the full-node to the Hathor testnet.
--test-mode-tx-weightReduces the transaction weight to 1 for testing purposes.
--hostname [host]Hostname used to be accessed by other peers.
--auto-hostnameTry to discover the hostname automatically.
--unsafe-modeEnable unsafe parameters. It shouldn't be used in a production environment.
--dnsDNS URL to search for peers to connect. It will extend what's in the configuration file, not substitute.
--peer [file]Json file with peer info.
--listen [addr]Address to listen for new connections (eg: tcp:8000).
--bootstrap [addr]Address to connect to (eg: tcp:127.0.0.1:8000).
--status [port]Port to run status server.
--rocksdb-storageUse RocksDB storage backend
--old-rocksdb-storageUse old RocksDB storage backend (deprecated)
--json-storageUse legacy JSON storage (not recommended).
--rocksdb-cacheRocksDB block-table cache size (bytes).
--walletSet wallet type. Options are 'hd' (Hierarchical Deterministic) or 'keypair'.
--wallet-enable-apiEnable wallet API. Must be used with --wallet.
--wordsWords used to generate the seed for HD Wallet.
--passphrasePassphrase used to generate the seed for HD wallet.
--unlock-walletAsk for password to unlock wallet.
--wallet-indexCreate an index of transactions by address and allow searching queries.
--prometheusSend metric data to Prometheus.
--recursion-limitSet python recursion limit.
--allow-mining-without-peersAllow mining without peers.
--x-full-verificationFully validate the local database.
--x-fast-init-betaExecute a fast initialization, which skip some transactions verification. This is a beta fetaure as it may cause issues when restarting the full node after a crash.
--procname-prefixAdd a prefix to the process name
--alow-non-standard-scriptAccept non-standard scripts on /push-tx API.
--max-output-script-sizeCustom max accepted script size.
--sentry-dsnOptional sentry DSN number to send errors to Sentry.
--enable-debug-apiEnable debug endpoints.
--enable-crash-apiEnable crash endpoints.
--x-localhost-onlyOnly connect to peers on localhost.

Examples

To run the full node

  • with RocksDB as storage;
  • with a cache of 100.000 transactions (about 8GB of RAM);
  • with /data as data directory;
  • with the peer id stored in a peer_id.json file;
  • connecting to the mainnet:
poetry run hathor-cli run_node --status 8080 --cache --cache-size 100000 --wallet-index --peer peer_id.json --data /data

To run the full node with memory as storage and connect to the testnet:

poetry run hathor-cli run_node --status 8080 --memory-storage --testnet