Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarification needed on running Fulcrum as a public Electrum server #175

Open
ghost opened this issue Jun 2, 2023 · 1 comment
Open

Comments

@ghost
Copy link

ghost commented Jun 2, 2023

Hi Calin,

First of all, thank you very much for bringing Fulcrum to life. I have managed to install it and configure it on my machine by taking the RaspiBolt guide as a reference and everything seems to be working fine. I am able to connect apps to it via TCP on port 50001 and SSL on port 50002 when I am connected to my home network and I can also connect via Tor if I am on the go. I have not enabled WS and WSS as I am not familiar with the websocket protocol and I don't actually know if/why I would use it in my specific case scenario.

I am seriously considering exposing Fulcrum to the public network so that I can use a hostname like, for example, fulcrum.example.com rather than an onion address and I would like to gather some info before messing things up as I am very new to this kind of things.

I have done some research and I think I should be ok doing the following:

  • Purchase example.com on NameCheap
  • Stop Fulcrum
  • Set hostname = fulcrum.example.com in fulcrum.conf
  • Obtain a full chain certificate and key for fulcrum.example.com from Let's Encrypt
  • Set cert = and key = in fulcrum.conf to point to the full chain certificate and key respectively
  • Configure NGINX reverse proxy to make sure that fulcrum.example.com resolves to https://127.0.0.1:50002
  • Start Fulcrum

My fulcrum.conf file would end up looking more or less like this:

# BASIC OPTIONS

datadir = /mnt/data2tb/fulcrum
bitcoind = 127.0.0.1:8332
rpccookie = /mnt/data2tb/bitcoin/.cookie
tcp = 0.0.0.0:50001
ssl = 0.0.0.0:50002
cert = /etc/letsencrypt/live/fulcrum.example.com/fullchain.pem
key = /etc/letsencrypt/live/fulcrum.example.com/privkey.pem

# PEER DISCOVERY AND PUBLIC SERVER OPTIONS

hostname = fulcrum.example.com
peering = false
announce = false

# ADVANCED OPTIONS

fast-sync = 8192

Finally, if I want to connect Sparrow Wallet to Fulcrum, I can just use fulcrum.example.com as the server name, specify port 50002 and toggle Use SSL.

Is this the correct way to run Fulcrum as a public Electrum server?

@ghost
Copy link
Author

ghost commented Jun 18, 2023

After some extensive testing, I think I've figured everything out so I'll write my findings here in case other beginners find them useful.

NOTE 1: Purchasing a domain name is not mandatory as you can use Fulcrum with self-signed certificates. The downside of this is that some apps such as ACINQ's Phoenix Wallet will not connect to your Fulcrum server as they require a valid hostname and certificate.

NOTE 2: Port 50002 has to be allowed to receive incoming connections (port forwarding on your router, add a rule in the firewall and so on).

Please find below two possible scenarios. You can always mix and match different configurations according to your needs.


SCENARIO 1: With no hostname. With no peering / announce. Self-signed certificate.

With this configuration you will be able to connect your wallet app to your Fulcrum server via SSL using using your public IP address and port 50002. You can choose to disclose your public IP address to friends and family so they can connect as well.

Your Fulcrum configuration file should look similar to this:

#################
# BASIC OPTIONS #
#################

datadir = /path/to/fulcrum_directory
bitcoind = 127.0.0.1:8332
rpccookie = /path/to/bitcoin_cookie
tcp = 127.0.0.1:50001
ssl = 0.0.0.0:50002
ssl = ::0:50002
cert = /path/to/self-signed-cert.pem
key = /path/to/self-signed-key.pem

############################################
# PEER DISCOVERY AND PUBLIC SERVER OPTIONS #
############################################

peering = false
announce = false

Here is a screenshot of Sparrow connected to my Fulcrum server with the above-mentioned configuration:

Screen Shot 2023-06-18 at 13 47 23

For the record, this test was successful also with BlueWallet.


SCENARIO 2: With hostname. With peering / announce. Let's Encrypt valid certificate.

With this configuration you will be running a proper public Fulcrum server, meaning that you'll have peers and clients connecting to it. You will be able to connect to your Fulcrum server using a hostname (e.g. fulcrum.example.com).

This configuration requires a valid domain name (e.g. example.com), an A record in your DNS provider (e.g. fulcrum) and a valid Let's Encrypt certificate. Do your own research on how to obtain those as they are outside the scope of this comment.

Your Fulcrum configuration file should look similar to this:

#################
# BASIC OPTIONS #
#################

datadir = /path/to/fulcrum_directory
bitcoind = 127.0.0.1:8332
rpccookie = /path/to/bitcoin_cookie
tcp = 127.0.0.1:50001
ssl = 0.0.0.0:50002
ssl = ::0:50002
cert = /etc/letsencrypt/live/fulcrum.example.com/fullchain.pem
key = /etc/letsencrypt/live/fulcrum.example.com/privkey.pem

############################################
# PEER DISCOVERY AND PUBLIC SERVER OPTIONS #
############################################

hostname = fulcrum.example.com
peering = true
announce = true

Here are two screenshot of Phoenix Wallet connected to my Fulcrum server with the above-mentioned configuration:

Screenshot_20230618-142445
Screenshot_20230618-142545

For the record, this test was successful also with BlueWallet and Sparrow.


@cculianu let me know if I need to edit some info in case it's incorrect. Otherwise please feel free to close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants