This repository contains the code for the 0L Network explorer and is structured in the following way:
api
: This directory contains the backend inNest.js
, the source fortransformer
binary and the required migration files.infra
: This directory contains the K8s YAML files for deployment on K8s.ol-fyi-local-infra
: This directory contains files for setting up the databases locally using docker-compose.web-app
: This directory contains the client-side code for the 0L Explorer app.
This documentation will walk you through setting up and running the Wallet Explorer project locally from scratch. Follow these steps carefully to ensure a smooth setup process:
Before you begin, ensure you have the following installed on your system:
- Docker: Install Docker
- Node.js and npm:
- Install nvm (Node Version Manager) from the nvm GitHub repository.
- Use nvm to install and use the Node.js version specified in your project's .nvmrc file:
nvm install nvm use
- Rust and Cargo: Install Rust
Once you are set, follow the steps:
-
First, set up all the necessary components using Docker Compose.
-
Navigate to the
ol-fyi-local-infra
directory.cd ./ol-fyi-local-infra
-
Once you are in the
ol-fyi-local-infra
directory, run:docker compose up -d
This brings all the databases up:
- Redis
- Clickhouse
- NATS
- Postgres
Check the status using:
docker ps
Once the Clickhouse database is up and running, you can connect to it and execute using:
docker compose exec -it clickhouse clickhouse client -h "127.0.0.1" --port 9000 -u "olfyi" --password "olfyi" -n
After connecting to the clickhouse client, execute the queries to
run the migrations stored in the tables_local.sql
file manually.
Navigate to the transformer directory and build the project:
cd ./api/transformer
Build the binary:
cargo build
Navigate to api
directory.
cd api
nvm install
nvm use
We use Primsa.
- Run
npx prisma generate
if you updateapi/prisma/schema.prisma
. - Run
npx prisma db push
to migrate the database.
First, install the project dependencies:
npm install
Don't forget to configure the .env
on your machine
cp .env.example .env
To run your Nest application, use the following commands:
# development
npm run start
# watch mode
npm run start:dev
# production mode
npm run start:prod
Once the backend is running, run the client,
cd web-app
First, install the project dependencies:
npm install
And run it with:
npm run dev