If you aren't an existing Infura customer and store your data on a self-hosted IPFS node, you can migrate too! Focus on your business and let Infura handle all the IPFS infrastructure and monitoring.
To interact with the Infura IPFS API, you need to register your account and set up your IPFS project.
After the registration, you will be redirected to the settings page, where you find your credentials to authenticate with:
- PROJECT_ID
- PROJECT_SECRET
Using go get
:
go get -u github.com/INFURA/ipfs-copy
Cloning the source code manually and compiling it:
git clone https://github.com/INFURA/ipfs-copy.git
cd ipfs-copy
make install
Or by downloading a pre-built binary from the release page.
The ipfs-copy
command will iterate all pins from the source node, copy the blocks and then pin them to your Infura IPFS project in parallel with multiple workers for optimal performance.
ipfs-copy --source-api-url=http://localhost:5001 --project-id=<YOUR_PROJECT_ID> --project-secret=<YOUR_PROJECT_SECRET>
- optional flag
--workers=20
defines how many CIDs to pin in parallel (default: 20) - optional flag
--max-req-per-sec=50
defines the maximum amount of CIDs a worker can pin per second to avoid getting rate limited (default: 50) - optional flag
--cids-failed=/tmp/failed_pins.txt
defines an absolute path where failed pins will be logged
The .env
contains:
- IC_SOURCE_API_URL
- IC_PROJECT_ID
- IC_PROJECT_SECRET
- IC_WORKERS
- IC_MAX_REQ_PER_SEC
- IC_CIDS_FAILED
cp new-self-hosted-users-sample.env .env
source .env && ipfs-copy
Done! You have migrated your content to Infura IPFS service!
Configure your IP inside the Allowlist -> Limit IP Access in your project's security settings to restrict access only from a desired list of IPs.