Get started with Sia downloading and starting a Sia Daemon via command line on an Ubuntu Server.
Today I started a Sia Daemon on my VPS. During the entire process I encountered some problems, so I decided to share this document with you.
You can start a Sia Daemon as a root user, but is a good practise to create a dedicated user. So before starting, let's create a user called sia.
Now, it is time to download the latest version of Sia. Visit the site Sia.tech, find and copy the link to the latest Sia Daemon package for Linux and download the file on the server via wget and unpack the zip.
Rename the unzipped folder choosing a fancy name :P
mv Sia-v1.3.7-linux-amd64/ sia-daemon/
Now you have all you need on your server and you can start playing with Sia. First at all, it is necessary to start the sia daemon. You can do this in different ways.
- Just start a process in background, without any supervisor:
./siad -M gctwh &
- Create and run a service with systemd:
Create the systemd file.
sudo vim /etc/systemd/system/sia-daemon.service
Copy and paste the following snippet into the file and save it.
Description=Sia Daemon After=network.target [Service] Type=simple ExecStart=/home/sia/sia-daemon/siad -M gctwh ExecStop=/home/sia/sia-daemon/siac stop WorkingDirectory=/home/sia/sia-daemon/ Restart=always RestartSec=10 User=sia Nice=2 [Install] WantedBy=multi-user.target Alias=siad.service
Finally, start the sia-daemon service entering:
systemctl start sia-daemon.service
Sia should be running as a service and you should be able to use the command-line client. To check sia-daemon.service status use:
systemctl status sia-daemon.service
To check that everthing works correctly, enter:
and you should see something like:
Progress (estimated): 80.2%
You can now start playing with Sia. To dispaly the documentation type:
Sia can be launched with different modules. To display information about modules, enter:
You should see something similar:
Modules are independent components of Sia. This flag should only be used by developers or people who want to reduce overhead from unused modules. Modules are specified by their first letter. If the -M or --modules flag is not specified the default modules are run.
The default modules are:
gateway, consensus set, host, miner, renter, transaction pool, wallet
This is equivalent to:
siad -M cghmrtw
Below is a list of all the modules available.
The gateway maintains a peer to peer connection to the network and
enables other modules to perform RPC calls on peers.
The gateway is required by all other modules.
siad -M g
Consensus Set (c):
The consensus set manages everything related to consensus and keeps the
blockchain in sync with the rest of the network.
The consensus set requires the gateway.
siad -M gc
Transaction Pool (t):
The transaction pool manages unconfirmed transactions.
The transaction pool requires the consensus set.
siad -M gct
The wallet stores and manages siacoins and siafunds.
The wallet requires the consensus set and transaction pool.
siad -M gctw
The renter manages the user's files on the network.
The renter requires the consensus set, transaction pool, and wallet.
siad -M gctwr
The host provides storage from local disks to the network. The host
negotiates file contracts with remote renters to earn money for storing
other users' files.
The host requires the consensus set, transaction pool, and wallet.
siad -M gctwh
The miner provides a basic CPU mining implementation as well as an API
for external miners to use.
The miner requires the consensus set, transaction pool, and wallet.
siad -M gctwm
The explorer provides statistics about the blockchain and can be
queried for information about specific transactions or other objects on
The explorer requires the consenus set.
siad -M gce
This is the reason why we started sia with
./siad -M gctwh.