IPFS Node on Raspberry Pi 3

Photo by NASA on Unsplash

What you will need


Flash SD card with OS

Note: If you need more help — https://www.raspberrypi.org/documentation/installation/installing-images/README.md

Setup WiFi and SSH

Note: If you are directly connecting the pi via an ethernet cable, you can skip this section.

wpa_passphrase "MyWiFiESSID" "MyWiFiPassword" >> wpa_supplicant.conf

Two things are happening here:

wpa_passphrase "MyWiFiESSID" "MyWiFiPassword" will create a network profile with your password replaced by a token so that it is not saved as plain text.

>> wpa_supplicant.conf will add the network profile to your configuration file.

sudo nano wpa_supplicant.conf
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
#psk="MyWiFiPassword" #Delete this line

More info can be found here — https://www.raspberrypi.org/documentation/configuration/wireless/headless.md

touch ssh

More info can be found here — https://www.raspberrypi.org/documentation/remote-access/ssh/README.md

Connect to Pi using SSH

ssh pi@<pi-ip-address>

I used a Linux machine to connect to my pi, but for Windows users, you will need to install an additional tool — Putty, in order to SSH into another computer.

Note: For more information on setting up SSH — https://www.raspberrypi.org/documentation/remote-access/ssh/README.md

Static IP address

sudo nano /etc/dhcpcd.conf
interface eth0static ip_address=
static routers=
static domain_name_servers=
interface wlan0static ip_address=
static routers=
static domain_name_servers=
sudo update
sudo upgrade
sudo reboot

Note: If you want to connect to your pi using your phone, you can use JuiceSSH. Make sure you are on the same network as your pi in order for it to work.

Install IPFS

uname -m

Note: For a complete listing of the ARM architecture and what bit is your pi — https://en.wikipedia.org/wiki/ARM_architecture

$ wget http://dist.ipfs.io.ipns.localhost:8080/go-ipfs/v0.9.0/go-ipfs_v0.9.0_linux-arm.tar.gz
$ tar -xvzf go-ipfs_v0.9.0_linux-arm.tar.gz
$ cd go-ipfs
$ sudo bash install.sh
$ ipfs --version

Note: Complete IPFS installation instructions — http://docs.ipfs.io.ipns.localhost:8080/install/command-line/#official-distributions

Configure IPFS node

ipfs init
sudo nano /etc/systemd/system/ipfs.service
Description=IPFS Daemon
Type=simple ExecStart=/usr/local/bin/ipfs daemon --migrate=true --enable-gc=true
sudo systemctl start ipfs
ipfs swarm peers
sudo nano ~/.ipfs/config
"Datastore": {
"StorageMax": "10GB",

Note: More information on configuring an ipfs node can be found here — http://docs.ipfs.io/how-to/configure-node/

Adding and Pinning your files to the node

echo "Hello World" >> hello.txt
ipfs add hello.txt
added QmWATWQ7fVPP2EFGu71UkfnqhYXDYH566qy47CnJDgvs8u hello.txt
12 B / 12 B [=========================================================] 100.00%

To add more than text files to your node, you can use Filezilla to copy across files to your pi and then add/pin them.

Note: All command line commands can be found here — http://docs.ipfs.io/reference/cli/

Hope this guide was useful and if there are any comments/edits/problems/questions, please do ask away :) All feedback is welcome. Feel free to ask any questions via Twitter as well — https://twitter.com/neha_m25



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store