Skip to content

Latest commit

 

History

History
147 lines (93 loc) · 3.05 KB

Installation.md

File metadata and controls

147 lines (93 loc) · 3.05 KB

zkDatabase Installation Guide

Prerequisites

  • Ensure you have Git, Yarn, and Docker installed on your system.

1. Clone the Repository

First, clone the zkDatabase repository and navigate into the directory:

git clone https://github.com/orochi-network/zkDatabase
cd zkDatabase

2. Install Dependencies

Use Yarn to install all required dependencies:

yarn install

3. Build the Project

Build the project, which will compile all packages located in the packages directory:

yarn run build

4. Set Up Environment Variables

Each package in the packages directory has its own .env.example file. Copy these files to .env and modify them as needed:

cp packages/your-package/.env.example packages/your-package/.env

Make sure to adjust any configurations in the .env files according to your environment.

5. Start MongoDB Replica Set

The project requires a running MongoDB replica set. Start the MongoDB instance using the provided script:

cd general/database/script
chmod +x start.sh
./start.sh
cd ..
docker compose up -d 

You can modify the environment variables in the docker-compose.yml file based on your requirements. If you keep the default settings, your MongoDB URL will be:

MONGODB_URL="mongodb://admin:password@mongo:27017/?directConnection=true"

6. Configure Services

Proof-Service Setup

To start proof-service, you need to run broker-service first. Then, set the BROKER_URL in the .env file of proof-service to:

BROKER_URL="http://broker-service-app-1:4001/graphql"

Make sure to adjust the service name if necessary based on your Docker setup.

7. Start Individual Services

You can start individual services by navigating into each package directory and running the following command:

For example, to start the FTP service:

cd packages/ftp
yarn start

8. Build and Run Docker Images

8.1 Create Docker Network

Before building and running Docker images, create the necessary Docker network:

make create-network

This command will create a zk network if it does not already exist. You can change the network name in the Makefile if needed.

8.2 Build Docker Images

To build Docker images for all services:

make build

This command will build the following services: ftp, proof-service, broker-service, and serverless.

To build a specific service, such as ftp, use:

make build-ftp

8.3 Run Docker Services

To run all services:

make up

To run a specific service, such as ftp:

make up-ftp

To run multiple specific services, such as ftp and proof-service:

make up-ftp up-proof

9. Stop Docker Services

9.1 Stop All Services

To stop all running services:

make down

9.2 Stop Specific Services

To stop specific services, such as ftp and proof-service:

make stop-ftp stop-proof