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 fortransformerbinary 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-infradirectory.cd ./ol-fyi-local-infra -
Once you are in the
ol-fyi-local-infradirectory, run:docker compose up -d
This brings all the databases up:
- Redis
- Clickhouse
- NATS
- Postgres
Check the status using:
docker psOnce 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" -nAfter connecting to the clickhouse client, execute the queries to
run the migrations stored in the tables_local.sql file manually.
docker compose exec -T clickhouse clickhouse-client --database=olfyi -n < ../api/tables_local.sqlNavigate to the transformer directory and build the project:
cd ./api/transformerBuild the binary:
cargo buildNavigate to api directory.
cd apinvm install
nvm useWe use Primsa.
- Run
npx prisma generateif you updateapi/prisma/schema.prisma. - Run
npx prisma db pushto migrate the database.
First, install the project dependencies:
npm installDon't forget to configure the .env on your machine
cp .env.example .envTo run your Nest application, use the following commands:
# development
npm run start
# watch mode
npm run start:dev
# production mode
npm run start:prodOnce the backend is running, run the client,
cd web-appFirst, install the project dependencies:
npm installAnd run it with:
npm run dev