Skip to content

Instantly share code, notes, and snippets.

@mshernandez5
Last active January 28, 2022 23:26
Show Gist options
  • Save mshernandez5/325c192b449b27174641b2d3c2142f14 to your computer and use it in GitHub Desktop.
Save mshernandez5/325c192b449b27174641b2d3c2142f14 to your computer and use it in GitHub Desktop.
Setting Up A Vertcoin Node systemd Service

Setting Up A Vertcoin Node systemd Service

Installing The Binaries

  1. Download the Vertcoin Core binaries, ex.
    wget https://github.com/vertcoin-project/vertcoin-core/releases/download/0.18.0-rc1/vertcoind-v0.18.0-rc1-linux-amd64.zip

  2. Extract the binaries into /usr/local/bin, ex.
    sudo unzip vertcoind-v0.18.0-rc1-linux-amd64.zip -d /usr/local/bin

Setting Up The Service

  1. Create a user to run the service, setting their shell to /bin/false to prevent login as a standard user:
    sudo useradd -r -s /bin/false vertcoind

  2. Create a new directory /var/vertcoind to store the blockchain and other application data:
    sudo mkdir /var/vertcoind

  3. Give ownership of the directory to the vertcoind user:
    sudo chown vertcoind:vertcoind /var/vertcoind

  4. Give the directory appropriate permissions to prevent less privileged users from accessing wallet data:
    sudo chmod 700 /var/vertcoind

  5. Use an editor like vim or nano to create a file /etc/systemd/system/vertcoind.service with the following contents:

[Unit]
Description=Vertcoin Wallet Daemon
After=network.target
StartLimitIntervalSec = 0

[Service]
Type=simple
Restart=always
RestartSec=1
User=vertcoind
ExecStart=/usr/local/bin/vertcoind -datadir=/var/vertcoind

[Install]
WantedBy=multi-user.target

Running The Service

  1. Enable the newly-created service:
    sudo systemctl enable vertcoind.service

  2. Start the vertcoind service (this will happen automatically on future startups):
    sudo service vertcoind start

  3. Check the logs with journalctl at any time, ex. show most recent 50 lines:
    sudo journalctl -u vertcoind.service -f -n 50

Running A Full Node

Optionally, if you would like to allow incoming connections you may configure your firewall to allow incoming port 5889 traffic. This is dependent on your current firewall setup; some VPS providers do not install any preconfigured firewall and instead offer these features from their control panel. Others allow all traffic to reach the server where it may be rejected via a user-configured firewall.

Using ufw, you can allow port 5889 traffic with:
sudo ufw allow 5889

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment