-
Notifications
You must be signed in to change notification settings - Fork 0
Install Linux Daemon
In the following a description on how to install Alias daemon and UI wallet.
The following documentation is based on an Ubuntu 20.04 installation named myStaker
and should easily be adoptable to other x86-64 Linux systems.
Please note the prompts before each command as they states as which user the commands should be executed.
This documentation should also be usable on Raspberry Pi systems, as long as they are based on 64Bit Raspberry Pi OS. All of the cmds below, which are executed as root
, needs to be prefixed with sudo
to gain proper permissions. The default account on a Raspberry Pi OS is pi
.
Update package lists and update system:
root@myStaker:~# apt-get update -y && apt-get upgrade -y
Install some dependencies and convenience tools:
root@myStaker:~# apt-get install -y --no-install-recommends \
bc \
ca-certificates \
curl \
dialog \
git \
jq \
mc \
tor \
unzip \
wget
Alias has only one requirement: Tor. All other packages are required for the installation or as they are used by the Shell-UI.
A Hint regarding Tor: The Tor version must be at least 0.4.x! You can check this on the cmdline with tor --version
. So i. e. if you're on Debian Stretch, you need to install Tor from Stretch-Backports as the default version is 0.3.x, which is too old.
To install the two binaries aliaswallet
(UI) and aliaswalletd
(daemon) just extract the downloaded archive on the filesystem root. The archive contains the proper directory structure, so the binaries will be located below /usr/local/bin/
. Please note to update the used download URL with the current download URL!
The binaries are static in the sense of their requirements but there are still dedicated versions for the supported Linux distribution. Don't forget to replace the download url below with the corresponding one for your system, you can find them on https://alias.cash/wallets
root@myStaker:~# cd /tmp/
root@myStaker:~# wget https://download.alias.cash/files/4.3.1/Alias-4.3.1-425be867-Ubuntu-20-04.tgz
root@myStaker:~# cd /
root@myStaker:~# sudo tar xzf /tmp/Alias-4.3.1-425be867-Ubuntu-20-04.tgz
To check if the daemon is working in general, just check it's version:
root@myStaker:~# aliaswalletd -version
v4.3.1...
At first we create the account, which should be used to run the wallet:
root@myStaker:~# groupadd staker
root@myStaker:~# useradd --create-home --shell /bin/bash --gid staker staker
root@myStaker:~# passwd staker
New password:
Retype new password:
passwd: password updated successfully
root@myStaker:~#
Clone the Shell-UI right from GitHub. Don't forget to switch to the staker
account!
root@myStaker:~# su - staker
staker@myStaker:~$ git clone https://github.com/aliascash/alias-sh-rpc-ui.git
Cloning into 'alias-sh-rpc-ui'...
remote: Enumerating objects: 14, done.
remote: Counting objects: 100% (14/14), done.
remote: Compressing objects: 100% (10/10), done.
remote: Total 1385 (delta 5), reused 8 (delta 3), pack-reused 1371
Receiving objects: 100% (1385/1385), 302.33 KiB | 702.00 KiB/s, done.
Resolving deltas: 100% (958/958), done.
staker@myStaker:~$
Create working directory with default configuration:
staker@myStaker:~$ mkdir .aliaswallet
staker@myStaker:~$ cp alias-sh-rpc-ui/sample_config_daemon/alias.conf .aliaswallet/
staker@myStaker:~$
Create aliases for easy ui handling and updating:
staker@myStaker:~$ echo "alias ui='~/alias-sh-rpc-ui/aliaswallet_rpc_ui.sh'" >> .bash_aliases
staker@myStaker:~$ echo "alias update-ui='cd ~/alias-sh-rpc-ui ; git reset --hard HEAD ; git pull ; cd -'" >> .bash_aliases
staker@myStaker:~$ echo "alias wallet-start='sudo systemctl start aliaswalletd'" >> .bash_aliases
staker@myStaker:~$ echo "alias wallet-stop='sudo systemctl stop aliaswalletd'" >> .bash_aliases
staker@myStaker:~$ echo "alias wallet-status='sudo systemctl status aliaswalletd'" >> .bash_aliases
After the next login as staker
you have the following aliases available:
-
ui
- Start the Shell-UI -
update-ui
- To update the Shell-UI itself (not the binaries!) -
wallet-start
- Start the Alias wallet daemon -
wallet-stop
- Stop the Alias wallet daemon -
wallet-status
- Check if the daemon is running
Don't worry if some of them fail at the moment. We're not finished with the setup! ;-)
Now download and extract the bootstrap blockchain:
staker@myStaker:~$ cd ~
staker@myStaker:~$ wget https://download.alias.cash/files/bootstrap/BootstrapChain.zip
...
staker@myStaker:~$ cd .aliaswallet/
staker@myStaker:~/.aliaswallet$ unzip ../BootstrapChain.zip
Archive: ../BootstrapChain.zip
inflating: blk0001.dat
creating: txleveldb/
inflating: txleveldb/088656.ldb
...
staker@myStaker:~/.aliaswallet$
Now we create the service, to handle the daemon properly during system startup, shutdown, reboot etc.
Start your favourite editor ...
root@myStaker:~# mcedit /lib/systemd/system/aliaswalletd.service
... and copy/paste the following into:
[Unit]
Description=Alias wallet daemon
After=network.target
[Service]
ExecStart=/usr/local/bin/aliaswalletd -daemon -pid=/run/aliaswalletd/aliaswalletd.pid -debug
# Creates /run/aliaswalletd owned by staker
RuntimeDirectory=aliaswalletd
User=staker
Type=forking
PIDFile=/run/aliaswalletd/aliaswalletd.pid
Restart=on-failure
# Hardening measures
####################
# Provide a private /tmp and /var/tmp.
PrivateTmp=true
# Mount /usr, /boot/ and /etc read-only for the process.
ProtectSystem=full
# Disallow the process and all of its children to gain
# new privileges through execve().
NoNewPrivileges=true
# Use a new /dev namespace only populated with API pseudo devices
# such as /dev/null, /dev/zero and /dev/random.
PrivateDevices=true
# Deny the creation of writable and executable memory mappings.
MemoryDenyWriteExecute=true
[Install]
WantedBy=multi-user.target
If you're using a different account, you need to update lines 7 and 9!
Enable service and check status:
root@myStaker:~# systemctl daemon-reload
root@myStaker:~# systemctl enable aliaswalletd
Created symlink /etc/systemd/system/multi-user.target.wants/aliaswalletd.service -> /lib/systemd/system/aliaswalletd.service.
root@myStaker:~# systemctl status aliaswalletd
* aliaswalletd.service - Alias wallet daemon
Loaded: loaded (/lib/systemd/system/aliaswalletd.service; enabled; vendor preset: enabled)
Active: inactive (dead)
root@myStaker:~#
Start visudo
...
root@myStaker:~# visudo
... and add one line for the staker account:
...
# User privilege specification
root ALL=(ALL:ALL) ALL
staker ALL=(ALL) NOPASSWD: ALL <-- Add this line
...
On the cmdline (a terminal) and as staker
you can just type ui
. At first run you will see some notes regarding initial steps:
staker@myStaker:~$ ui
Info : ~/.dialogrc not found, installing it
Warning: =============================================================
Warning: You are using the default rpc password!
Warning: It will be replaced with a random password now.
Warning: =============================================================
Info : Press return to continue
After pressing Return
the Shell-UI will start together with the initial start of the Alias daemon. This initial start might take some time as the daemon must catch up the time difference since bootstrap creation.
You might stop the wallet now using the corresponding option during exit of the Shell-UI or using the alias wallet-stop
on the cmdline and install your existing wallet.dat
file.
At the moment it's not possible to use seed words on Shell-UI, so if you need to create a wallet using your seedwords, you need to copy your wallet.dat
from a different machine, where you could use the Alias wallet with the Qt-UI.
If you're walking through this guide on a Linux machine with already installed graphical user interface, you could just start the graphical Alias wallet by typing aliaswallet
on a terminal. There you can also use the seedwords feature to re-generate your wallet.dat
file.
Happy staking! :-)