2023-04-29 02:23:32 +00:00

4.7 KiB

Sparrow Server - 24/7 Mixing

Introduction

In this guide I will walk you through how to use Sparrow Server on your headless Bitcoin node to allow you to mix 24/7 without leaving your laptop running all night.

I used RaspiBolt's Guide as the basis for this guide but modified it for a Intel/AMD Debian/Ubuntu based server.

Pre-requisites

Technically you can do this without a private Electrum server and opt to use the public Electrum servers that Sparrow offers in it's server preferences. If you want to use your own node I used @k3tan's Ministry of Nodes Guide 01 to 05 as the basis of my home Electrum server.

Setup a Local machine with +1TB SSD:

Setup Bitcoin Core on Local machine:

Setup Fulcrum Server OR ElectrumX Server on Local machine:

This guide also assumes you already have Sparrow Wallet files that are setup to use Whirlpool.

Installing Sparrow Server

SSH into your headless server:

ssh username@{headless-ip}
sudo apt update && sudo apt upgrade
### Download, verify and install Sparrow Server
VERSION="1.7.6"
wget https://github.com/sparrowwallet/sparrow/releases/download/$VERSION/sparrow-server_$VERSION-1_amd64.deb
wget https://github.com/sparrowwallet/sparrow/releases/download/$VERSION/sparrow-$VERSION-manifest.txt.asc
wget https://github.com/sparrowwallet/sparrow/releases/download/$VERSION/sparrow-$VERSION-manifest.txt

Verify the release:

VERSION="1.7.6"
curl https://keybase.io/craigraw/pgp_keys.asc | gpg --import
gpg --verify sparrow-$VERSION-manifest.txt.asc
sha256sum --check sparrow-$VERSION-manifest.txt --ignore-missing

Install Sparrow Server:

VERSION="1.7.6"
sudo dpkg -i sparrow-server_$VERSION-1_amd64.deb

Often the location of the Sparrow binary won't be in your $PATH. Edit your .bashrc (Also install vim because it kicks ass):

sudo apt install vim
sudo vim ~/.bashrc
### Add the end of the .bashrc include this:
export PATH="/opt/sparrow/bin:$PATH"
### exit with :wq
### reload your bash script:
source ~/.bashrc

Keeping Sparrow Server Running 24/7

If you open Sparrow from your ssh session you will get a nice blue colored terminal UI. Familiarise yourself with the interface it varies in a few ways from the regular desktop GUI. Exit Sparrow in your ssh session.

Optional: Connect to your local Electrum Server

If you are running your own Electrum Server on the same headless server then while within Sparrow go to Preferences > Server and select Private Electrum and Continue. Set values according to your Electrum Server implementation and test connection.

# For Electrs (default)
URL: 127.0.0.1:50001
Use SSL?: No
  
# For Fulcrum 
URL: 127.0.0.1:50002
Use SSL?: Yes 

You are now connected to your own Electrum Server

Copy existing Wallet files to server

Install rsync on both your laptop and your headless server:

sudo apt install rsync
ssh username@{headless-ip}
sudo apt install rsync
exit
### copy wallet files to server
rsync -aP .sparrow/wallets/* username@{headless-ip}:.sparrow/wallets/

Keeping Sparrow Server Running 24/7 - ctd.

Sparrow server doesn't come with a way to run as a system daemon, so you will have use something like tmux to allow you to run Sparrow server and keep it running in the background on your server.

While still in your ssh session install tmux:

sudo apt install tmux

Now start a new tmux session for your Sparrow Server

tmux new -s sparrowserver
### This will open a tmux terminal instance
### Run Sparrow
Sparrow

Using Sparrow Server open the wallet files you copied across. Enter passwords and passphrases (if needed). Go to Postmix > UTXOs > Mix To... and set Postmix index range to Odd. Now lock your wallet files and exit the tmux session by using ctrl+b then d.

Accessing your tmux session

When you want to access the tmux session again use this command:

tmux a -t sparrowserver

This will bring up your Sparrow Server instance as you left it.