This guide is a part of RPI0 review: https://git.io/ilyaigpetrov-rpi0.
- Buy rPi Zero WH.
- Downlaod and
ddRaspbian Lite to the SD Card. - Boot into the pi with
pi:raspberry, runsudo raspi-config, set password, network, enable ssh. - Ssh into your pi,
wgetthe latest ipfs-update binary for arm from https://dist.ipfs.io/#ipfs-update, unpack withtar xf ./the-downloaded-file.tar.gz,./install.sh. ipfs-update versions,sudo ipfs-update install v<the-latest-ipfs-version>.ipfs initand launch the daemon withipfs daemon.- On your non-pi machine add some files:
sudo ipfs add Он\ вам\ не\ Димон\ 720p.mp4, note the hash in output:QmUpt66k9cmcJPfHbtxsBCp4V4nu99pSwwMFobkkFUUruV. - On the pi:
ipfs pin add --progress /ipfs/QmUpt66k9cmcJPfHbtxsBCp4V4nu99pSwwMFobkkFUUruV(make sure this file is served by an active ipfs daemon, you may check a public gateway at http://ipfs.io/ipfs/QmUpt66k9cmcJPfHbtxsBCp4V4nu99pSwwMFobkkFUUruV).
In my cases while pinning some videos IPFS daemon's memory appetites could grow much. Though I never witnessed OOM killler I enlarged swap up to 2gb and noted ipfs repo gc and ipfs daemon --enable-gc (is it true by default?) for myself.
Now you may want to see some stats on the pi. ipfs stats helps a little but for more forward a webui: ssh -L 5001:localhost:5001 -L 8080:localhost:8080 ip@static-ip-of-your-pi. Now open http://localhost:5001/webui on the non-pi machine to view the stats.
After such redirect you won't be able to use ipfs on the non-pi machine because the same required ports are already in use. To change ports on the non-pi machine:
ipfs config Addresses.Gateway /ip4/127.0.0.1/tcp/8082
ipfs config Addresses.API /ip4/127.0.0.1/tcp/5002Important document: https://github.com/ipfs/go-ipfs/blob/master/docs/experimental-features.md
ipfs config Pubsub.Router gossipsub
ipfs config --json Experimental.FilestoreEnabled true
ipfs config --json Experimental.QUIC true
ipfs daemon --enable-pubsub-experiment --routing=dhtclient --enable-namesys-pubsubexport LIBP2P_MUX_PREFS="/mplex/6.7.0 /yamux/1.0.0 /spdy/3.1.0"
Unfortunately I had no success with sharing one video file over ipfs. Whatever I tried (configuring DMZ, Nat Full Cone on the router) I wasn't able to access a shared video file on public ipfs gateways or other PCs at acceptable speeds (>22m for 190mb). This is due to poor Wi-Fi connectivity of the rpi0, see https://git.io/rpi0-wifi because, I belive, I burnt my rpi0 while overclocking it.
Viewing Stats:
I changed the port on the Pi machine to 5002 instead, ran the configs on the Pi, and opened 5002 on the non-Pi machine. That solves the non-PI machine port problem.