Script to manage the IPFS files. It can be used to sync the CID's between two nodes
go install cmd/cli/ipfs-mgm.go
ipfs-mgm
or
ipfs-mgm --help
ipfs-mgm sync --help
ipfs-mgm sync -s <SOURCE URL> -d <DESTINATION URL>
ipfs-mgm sync -s <SOURCE URL> -d <DESTINATION URL> -f <FILE>
In this case, has to be a file with one IPFS hash per line for each file that should be synced from the -s
node to the -d
node.
Example:
QmZaHasmzsb1ReQHpCLUoXqqWchTgBrtRvbg7TqsUZXSuU
bafkreib47hfjivabsgaly3mupfqjvdywygfwnnoizlwg7wj2we3yh4t6fe
QmbyzKCFE6d22vnRVekN2Z5PT8Ha1g3TSku8UH5KBp2cTY
QmfNueFQg19hyBtCRUPJRpxVtdwtp8cgWpuRoQpRP3n9st
The easiest way is to use the built docker image
docker run -it ghcr.io/graphprotocol/ipfs-mgm sync --help
- Implement async calls by creating a worker queue in batches
- Check for exisging IPFS files on destination to not try to sync twice. It's not critical due to IPFS immutability but critical to decrease the load
- Control the sync batches with a pause between them to decrease the load on destination
- Add directory support for sync operation