Bootsrapping from an existing IPFS Cluster


IPFS-Cluster | Documentation​

Bootsrapping from an existing IPFS Cluster | Documentation​

IPFS is designed so that a node only stores files locally that are specifically requested. The following is one way of populating a new IPFS node with all existing files from a pre-existing node.
To do so, first create a secret from node0, the original node, then share that secret with node1, the node you want to bootstrap from node0. Then node1 runs the bootstrap command specifying the cluster’s address and setting the CLUSTER_SECRET as an env variable.
  • export CLUSTER_SECRET=$(od -vN 32 -An -tx1 /dev/urandom | tr -d ' \n')
  • ipfs-cluster-service init
  • ipfs-cluster-service daemon
node1 (bootstrapping from node0)
  • export CLUSTER_SECRET=<copy from node0>
  • ipfs-cluster-service init
  • ipfs-cluster-service daemon --bootstrap /ip4/ // replace with what you see from running node0’s daemon
  • ipfs-cluster-ctl peers ls check your peers to see you’ve added node0 correctly
  • if you want to remove a peer after the bootstrapping is complete, the following command will do that and shut down the IPFS cluster
  • ipfs-cluster-ctl peers rm QmYFYwnFUkjFhJcSJJGN72wwedZnpQQ4aNpAtPZt8g5fCd
Copy link