5 min read

Run Fulcrum on Linux X86

Run Fulcrum on Linux X86

In this post I guide you through a full installation of a Fulcrum indexer on a Linux X86 system.

Requirements

For the Fulcrum installation we need a fully installed and synced Bitcoin Core and enough disk space for the Fulcrum database on our server. For the access via Tor we also need a running Tor version (it's not necessary).

Preparation

In our user home directory we create a folder called fulcrum_data.

mkdir fulcrum_data

If we have to install tor:

Debian / Ubuntu systems

sudo apt install tor

Fedora

sudo dnf install tor

Arch

sudo pacman -S tor

Download

We download the latest Fulcrum release from the Fulcrum GitHub repository in our download folder. Fulcrum-version-x86_64-linux.tar.gz is our file.

wget https://github.com/cculianu/Fulcrum/releases/download/v1.8.2/Fulcrum-1.8.2-x86_64-linux.tar.gz

In the next step we are extracting the Fulcrum tar.gz file.

tar xvf Fulcrum-1.8.2-x86_64-linux.tar.gz

Self Signed Certificate

We change now into the Fulcrum directory

cd ~/Fulcrum-1.8.2-x86_64-linux

It's always important to have a encrypted communication between our components. To make this possible we create a self signed certificate with the following command:

openssl req -newkey rsa:2048 -new -nodes -x509 -days 3650 -keyout fulcrum.key.pem -out fulcrum.pem

We confirm all questions with "y".

Configuration

In the next step we have to configure our indexer. We copy the fulcrum example config and set some customized parameters.

cp fulcrum-example-config.conf fulcrum.conf

And now we are editing the the config.

nano fulcrum.conf

The first parameter we need to change is the datadir. This is the location for the Fulcrum database.

datadir = /path/to/a/dir  # Windows: datadir = D:\FulcrumData\mainnet

Change to

datadir = /home/yourusername/fulcrum_data

Change the rpcuser and rpcpassword. We can find both in the bitcoin.conf file.

Change the rpcuser

rpcuser = Bob_The_Banker

to

rpcuser = yourrpcusername

Change the rpcpassword

rpcpassword = hunter1

to

rpcpassword = yourrpcpassword

If we are running bitcoind on the same machine we can skip the following setting, otherwise we have to change the ip and maybe the port.

bitcoind = 127.0.0.1:8332

For the encrypted communication we have to activate the SSL port and set the path for our self signed certificate and key.

Remove the # from from line with ssl

#ssl = 0.0.0.0:50002

to

ssl = 0.0.0.0:50002

Change to path for our self signed certificate

#cert = /path/to/server-cert.pem

to

cert = /home/yourusername/fulcrum/fulcrum.pem

The same for the key

#key = /path/to/server-key.pem

to

key = /home/yourusername/fulcrum/fulcrum.key.pem

We don't want to query other servers for their peer list.

Change

#peering = true

to

peering = false

In this step we want to give Fulcrum extra memory for a faster sync. You can set this parameter to 4096 MB for 4GB ram. If you have plenty of ram, let's say 16GB then you can set this parameter higher.

#fast-sync = 0

to

fast-sync = 4096

For easier updates and in the case we want to switch between Fulcrum versions we are creating a symlink.

cd ..
ln -sf Fulcrum-1.8.2-x86_64-linux fulcrum

In the directory we see now the following structure

la -la

We can delete older Fulcrum versions as soon as the new version is up & running.

System Service File

We are now creating a system service file. This is necessary if our server restarts or we want to stop / start / restart it.

sudo nano /etc/systemd/system/fulcrum.service

In the file we insert

[Unit]
Description=Fulcrum
After=network.target

[Service]
ExecStart=/home/yourusername/fulcrum/Fulcrum /home/yourusername/fulcrum/fulcrum.conf
User=yourusername
LimitNOFILE=8192
TimeoutStopSec=30min

[Install]
WantedBy=multi-user.target

We have to change "yourusername" to our real username!
To save the file we press CTRL + X + Y then enter.

No we active the service file.

sudo systemctl enable fulcrum.service

To start the service

sudo systemctl start fulcrum.service

To see if the service is running smooth we check the log

journalctl -fu fulcrum

The synchronization process takes around 12 hours, depends on your hardware.

Starting listener serivce for SslSrv 0.0.0.0:50002

As soon as the message above pops up in the log your Fulcrum server is is fully synced.

Upgrade to a newer version

If we want to upgrade our Fulcrum server to a newer version we follow the steps below. At first we have to stop Fulcrum

sudo systemctl stop fulcrum.service

Now we are going into our download folder.

cd ~/Downloads

From the Fulcrum GitHub repository we are downloading the latest version - described under "Download" - and extracting the file.

Now we are moving the new Fulcrum version in our home directory.

mv fulcrum-newest-version ~/

We are now changing into the directory from the new Fulcrum version

cd fulcrum-new-version

And copy the self signed certificate files and our Fulcrum config to the new version.

cp ../Fulcrum-old-version/*.pem .

Config

cp ../Fulcrum-old-version/fulcrum.conf .

Now we are removing the symlink to the old version and create a new one to the new version.

cd ..

At first we are deleting the link to the old version

rm fulcrum

New symlink

ln -sf Fulcrum-new-version fulcrum

Why do we do that? In any case we have problems with the new version we can easily switch betweet the version as we only have to repeat the step with the deletion from the link to the actual version and set it to the version which is working.

Start Fulcrum

sudo systemctl start fulcrum.service

Check

journalctl -fu fulcrum

If everything is okay we are running now the latest Fulcrum version.

Tor onion address

To create an onion address we have to do some steps.
First

sudo nano /etc/tor/torrc

We scroll to the end of the file and insert

# Fulcrum Tor Service
HiddenServiceDir /var/lib/tor/fulcrum/
HiddenServiceVersion 3
HiddenServicePort 50002 127.0.0.1:50002

To save the file we press CTRL + X + Y then enter.

Restart tor

sudo systemctl restart tor

To get the onion address

cat /var/lib/tor/fulcrum/hostname

Done.

Connection with Sparrow

Open your Sparrow wallet and go to File -> Preferences -> Server and click on "Edit Existing Connection". Select "Private Electrum" and add you Fulcrum server ip in the URL field and port 50002 or add the tor onion address in the URL field and port 50002.

Important

It's very important to keep the downtime from Fulcrum as low as possible. The database is very delicate and it can happen that it gets corrupted. So be carefull with power cuts etc.

๐Ÿงก
If this article was helpful for you, please consider a donation to the author.