Skip to content

grassrootseconomics/sarafu.network

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sarafu Network

Here Be Dragons

Sarafu Network is the premier dApp for interacting with CAV's (Community Asset Vouchers).

Try it on https://sarafu.network

Features

  • Create customized CAV's
  • Client-side wallet interface to interact with the Celo blockchain including sending transactions
  • Create and connect Paper Wallets
  • Transaction explorer for CAV's
  • View detailed stats for all CAV's in the Sarafu Network realm

Development

To get started, make sure you have the following prerequisites installed:

  • Git
  • Node.js (>= 18.0.0)
  • Docker (>= 24.0.0)\
  • tern

Clone the repo and cd it:

git clone https://github.com/grassrootseconomics/sarafu.network.git && cd sarafu.network

Install NPM dependencies:

pnpm i

Start postgres via Docker Compose:

cd dev
docker compose up

Update env.local file:

cp .env.local.example .env.local
# Update any value that you would like to change

Prepare DB:

In another folder, e.g. /tmp, clone cic-graph

git clone https://github.com/grassrootseconomics/cic-graph.git
cd migrations
PG_DATABASE_URL="postgresql://postgres:postgres@localhost:5432/cic_graph" tern migrate

Note: You can use any SQL migration tool to run the migrations.

# You can run the SQL queries with your tool of choice
psql -h localhost -U postgres
# Password postgres
\c cic_graph
# Run the queries

Start the development server:

pnpm run dev

Restore from a cic-graph snapshot

If you have access to a redacted snapshot, you can restore the db with the command:

docker run -i -v dev_sarafu-network-pg:/volume --rm loomchild/volume-backup restore < graph.tar.bz2

Docker

To run the app in a Docker container, uncomment the following in next.config.mjs:

// output: "standalone",

Then build the image and run it:

# Build the image
DOCKER=1 docker build -t sarafu-network .
# Run the container
docker run -p 3000:3000 sarafu-network

License

AGPL-3.0