Skip to content

Instantly share code, notes, and snippets.

@kdmukai
Last active December 20, 2023 08:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save kdmukai/e79024430bf1b2d2929251cdd97a817d to your computer and use it in GitHub Desktop.
Save kdmukai/e79024430bf1b2d2929251cdd97a817d to your computer and use it in GitHub Desktop.
Create a Liquid `elementsd` node CT in Proxmox

Create a Liquid Node CT in Proxmox

Create the CT:

  • Debian 12 image
  • 1GB system disk in local-lvm
  • 8GB RAM, 0 swap

Add a data disk mount point

In the CT's "Resources" > "Add" > "Mount point":

  • Storage: "Directory" disk from above
  • Disk size: 50 GB (Liquid is 18GB as of Dec 2024)
  • Path: /data

Debian setup

apt update && apt upgrade -y
apt install gpg -y

Enable ssh

nano /etc/ssh/sshd_config

# In sshd_config:
PermitRootLogin yes

Exit and save changes, restart ssh

/etc/init.d/ssh restart

Install elementsd

Download a pre-built binary:

# download and verify the binary
wget https://github.com/ElementsProject/elements/releases/download/elements-23.2.1/elements-23.2.1-x86_64-linux-gnu.tar.gz
wget https://github.com/ElementsProject/elements/releases/download/elements-23.2.1/SHA256SUMS
wget https://github.com/ElementsProject/elements/releases/download/elements-23.2.1/SHA256SUMS.asc

# Add the Blockstream Elements signing key
gpg --keyserver keyserver.ubuntu.com --recv-keys "BD0F3062F87842410B06A0432F656B0610604482"

# Verify the .asc
gpg --verify SHA256SUMS.asc
sha256sum --check SHA256SUMS --ignore-missing

Now complete installation

tar --extract --file elements-23.2.1-x86_64-linux-gnu.tar.gz
rm elements-23.2.1-x86_64-linux-gnu.tar.gz
rm SHA256SUMS*
cd elements-23.2.1

Create elements.conf config

nano /data/elements.conf

Basic config:

datadir=/data

txindex=1

mainchainrpchost=<your_bitcoind_ip>
mainchainrpcport=8332
mainchainrpcuser=<your_bitcoind_rpcauth_user>
mainchainrpcpassword=<your_bitcoind_rpcauth_pass>

chain=liquidv1

server=1
rpcbind=0.0.0.0
rpcuser=<your_liquid_rpc_user>
rpcpassword=<your_liquid_rpc_pass>

liquidv1.rpcport=18884
liquidv1.port=18886

see: https://github.com/ElementsProject/elements/blob/master/share/examples/liquid.conf

Manually run elementsd

/root/elements-23.2.1/bin/elementsd -conf=/data/elements.conf

Install as a service

nano /etc/systemd/system/elementsd.service

# configuration:
[Unit]
Description=elementsd
After=network.target

[Service]
ExecStart=/root/elements-23.2.1/bin/elementsd -conf=/data/elements.conf
TimeoutStopSec=30min
Restart=always
StandardOutput=append:/data/stdout.log
StandardError=append:/data/error.log

[Install]
WantedBy=multi-user.target

Load the new service and run:

systemctl enable elementsd
systemctl start elementsd

If you make further service config changes, load your new changes with:

systemctl daemon-reload

Set up logrotate

nano /etc/logrotate.d/elementsd.conf

# config details
/data/*.log {
    minage 2
    rotate 6
    size 10M
    compress
    delaycompress
    postrotate
        pkill -f "elementsd"
    endscript
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment