Build Decentralized Web with NBdomain

NBdomain
Coinmonks
2 min readMar 25, 2021

--

As we already know, the NBdomain system is created to fix the problems of traditional domain system and provide powerful features in Web3.

We also have learnt how to put markdown content into a NBdomain.

Here we want to cover the most important part, how to build a full featured, decentralized website on NBdomain system?

We will utilize IPFS to host the content

Why IPFS ?

IPFS is a well known, matured technology that can host data in a decentralized way. It’s been used by a lot of projects which means it’s quite reliable now. To learn more about IPFS, please visit https://ipfs.io .

It offers one unique feature that most blockchain projects are struggling with, the data on IPFS can be removed. It gives content providers a peace in mind, no need to worry about wrongly uploaded content.

NBdomain utilizes IPFS to host contents and put the hash of the content on blockchain, which perfectly prove the ownership and greatly reduced the hosting cost.

Please note: Using IPFS to host decentralized sites is just a use case of NBdomain. It’s not the only way to host sites on NBdomain. For example, an app can also be made to host all site contents on blockchain.

Step by Step instructions

  1. Put all files of the website into a folder.
  2. Upload the folder to IPFS, using self hosting node or a cloud service provider.
  3. After the upload is completed, you will have a CID of the content, which looks like “QmehANHLuNBkBo42Y54s4TH6UaSrSKbjjGtTut1CvhNV8y”
  4. Goto https://nbdomain.com , login to your domain and create a new subdomain( or update an existing subdomain) with below content, using the CID of your content:

If you use “ * ” as the name of subdomain, its content will be the default content when people visit your NBdomain.

5. Open your NBdomain or subdomain in Maxthon browser. You shall be able to see your websites.

The site will show content of the file defined by ‘home’ key, default is ‘index.html’ file in the folder. If there is no ‘index.html’, the file list of the folder will be shown.

You can use either of below ways to view NBdomain websites

Assuming your nbdomain is hello123.b

  1. Maxthon Browser: visit hello123.b directly
  2. Google chrome with the extension: visit hello123.b directly
  3. Via a NBnode gateway in the form gatewayurl/hello123.b
    * https://api.nbdomain.com/web/hello123.b
    * https://nbnode.maxthon.com/web/hello123.b
    * http://127.0.0.1:9000/web/hello123.b (if you setup a NBnode on your local machine)

Some cool sites built by our community

NBdomain user telegram group https://t.me/nbdomain

NBdomain developer telegram group https://t.me/nb_dev

--

--

NBdomain
Coinmonks

Blockchain Domain + Global ID + Updatbale DataStore