Archive

Howto: IPFS on Fedora 34

I like IPFS a lot; for many reasons.

  • They're distributed.
  • Support newer technologies (quic, for example)
  • Enable a descentralized web.

Besides that, it's a pretty convenient app to use once you get the hang of it. You can either go full CLI on it or just user it from the browser (once you install the addon).

In any case, here's how to install and configure it on Fedora.

First step, install the ipfs-update app. Now, if you know your way around go, just build it. It's easy enough. Make sure you have the binary in $PATH and you're done.

I don't, usually, go for the "get the binary" way but, this time, in order to make it simpler for you, I just will:

# Install ipfs-update first
# mind the version and arch please.
# more info here: https://dist.ipfs.io/#ipfs-update
curl -O https://dist.ipfs.io/ipfs-update/v1.7.1/ipfs-update_v1.7.1_linux-amd64.tar.gz

After that, it's just easy:

ipfs-update install latest

There you go. You have ipfs now.

If you haven't used ipfs before, you will have to initialize it. Just:

ipfs init

Nota

Your ipfs repo will be at ~/.ipfs. If that's not desirable, make sure you have an environment variable pointing at where you want your repo. For example: IPFS_PATH=/srv/ipfs/repo.

Well, you're all set! But wait! You still need to start the daemon in order to get all the benefits and collaborate with the network!

Easy enough. We will setup a systemd service for our user.

# create the systemd directory
umask 077
mkdir -p ~/.config/systemd/user

# create the systemd service file
cat << 'EOF' > $_/ipfs.service
[Unit]
Description=IPFS daemon
After=network.target

[Service]
ExecStart=%h/bin/ipfs daemon --migrate
Restart=on-failure

[Install]
WantedBy=default.target

EOF

# enable it
systemctl --user enable --now ipfs.service

And, now, we're done! You can check the status of it with: systemctl --user status ipfs.service. You could, also, check the logs with: journalctl -t ipfs

And, to check if you're connected or not, just: ipfs swarm peers. You can check your ID as well with: ipfs id.