I was helping someone on twitter with this so I figured I'd share the information here as well so that other people would have an easier time than I did.

I'm going to explain how to do this setup on a Raspberry Pi, but note that this should work on a VM as well. You can also set up and run the node headless this way, but I will be explaining how to set up the node using a monitor that you can then later disconnect and access remotely once everything is setup.

Hardware:

-Raspberry Pi 4 (2GB RAM minimum) preferably 4GB RAM
-Raspberry Pi 4 Heatsinks
-Raspberry Pi 4 case -Micro HDMI cable
-USB-C power cable and wall adapter
-Monitor
-Keyboard and mouse
-Ethernet cable (Optional)
-16GB or larger microSD card
-500GB or larger external hard drive (SSD or portable)

Node Requirements:
-50 KBps upload internet speeds (Most people should have this)
-Unlimited or high data cap internet download/upload service
-6 hours or longer per day dedicated run time

Okay, once you have the hardware its time to get started!

The first thing you'll need to do is install the Raspberry Pi imager, this is how we're going to install Ubuntu onto our Raspberry Pi. After your download and install finishes, open the imager.

  1. Click the "choose OS" box and from the list select Ubuntu, then select Ubuntu Server 20.04 LTS (Raspberry Pi 2/3/4).
  2. Insert your microSD card to your computer directly or via a USB converter. Click "choose SD card" and select your inserted microSD card.
  3. Click "Write" and wait for the imager to finish flashing the OS onto your card

When it is done, remove the SD card and reinsert it to access the files installed. You can choose the overclock the Raspberry Pi by editing the config file. To connect to the Raspberry Pi remotely, you'll need to create an SSH file. If you're on windows this is pretty easy. In the File Explorer, highlight the address bar at the top, erase the text and type cmd, press enter and the Command Prompt will pop up. Type the following:

echo\ssh

This will create an SSH file in your SD directory so that you can remote access the Rasberry Pi later. Now you can go ahead and eject the SD card from your computer.

Now we can set up the Raspberry Pi

Go ahead and connect all your peripherals to your Raspberry Pi, insert the microSD, and connect it to power to turn it on. Give it a moment to boot up, then when prompted enter "ubuntu" for the password. It will make you change the password. Afterward, it will print a bunch of information to the screen, write down the IPv4 address, this is the IP address you'll use to remote access the Raspberry Pi. Now, at any time you can remote access your Raspberry Pi by entering a terminal on another PC in your network and typing:

ssh ubuntu@(your IP address)

The next step is to install a desktop. There are plenty to choose from so feel free to use a different one than what I use, you can also choose to ignore this and to just work from in the terminal from this point forward.

You need to update all the repositories so type: (Note you'll either have to be connected by ethernet or have edited the network-config file to setup your wifi in advance)

sudo apt-get update

Once it's done updating type the following to upgrade your system:

sudo apt-get upgrade

Now that you're up-to-date, you can install the desktop using the command:

sudo apt-get install ubuntu-gnome-desktop

This will take a while to download and install so just sit back and let it do its thing. Once it's done downloading, restart your Raspberry Pi and log in with the password you changed earlier. Your first boot may take a while so just be patient, don't freak out if you see a single purple square in the center of the screen while it's loading. You should now have the Ubuntu desktop ready to go and now it's on to installing Bitcoin Core!

Installing Bitcoin Core 0.20.0

Since we're running Ubuntu Server 20.04 LTS, it should come preinstalled with the Snap Store. This makes installing apps very easy and works similar to pip install in Python. Simply open your terminal and type:

sudo snap install bitcoin-core

This will install Bitcoin Core into your Snap folder and will add the application to your system. Unfortunately, there are still a few steps left before we can begin downloading the blockchain. By default, Bitcoin Core doesn't have the removable-media Plug connected to the Socket. You can view this by typing:

snap connections bitcoin-core

This means when you try installing everything onto your external hard drive, Bitcoin Core won't be able to identify it or write to it even when passed the directory path. To fix this first locate your Snap folder, make a copy of the bitcoin-core folder inside, and paste it into your external drive.

NOTE: You must make a copy, you can't just move the snap file to the external drive.

Now, you can connect the removable-media Plug to the Socket by typing:

sudo snap connect bitcoin-core:removable-media :removable-media

This gives you the read/write permissions necessary to access the /media path. Finally, you can now launch Bitcoin Core and select "use a custom directory path" when prompted. Highlight the current directory path and replace it with the path to your external hard drive, it should look something like this:

/media/(external drive)/bitcoin-core/common/.bitcoin

This is why we had to make a copy of the bitcoin-core folder to the external drive earlier, the Bitcoin Core application will create the new data directory through ".bitcoin".Hit "Okay" and the application will begin synchronizing with the network! Once the synchronization is finished your very own node will be up and running!

submitted by /u/Noblefire_62
[link] [comments]

Source and link to Reddit topic: How to run Bitcoin Core 0.20.0 on Ubuntu Server 20.04 LTS using a Raspberry Pi 4 (or Virtual Machine)

Author: Reddit.com