Getting Started
Configuration
Daemon

Introduction

The daemon is the core service that runs the XELIS blockchain on your machine. It is responsible for maintaining a full copy of the distributed ledger, validating incoming blocks, and relaying transactions across the network.

When the daemon is running, your node actively participates in the XELIS peer-to-peer system, helping to secure the network and keep it synchronized in real time.

The daemon also provides the foundation for other components, such as the wallet and the miner, by exposing an interface through which they can interact with the blockchain. Running the daemon is an essential step for users who want to operate a full node, mine directly on the network, or simply ensure they are working with the most up-to-date state of the chain.

Running a local node is highly recommended, as it ensures you remain fully trustless and independent of third parties, enhances your privacy, and helps spread and secure the XELIS network.

Configuration

Run ./xelis_daemon --help to see all available options.

Network

Network selected by default is mainnet.
Available values are mainnet, testnet and dev.

Example: ./xelis_daemon --network testnet.

Boost Sync Mode

Boost sync mode syncs the full blockchain faster by requesting blocks in parallel during synchronization. It is not enabled by default as it requires more system resources.

To enable it, use: ./xelis_daemon --allow-boost-sync.

Fast Sync Mode

Fast sync mode downloads the last chain state from any peer.
It allows having a light node with very light disk usage as it will use only the latest available data.

To enable it, use: ./xelis_daemon --allow-fast-sync.

Auto Pruning

Enable the auto prune mode and prune the chain at each new block by keeping at least N blocks before the top block. This is useful to keep a light node and to reduce the disk usage.

To keep only 1000 latest blocks: ./xelis_daemon --auto-prune-keep-n-blocks 1000.

Cache Size

The cache size determines how many elements to keep in memory. Higher cache size will require more memory but can be useful for chain operations.

Default is set to 1024 elements. If you set it to 0, it will disable the cache and will not keep any.

To set the cache size to 1000: ./xelis_daemon --cache-size 1000.

Disable P2P Server

Disable the P2P server, this will prevent the node from connecting to other nodes. With P2P disabled, the node will not be able to sync the chain or broadcast mined blocks.

To disable the P2P Server, use: ./xelis_daemon --disable-p2p-server.

Disable RPC Server

Disable RPC Server, this will also disable the GetWork Server as it is loaded on RPC server

To disable the RPC Server, use: ./xelis_daemon --disable-rpc-server.

P2p Bind Address

Set the bind address to use for the P2P server. By default, the bind address is set to 0.0.0.0:2125.

To set the bind address to 0.0.0.0:2126, use: ./xelis_daemon --p2p-bind-address 0.0.0.0:2126.

Max Peers

Set the maximum number of P2P peers to connect to.
By default, the maximum number of peers is set to 32.

To set the maximum number of peers to 64, use: ./xelis_daemon --max-peers 64.

Exclusive Nodes

Set exclusive nodes to connect to. This will only connect to the given nodes and will not connect to any other nodes.
Each Socket Address must be separated by a comma.

Example to connect to two nodes: ./xelis_daemon --exclusive-nodes 0.0.0.0:2125,0.0.0.0:2126.

Priority Nodes

Gives certain nodes a higher connection priority. Connections will be made with priority nodes first, and then connections will be made with regular nodes.
Connections to priority nodes will be also maintained in case of disconnection.
Each Socket Address must be separated by a comma.

Other nodes will still be connected to as long as the maximum number of peers is not reached.

Example to connect to two nodes: ./xelis_daemon --priority-nodes 0.0.0.0:2125,0.0.0.0:2126

Tag

Set the tag to use for the node. This is useful to identify the node in the network. Maximum length is 16 characters.

To set the tag to mytag: ./xelis_daemon --tag mytag.

Maximum Chain Response Size

Configure the maximum chain response size. This is useful for low end devices who want to reduce resources usage and also for high-end devices who want to (or help others to) sync faster.

By default, the maximum chain response size is set to 4096.
Minimum value is 512 and maximum value is 16384.

This is used to notify others nodes about the maximum size of the chain response that you accept to receive / send per request. It can speedup the synchronization process by allowing to send more data at once.

The lowest value available between two node will be used.

To set the maximum chain response size to 8192: ./xelis_daemon --max-chain-response-size 8192.

Disable IP Sharing

Ask peers to not share your IP to others and/or through API.
This is useful for people that don't want their IP to be revealed in RPC API and/or shared to others nodes as a potential new peer to connect to.

By default, your IP is allowed to be shared across the network to others nodes.
To enable it, use: ./xelis_daemon --disable-ip-sharing.

Please note that it may prevent to have new incoming peers as your IP will not be shared to others.

Disable P2P Outgoing Connections

Disable P2P outgoing connections from peers. This is useful for seed nodes under heavy load or for nodes that don't want to connect to others.

To disable, use: ./xelis_daemon --disable-p2p-outgoing-connections.

P2P Concurrency Task Count Limit

Limit of concurrent tasks accepting new incoming connections. Default to 4.

To set limit, use: ./xelis_daemon --p2p-concurrency-task-count-limit 4.

Disable File Logging

By default, the daemon logs to a file. To disable logging, use: ./xelis_daemon --disable-file-logging.

Disable Date-Based File Log Naming

Disable date-based file naming for logs. If disabled, the log file will be named xelis-daemon.log instead of YYYY-MM-DD.xelis-daemon.log

To disable, use: ./xelis_daemon --disable-file-log-date-based.

Disable Log Colors

Disable the usage of colors in the log.

To disable, use: ./xelis_daemon --disable-log-color.

Disable Interactive Mode

Disable terminal interactive mode. You will not be able to write CLI commands in it or have an updated prompt.

To disable, use: ./xelis_daemon --disable-interactive-mode.

Log Filename

Set a custom log file name. By default, the filename is set to xelis-daemon.log.
Log file are stored in the logs folder and are named with the date of the day.

To set the filename to mylog.log, use: ./xelis_daemon --filename-log mylog.log.

Logs Dir Path

Set a custom directory path to store the logs files.
By default it will be logs/ of the current directory.

To set the path to mylogs/, use: ./xelis_daemon --logs-path mylogs/.

NOTE: The directory will be created using the provided path if it does not exist. The path must end with a /.

Logs Modules

Module configuration for logs.

To set, use: ./xelis_daemon --logs-modules module_name=off.

Log Level

Set the log level to use. Available values are trace, debug, info, warn, error.

By default, the log level is set to info.

To set the log level to debug: ./xelis_daemon --log-level debug.

File Log Level

Set the file log level to use. Available values are trace, debug, info, warn, error.

This is useful to have a different log level for the file log than the console log.

By default, the file log level is set to value passed to --log-level (which is also info by default).

To set the file log level to debug: ./xelis_daemon --file-log-level debug.

Disable GetWork Server

Disable the GetWork server, this will disable the HTTP server running above the RPC Server and will prevent miners from connecting and receive new jobs.

To disable the GetWork server, use: ./xelis_daemon --disable-getwork-server.

RPC Bind Address

Set the bind address to use for the RPC server. By default, the bind address is set to 0.0.0.0:8080.

To set the bind address to 0.0.0.0:8081, use: ./xelis_daemon --rpc-bind-address 0.0.0.0:8081.

Dir Path

Set the directory path to use for the database and the blockchain. By default, the directory path is set to the name of the network at the same location of the executable.

To set the directory path to mydir, use: ./xelis_daemon --dir-path mydir.

Simulator

Enable the simulator mode. This will disable the P2P server and will simulate the blockchain based on its variant. This will generate new blocks when necessary and will not connect to any other nodes.

Available values are:

  • blockchain: to simulate the blockchain with a new block every 15 seconds and up to 15 random transactions.
  • blockdag: to simulate the blockdag with up to 3 new block every 15 seconds and up to 15 random transactions.
  • stress: to simulate a blockDAG under attacks with heavy blocks and a lot of transactions.

To enable the stress simulator mode, use: ./xelis_daemon --simulator stress.

Skip POW Verification

Skip PoW verification. Warning: This is dangerous and should not be used in production.

To skip verification, use: ./xelis_daemon --skip-pow-verification.

Version

Print the daemon version.

To print the version, use: ./xelis_daemon --version.

Internal DB cache size

Set the internal DB cache size to use for the daemon. By default, the cache size is set to 16 MB.

This is useful to speed up the I/O database operations.

To set the cache size to 32 MB, you must provide the bytes count to use: ./xelis_daemon --internal-cache-size 33554432.

Internal DB mode

Set the internal DB mode to use for the daemon. By default, the mode is set to slow-space.

Availale values are:

  • slow-space: to use the slowest mode with the smallest space usage by rewriting (if needed) few times the data to defragment the database.
  • high-throughput: to use the fastest mode to have the best performance but may provide bigger space usage.

To set the mode to high-throughput, use: ./xelis_daemon --internal-db-mode high-throughput.

Skip block template TXs verification

Disable the (double) verification of the transactions while building a block template. This is useful to speed up the block template creation for miners node.

This will rely entirely on the transaction verification done by the mempool and will not verify the transactions again.

To skip verification, use: ./xelis_daemon --skip-block-template-txs-verification.

NOTE: In case of a TX not deleted correctly from the mempool, it may be included in a block template and will make your block rejected by the network.