Skip to content

InternetMaximalism/intmax2-cli

Repository files navigation

Install dependency

  • Install Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
  • Install forge (if you launch local network)
curl -L https://foundry.paradigm.xyz | bash
foundryup
  • Install sqlx-cli
cargo install sqlx-cli
  • Install wasm-pack
cargo install wasm-pack

Preparation

Launch local network

anvil  

Contract deployment

cd tests
cargo test -r -p tests deploy_contracts -- --nocapture

Launch database

docker run --name postgres -e POSTGRES_PASSWORD=password -p 5432:5432 -d postgres

Copy env file

You need to run cp .env.example .env in each directory.

Start server

  1. Start Store-vault-server. Example port: 9000
cd store-vault-server && sqlx database setup && cargo run -r
  1. Start balance-prover. Example port: 9001
cd balance-prover && cargo run -r
  1. Start validity-prover. Example port: 9002
cd validity-prover && sqlx database setup && cargo run -r
  1. Start withdrawal-server. Example port: 9003
cd withdrawal-server && sqlx database setup && cargo run -r
  1. Start block-builder. Example port: 9004
cd block-builder && cargo run -r

CLI

Please refer to the examples of cli

Reset DB

(cd store-vault-server && sqlx database reset -y && cd ../validity-prover && sqlx database reset -y && cd ../withdrawal-server && sqlx database reset -y)

Overview

store-vault-server: A server that stores backups of user's local states. It also acts as a mailbox for sending necessary data to a receiver during transfers.

balance-prover: A server that generates client-side ZKPs on behalf of users. This server maintains no state.

validity-prover: A server that generates ZKPs related to onchain information. It collects onchain data and generates corresponding ZKPs.

block-builder: A server that receives transactions from users and generates blocks.

withdrawal-server: A server that receives withdrawal requests from users and writes them to the database.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages