Tag Archives: Siad -daemon

How to run Siad as a background service in Ubuntu server

Configure a service that allow siad to run on boot (and restart in case of crashed):

    • Assume that you already install Sia Core and ./siad is operational (i.e. you can run command ./siad to start Sia application)
    • Stop siad process.
    • Create a file named: siad.service at a folder you need. In the below example, you create file siad.service in folder /home/your-user-name/config/services
      • $ mkdir config && cd config && mkdir services && cd services
      • $ sudo nano siad.service
      • Add these lines to siad.service file:

        Description=Sia Daemon
         
        [Service]
        ExecStart=/home/your-user-name/path-to-sia-storing-folder/siad
        WorkingDirectory=/home/your-user-name/path-to-sia-storing-folder/
        Restart=always
         
        [Install]
        WantedBy=multi-user.target
        Alias=siad.service
    • Save file and exit to root user.
    • Configure firewall (if ufw is in use):
      • $ ufw allow 9982
    • Start siad as a service:
      • $ systemctl daemon-reload
      • $ systemctl enable ~/.config/systemd/siad.service
      • $ systemctl start siad.service
  • Sia should now be running as a service which can be confirmed/verifyed with:
Advertisements

Install and run SIA (for SiaCoin – SC) in Ubuntu 16.04

  • Run SIA:
    • $ ./siad
    • While ./siad running, it will take several hours to download all blockchain.
    • You can confirm siad is running by querying its API:
    • You should see something like this:  {“synced”:false,“height”:29731,”currentblock”:”0000045c26825f0d”,”target”:[0,0,0,0,0,1,137,1]}
    • Compare downloaded block height with the real total block height to calculate blockchain downloading progress. Total block height of SiaCoin available at: https://explore.sia.tech/
    • Keep ./siad running until it downloads all blockchain. When the consensus endpoints returns {“synced”: true} the blockchain download is completed.
  • Run SIA in background:
    • $ ./siad & (note: the app will also be closed if ssh terminal is closed)
    • see this to run siad as a service.
  • Configure the host for now do not take any contracts (can do this only while ./siad is running):
    • $ ./siac host config acceptingcontracts false
  • Create SiaCoin Wallet and Wallet Address:
    • While siad is running,
    • Create new wallet:
      • $ ./siac wallet init
      • (Save your recovery seed and wallet encrypted password for later use)
    • Or use an existing wallet:
      • $ ./siac wallet load
    • Unlock wallet:
      • $ ./siac wallet unlock
    • Create a new wallet address
      • $ ./siac wallet address
      • (Save wallet address for later use)
  • Show current Sia Wallet address/balance (need to unlock first):
    • $ ./siac wallet addresses
    • $ ./siac wallet balance

* Note: SIA Client has versions for both Windows and Linux.