Crust Storage 101
Want to store files on Crust but still get confused? No worries, this article will give you a brief introduction to the storage process of Crust Network! You'll learn:
- How to upload your file to IPFS and pin the file on Crust
- How to add balance and extend the expiry of your storage order
- How to check the storage status of your file
The following pictures show the Crust storage process in general:
STEP 1. Upload file to IPFS
First, you need to upload the file to the IPFS network(cached on a long-running IPFS node). There are 2 ways to upload the file to IPFS:
- Upload the file to IPFS Gateway through IPFS HTTP API
- Pin the file to a local IPFS node through IPFS P2P protocol
For the 1st way, Crust provides a web3-oriented gateway, which is provided by Crust storage nodes for free and 100% compatible with standard IPFS HTTP interfaces. More details in below:
- Learn how to upload files through the Web3Auth gateway with code on LINK
- Learn the tech detail of the Web3Auth gateway on LINK
- Get all FREE usable gateways on LINK
- Learn the gateways' performance on LINK
- More IPFS HTTP APIs on LINK
Specially, Cloud3 provides a different implementation of authenticated gateway based on W3Bucket NFT, which is also 100% compatible with standard IPFS HTTP interfaces. Check the LINK for more details.
For the 2nd way, you need to install IPFS and keep it running background. More details can be referred to IPFS docs:
After uploading the file to IPFS, you will get a cid
, which is the unique identity of the file. Crust storage nodes also use cid
to retrieve the file.
STEP 2. Pin the file on-chain and add balance
Then, you need to "tell" Crust storage nodes that the file is ready to be stored! To accomplish that, you need to send a transaction on the Crust chain. There are 2 different ways:
- Directly send the transaction with Crust on-chain interface
- Send cross-chain transaction with Crust IPFS pinning service
For the 1st way, you can simply follow the steps below to communicate with the Crust chain:
- Create a Crust account on LINK
- Get free storage quota:
- Join Crust discord
- Follow the pinned message on
📦free-storage
channel
- Send a transaction with typescript code on LINK
The 2nd way is for cross-chain, most public chains support directly calling Crust storage interface through standard IPFS pinning service, More details can be referred below:
- Learn how to call Crust cross-chain storage API with code on LINK
- Learn Crust's cross-chain solution(How Crust IPFS pinning service work) on LINK
- Supported platforms:
- All Ethereum-compatible chains: Polygon, Moonriver, BSC, ...
- All substrate-compatible chains: Polkadot, Kusama, Acala, Clover, ...
- Others: Elrond, Solana, Flow, and Near
If you are using Cloud3 W3Bucket on ethereum mainnet, check the LINK to learn how to call Cloud3 storage API with W3Auth Token.
After you "told" Crust storage nodes, they're starting pulling the file through the IPFS network. After a few minutes, you can query the file's storage status on-chain:
- How many replicas of the file exist on the IPFS through Crust Network
- Which nodes are storing your file
- How long will the file be guaranteed to be stored on Crust Network
- How much is the file valued
The default storage time for a single transaction(order) is 6 months. If you want to extend the storage duration, Crust provides a pre-paid pool for you to customize the file's storage time, it allows you to add balance and automatically extend the file's expiry time. You can learn more details about the pre-paid pool below:
- Crust storage price calculator on LINK
- Learn how to add balance to the pre-paid pool on LINK
- Learn more about Crust’s pricing model on LINK
- Get real-time Crust storage price on LINK
STEP 3. Visually check storage status
At last, you can visually check the file's storage states via IPFS Scan. IPFS Scan is a DApp that shows rich information of files on IPFS, including:
- How is the file distributed in the world
- Where to retrieve the file
- Which nodes are storing the file
- In which incentive layers the file are stored(Crust/Filecoin/Arweave)
- How much the file valued
The 1st page of IPFS Scan shows 1-2
And the 2nd page shows 3-5
With IPFS Scan, you can easily track the status of files on decentralized storage networks and monitor files' on-chain status in incentive layers.
At last
That's a brief introduction to Crust's storage process, but in the Crust world, we offer much more than that! The following toolkits and some example cases may give you some ideas on how to integrate Crust into your project.
Toolkits
- IPFS W3Auth gateway uploader Github action: Auto-deploy the DApp/website through Github action
- Crust Pinner Github action: Decentralized pin(send tx) to Crust chain through Github action
- Crust Pinner node package: Node.js package module provides decentralized pin(send tx) to Crust chain function
- Crust CLI: Crust command-line tool, provides pin to local IPFS, pin to Crust(send tx), and query on-chain storage status function
Case Examples
- Uniswap release process with Crust Pinner Github action
- AAVE deploy process with Crust Pinner Github action
- Polkadot deploy process with Crust Pinner node package
- Crust Files - the E2E storage process
- W3Bucket - an NFT gated Web3 Cloud Storage solution provided by Cloud3
Demos/Code Tutorials