2.2 Electrum Server: Fulcrum
Fulcrum is a fast & nimble SPV server for Bitcoin created by Calin Culianu. It can be used as an alternative to Electrs because of its performance, as we can see in Craig Raw's comparison of servers.
Requirements
~ 130GB of free storage for the database
Fulcrum is a replacement for Electrs, these two services cannot be run at the same time (due to the same standard ports used), remember to stop Electrs doing $ sudo systemctl stop electrs
.
Introduction
Bitcoin with hardware wallets
The best way to safely keep your bitcoin (meaning the best combination of security and usability) is to use a hardware wallet (like BitBox, Coldcard, Ledger, or Trezor) in combination with your own Bitcoin node. This gives you security, privacy and eliminates the need to trust a third party to verify transactions.
Bitcoin Core on the MiniBolt itself is not meant to hold funds.
One possibility to use Bitcoin Core with your Bitcoin wallets is to use an Electrum server as middleware. It imports data from Bitcoin Core and provides it to software wallets supporting the Electrum protocol. Desktop wallets like Sparrow, the BitBoxApp, Electrum, or Specter Desktop that support hardware wallets can then be used with your own sovereign Bitcoin node.
Preparations
Make sure that you have reduced the database cache of Bitcoin Core
Install dependencies
With user
admin
, make sure that all necessary software packages are installed
Configure Firewall
Configure the firewall to allow incoming requests
Configure Bitcoin Core
We need to set up settings in the Bitcoin Core configuration file - add new lines if they are not present
Edit
bitcoin.conf
file
Add the following line to the
"# Connections"
section. Save and exit
Restart Bitcoin Core to apply changes
Check Bitcoin Core is enabled
zmqpubhashblock
on the8433
port
Expected output:
Installation
Download binaries
We have our Bitcoin Core configuration file set up and can now move on to the next part of the Fulcrum installation.
Login as
admin
user and change to a temporary directory which is cleared on reboot
Set a temporary version environment variable to the installation
Download the application, checksums, and signature
Signature check
Get the public key from the Fulcrum developer
Expected output:
Verify the signature of the text file containing the checksums for the application
Expected output:
Checksum check
Verify the signed checksum against the actual checksum of your download
Example of expected output:
Extract
Ignore the next line output if it appears to you, this happens because the dev uses macOS with an xattr-capable filesystem:
Binaries installation
Install it
Check the correct installation requesting the version
Example of expected output:
(Optional) Delete installation files of the
/tmp
folder
If you come to update, this is the final step, go back to the Upgrade section to continue
Create the fulcrum user & group
Create the
fulcrum
user and group
Add
fulcrum
user to the "bitcoin" group
Create data folder
Create the fulcrum data folder
Assign as the owner to the
fulcrum
user
Change to the
fulcrum
user
Create a symlink from
/home/fulcrum/.fulcrum
folder to the/data/fulcrum
folder
Check symbolic link has been created correctly
Expected output:
Change to the fulcrum data folder
Generate cert and key files for SSL
Expected output:
Download the custom Fulcrum banner based on MiniBolt. Create your own if you want here
Configuration
MiniBolt uses SSL as default for Fulcrum, but some wallets like BlueWallet do not support SSL over Tor. That's why we use TCP in configurations as well to let the user choose what he needs. You may as well need to use TCP for other reasons.
Create a Fulcrum configuration file
Enter the following content. Save and exit
Remember to accommodate the fast-sync
parameter depending on your hardware
Remember, if you have a slow-performance device, follow the slow device section to improve the experience of the first indexation
Exit the
fulcrum
user session to return to the "admin" user session
Create systemd service
Fulcrum needs to start automatically on system boot.
As user
admin
, create the Fulcrum systemd unit
Enter the complete following configuration. Save and exit
Enable autoboot (optional)
Prepare "fulcrum" monitoring by the systemd journal and check log logging output. You can exit monitoring at any time with
Ctrl-C
Run
To keep an eye on the software movements, start your SSH program (eg. PuTTY) a second time, connect to the MiniBolt node, and log in as "admin". Commands for the second session start with the prompt $2
(which must not be entered).
Start the service
Example of expected output on the first terminal with $ journalctl -f -u fulcrum
⬇️
Fulcrum must first fully index the blockchain and compact its database before you can connect to it with your wallets. This can take up to ~1.5 - 4 days or more, depending on the hardware. Only proceed with the Blockchain explorer: BTC RPC Explorer and Desktop Wallet Section once Fulcrum is ready.
Fulcrum will now index the whole Bitcoin blockchain so that it can provide all necessary information to wallets. With this, the wallets you use no longer need to connect to any third-party server to communicate with the Bitcoin peer-to-peer network.
DO NOT REBOOT OR STOP THE SERVICE DURING THE DB CREATION PROCESS. YOU MAY CORRUPT THE FILES - in case that happens, start the sync from scratch by deleting and recreating fulcrum_db
folder.
When you see logs like this
<Controller> XXXX mempool txs involving XXXX addresses
, which means that Fulcrum is fully indexed
Ensure the service is working and listening at the default
50002
&50001
ports and the8000
admin port
Expected output:
Extras (optional)
Remote access over Tor
Ensure that you are logged in with the user
admin
and edit thetorrc
file
Add the following lines in the "location hidden services" section, below
## This section is just for location-hidden services ##
in the torrc file. Save and exit
Reload the Tor configuration to apply changes
Get your Onion address
Example of expected output:
You should now be able to connect to your Fulcrum server remotely via Tor using your hostname and port
50001
(TCP) or50002
(SSL)
Admin Script: FulcrumAdmin
Fulcrum comes with an admin script. The admin service is used for sending special control commands to the server, such as stopping the server. You may send commands to Fulcrum using this script.
Type the next command to see a list of possible subcommands that you can send to Fulcrum
Expected output:
Type the next command to get complete server information
Get more information about this command in the official documentation section
Slow devices mode
Fulcrum configuration
As the
admin
user, edit the existingfulcrum.conf
file
Uncomment the
db_max_open_files
parameter choosing the appropriate one for 4 GB or 8 GB of RAM depending on your hardware
Install zram-swap
zram-swap is a compressed swap in memory and on disk and is necessary for the proper functioning of Fulcrum during the sync process using compressed swap in memory (increase performance when memory usage is high)
With user
admin
, access to "admin" home folder
Clone the repository of GitHub
Go to the
zram-swap
folder
Install it
Add kernel parameters to make better use of zram
Add next lines at the end of the file. Save and exit
Then apply the changes with
Restart the service
Make sure zram was correctly installed and prioritized (+ Priority than swap)
Example of expected output:
Upgrade
Follow the complete Download and set up Fulcrum section replacing the environment variable "VERSION=x.xx"
value for the latest if it has not been already changed in this guide.
Restart the service to apply the changes
Check logs and pay attention to the next log if that attends to the new version installed
Example of expected output:
Uninstall
Uninstall service & user
Ensure you are logged in with the user
admin
, stop, disable autoboot (if enabled), and delete the service
Delete the fulcrum user. Don't worry about
userdel: fulcrum mail spool (/var/mail/fulcrum) not found
output, the uninstall has been successful
Delete fulcrum directory
Uninstall binaries
Delete the binaries installed
Uninstall Tor hidden service
Ensure that you are logged in with the user
admin
and delete or comment the following lines in the "location hidden services" section, below "## This section is just for location-hidden services ##
" in the torrc file. Save and exit
Reload the torrc config
Uninstall FW configuration
Ensure you are logged in with the user
admin
, display the UFW firewall rules, and note the numbers of the rules for Fulcrum (e.g., X and Y below)
Expected output:
Delete the rule with the correct number and confirm with "
yes
"
Uninstall the Zram
Ensure you are logged in with the user
admin
, navigate to the zram-swap folder, and uninstall
Make sure that the change was done
Expected output:
Port reference
Port | Protocol | Use |
---|---|---|
50001 | TCP | Default port |
50002 | TCP (SSL) | Encrypted port |
8000 | TCP | Admin port |
Last updated