Project Setup
Host your website on EarthFast
Last updated
Host your website on EarthFast
Last updated
EarthFast is currently in Testnet, and its Smart Contracts live on Sepolia Testnet
For most projects, the is the simplest and quickest way to get setup. Continue to the docs below if you want a more involved, custom setup
Your website
Must contain an index.html
entrypoint
all rendering/logic should be run in browser (ie. no server-side rendering)
Supports client-side frameworks like React, Vue, Svelte, etc., and static site generators like Gatsby
If using Next.js, follow docs
A subdomain on which your site will be hosted
Access permissions – if your site makes API calls to backend or API services (eg. Infura, Alchemy), ensure your new EarthFast subdomain is added to any policies or domain allowlists
Ethereum
An Ethereum wallet (OwnerWallet
) to manage EarthFast resources on-chain
ETH for tx execution. For Testnet, use Sepolia ETH
USDC for paying Content Nodes. for Testnet, we will fund your OwnerWallet
with Sepolia USDC
Below commands instruct you to use this cli via npx
, which means you don't have to install anything.
For all available commands and options run npx earthfast-cli --help
. For help on individual commands append --help
to a command, eg. npx earthfast-cli project create --help
.
This is intended to run in your dev environment, not your node VM, although you can run it wherever you like. Currently supported on MacOS + Debian.
For brevity, consider setting up a shell alias like alias ef="npx earthfast-cli"
Alternatively, you can set the optional signer
flag to --signer=ledger
for use with a Ledger, or --signer=raw
to export transaction info for external signing.
If successful, you should see the below output. Save your projectId
for later.
Deposit some USDC into your project's escrow. These tokens will be used to pay Content Nodes for hosting your project site.
If successful, you should see the below output.
Find an available Content Node:
Using node IDs returned from above (the value for id
key), make your reservation. See npx earthfast-cli reservation create --help
to set the flags per your preferences.
If successful, you should see the below output.
If your project is hosted on GitHub, this option greatly simplifies the integration by taking care of both (1) bundling the site into an EarthFast-compatible artifact and (2) leveraging the binary asset serving capability of GitHub Releases to host that artifact.
Building the Site
EarthFast is designed to be able to be easily integrated into your existing build pipeline. With the help of the CLI, you will package your site’s production build into an artifact that can be served by the network (i.e. the “EarthFast bundle”).
Build your site as you normally would into a final output directory (i.e. dist, build, etc.).
The previous command will print the final bundle filename, which you’ll need now. Run the following to obtain the checksum of the bundle, which you’ll need later:
Once your site has been bundled for use on EarthFast, it needs to be published somewhere on the Internet where it’s:
Publicly accessible
Will remain available as long as it’s the live version
Both of the above are necessary because the nodes that operate the EarthFast network will fetch your site from this location throughout their serving lifetimes. However, the content is heavily cached so the request rate for the bundle should be extremely low.
Suggested locations for hosting your bundle:
GitHub Release Assets
AWS S3 / Google Cloud Storage / Azure Blob
Not recommended locations that would still work:
IPFS – you’ll need to pin the file, fetching performance will likely be poor, and you’ll need to use an IPFS gateway to get a publicly accessible URL.
Now that your bundle is hosted publicly, you need to publish it to instruct your newly reserved Content Nodes to begin serving your site.
If successful, you should be able to curl this url and get a 200 JSON response: https://<node-url>?project_id=<project-id>&resource=earthfast.json
Your project is now live on the EarthFast network, but you most likely want to set up a custom domain.
– You will use this CLI to manage all EarthFast resources.
The CLI can sign transactions for you if you import your wallet into its keystore. This is done locally using – you can see the .
The GitHub Action itself can be found at , or you can follow the demo project at for a complete example.
Create the EarthFast bundle by running the following command, replacing the placeholders with appropriate values (archive-name-and-version can be anything you want, build-dir should be the directory from above):
Follow the instructions on this repo to get setup –