Skip to content

Instantly share code, notes, and snippets.

@ilyaigpetrov
Last active November 24, 2025 05:59
Show Gist options
  • Select an option

  • Save ilyaigpetrov/6a5d25bc6b076f67d44d6c83e2ce6524 to your computer and use it in GitHub Desktop.

Select an option

Save ilyaigpetrov/6a5d25bc6b076f67d44d6c83e2ce6524 to your computer and use it in GitHub Desktop.
My IPFS Notes

My IPFS Notes

Local Sharing via IPFS

WARNING: IPFS is designed as a public network so, please, don't share sensetive info, because it may leak.

See:

  1. https://github.com/ipfs/kubo/blob/master/docs/config.md#routingtype.
  2. https://github.com/ipfs/kubo/blob/master/docs/config.md#profiles.
  3. https://discuss.ipfs.tech/t/ipfs-for-file-distribution-in-local-network/9458.
ipfs config Routing.Type none
ipfs config profile apply local-discovery
# [...] Install avahi or mdns packages for your OS.
ipfs id # Returns your ipfs peer ID. Transfer it to another machine.
# Connect to another local peer:
ipfs swarm connect /ip4/HIS_LOCAL_IP_HERE/tcp/4001/p2p/HIS_PEER_ID_HERE

Generating IPNS Keys in Batch

# Endlessly generate IPNS keys until interrupted with `Ctrl+C`:
$ i=0; while true; do i=$((i+1)); ipfs key gen "2025_11_03_e2_tmp$i"; done
> [...] # Outputs each key generated and saves it to IPFS key storage (under `~/.ipfs/`).

# Then search among all generated keys for some keywords:
$ ipfs key list -l | grep --color -e 'SOME_REGEX_HERE' -e 'ANOTHER_REGEX_HERE'
> [...] # Prints matched keys with the keywords colored.
# or search for prefixes. Prefixes can only begin with some letters, most frequent are `ghijklm`.
# Skip one char by using a dot in regexes if needed:
$ ipfs key list -l | cut -d ' ' -f 1 | sed 's/^k51qzi5uqu5d//' | grep --color -E '^(ilya|.decrab)'

Mounts via FUSE

See https://github.com/ipfs/kubo/blob/master/docs/fuse.md.

Alpine Linux

IPFS project doesn't provide musl binaries. So I'm using gcompat: see https://wiki.alpinelinux.org/wiki/Software_management#Running_glibc_programs.
To install:

doas apk add gcompat

Local Discovery via mDNS

See https://wiki.alpinelinux.org/wiki/MDNS.
To install:

doas apk add avahi

FUSE for IPFS Mounts

doas apk add fuse3
doas ln -s /usr/bin/fusermount3 /usr/bin/fusermount
doas modprobe fuse
ipfs init
ipfs daemon --mount
# [...]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment