Development Guide: deploying decentralized web pages / DAPP on crust

By April 26, 2021DApps
Click here to view original web page at javamana.com

“Crust Provides Web3 Decentralized storage networks for ecosystems , Support includes IPFS Multiple storage layer protocols within , And provide interface for application layer .Crust Our technology stack can also support the decentralized computing layer .Crust It aims to build a distributed cloud ecosystem that attaches importance to data privacy and ownership .”

2

Uniswap Integrated in its code for Automated Deployment Crust Storage function of network .Crust Have been to Uniswap Webpage (app.uniswap.org) Provides 100 Multiple IPFS Copies of documents . in other words , When users access Uniswap when , Pages will come from hundreds of Crust At the nodes of the network .

See :

https://github.com/Uniswap/uniswap-interface/pull/1342

Besides ,PolkaApps Code has also been merged , Deploy its front-end pages in Crust In the network , Achieve truly decentralized web deployment .

See :

https://github.com/polkadot-js/apps/pull/4933

meanwhile ,Crust The technology community contributes to open source CI flow, Support in Crust Decentralized deployment of websites and DApp.

More technical details can be added to Crust Discord group :https://discord.gg/UtbAuQt

stay IPFS Build a website on the Internet / DApp There are many benefits , For example, no server architecture 、 Yes DNS Hijacking has the potential to resist ( In the use of IPNS / ENS Technical time ) And can ensure the reliability of the website .Uniswap As one of the most well-known decentralized exchanges , Already with IPFS Collaboration and integration for up to a year , At the same time, they also introduced IPFS Integrated information for .

This paper expounds the whole process in detail , It also introduces the use of Crust A way to deploy a website in a more decentralized way .

1. stay IPFS Upper management Uniswap

step 1: structure Uniswap Website

Uniswap Build a website , Latest version Uniswap All the content of will be contained in a Build Folder in .

step 2: Upload to IPFS

adopt Pinata( A kind of IPFS Ecological storage services , Also called Pin service ),Uniswap Upload Build Folder To IPFS The Internet , After the upload , Anyone can go through IPFS The Internet retrieved this BuildFolder.

step 3: stay IPFS On Pin live

Uniswap Front end and IPFS Pin Service integration . Currently integrated Pin Service contains :pinata.cloud and Crust Network, Ensured Build Folder Spread Throughout the network .

step 4: to update DNS Record

Uniswap Front-end DNS To configure , Make the site readable URL app.uniswap.org Visit .DNS The record configuration is as follows :

● app.uniswap.org Of CNAME Record , Configure to cloudflare-ipfs.com

●_dnslink.app.uniswap.org Of TXT Record , Configure to dnslink=/ipfs/QmRELxvJy8rNA5EoCpYQkWKzxi5y1zCMmcM4UveBaNGuLo

At the time of writing ,Uniswap Front-end Content ID by QmRELxvJy8rNA5EoCpYQkWKzxi5y1zCMmcM4UveBaNGuLo, once Uniswap Front end update , The ID It could change .

Continuous integration and deployment CICD

Uniswap Integrate the above steps into GitHub Actions in , Built an automated CI/CD The Conduit .

2. decentralized Uniswap Front end deployment

Uniswap Use Crust Network As its Pin One of the services , Decentralize deployment . whenever Uniswap When the front end is updated , The corresponding deployment workflow will be executed automatically , Trigger at the same time Crust IPFS Pin Actions.

Crust IPFS Pin Action Will help the caller in Crust Network Generate storage orders on ( A website that contains BuildFolder Of IPFS file ID Orders on the chain ). When this is done , Website build folder Will pass through Crust Network Storage nodes for storage and distribution . Both the process of placing orders and the process of document distribution are decentralized .

After the storage order is generated , Information including file status and number of copies can be viewed on the chain , And can pass through Crust Apps To view the .

 picture
As can be seen from the above figure ,Uniswap pagefile

( have CID QmbvfctPrBHtSBrvBY8ENRbkaFzeJt2rP7gu6cTdBKJNVe)Pin stay Crust Network 122 A node .

3. A general website /DApp Deployment process

Crust Provides a generic Github Workflow , Developers can use it to decentralize deployment sites /DApp, Please refer to :

IPFS Crust Workflow fixed template :

https://github.com/crustio/ipfs-crust-pinner/blob/main/.github/workflows/template.yml

Combined with this workflow , The whole deployment process is as follows ( Take website deployment as an example ):

step 1: Create a website

And Uniswap The steps to build a web page are the same , Web files also need to be included in a Build Folder in .

step 2: Upload to IPFS

When doing this step , Will trigger Crust IPFS Upload Action.

The Build Folder Upload to a public IPFS gateway -crustwebsites.net On .

step 3: stay IPFS On Pin Live in web files

This step will trigger Crust IPFS Upload Action. Website Build Folder Will be Crust Network Storage nodes of Pin Live and distribute .

step 4: to update DNS Record

Finally, developers need to refer to this document for DNS Configuration update . Besides ,Crust It also provides a standard Github Workflow to help automatically update Cloudflare Of DNS Record .

Further decentralization

Developers can integrate domain name resolution services such as Ethereum (ENS) Something like that , For its website /DApp Providing more secure and decentralized services , And effectively prevent being DNS hijacked .

The key words of this article can be found in the links below .

4. Reference material

IPFS Reference material

● What is IPFS

https://docs.ipfs.io/concepts/what-is-ipfs/#decentralization

● IPFS Pinning

https://docs.ipfs.io/concepts/persistence/#pinning-in-context

● DNS Link

https://docs.ipfs.io/how-to/websites-on-ipfs/link-a-domain/#domain-name-service-dns

Crust Reference material

Crust Provides Web3 Decentralized storage networks for ecosystems .

● Crust Network

https://crust.network/

● Crust JS

https://github.com/crustio/crust.js/tree/main/packages/crust-pin

● Crust IPFS Action

https://github.com/crustio/ipfs-crust-action

● Crust IPFS Upload Action

https://github.com/crustio/ipfs-upload-action

● IPFS Crust Pinner

https://github.com/crustio/ipfs-crust-pinner

● A Demo of Website Hosting

https://github.com/crustio/crust-demo/tree/main/website-hosting-demo

About Crust Network

Crust Provides Web3 Decentralized storage networks for ecosystems , Support includes IPFS Multiple storage layer protocols within , And provide interface for application layer .Crust Our technology stack can also support the decentralized computing layer .Crust It aims to build a distributed cloud ecosystem that attaches importance to data privacy and ownership .

Strive for and Crust The main network has the same function Crust Maxwell Preview Web On 2 month 4 Day of launch , Integrate Crust All the core functions , Including token pledge 、 Decentralized storage market DSM And document retrieval mechanism .

Crust Network Join successively Substrate Builders Program、Web3.0 Bootcamp, And get Web3 The foundation Grant .

Crust relevant :\

Crust Network Technical white paper v1.9.8

Crust Network Economic white paper v.1.1

Crust Network Token indicators & economics

Official website :https://crust.network/

Twitter:@CrustNetwork

Medium:https://medium.com/@crustnetwork

GitHub:https://github.com/crustio

Telegram:https://t.me/CrustNetwork

 picture
本文为[Crust distributed cloud]所创,转载请带上原文链接,感谢 https://javamana.com/2021/04/20210426102605482V.html

Leave a Reply