Skip to content

Instantly share code, notes, and snippets.

Last active Jun 26, 2017
What would you like to do?
IPFS snap testing

Build in archlinux

Install docker:

$ sudo pacman -S docker
$ sudo systemctl start docker
$ sudo gpasswd -a $USER docker
$ newgrp docker

Clone the repo:

$ sudo packman -S git
$ git clone
$ cd ipfs-snap

Build the snap in a docker container:

$ docker run -v $(pwd):/cwd snapcore/snapcraft sh -c 'apt install software-properties-common wget -y && add-apt-repository -y ppa:gophers/archive && apt update && cd /cwd && snapcraft

Install snapd:

$ sudo pacman -S snapd
$ sudo systemctl enable --now snapd.socket

Because in archlinux the /snap/bin path is not added to $PATH, do this quick hack:

$ alias ipfs=/snap/bin/ipfs

This is reported in

Build in ubuntu

Install snapcraft:

$ sudo apt install snapcraft

Clone the repo:

$ sudo apt install git
$ git clone
$ cd ipfs-snap

Configure the PPA with go 1.7:

$ sudo add-apt-repository ppa:gophers/archive
$ sudo apt update

Build the snap:

$ snapcraft

Smoke tests for the IPFS snap

(based on

First, install the snap:

$ sudo snap install ipfs --candidate

Init the repo:

$ ipfs init
initializing ipfs node at $HOME/ipfs/x1/.ipfs
generating 2048-bit RSA keypair...done
peer identity: $hash
to get started, enter:

    ipfs cat /ipfs/$hash/readme

Show the readme:

$ ipfs cat /ipfs/$hash/readme
Hello and Welcome to IPFS!

██╗██████╗ ███████╗███████╗
██║██████╔╝█████╗  ███████╗
██║██╔═══╝ ██╔══╝  ╚════██║
██║██║     ██║     ███████║
╚═╝╚═╝     ╚═╝     ╚══════╝

If you're seeing this, you have successfully installed
IPFS and are now interfacing with the ipfs merkledag!

Go online:

$ ipfs daemon
Initializing daemon...
Swarm listening on /ip4/
Swarm listening on /ip6/::1/tcp/4001
API server listening on /ip4/
Gateway (readonly) server listening on /ip4/
Daemon is ready

The server keeps running in this terminal, so open another one for the following tests.

Show the addresses of the peers:

$ ipfs swarm peers

Get an object from the network:

$ ipfs cat /ipfs/QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ/cat.jpg > cat.jpg
$ eog cat.jpg

Put an object in the network:

$ hash=`echo "I <3 IPFS -$(whoami)" | ipfs add -q`
$ curl "http://localhost:8080/ipfs/$hash"
I <3 IPFS -elopio
$ curl "$hash"
I <3 IPFS -elopio

Open the web ui:

$ sensible-browser http://localhost:5001/webui

View the connected peers:

1. Click the `Connections` item in the list on the left.
2. Wait for the connected peers to show up in the map.
Copy link

elopio commented Sep 29, 2016

Tested in an ubuntu xenial kvm. No errors found.

Copy link

freekvh commented Jan 27, 2017

It works well:
sudo snap install ipfs --candidate
Installed nicely, but what does --candidate mean?

Also, perhaps you can add a way to change the default 8080 port this port is very often already taken which leads to errors. I tried ipfs config Addresses.Gateway /ip4/ myself, the daemon starts and works but I have no idea where the webui is (not at localhost:9001/webui)

Perhaps instruction on how the daemon start automatically? So that your node is online after a reboot without manual actions...

Thank you.

Copy link

elopio commented Jan 28, 2017

@freekert candidate is the channel in the store. We have four channels, with different levels of stability: edge, beta, candidate, stable.

This is just using the default ipfs port. If you want to suggest a different default, you should talk to upstream:
And autostarting the daemon on the snap would be nice. I will try it.

Thanks for your report. A new candidate version is coming soon, let me know how the update goes for you.

Copy link

urcminister commented Feb 7, 2017

Everything seemed to work for me. Barry.

Copy link

letozaf commented Feb 7, 2017

Everything ok also for me a part the connected peers not showing, but that has already been reported upstream. (Tested v0.4.5-rc2)

Copy link

casept commented Feb 12, 2017

Works fine on debian sid.

Copy link

chrisdebian commented Mar 15, 2017

Hi, Leo.

As per my email, I'm keen to help with testing. I have a Linux Mint xfce box, and a spare 32-bit laptop. Also just got a Raspberry Pi 3, which may help from an ARM perspective. I'll try to run the above tests, in the next 24hrs.



Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment