<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Crust Network</title>
    <description>The latest articles on DEV Community by Crust Network (@crustnetwork).</description>
    <link>https://dev.to/crustnetwork</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1018605%2F1cc0bebd-803f-4f20-ae6a-88773e3b5c08.jpg</url>
      <title>DEV Community: Crust Network</title>
      <link>https://dev.to/crustnetwork</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/crustnetwork"/>
    <language>en</language>
    <item>
      <title>Crust Storage 101</title>
      <dc:creator>Crust Network</dc:creator>
      <pubDate>Wed, 01 Feb 2023 05:23:05 +0000</pubDate>
      <link>https://dev.to/crustnetwork/crust-storage-101-5g2d</link>
      <guid>https://dev.to/crustnetwork/crust-storage-101-5g2d</guid>
      <description>&lt;p&gt;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:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;How to upload your file to IPFS and pin the file on Crust&lt;/li&gt;
&lt;li&gt;How to add balance and extend the expiry of your storage order&lt;/li&gt;
&lt;li&gt;How to check the storage status of your file&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The following pictures show the Crust storage process in general:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3a0my8o7mtccvj6lm1ya.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3a0my8o7mtccvj6lm1ya.png" alt="Image description" width="800" height="337"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;STEP 1. Upload file to IPFS&lt;/strong&gt;&lt;br&gt;
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:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Upload the file to IPFS Gateway through IPFS HTTP API&lt;/li&gt;
&lt;li&gt;Pin the file to a local IPFS node through IPFS P2P protocol&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;For the 1st way, Crust provides a &lt;a href="https://docs.ipfs.tech/concepts/ipfs-gateway/#gateway-types" rel="noopener noreferrer"&gt;web3-oriented gateway&lt;/a&gt;, which is provided by Crust storage nodes for free and 100% compatible with standard IPFS HTTP interfaces. More details in below:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Learn how to upload files through the Web3Auth gateway with code on &lt;a href="https://wiki.crust.network/docs/en/buildFileStoringDemo#1-upload-file-to-ipfs" rel="noopener noreferrer"&gt;LINK&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Learn the tech detail of the Web3Auth gateway on &lt;a href="https://wiki.crust.network/docs/en/buildIPFSWeb3AuthGW" rel="noopener noreferrer"&gt;LINK&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Get all FREE usable gateways on &lt;a href="https://github.com/crustio/ipfsscan/blob/main/lib/constans.ts#L29" rel="noopener noreferrer"&gt;LINK&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Learn the gateways' performance on &lt;a href="https://github.com/crustio/ipfs-w3auth-gateway/blob/main/docs/PERFORMANCE.md#summary" rel="noopener noreferrer"&gt;LINK&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;More IPFS HTTP APIs on &lt;a href="https://docs.ipfs.tech/reference/http/api/" rel="noopener noreferrer"&gt;LINK&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;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 &lt;a href="https://docs.cloud3.cc/w3bucket/aboutnft/" rel="noopener noreferrer"&gt;LINK&lt;/a&gt; for more details.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For the 2nd way, you need to install IPFS and keep it running background. More details can be referred to IPFS docs:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Learn how to install IPFS on &lt;a href="https://docs.ipfs.tech/install/" rel="noopener noreferrer"&gt;LINK&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Learn how to pin(add) file on &lt;a href="https://docs.ipfs.tech/how-to/pin-files/" rel="noopener noreferrer"&gt;LINK&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;STEP 2. Pin the file on-chain and add balance&lt;/strong&gt;&lt;br&gt;
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:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Directly send the transaction with Crust on-chain interface&lt;/li&gt;
&lt;li&gt;Send cross-chain transaction with Crust IPFS pinning service&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For the 1st way, you can simply follow the steps below to communicate with the Crust chain:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create a Crust account on &lt;a href="https://wiki.crust.network/docs/en/crustAccount" rel="noopener noreferrer"&gt;LINK&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Get free storage quota:&lt;/li&gt;
&lt;li&gt;Join Crust &lt;a href="https://discord.com/invite/WQQHnyKCmn" rel="noopener noreferrer"&gt;discord&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Follow the pinned message on 📦free-storage channel&lt;/li&gt;
&lt;li&gt;Send a transaction with typescript code on &lt;a href="https://wiki.crust.network/docs/en/buildFileStoringDemo#2-place-storage-order" rel="noopener noreferrer"&gt;LINK&lt;/a&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;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:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Learn how to call Crust cross-chain storage API with code on &lt;a href="https://wiki.crust.network/docs/en/buildFileStoringWithGWDemo#2-pin-file-through-ipfs-pinning-service" rel="noopener noreferrer"&gt;LINK&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Learn Crust's cross-chain solution(How Crust IPFS pinning service work) on &lt;a href="https://medium.com/crustnetwork/crusts-cross-chain-dstorage-solution-f7ff837ed0ef" rel="noopener noreferrer"&gt;LINK&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Supported platforms:&lt;/li&gt;
&lt;li&gt;All Ethereum-compatible chains: Polygon, Moonriver, BSC, ...&lt;/li&gt;
&lt;li&gt;All substrate-compatible chains: Polkadot, Kusama, Acala, Clover, ...&lt;/li&gt;
&lt;li&gt;Others: Elrond, Solana, Flow, and Near&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you are using Cloud3 W3Bucket on ethereum mainnet, check the &lt;a href="https://docs.cloud3.cc/w3bucket/uploadfile/" rel="noopener noreferrer"&gt;LINK&lt;/a&gt; to learn how to call Cloud3 storage API with W3Auth Token.&lt;/p&gt;

&lt;p&gt;After you "told" Crust storage nodes, they're starting pulling the file through the IPFS network. After a few minutes, you can query the &lt;a href="https://apps.crust.network/?rpc=wss%3A%2F%2Frpc.crust.network#/chainstate" rel="noopener noreferrer"&gt;file's storage status on-chain&lt;/a&gt;:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foeoffh3g7oq7ofsod9vw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foeoffh3g7oq7ofsod9vw.png" alt="Image description" width="800" height="284"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;How many replicas of the file exist on the IPFS through Crust Network&lt;/li&gt;
&lt;li&gt;Which nodes are storing your file&lt;/li&gt;
&lt;li&gt;How long will the file be guaranteed to be stored on Crust Network&lt;/li&gt;
&lt;li&gt;How much is the file valued&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;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:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Crust storage price calculator on &lt;a href="https://crust.subscan.io/tools/storage_calculator" rel="noopener noreferrer"&gt;LINK&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Learn how to add balance to the pre-paid pool on &lt;a href="https://wiki.crust.network/docs/en/buildFileStoringDemo#4-add-file-assurance" rel="noopener noreferrer"&gt;LINK&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Learn more about Crust’s pricing model on &lt;a href="https://wiki.crust.network/docs/en/DSM#2-price-mechanism" rel="noopener noreferrer"&gt;LINK&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Get real-time Crust storage price on &lt;a href="https://crust.subscan.io/storage" rel="noopener noreferrer"&gt;LINK&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;STEP 3. Visually check storage status&lt;/strong&gt;&lt;br&gt;
At last, you can visually check the file's storage states via &lt;a href="https://ipfs-scan.io/" rel="noopener noreferrer"&gt;IPFS Scan&lt;/a&gt;. IPFS Scan is a DApp that shows rich information of files on IPFS, including:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;How is the file distributed in the world&lt;/li&gt;
&lt;li&gt;Where to retrieve the file&lt;/li&gt;
&lt;li&gt;Which nodes are storing the file&lt;/li&gt;
&lt;li&gt;In which incentive layers the file are stored(Crust/Filecoin/Arweave)&lt;/li&gt;
&lt;li&gt;How much the file valued&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The 1st page of IPFS Scan shows 1-2&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fooh9etu13oyse1qi1c8j.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fooh9etu13oyse1qi1c8j.png" alt="Image description" width="800" height="424"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And the 2nd page shows 3-5&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz6vvdusmaz8xqbqn7ezb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz6vvdusmaz8xqbqn7ezb.png" alt="Image description" width="800" height="397"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With IPFS Scan, you can easily track the status of files on decentralized storage networks and monitor files' on-chain status in incentive layers.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;At last&lt;/strong&gt;&lt;br&gt;
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.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Toolkits&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://github.com/marketplace/actions/crust-ipfs-upload" rel="noopener noreferrer"&gt;IPFS W3Auth gateway uploader Github action&lt;/a&gt;: Auto-deploy the DApp/website through Github action&lt;br&gt;
&lt;a href="https://github.com/marketplace/actions/crust-ipfs-pin" rel="noopener noreferrer"&gt;Crust Pinner Github action&lt;/a&gt;: Decentralized pin(send tx) to Crust chain through Github action&lt;br&gt;
&lt;a href="https://github.com/crustio/crust.js/tree/mainnet/packages/crust-pin" rel="noopener noreferrer"&gt;Crust Pinner node package&lt;/a&gt;: Node.js package module provides decentralized pin(send tx) to Crust chain function&lt;br&gt;
&lt;a href="https://github.com/crustio/crust-cli" rel="noopener noreferrer"&gt;Crust CLI&lt;/a&gt;: Crust command-line tool, provides pin to local IPFS, pin to Crust(send tx), and query on-chain storage status function&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Case Examples&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://github.com/Uniswap/interface/blob/main/.github/workflows/release.yaml#L58-L64" rel="noopener noreferrer"&gt;Uniswap&lt;/a&gt; release process with Crust Pinner Github action&lt;br&gt;
&lt;a href="https://github.com/aave/aave-ui/blob/master/.github/workflows/deploy_prod.yml#L28-L34" rel="noopener noreferrer"&gt;AAVE&lt;/a&gt; deploy process with Crust Pinner Github action&lt;br&gt;
&lt;a href="https://github.com/polkadot-js/apps/blob/master/scripts/ipfsUpload.mjs#L94-L97" rel="noopener noreferrer"&gt;Polkadot&lt;/a&gt; deploy process with Crust Pinner node package&lt;br&gt;
&lt;a href="https://github.com/crustio/crust-files" rel="noopener noreferrer"&gt;Crust Files&lt;/a&gt; - the E2E storage process&lt;br&gt;
&lt;a href="https://github.com/decooio/w3bucket-contracts" rel="noopener noreferrer"&gt;W3Bucket&lt;/a&gt; - an NFT gated Web3 Cloud Storage solution provided by Cloud3&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Demos/Code Tutorials&lt;/strong&gt;&lt;br&gt;
Crust demo on &lt;a href="https://github.com/crustio/crust-demo" rel="noopener noreferrer"&gt;LINK&lt;/a&gt;&lt;br&gt;
Crust workshop on &lt;a href="https://github.com/RoyTimes/crust-workshop" rel="noopener noreferrer"&gt;LINK&lt;/a&gt;&lt;/p&gt;

</description>
      <category>crypto</category>
      <category>blockchain</category>
      <category>web3</category>
      <category>offers</category>
    </item>
  </channel>
</rss>
