User Tools

Site Tools


The Sia Daemon

The Sia daemon (called siad) is a system process (or background process) that does all of the heavy lifting for Sia. The daemon downloads the blockchain, uploads files, manages redundancy, monitors hosts for uptime, to name a few of the many tasks that it performs.

The daemon is composed of modules, and each modules provides a set of primary functions on the network. Here is a list and description of the major modules:

  • gateway: Manages the Sia peer network. Finds and connects to peers. Responsible for propagating blocks and transactions.
  • consensus: Accepts and verifies blocks. Keeps track of the longest chain, and notifies other modules when the longest chain has updated to a new longest chain. New valid blocks are sent to the gateway to be propagated around the network
  • transactionpool: Accepts and verifies new, unconfirmed transactions. The set of unconfirmed transactions can be queried by other modules.
  • wallet: Can create addresses and keys for the user. Keeps track of all money that the user has received, and sends money to other users at the user's request.
  • renter: Responsible for uploading data to the network. Will create contracts with hosts, monitor hosts, and restore file redundancy if hosts go offline or become unreliable.
  • host: Accepts contracts from the renter and stores data locally. Receives payment for keeping other users files.

Most of the modules have persistent data - files that need to be saved and loaded every time the daemon is restarted. The daemon itself will use whatever directory it is run from to create the persistent files. To move the daemon from one directory to another, you only need to copy or move the folder to the desired location. The files are cross platform, and can be copied even between operating systems. Note that you should not run two daemons at the same time from the same persist data, including persist data that has been copied to new machines. You should also try to avoid using old persist data to run a daemon. If your machine crashes, you should use the recovery tools provided by the CLI and UI instead of just copying in old persist data.

The UI will always run the daemon from the user's app folder. This folder is in different places on different operating systems:

  • Linux: $HOME/.config/Sia-UI/sia
  • Windows: %APPDATA%\Sia-UI\sia
  • Mac / OS X: $HOME/Library/Application Support/Sia-UI/sia (this Library folder may be hidden, one of the trick is pressing ALT while clicking on top Go menu, so that Library appears in the list)
daemon.txt · Last modified: 2017/03/24 20:55 by Luke Champine