- based on small VPS with Ubuntu 16.04
https://github.com/gdassori/spruned
$ sudo apt-get install libleveldb-dev python3-dev git virtualenv gcc g++
$ sudo adduser bitcoin
$ sudo su - bitcoin
# bitcoin user session
$ git clone https://github.com/gdassori/spruned.git
$ cd spruned
$ virtualenv -p python3.5 venv
$ . venv/bin/activate
$ pip install -r requirements.txt
$ python setup.py install
$ exit
$ sudo nano /etc/systemd/system/spruned.service
# sPRUNED: systemd unit
# /etc/systemd/system/spruned.service
[Unit]
Description=sPRUNED Bitcoin node
After=network.target
[Service]
ExecStart=/home/bitcoin/src/venv/bin/spruned --network bitcoin.mainnet --rpcuser xxx --rpcpassword xxx
Type=simple
User=bitcoin
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.target
Start & enable
$ sudo systemctl daemon-reload
$ sudo systemctl start spruned
$ sudo systemctl status spruned
$ sudo systemctl enable spruned
https://bitcoin.org/en/download
# admin user session
$ mkdir download && cd download
$ wget https://bitcoin.org/bin/bitcoin-core-0.16.1/bitcoin-0.16.1-x86_64-linux-gnu.tar.gz
$ tar -xvf bitcoin-0.16.1-x86_64-linux-gnu.tar.gz
$ sudo install -m 0755 -o root -g root -t /usr/local/bin bitcoin-0.16.1/bin/bitcoin-cli
$ mkdir /home/bitcoin/.bitcoin
$ sudo nano /home/bitcoin/.bitcoin/bitcoin.conf
# Connection settings
rpcuser=xxx
rpcpassword=xxx
https://github.com/ElementsProject/lightning
# admin user session
$ sudo apt-get update
$ sudo apt-get install -y \
autoconf automake build-essential git libtool libgmp-dev \
libsqlite3-dev python python3 net-tools zlib1g-dev
$ cd
# bitcoin user session
$ git clone https://github.com/ElementsProject/lightning.git
$ cd lightning
$ git tag -l
$ git checkout tags/v0.6
$ ./configure
$ make
$ sudo make install
Create systemd unit
$ sudo nano /etc/systemd/system/lightning.service
# c-Lightning: systemd unit
# /etc/systemd/system/lightning.service
[Unit]
Description=c-Lightning daemon
Requires=spruned.service
After=spruned.service
[Service]
ExecStart=/usr/local/bin/lightningd --pid-file=/home/bitcoin/.lightning/lightning.pid --daemon
PIDFile=/home/bitcoin/.lightning/lightning.pid
User=bitcoin
Type=forking
Restart=on-failure
RestartSec=10
# 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
Start and enable unit
$ sudo systemctl daemon-reload
$ sudo systemctl start lightning
$ sudo systemctl status lightning
$ sudo systemctl enable lightning