Crust Wiki

Crust Wiki

  • Docs
  • Shadow
  • Contribute
  • Languages iconEnglish
    • 中文
    • Help Translate

›Integration Guide

General

  • Crust Overview
  • Crust Grants
  • Crust Ecosystem Growth
  • CRU Claims
  • LockedCRU Claims
  • LockedCRU Unlock
  • Bridge

    • Ethereum Bridge
    • Elrond Bridge
  • Crust Wallet
  • Glossary
  • Use CRU18 Guarantee
  • Parameters
  • Contributing

Learn

  • Account
  • Crust Tokens
  • New Bond
  • Guarantor
  • Validator
  • GPoS
  • sWorker

    • Overview
    • Entry Network
    • Workload
  • DSM
  • Storage Merchant
  • Identity
  • Governance Guide

Build

  • Builder's Portal
  • Crust Storage 101
  • Basics

    • Developer faucet
    • Crust Rocky Network
    • Store file with Crust Storage API
    • Store file with Crust IPFS Pinning Service API

    Crosschain Storage Solution

    • Crust's XCMP-based cross-chain dStorage solution
    • Crust's Parachain-based cross-chain dStorage solution
    • Crust's Native IPFS cross-chain dStorage solution
    • Crust's Smart contract cross-chain dStorage solution

    Integration Guide

    • DApp Hosting
    • NFTs
    • File Storage

    Node Guide

    • Crust Node
    • Crust Storage Manager

    Toolkits

    • Crust Pinner Github Action
    • Crust Pinner NPM Package
    • IPFS W3Auth Gateway
    • IPFS W3Auth Pinning Service

Build With EVM

  • Overview
  • Build With EVM 101
  • Chains

    • Ethereum
    • Optimism
    • Arbitrum
    • zkSync

    Toolkits

    • SDK

Build With Algorand

  • Overview
  • Build With Algorand 101
  • Algorand applications

Build With TON

  • Overview
  • Build With TON 101
  • TON applications

Node

  • Node Overview
  • Node Hardware Spec
  • Owner Node
  • Member Node
  • Isolation Node
  • Validator Guidance
  • Guarantor Guidance
  • sWorker Version
  • Node Benefits
  • Configure QoS

Storage

  • Overview
  • User Guidance
  • Merchant Guidance
  • Order Settlement
  • Storage Market Benefits
  • Apps Storage Issue

Q&A

  • Basic Knowledge
  • Verifiers and Candidates
  • Guarantor
  • Rewards and Punishments
  • Basic Node Problems
  • Member Node Related
  • Related Groups
  • Fix unstable chain
  • Applications
  • EPID & ECDSA
  • Other
Edit

DApp Hosting

Currenly, Crust provides 3 ways to host DApps/websites:

  1. 💻 Crust Command Line: Allows user to publish website to Crust Network through terminal command line.
  2. 📦 Crust Pin Nodejs Package: Allows user to write javascript code to publish website to Crust Network through javascript code.
  3. 🔗 Crust IPFS Pin Github Action: Allows user to integrate standard Github Action to publish website to Crust Network.

In this guide, we will host a simple React website as an example and show how to deploy and host it on Crust Network use 3 different ways.

Create a Website

  1. Instal the Crust CLI
sudo npm i -g @crustio/crust-cli
  1. Create a React app
npx create-react-app hello-crust
  1. Build it
cd hello-crust/
PUBLIC_URL=./ npm run build

Deploy to Crust IPFS Network

1. [Local Mode] Through Crust CLI

In the local mode, please make sure you have IPFS running locally, refer to this to install and run.

  • Login with seeds

SEEDS are 12 secret words of your Crust Account. You can refer to this to create your Crust Account.

npx crust-cli login [SEEDS]
  • Pin build/
npx crust-cli pin build/

You'll get an IPFS cid in this step, like QmYene5icko1cusFCG9D92YUyfonN4hmRPNdPkxvJkNjTb.

  • Publish build/
npx crust-cli publish QmYene5icko1cusFCG9D92YUyfonN4hmRPNdPkxvJkNjTb

Now your website is published into Crust Network. Storage nodes in Crust Network will get notified and try to pull your website to store.

  • Monitor website status

You can query your website's status by calling the command below, it will show you how many IPFS nodes are hosted your site.

npx crust-cli status QmYene5icko1cusFCG9D92YUyfonN4hmRPNdPkxvJkNjTb

2. [Script] Through Crust Pin Nodejs Package

We take typescript as an example, in the script mode, please make sure you have IPFS running in your code environment, refer to this to install and run.

  • Create an deploy project
mkdir site-deployer && cd site-deployer
yarn init
  • Install dependencies
yarn add ipfs-http-client @crustio/crust-pin
  • Pin site to IPFS
const IpfsHttpClient = require('ipfs-http-client');
const { globSource } = IpfsHttpClient;

/**
 * 
 * @param folderPath Site files path
 * @returns IPFS CID
 */
async function pin(path: string): Promise<string> {
    // 1. Create IPFS client
    const ipfs = IpfsHttpClient();

    // 2. Pin it
    const { cid } = await ipfs.add(globSource(path, '**/*'));
    
    return cid;
}

pin('./build/');
  • Publish site
import CrustPinner from '@crustio/crust-pin';

/**
 * 
 * @param cid IPFS cid
 */
async function publish(cid: string) {
    // 1. Create CrustPinner
    const crustPinner = new CrustPinner(process.env.CRUST_SEEDS);
    
    // 2. Publish to Crust
    await crustPinner.pin(cid);
}

publish('QmP71MVoZBWzuh7BLXSPTnGSm7ykhfxYEsD6YNThqQ3go7');

This deploy code sample can be found on Github.

3. [Github Action] Crust IPFS Pin

Crust also provides standard Github Action to help host website, you can refer ipfs-crust-pinner's template workflow to config your own Github CD.

It uses 2 Github Actions provided by Crust Network:

  • Crust IPFS Upload: This action helps to upload website onto Public IPFS Gateway - gw.crustfiles.app, this action also can be replaced by some pin services, such as Pinata Workflow, IPFS Cluster Workflow, ...
  • Crust IPFS Pin: This action helps to place a storage order(IPFS CID) on Chain, then the storage nodes will pull the file from local/gateway's IPFS and decentralized stored by the whole network.

[Optional] Link a domain

Once you deployed your website to Crust Network and since Crust is a standard IPFS Network, you can refer this doc to link your domain with IPFS CID.

Also, there is a standard Github Workflow to help automatically update the DNS Record of Cloudflare.

Cases

There's already some project used Crust Network to host their website application.

  • 🦄 Uniswap: Use Crust IPFS Pin Github Action
  • 🟣 Polkadot Apps: Uses Crust Pin Nodejs package
  • 🟠 Crust Apps: Use Crust IPFS Pin Github Action
  • More

Considerations

  • When using React-router-dom BrowserRouter should be replace by HashRouter

Resources

  • Uniswap
  • Crust Apps
  • crust-pin
  • ipfs-crust-action
  • ipfs-upload-action
  • ipfs-crust-pinner
  • website-hosting-demo
  • ipfs-http-client
← Crust's Smart contract cross-chain dStorage solutionNFTs →
  • Create a Website
  • Deploy to Crust IPFS Network
    • 1. [Local Mode] Through Crust CLI
    • 2. [Script] Through Crust Pin Nodejs Package
    • 3. [Github Action] Crust IPFS Pin
  • [Optional] Link a domain
  • Cases
  • Considerations
  • Resources
Docs
Getting StartedCRU ClaimsWebsite Hosting with CrustNFT Data Storage with Crust
Community
DiscordTwitterTelegram
More
CooperationGitHub
Copyright © 2025 Crust Network