• econoalchemist

Receiving Bitcoin Blockchain Data with a Blockstream Satellite Node

This article covers materials, installation, configuration, and operation of a Bitcoin node connected via satellite using a RaspberryPi and a Blockstream satellite kit. This article can also be found on the Bitcoin Magazine website here.

Special thank you to Igor Freire from Blockstream, his patience and attention to detail was a tremendous resource for me through this exercise.


This guide has the following sections:



Recommended Materials:

All together, a setup like this will cost less than $800 USD for all the required materials. You will also benefit from having a laptop with WiFi capabilities.


Everything needed for the Raspberry Pi comes in the Cana Kit listed above except for the SSD.


Make sure to first install the supplied heat sinks as shown here:


Then start with the lower portion of the case and place the Raspberry Pi circuit board on it. Then place the middle of the case on the circuit board as shown here:


Then connect the red lead from the fan to pin #2, which is the 5 volt direct current power supply pin. Connect the black lead from the fan to pin #6, which is the ground pin. The fan itself snaps into place on the underside of the top of the case.


Then snap the top of the case onto the middle part and the Raspberry Pi assembly is finished. You can set this aside for now and we'll come back to it later.





Satellite Selection & Rough Pointing Angles:


Navigate to the Blockstream Satellite Network Coverage website and make note of the satellite with the strongest signal for your geographic location. You will want to either drop a pin on the map, enter the address where the satellite will be installed, or use a satellite pointer mobile app to get the most accurate elevation, azimuth, & polarity numbers that you will need to setup your mounting bracket and antenna.


For example, using the Federal Reserve bank address:


1020 16th Street Mall, Denver, Colorado 80202, United States


Enter this address into the satellite map website, it will reveal the best numbers for the elevation, azimuth, & polarity. Then use those numbers to set up the correct angles on the mounting bracket and antenna. If you are using the flat panel antenna like the one in this guide, then you will want to make sure your selected satellite has the green check mark, like the Galaxy 18 for example.



You can also download the Satellite Pointer app for iOS or Android to utilize an augmented reality tool to help get all your angles right. With this app, you can find the satellite you want to point your antenna at by scanning the sky around you. Then you will be given the best Azimuth & elevation to use when you align the cross-hair pointer on screen with the satellite you want to connect with. You can also find the best polarity to use by selecting the appropriate satellite from the list option and scrolling down through the details. It helps too if you allow the app access to your location or you can also enter the location manually.


Make sure to notate the ideal pointer angles, you will need to carefully setup your mounting bracket based on these angles as described in the next section; otherwise you may not receive good reception from the satellite.


Also, you can follow the @BlockstreamHelp Twitter account to stay up to date with scheduled satellite maintenance that may briefly interrupt service. The announcements will look like this:





Antenna Installation:

The antenna is shipped in an inconspicuous box that has no mention of Blockstream or Bitcoin on it. The label on the outside of the box merely indicates that there is a flat panel antenna inside which is commonly used for internet reception and television among other things. You can view the complete manual here.


Upon opening the box you will find that it contains the antenna, the ethernet power supply, literature, mounting brackets for multiple applications, a compass, hardware, and a flat wrench.


Be careful while handling the antenna; try not to scratch the surface or drop it. Also do not apply any paint, stickers, or anything else to the face of the unit. The back of the unit has the legacy style coax cable connections and the Ethernet connection. In this guide, I will be demonstrating the Ethernet connection. The advantage here is that the satellite signal is being converted into a digital signal internally and I do not need additional outboard hardware with this antenna.


There are a few different mounting options such as window mounting, railing mounting, and surface mounting. The right choice for you will depend on your unique situation. For me, I had an old DirectTV satellite dish installed on my house so I decided to use the existing stand for it and I went with the railing mounting hardware in the kit.



After removing the old satellite dish, I mocked up the mounting bracket with the hardware to make sure I had everything I needed before going back up onto the roof.

Next, I installed the bare mounting bracket onto the existing mounting pole on the roof, leaving the satellite safe on the ground.


After I had the new mounting bracket installed and only fastened hand-tight, then I mounted the satellite antenna onto the mounting bracket.


Now that everything is in place and still only hand-tight, the pointing angles all need to be roughly set, these angles will be fine-tuned once it's powered up. Based on the geographic location example using the Denver Federal Reserve bank, the best pointing angles for the antenna are going to be:


Elevation = 40.37°

Azimuth = 206.94°

Polarity = 20.39°

Geometry is not my strong suit but here is my best explanation. This graphic helps illustrate the 3-dimensional planes. The vertical xz plane defines elevation, the flat xy plane defines azimuth, and the horizontal yz plane defines polarity.





Elevation is the vertical degrees of x from z, with z being 0.

Azimuth is degrees on the xy plane of y from x, with x being equal to north. With my antenna, I set the main mounting bracket roughly correct and then used the smaller adjustment to fine tune the setting:


Polarity is the horizontal degrees of z from y, with y being equal to 0.


The notches on the mounting hardware will only get you so far. To get as accurate as I could, I used the Satellite Pointer app to provide the angles while my mobile phone was physically placed on the satellite. Since the Satellite Pointer app doesn't display real time polarity, I used the level tool app on my mobile device for this. Also, to assist with the azimuth reading I used the compass app on my mobile device. As each angle was as accurate as I could get it, I would tighten down the hardware with the included flat wrench.


With the antenna installed and the pointer angles roughly set, all that is left for the installation piece is to run the Ethernet cable. About a year ago I had ran a new coax cable from this satellite dish to my office in the basement on the other side of the house. Due to stocking levels at Blockstream and Lightning payment routing issues on my end and getting busy with other projects, I never did end up ordering the satellite kit despite running the cabling for it. I'm glad that I waited though because the flat panel antenna has a built in LNB and internal satellite signal converter. Running a new Ethernet cable from the new antenna to my office was a worth while chore since I did not want to use the legacy signal and buy an additional piece of hardware to convert it.


If you are not comfortable installing your own cable then call a licensed professional. Depending on your installation you may need to terminate your own cables, drill holes in your walls, and craw inside your attic. I went to a hardware store and bought 100 feet of outdoor rated CAT5e Ethernet cable, a box of RJ45 connectors, and the crimping tool.


Then you need to decide which standard you want to use for your Ethernet cable. I couldn't find the standard used for the SelfSat>IP22 antenna but considering it is new, I made a safe assumption that it was the T568B configuration. So long as you terminate both ends of the cable with the same configuration, I don't think it really matters how the device's internal configuration is setup. All the wires are the same color on the inside after all.


image source


There are some good guides online for making your own Ethernet cables, such as this one. I won't go into the full details here on how to terminate your Ethernet cables since there are so many good videos and guides online. But just a few things I do want to point out, make sure your wire color order is the same on both ends. Make sure the wires go all the way to the end of the RJ45 connector. And make sure there is some of the insulated outer jacket where the pinch point clamps down on the cable in the RJ45 connector.


Before terminating the end of your Ethernet cable that gets plugged into the antenna, make sure you slip the cord-grip connector over the cable so that once you do have the end terminated you can still plug it in and tighten down the cord-grip to keep and weather out of the connection.


Next, I used some zip ties to run the cable down along the side of my house and then drilled an inconspicuous hole to pass the cable through to the attic. Then I crawled inside the attic and ran the cable along the length of the house to the opposite side and then down through the interior wall and then through the floor into the basement where I terminated the other end of the cable in my office. If you are uncomfortable with crawling into confined spaces to do this type of work then I would recommend contacting a professional installer.


With the cable installed, simply plug it into the Power Over Ethernet adaptor making sure that the cable connected to the antenna is in the correct port and that the other port is connected to your Raspberry Pi.





Raspberry Pi OS Image:

There are three main steps covered in this section:

1) Installing a Raspberry Pi Image.

2) Installing the Blockstream Satellite Command Line Interface (CLI).

3) Installing the Bitcoin Satellite application which is a fork of BitcoinCore with the added capabilities to receive Bitcoin network data from satellites.


First the Raspberry Pi needs an Operating System (OS). To achieve this, the OS image will be downloaded and then flashed to the 32GB micro SD card that came in the Cana kit. Navigate to this website and select the image you want, I recommend downloading the latest available arm64 image; you may need to navigate back up the parent directory to get to the latest images. I chose the "2021-05-07-raspios-buster-arm64.zip". Then you also want to download the SHA256 file as well as the signature file as shown here:


You will also need the Raspberry Pi imager executable file to flash the OS image onto the microSD card. The imager application can be downloaded from here. Unfortunately, I wasn't able to find any PGP verification tools for the imager executable file.



Save all the files in the same folder. It is important to verify the software that you can. This is why the SHA256 file and the signature file were also downloaded in addition to the OS image. I'll show you how to use a PGP signature and a hash value to cryptographically verify the integrity of the OS image you just downloaded before installing it on your Raspberry Pi. For this, I will be using the Kleopatra key manager. First import the Raspberry Pi public PGP key into your key manager and then certify it. The PGP key can be downloaded from here:

https://www.raspberrypi.org/raspberrypi_downloads.gpg.key


Then simply right click on the signature file, select "More GpgEX options" and then select "Verify".



The software will run for a moment and it should return a green verified dialog. Now you know the downloaded .zip file is verified with the Raspberry Pi signature.



Now you can run a SHA256 hashing algorithm on the .zip file and compare that to the hash value in the downloaded hash file. I like to use a hex editing program called HxD for calculating hash values. Always be sure to get the latest hash files from the same archive you downloaded the image file.



Now that everything is verified, you can delete the SHA256 hash file and the signature file from that folder so the only items left are the imager executable file and the .zip file. Leave the zip file compressed, the imager executable will take care of decompressing it. Load the microSD card in the USB adaptor and make sure that is available for your computer to communicate with it. Then double click on the imager executable file and the flashing process should start.


The microSD card that comes with the CanaKit already has an image loaded on it. But there is a preference to use the downloaded image in this case. Simply formatting the microSD card is only going to clear out the data in the available disk volume, just to be sure there are no hidden partitions, I'll do this with the Disk Manager instead. Open the Computer Manager by right clicking on "This PC" from a file explorer. Then navigate to the Disk Manager and then right click on the disk volume in question and select "delete volume". A warning will pop up indicating that this will delete all the data, select "yes".


Next, right click on the unallocated volume and select "start new volume". Then follow the prompts in the wizard leaving all the default settings as they are. Formatting for FAT32 is fine.


Navigate back to the folder containing only the zip file and the imager executable, double click on the executable. Then follow the prompts to install it and then run it. If everything went according to plan, you should be looking at this screen:


Select "choose OS" then scroll down to "use custom" and then navigate to your zip file:


Select "choose storage" and then select your microSD card. Then click on "write" and select "yes" to the warning that all data will be erased.


Then the writing and verification processes will start. This should take approximately ten minutes. When it is finished, you should receive the success notification.


Once you hit "continue" it will eject the microSD card from the computer. However, a blank Secure Shell (SSH) file needs to be written to the root directory of the microSD card so that it can be connected to remotely. Upon reinserting the microSD card, your computer may tell you that the microSD card needs to be reformatted. Do not reformat it, just select "cancel".


Using the file explorer, navigate to the root folder on the microSd card, it is probably called "boot". Then simply right click in that folder and select "new" then "text document". Then just name it "ssh" without any file extension. You should receive a dialog warning you about changing file extensions, just select "yes".

That's it, you're done flashing the Raspberry Pi image, you can eject the microSd card. Insert the microSD card into the Raspberry Pi microSD card port, not into the USB port using the adaptor but on the opposite side of the circuit board from the USB ports there is a microSD card port. Then connect an Ethernet cable to your router or switch, and the power cable. Now you are ready to turn on the Raspberry Pi and next I'll show you how to remote in via SSH connection and install the Blockstream Satellite command-line interface (CLI) tool.


Do not connect your SSD yet.


Software Compiling:

In this step you will see how to make the SSH connection from your desktop computer to your Raspberry Pi computer. Once this connection is established, you will then build the OS Image, install the Blockstream Satellite CLI, and compile the Bitcoin Satellite application.


I recommend using a simple SSH tool like Putty.exe. Learn more about Putty here and download it from here. Verify the download, then run the .msi file and follow the install wizard prompts.


Once you run Putty, you will need to enter the IP address of your Raspberry Pi. To find this, log into your home router from a web browser, usually by simply entering 192.168.0.1 in the URL dialog box. Most routers have basic log in credentials like Admin/1234, check online for your brand of router and login instructions.


Once logged into your router, you should be able to locate a list of connected devices on your home network. For example, the connected devices on my home network and their IP address can be viewed from navigating to: Basic Router>DHCP.

Then in Putty, in the Host Name dialog box, enter your user, which will be "pi" the "@" symbol followed by your RaspberryPi IP local address. For example, all together, mine was: "pi@192.168.0.33" and then select "Open" at the bottom.


A terminal window will automatically open on your desktop then you may get a warning about the host key not being registered, select "Yes" to add this key to your registry.


Then you will be asked for the password: "raspberry".


Then you should be ready to continue when you see this screen:


Configuring The SSD

Here is how I configured my SSD. There might be better and/or more efficient ways to do this, but here are the steps I took:

$sudo apt update;
$sudo apt upgrade -y;

A script will run for a few moments and then run the following commands:


$sudo apt install git -y;
$sudo apt install htop -y;
$sudo apt install curl -y;
$sudo apt install bash-completion -y;
$sudo apt install jq -y;
$sudo apt install qrencode -y;
$sudo apt install dphys-swapfile -y;
$sudo apt install hdparm -y;

Now there are a few things that need to done in order to set up the SSD such as formatting it, mounting it, and setting the permissions:

$sudo dmesg -C;
$sudo dmesg -w;

Now connect your external drive.

Make note of idVendor & idProduct. For example: idVendor = 1058 & idProduct = 0748

$ctl+c;
$lsblk -o NAME,MOUNTPOINT,UUID,FSTYPE,SIZE,LABEL,MODEL;

Make note of the partition name. For example: sda or sda1.

Test your external drive's performance with:

$sudo hdparm -t --direct /dev/XXX;

(Where XXX = your partition name).


You should get a result that reads something like: Timing O_DIRECT disk reads: 902 MB in 3.0 seconds = 300.13 MB/s.


If your results are less than 50 MB/s then follow the next step with your idvendor & idproduct from above. Otherwise, skip ahead to "$sudo mkfs.ext4...".


First edit the cmdline text file:

$sudo nano /boot/cmdline.txt;

At the very beginning of the text in the file insert:

usb-storage.quirks=XXXX:YYYY:u 

Where XXXX=idVendor & YYYY=idProduct. Make sure you leave a single space after the "u" and before the original text.


Save the text file by hitting ctrl+x, y for yes, and enter.

$sudo reboot;

Once you're all logged back in and back in the shell, re-run the performance test.

$sudo hdparm -t --direct /dev/sda1;

You should have increased performance. If not, get a new external drive and start again.


Format the partition on the external drive.

$sudo mkfs.ext4 /dev/XXX;

Where XXX = your partition name such as "sda".


In case your external drive was previously mounted, you can use "$ sudo umount /dev/sda" to unmount.


Next you need the UUID, so run:

$lsblk -o NAME,MOUNTPOINT,UUID,FSTYPE,SIZE,LABEL,MODEL;

Make note of your external drive's UUID, this should be on the same line as the partition name (sda).

$sudo nano /etc/fstab;

Create a new line below the others that reads the following: where "{tab}" is you hitting the tab key.

UUID=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXX {tab} /mnt/ext {tab} ext4 {tab} defaults,noatime {tab} 0 {tab} 2

Where the UUID is what you copied from above. Hit ctrl+x, y for yes, & enter to save.


$sudo mkdir -p /mnt/ext;
$sudo mount -a;
$df -h /mnt/ext;

Should return something like:

Filesystem Size Used Avail Use% Mounted On
#/dev/sda  916G 77M  870G  1%   /mnt/ext

Set the owner:

$sudo chown -R pi:pi /mnt/ext/;
$cd /mnt/ext;
$sudo mkdir -p .bitcoin;
$ls -la;

If owner & group for the new bitcoin folder are root & root, then run:

$sudo chown -R pi:pi /mnt/ext/.bitcoin;
$ls -la;

The bitcoin folder should now be owned by pi.


Edit swap file:

$sudo nano /etc/dphys-swapfile;

Scroll down to "CONF_SWAPSIZE=100" and put a (#) hashtag in front of it. Hit ctrl+x, y for yes, enter for save.

$sudo dphys-swapfile install;
$cd ../..;


Install BlockSat CLI:

$sudo apt update;
$sudo pip3 install blocksat-cli;

Install BitcoinSatellite:

$blocksat-cli deps install --btc;
$blocksat-cli btc -d /mnt/ext/.bitcoin;

Enter y for yes to save the bitcoin.conf file to your bitcoin directory on your SSD.


Configure BlockSat CLI:

After that runs for a moment, run the following command and launch the configuration dialog, the terminal will ask you if you want to run the configuration file now, select y for yes.

$blocksat-cli sat-ip;

First you will select the appropriate satellite for your location and then the model of receiver you have. For example, option "0" for Galaxy 18, followed by option "3" for the Base Station receiver.

Next run this command:

blocksat-cli instructions

Following the instructions, now you can connect the Eternet cable coming from the satellite to the Power of Ethernet (PoE) adaptor. Then plug the other Ethernet port into your router or switch. And then plug the PoE adaptor into power. Ensure you have the Ethernet cables connected to the right ports otherwise you can cause damage to your hardware.


When that is connected and powered on, then hit "enter" on the terminal window and then you will receive instructions giving you a couple commands you can run once you get back to the main terminal window to complete the configuration.

Now you should be able to run this command:

blocksat-cli sat-ip

And get a return like this:

2021-08-05 04:16:53 Lock = False; Level = -71.67dBm; Signal Quality = 0.0%;

This means you are ready to run this terminal on your laptop and monitor the values to make the fine tuning alignment adjustments on the satellite receiver.


Dialing in the Antenna Pointing Angles

With your laptop in hand and a connection to your antenna you can start dialing in the exact angles on your receiver. This is the most time consuming part of this entire project. Make sure you attempt this when you have plenty of time and are not in a rush. Ensure you do this on a day when you have a clear, unobstructed view of the sky, preferably with no clouds, smoke, or smog in the air.


My basic approach was to loosen the bolts for the azimuth adjustments and then slowly move the antenna side to side ever so slightly, like half a degree at a time. Then I would wait a few seconds to see if the readings in the terminal window changed to Lock = True. If not, then I would move the antenna half of a degree and wait again. I repeated this process again and again and again. Sweeping from center to one side, then starting back at center and sweeping the other side. When I couldn't get a locked signal then I would loosen the elevation adjusting bolts, adjust the elevation angle by half a degree, and lock the elevation adjusting bolts back down. Then I would start sweeping the azimuth again.


I repeated this process several times over the course of several days. The windows of opportunity to try this were few and far between because of all the wild fire smoke in the air where I live during this time. My attempts were spread out over several weeks. But finally, during a clear evening around sunset, I got my terminal to print Lock = True.

Once you achieve Lock = True make sure to tighten down all the hardware. The connection should remain locked. Also keep an eye on the signal quality, if you are not getting 100% quality in clear sky conditions, try adjusting the polarity to dial this in. Be careful not to lose your locked signal.


Running BitcoinSatellite:

With your signal locked, you are now ready to start downloading the Bitcoin blockchain data. You can either use your internet connection to facilitate a quicker Initial Blockchain Download (IBD). Or if you want to strictly download Bitcoin blocks from the satellite connection and not use any internet connection, you can run bitcoind with the "connect=0" flag. Be aware that if you are doing this for your IBD, this will take approximately 40 days.


You're going to have three terminal windows open during this part.


1) In the first terminal window you need to have the blocksat-cli running:

 $blocksat-cli sat-ip;

Lock should = True and Quality should be as close to 100% as possible.


2) In the second window, you can run BitcoinSatellite. You want to run this from the directory where you created the /.bitcoin folder on your SSD:

$sudo bitcoind -datadir=/mnt/ext/.bitcoin -connect=0;

*In this step you may have encountered an error regarding the maximum receive buffer size. To fix this first check what the buffer size is set to by running:

$sysctl net.core.rmem_max;

If the size is set smaller than 246600008, you can increase it by running:

$ sudo sysctl -w net.core.rmem_max=24660008;

Now try running this command again:

$sudo bitcoind -datadir=/mnt/ext/.bitcoin -connect=0;

You should see the application start and then it should hesitate on the line ending with "udpread thread start", like this:


3) Now you can open the third terminal window and run a couple commands to check if everything is working as expected.

$sudo bitcoin-cli -datadir=/mnt/ext/.bitcoin getudpmulticastinfo;

And then this command:

$sudo bitcoin-cli -datadir=/mnt/ext/.bitcoin getchunkstats;

Should return something like this:


Now you can just let the IBD run, remember this will take roughly a month or longer, so check on it often and make sure to address any issues if they happen.


Conclusion:

After I get the blockchain synchronized I plan on setting this up so that my other Bitcoin nodes will continue receiving blockchain data from my satellite node over my local network during an internet outage. But because I'm strictly downloading from satellite signal, this will take roughly a month or longer to get a full sync. That is why I think this is a good stopping point for this guide and I will follow up with shorter guides on useful things you can do with a satellite connected receiving node. Having a Bitcoin node configured to receive blockchain data over satellite connection is a censorship resistant tool that can help mitigate government enforced internet shutdown like have been seen in Myanmar recently. Even though the current satellite node configuration only allows for receiving blockchain data and not broadcasting transactions back to the network yet, this can still be a valuable tool to facilitate keeping other internet-connected nodes up to date during times of internet outages so that when internet communications are back online, valuable time is not wasted syncing. As this technology continues to develop and get into the hands of those who need it, development of application use cases will grow.



Thanks for reading! I hope that this article helped you get your own Bitcoin Satellite node up and running. Whether you are using a Blockstream satellite kit or sourcing the materials from other places, this is a powerful censorship-resistant tool that helps strengthen the Bitcoin network and helps transfer power from the hands of the few to the hands of the many.


If you enjoyed this content, leave me a tip here: Donate.


This article can be found on Twitter as a thread here.

96 views