Merge branch 'master' of ssh://git.stormux.org:1101/storm/audiogame-manager.wiki

Storm Dragon
2025-08-29 14:54:00 -04:00

26
ipfs.md

@@ -15,6 +15,8 @@ These instructions are going to require a bit of elbow grease in the command lin
- Start your daemon.
- Pin the directory resolved by way of IPNS.
- Optional, but really recommended: mounting the archive into MFS.
- Sync the archive.
### Installing the Daemon
@@ -45,33 +47,45 @@ In order for your node to be able to talk to other nodes on the IPFS network, yo
### Start or Create a Service
For some distributions, a user service is already shipped, so starting the daemon is pretty straightforward. Consult the specifics of your init system and be sure it is running now and enabled on boot. If a service is not available, be sure that you run the following as your user:
For some distributions, a user service is already shipped, so starting the daemon is pretty straightforward. Consult the specifics of your init system and be sure it is running now and enabled on boot. If a service is not available, be sure that you run the following as your user, editing the user services where necessary:
```bash
ipfs daemon
ipfs daemon --enable-gc --migrate --enable-namesys-pubsub
```
In brief, these extra flags allow for subscribing to published events about names, allowing migrations on daemon startup, and allows for the newer pubsub system.
### Sync the Archive
Now that you have the IPFS node running, you can now get the archive and pin a copy locally by way of its IPNS key.
```bash
ipfs pin add /ipns/k51qzi5uqu5dg7ndb48x1v9hzp98vg6wncrbhps16a8yn3eh4nqis7v384jh20
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 files 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 ipns entry by hand and pipe that into pin add.
```bash
ipfs name resolve --nocache /ipns/k51qzi5uqu5dg7ndb48x1v9hzp98vg6wncrbhps16a8yn3eh4nqis7v384jh20 | 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 /ipns/k51qzi5uqu5dg7ndb48x1v9hzp98vg6wncrbhps16a8yn3eh4nqis7v384jh20 | 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
```