Skip to content

Latest commit

 

History

History
68 lines (46 loc) · 1.41 KB

README.md

File metadata and controls

68 lines (46 loc) · 1.41 KB

ipfs-mgm

Script to manage the IPFS files. It can be used to sync the CID's between two nodes

Install

Manually

go install cmd/cli/ipfs-mgm.go

Usage

View help:

ipfs-mgm

or

ipfs-mgm --help
View subcommand help:
ipfs-mgm sync --help

Transfer all files from one IPFS node to another:

ipfs-mgm sync -s <SOURCE URL> -d <DESTINATION URL>

Transfer only specific files from one IPFS node to another:

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

Docker

The easiest way is to use the built docker image

docker run -it ghcr.io/graphprotocol/ipfs-mgm sync --help

TODO:

  • 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