EarthFast Documentation
earthfast.com
  • Overview
    • Quickstart
    • Architecture
    • Next.js
    • FAQ
  • Security
  • PROJECTS
    • Project Setup
    • Project Dashboard
  • Node Operators
    • Content Node Setup
Powered by GitBook
On this page
  • Overview
  • User Flow (Read only)
  • Project Flow (Create & Update)
  • Node Operator Flow
  • System Components
  • Project Owner
  • EarthFast Smart Contracts
  • Content Node
  • Domain Node
  • Browser Service Worker
  1. Overview

Architecture

Last updated 1 month ago

Overview

This page introduces the high level components in EarthFast and the user and project flows that are for both static assets and Next.js. For more specific information about server side rendered (SSR) Next.js see .

User Flow (Read only)

This is how an end-user interacts with an EarthFast-hosted site

  1. Make request to site URL, which is pointed to project's Domain Node

    1. Domain Node returns service worker to user's browser

  2. Service worker securely fetches project content from Content Nodes

Project Flow (Create & Update)

This is how project owners create & manage their EarthFast projects

Create Project

  1. Create project on EarthFast Smart Contracts

  2. Connect DNS to Domain Node

  3. Make a reservation with Content Nodes to host project content

Update Project

  1. Update project metadata on EarthFast Smart Contracts

Node Operator Flow

  1. Operator sets up node, per specs defined in Node Operators

  2. Operator registers node on EarthFast Smart Contracts

  3. Operator can manage project reservations as needed

System Components

Project Owner

The on-chain entity that owns + manages an EarthFast project. It can be any on-chain address, eg. a DAO, governance contract, multisig, or wallet.

EarthFast Smart Contracts

Set of on-chain contracts for state & management of: projects, nodes, and reservations.

More info will be available once contracts are open sourced.

Content Node

An EarthFast Content Node is essentially an HTTP file server, acting on behalf of a project that has paid to reserve it. The project dictates what content should be served recording the URL of a tarball containing the project website (and its checksum) onto the EarthFast Smart Contracts. Content Nodes that have been reserved will fetch their project's tarball from its origin, verify it, and serve its file contents when requested. Content Nodes can serve static assets via a static file server or Next.js by running a server process.

In addition to serving files for a project, Content Nodes also participate in a distributed monitoring system whereby peer nodes are assessed for uptime and performance. This data is collected over time and stored in a local database, where it eventually gets retrieved by the EarthFast network reconciliation process.

Domain Node

A server that is responsible for responding to browser's DNS requests and maintaining SSL for a project's domain. Domain Nodes host none of the website content directly, in the case of static asset projects the Domain Node serves the service worker and in Next.js projects acts as a proxy between the browser and content nodes.

Since this node provides SSL, there is an element of trust. There's ways to mitigate attacks and add redundancy by running multiple Domain Nodes or setting multivariate A records on the DNS.

Browser Service Worker

A service worker in the web browser handles end-user requests. It runs a set of static HTML and JS files returned by the Domain Node. These files are project specific and have a list of Content Nodes for the project based on the browser's location.

This Service Worker is also responsible for fetching the correct content bundle from Content Nodes and verifying that each file in the bundle matches the expected checksum. The service worker does not run in Next.js, only static asset projects.

The requirements for running a Content Node are outlined in the page, but generally follow from its responsibility as a basic HTTP server: it must be reachable via HTTPS, needs a modest amount of dedicated CPU/memory, persistent storage, and a high quality network link.

Content Node Setup
Content Node Setup
this page