Skip to content

Instantly share code, notes, and snippets.

@tgerring
Last active February 24, 2022 13:20
Show Gist options
  • Star 12 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save tgerring/f9089e7b5c52d5f4dbcc to your computer and use it in GitHub Desktop.
Save tgerring/f9089e7b5c52d5f4dbcc to your computer and use it in GitHub Desktop.
IPFS Mac Guide

IPFS Guide

Mac Installation

  1. Install Homebrew
  2. ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  3. Install prerequisites
  4. brew install git hg
  5. brew install osxfuse (see Mac issues to troubleshoot common errors)
  6. Install Go
  7. Follow go-ipfs installation instructions
  8. go get github.com/jbenet/go-ipfs/cmd/ipfs
  9. cd $GOPATH/src/github.com/jbenet/go-ipfs/cmd/ipfs
  10. go install
  11. ipfs init (default configuration location is ~/.go-ipfs)

Getting started

Manipulating objects

  1. ipfs add <path to file or directory>
  • note the resulting object hash

Interfaces

Mount

When running in mount mode, go-ipfs attempts to mount IPFS inside directories on your system with FUSE. This allows for referencing and accessing objects as if they were a part of your local filesystem.

  1. ipfs mount
  • see General Issues to troubleshoot common errors
  • when working correctly, you should see mounting ipfs at <mount path> and mounting ipns at <mount path>, followed by a blank line. This means it's running! Subsequent commands will need to be run at a separate terminal prompt
  1. Verify your object is available: ls <mount point>/<object hash>
  • This uses the system directory listing command NOT go-ipfs
  • Running ls against a bad hash should result in "No such file or directory"

HTTP

TODO

General issues

When running ipfs mount, you may get errors similar to the following:

  • ipfs mount: exit status 64: mount_osxfusefs: /ipfs: No such file or directory
    • Make sure the mounting directory exists
    • Default values are /ipfs and /ipns
    • Supply custom values with flags: ipfs mount -f="/Users/myaccountname/ipfs" -n="/Users/myaccountname/ipns"
  • ipfs mount: exit status 71: mount_osxfusefs: failed to mount /ipfs@/dev/osxfuse0: Operation not permitted
    • Make sure the mounting directory has correct permissions. For exmaple, mount in a location in your user directory

Mac issues

  • System crash when using ipfs mount
    • Install the latest Fuse with brew install osxfuse
  • Brew error osxfuse: osxfuse is already installed from the binary distribution and conflicts with this formula.
    • Fuse may have been installed as part of another binary package
    • Install latest Fuse for OS X including Preferences Pane. After installation is complete, navigate to System Preferences -> FUSE for OS X -> Click "Remove OSXFUSE"
    • Try to brew install osxfuse again
@whyrusleeping
Copy link

getting started #1: say: "note the resulting hash value" or similar

@tgerring
Copy link
Author

bah, silly markdown! had the words enclosed in angle brackets that got stripped

@flufftronix
Copy link

Looks like the brew recipe has been moved to cask, it's installing for me via

brew cask install osxfuse

@richburdon
Copy link

I have IPFS working correctly and have installed the latest version of FUSE from the installer (3.8.2).

Following the instructions here:https://github.com/ipfs/go-ipfs/blob/master/docs/fuse.md

But getting errors when starting the daemon.

> ipfs daemon --mount
Initializing daemon...
Successfully raised file descriptor limit to 2048.
Swarm listening on /ip4/127.0.0.1/tcp/4001
Swarm listening on /ip4/192.168.52.134/tcp/4001
Swarm listening on /ip6/::1/tcp/4001
Swarm listening on /p2p-circuit/ipfs/QmRoTtgs4CUxKmfDBuRyZLt3YQDMhJiwfLS4RY5HG8WzoL
Swarm announcing /ip4/127.0.0.1/tcp/4001
Swarm announcing /ip4/192.168.52.134/tcp/4001
Swarm announcing /ip6/::1/tcp/4001
API server listening on /ip4/127.0.0.1/tcp/5001
13:30:06.118 ERROR       node: error mounting: mount_osxfusefs: exit status 64 mount_unix.go:89
13:30:06.118 ERROR       node: error mounting: mount_osxfusefs: exit status 71 mount_unix.go:93
Error: mount_osxfusefs: exit status 64
Received interrupt signal, shutting down...
(Hit ctrl-c again to force-shutdown the daemon.)

@melgu
Copy link

melgu commented Jun 21, 2020

13:30:06.118 ERROR node: error mounting: mount_osxfusefs: exit status 64 mount_unix.go:89
13:30:06.118 ERROR node: error mounting: mount_osxfusefs: exit status 71 mount_unix.go:93
Error: mount_osxfusefs: exit status 64

Your error seems to be with OSXFUSE. Try starting the deamon without --mount. Do the mounting afterwards and look into General Issues. E.g. on my machine, mounting worked after manually creating mount folders elsewhere and then supplying the paths via the flags -f& -n.

@GwynethLlewelyn
Copy link

GwynethLlewelyn commented Nov 14, 2020

Hm. I have no errors (after figuring out exactly what I ought to do), but also no files on the ipfs and ipns directories (I placed them inside my user because I was trouble getting the file permissions right).

Why? The system mount command shows the two mount points via Fuse. ipfs is running, I can access all my files from the IPFS Desktop, via web to the usual port, or even using ipfs ls <hash> (or even see that the files are correctly being retrieved using ipfs cat <hash> > /tmp/filename). Nevertheless, using either the Finder or the command line to navigate to the mounted folders, they are either empty, or, if I place anything inside them, they are just local files — not sync'ed with IPFS.

(Note that there is an .ipfs directory for my user — presumably set up by IPFS Desktop — which holds data in a completely different structure; I believe this is as it ought to be).

Some more info: I'm running macOS Big Sur version 11.0.1 (20B29), IPFS Desktop 0.13.2 and go-ipfs 0.7.0; I also use Brave with the IPFS extension (2.15.0). The actual command line to run ipfs is /Applications/IPFS Desktop.app/Contents/Resources/app.asar.unpacked/node_modules/go-ipfs/go-ipfs/ipfs daemon --migrate --enable-gc --routing dhtclient.

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