Some tweaks to the IPFS instructions.

It is interesting to have the archive mounted into your MFS for easier
browsing. Also, it will make updating the pins easier, I hope.
Hunter Jozwiak 2024-01-22 13:32:50 -05:00
parent e717859c13
commit ce053fb56b

17
ipfs.md

@ -61,18 +61,29 @@ Now that yu have the IPFS node running, you can now get the archive and pin a co
ipfs pin add /ipns/games-archive.stormux.org
```
### Copy the Archive into Your MFS for Easier Perusal
If you want an easier way to parooze the archive, you can put it into your MFS (Mutable File Storage). I believe there is a way to mount this onto your filesystem by way of fuse, but I am not sure if it works, as it is an experimental feature. Regardless, you'll want to do this so that you can update the records easier (you need to keep track of the old hash for the pin to update, since ipfs pin update will delete the old hash and pin the new one). So here is how you do this:
```bash
ipfs files cp $(ipfs name resolve /ipns/games-archive.stormux.org) /games-archive
```
Now you can do ipfs ls /games-archive instead of a longer path.
### Syncing the Archive
To ensure you have the latest archive, run the pin on a periodic interval. Additionally, if your node is slow in updating, as mine was, you can resolve the resolve the ipns entry by hand and pipe that into pin add.
```bash
ipfs name resolve --nocache games-archive.stormux.org | ipfs pin add
ipfs pin update $(ipfs files stat --hash /games-archive) $(ipfs name resolve --nocache /ipns/games-archive.stormux.org) && ipfs files rm -r /games-archive && ipfs files cp $(ipfs name resolve /ipns/games-archive.stormux.org) /games-archive
```
To automate this process, you can add it to your crontab:
```bash
crontab -e
# ipns update for audiogame-manager once a week
0 12 * * 1 ipfs name resolve --nocache games-archive.stormux.org | ipfs pin add
0 12 * * 1 ipfs pin update $(ipfs files stat --hash /games-archive) $(ipfs name resolve --nocache /ipns/games-archive.stormux.org) && ipfs files rm -r /games-archive && ipfs files cp $(ipfs name resolve /ipns/games-archive.stormux.org) /games-archive
```