Blockchain Stack
CELO (Pre Hardfork)

Celo Blockchain (Pre Hardfork)

All Grassroots Economics components have been specifically developed to run on any EVM blockchain, primarily targetting Celo.

Full node

Sarafu Network and the Custodial Stack specifically requires a full node with the flowing API's enabled:

  • eth.
  • net.
  • txpool.
  • debug.

And the following transports also enabled:

  • Websocket.
  • RPC.

Docker deployment

We provide an easy to use Docker setup (opens in a new tab) to quickly setup a full node.

System Requirements

For Alfajores testnet:

  • 4 vCPU
  • 8 GB RAM
  • 200 GB SSD storage
  • 100Mbps network connection

For Mainnet:

  • 4 vCPU
  • 12 GB RAM
  • 500 GB SSD storage
  • 100Mbps network connection

Prerequisites

  • Docker
  • chrony or any other NTP daemon
  • A download manager e.g. aria2
  • zstd

Firewall Requirements

The following ports should be open to the internet:

  • 30303/udp
  • 30303/tcp
  • 443/tcp
  • 80/tcp

Quick Docker installation

ℹ️

This step can be skipped if you have Docker already installed.

$ apt update && apt upgrade --yes
$ apt install curl
$ curl -fsSL https://get.docker.com | bash

Quick Other Required Packages installation

ℹ️

This step assumes you are on an Ubuntu/Debian based OS.

$ apt install git chrony aria2 unzip

Setup

1. Download Celo snapshot

Celo offers periodic snapshots that allow you to get you blockchain node up and running as fast as possible. The links are:

  • Mainnet: https://storage.googleapis.com/celo-chain-backup/mainnet/chaindata-latest.tar.zst (Contains a missing block, may require manual rewinding)
  • Alfajores Tesnet: https://storage.googleapis.com/celo-chain-backup/alfajores/chaindata-latest.tar.zst
  • Baklava Testnet: https://storage.googleapis.com/celo-chain-backup/baklava/chaindata-latest.tar.zst

To download either of these:

$ aria2c -x 16 -s 16 $DOWNLOAD_LINK

The downloaded archive will be used in step 4.

2. Clone grassrootseconomics/celo-node Repo

Grassroots Economics provides an opinionated and alternative devops setup flavor to the official full node setup provided by Celo (opens in a new tab).

$ git clone https://github.com/grassrootseconomics/celo-node.git

3. Prepare directories

$ cd celo
$ docker network create celo
$ docker compose up
# After a few seconds, cancel the operation with CTRL+C

This step will create a data folder inside the current celo folder.

4. Extract and restore the downloaded snapshot

⚠️

This step requires sudo permissions because of the container init user. It also requires running sensitive delete commands i.e. rm and mv.

$ tar --use-compress-program=unzstd -xvf chaindata-latest.tar.zst
# This assumes you are in the root folder of the cloned celo-node
$ sudo mv chaindata data/celo

4. Bring up Celo node container

# If you want to run the testnet node, modify the docker-compose.yaml file first! i.e. --alfajores flag
$ docker compose up -d

4. Bring up Caddy container

ℹ️

This step should only be run if you plan on exposing your node's APIs to the internet.

# In the celo-node folder
$ cd caddy
# Update the Caddyfile with correct values
$ docker compose up -d