All Projects → alanshaw → Iim

alanshaw / Iim

Licence: mit
🔁 IPFS install manager

Programming Languages

javascript
184084 projects - #8 most used programming language

iim

Build Status dependencies Status JavaScript Style Guide

IPFS install manager

https://youtu.be/C7A3-ycCRWU

screenshot 2019-02-03 at 22 35 58

Install

npm install -g iim

Note: Windows not yet supported!

Usage

# Use the latest version of JS IPFS
$ iim use js
✔ selected js-ipfs version 0.34.4
✔ installed js-ipfs 0.34.4
✔ installed binary at /Users/alan/.iim/dists/[email protected]/ipfs
✔ initialized IPFS at /Users/alan/.iim/[email protected]
✔ configured IPFS
✔ symlinked /Users/alan/.iim/dists/[email protected]/ipfs -> /Users/alan/.iim/dists/current
✔ symlinked /Users/alan/.iim/dists/[email protected]/ipfs -> /usr/local/bin/ipfs
🚀 IPFS is ready to use

$ ipfs version
js-ipfs version: 0.34.4

# Use JS IPFS at version 0.33
$ iim use js 0.33
✔ selected js-ipfs version 0.33.1
✔ installed js-ipfs 0.33.1
✔ installed binary at /Users/alan/.iim/dists/[email protected]/ipfs
✔ initialized IPFS at /Users/alan/.iim/[email protected]
✔ configured IPFS
✔ symlinked /Users/alan/.iim/dists/[email protected]/ipfs -> /Users/alan/.iim/dists/current
✔ symlinked /Users/alan/.iim/dists/[email protected]/ipfs -> /usr/local/bin/ipfs
🚀 IPFS is ready to use

$ ipfs version
js-ipfs version: 0.33.1

# Use the latest version of Go IPFS
$ iim use go
✔ selected go-ipfs version 0.4.18
✔ installed go-ipfs 0.4.18
✔ installed binary at /Users/alan/.iim/dists/[email protected]/ipfs
✔ initialized IPFS at /Users/alan/.iim/[email protected]
✔ symlinked /Users/alan/.iim/dists/[email protected]/ipfs -> /Users/alan/.iim/dists/current
✔ symlinked /Users/alan/.iim/dists/[email protected]/ipfs -> /usr/local/bin/ipfs
🚀 IPFS is ready to use

$ ipfs version
ipfs version 0.4.18

# Use Go IPFS at version 0.4.18
$ iim use go 0.4.17
✔ selected go-ipfs version 0.4.17
✔ installed go-ipfs 0.4.17
✔ installed binary at /Users/alan/.iim/dists/[email protected]/ipfs
✔ initialized IPFS at /Users/alan/.iim/[email protected]
✔ symlinked /Users/alan/.iim/dists/[email protected]/ipfs -> /Users/alan/.iim/dists/current
✔ symlinked /Users/alan/.iim/dists/[email protected]/ipfs -> /usr/local/bin/ipfs
🚀 IPFS is ready to use

$ ipfs version
ipfs version 0.4.17

How does it work?

A new repo is created and used for each implementation/version combination at ~/.iim/[email protected], for example.

Adds a symlink at /usr/local/bin/ipfs that points to a script that runs IPFS with IPFS_PATH set to ~/.iim/[email protected].

IPFS is installed to ~/.iim/dists/[email protected]/node_modules/ipfs or ~/.iim/dists/[email protected]/node_modules/go-ipfs-dep for example.

Common issues

Failed to symlink

Looks like this:

$ iim use go
✔ selected go-ipfs version 0.4.18
✔ installed go-ipfs 0.4.18
✔ installed binary at /home/dave/.iim/dists/[email protected]/ipfs
✔ initialized IPFS at /home/dave/.iim/[email protected]
✔ symlinked /home/dave/.iim/dists/[email protected]/ipfs -> /home/dave/.iim/dists/current
✖ failed to symlink /home/dave/.iim/dists/[email protected]/ipfs -> /usr/local/bin/ipfs
💥 failed to link binary at /usr/local/bin/ipfs, try running sudo iim link

Don't worry! Mostly everything worked fine - you just don't have permission to write to /usr/local/bin! Just run sudo iim link and it'll try again to create that symlink.

How to debug?

You can get some debug output using the DEBUG environment variable e.g.

$ DEBUG=iim* iim use js

Contribute

Feel free to dive in! Open an issue or submit PRs.

License

MIT © Alan Shaw

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].