Sia Docs
GithubDiscordYouTubeBlogsRedditForum
Legacy
Legacy
  • Welcome to Sia!
  • Get Started with Sia
    • Introduction to these docs
    • Sia 101
    • What are Siacoins?
    • How to buy Siacoins
    • What is the Siacoin total supply?
  • Your Sia Wallet
    • Wallet overview
    • The importance of your seed
    • How to make a Sia address
    • How to send Siacoins
    • How do I change my Sia wallet password?
    • Back up your Sia wallet
    • Wallet troubleshooting
      • Delete your seed and make a new one
      • Find or fix your seed
      • I lost my seed. What do I do?
      • My deposit or withdrawal didn't go through
      • Why does Sia take so long to sync?
      • What are these deductions in my wallet?
      • Why does Sia-UI give me a new address each time I click Receive Siacoin?
    • Sia-UI FAQs
      • How to download and install Sia-UI
      • How to make a new wallet in Sia-UI
      • How to restore a wallet from a seed in Sia-UI
      • How to perform a clean install in Sia-UI
      • How do I uninstall Sia-UI?
    • For Advanced Users
      • Verify the Sia release signature
      • Using Sia on a remote node
      • Using Sia on multiple computers
      • How to bootstrap the Sia blockchain
      • How to automatically restart and unlock Sia
      • How to set an environment variable
    • 🚧walletd
      • Wallet overview
  • Renting
    • About renting on Sia
    • Managing your files
    • How to rent storage on Sia
    • How to back up and restore your files
    • Renter troubleshooting
    • Is my data secure?
    • 🚧renterd
      • About renting on Sia
      • renterd Workshop
  • Hosting
    • About hosting on Sia
    • Hosting with the Sia-UI GUI
    • Hosting with the siad CLI on Linux
    • Hosting FAQ
    • 🚧hostd
      • About hosting on Sia
      • Setup Guides
        • Linux
        • macOS
        • Windows
      • Dynamic DNS
        • DuckDNS
        • Cloudflare (Advanced)
  • Mining
    • About mining on Sia
    • Sia mining pools
  • Contributing
    • How can I contribute to Sia?
    • Where can I learn more about Sia?
  • Siafunds
    • What are Siafunds?
    • How do I buy Siafunds?
    • How to cash out Siafunds
    • SEC Settlement FAQ
  • Sia Integrations
    • Listing Siacoin on your exchange
    • Using the Sia Ledger app with Sia Central
    • Using the Sia Ledger Nano app with CLI
    • Brand guidelines for Sia in your project or site
  • Testnet
    • What is Zen?
  • Forks
    • Using the wrong chain after a fork
    • Navigating the 2021 Sia hardfork
    • So, you didn't update in time for the fork
Powered by GitBook
On this page
  • Set the environment variable
  • Set your computer to automatically reboot after a power failure
  • Set your user to automatically login on startup
  • Set Sia as a startup item
  • Creating a systemd service on Ubuntu

Was this helpful?

Edit on GitHub
  1. Your Sia Wallet
  2. For Advanced Users

How to automatically restart and unlock Sia

PreviousHow to bootstrap the Sia blockchainNextHow to set an environment variable

Last updated 1 year ago

Was this helpful?

When your Sia wallet is locked, it isn't able to perform common and important tasks. For renters, this might mean new contract formation or renewing your allowance. For hosts, it would mean downtime that affects your host scoring and the collateral you've put into contracts.

You can have your Sia wallet automatically unlock by setting up a few simple steps.

Set the environment variable

An environment variable is just a piece of information that is specific to your computer. In this case, it's your Sia wallet password, so you'll set an environment variable named SIA_WALLET_PASSWORD.

Environment variables are accessible by any program on your computer. If you still use your Sia seed to unlock your wallet instead of a custom password, you should change this before entering your Sia seed into the environment variable. Someone with access to your seed can easily steal your Siacoins and access your files. Learn how to set a custom password.

Set your computer to automatically reboot after a power failure

Everything we do here won't matter much if you physically need to reboot your machine after it loses power. At that point, you could just launch Sia again on your own. This setting will allow your computer to reboot automatically anytime its power is interrupted.

  • (done through your BIOS, complete with instructions for connecting to an APC for smooth power-downs and startups)

  • (only applicable to certain models)

Set your user to automatically login on startup

Your computer needs to automatically log in to your user after it reboots. Follow these steps depending on your OS.

Set Sia as a startup item

Now that your computer will automatically login after startup, you need to make sure that Sia will launch on its own after that happens. Follow one of these options:

  • Visit one of the following links to learn how to setup Sia as a startup item. Once all these steps are set, reboot your computer and verify that your account logs in, Sia starts, and your wallet unlocks automatically.

  • If you are using Linux Ubuntu and are comfortable with the command line, you can follow the systemd service setup guide featured in the next section.

Creating a systemd service on Ubuntu

By creating a systemd file we can start Sia whenever the computer is booted instead of starting it manually. Run the following command to create a new systemd unit file:

$ sudo nano /etc/systemd/system/siad.service

Then, modify the following snippet to fit your host and then paste it into the file. You will want to change asecurewalletpassword to a more secure wallet password.

[Unit]
Description=siad
After=network.target

[Service]
Type=simple
ExecStart=/usr/local/bin/siad -M gctwh -d /home/ubuntu/siad
ExecStop=/usr/local/bin/siac stop
Restart=always
RestartSec=15
User=ubuntu 
Environment="SIA_WALLET_PASSWORD=asecurewalletpassword"
LimitNOFILE=900000

[Install]
WantedBy=multi-user.target
Alias=siad.service
$ sudo systemctl start siad
$ sudo systemctl enable siad

Your Sia node should now be running and accessible. You can try out a few commands to test it:

$ siac consensus
Synced: No
Height: 0
Progress (estimated): 0.0%
$ siac gateway
Address: localhost:9981
Active peers: 0
Max download speed: 0
Max upload speed: 0

How do I set an environment variable?
Windows and Linux
Mac
Windows
Mac
Linux - Ubuntu
Linux - other distros
Windows
Mac
Linux - Ubuntu
Linux - other distros