Skip to content

Publishing this site to dat network

Posted on:January 19, 2020 at 02:56 PM

After completing the tutorial from my last post, you should have a git repo with your site. With the help of the “dat” command (npm install dat) and hashbase.io, you can publish the site to the decentralized web.

Step 1: Build your Gatsby site

gatsby build

Step 2: Create your Dat

In the /public/ directory of your gatsby site, run:

dat .

This will create your dat and start sharing.

Step 3: Mirror to Hashbase.io

After logging into Hashbash.io, you will be able to click the “add a new archive” button.

A modal will appear after asking for your dat:// address. This will be displayed in the terminal window where you ran the dat command.

(mine is dat://johnkennedy.hashbase.io/)

Step 4: Backup your dat key

dat keys export

This will give you your private key, which will enable you to recover your site and dat address if needs be.

Ongoing Publishing workflow

  1. Make publishing changes via https://your.domain/admin/
  2. Update your local codebase: git pull
  3. Recreate your local /public/ directory: gatsby build
  4. Run dat in the /public/ directory to start sharing the new version: dat .