Update Dockerfile + docker doc (#55)

This commit is contained in:
Sydhds
2025-10-21 10:30:21 +02:00
committed by GitHub
parent 894677563c
commit d47719a093
4 changed files with 18 additions and 10 deletions

View File

@@ -1,5 +1,5 @@
# Stage 1: Build Prover
FROM rust:1.89-slim-bookworm AS builder
FROM rust:1.90-slim-bookworm AS builder
RUN apt update && apt install -y \
pkg-config \
@@ -23,7 +23,9 @@ COPY smart_contract ./smart_contract
RUN cargo build --release
# Stage 2: Run Prover
FROM ubuntu:25.04
FROM ubuntu:25.10
ARG RUST_LOG_LEVEL=info
RUN groupadd -r user && useradd -r -g user user
@@ -45,5 +47,7 @@ USER user
# Exppose default port
EXPOSE 50051
ENV RUST_LOG=${RUST_LOG_LEVEL}
# Run the prover - shell script will build arguments with parsed env var
ENTRYPOINT ["docker-entrypoint.sh"]

View File

@@ -1,11 +1,15 @@
# Status L2 Rln Prover
Rln prover for Status Layer 2
## Docker
* docker build --progress=plain --no-cache -t prover .
* docker run -p 50051:50051 prover --mock-sc true --mock-user mock/mock_user_1.json
* `docker build --progress=plain --build-arg RUST_LOG_LEVEL=info --no-cache -t rln-prover-image .`
* `docker run -p 50051:50051 prover --mock-sc true --mock-user mock/mock_user_1.json --no-config`
## Run prover
## Rln prover development
### Run prover
PRIVATE_KEY=__MY_PRIVATE_KEY__ RUST_LOG=debug cargo run -p prover_cli -- --no-config
@@ -27,17 +31,17 @@ RUST_LOG=debug cargo run -p prover_cli -- --ip 127.0.0.1 --metrics-ip 127.0.0.1
* RUST_LOG=debug cargo run -p prover_client -- -i 127.0.0.1 -p 50051 send-transaction --tx-hash aa
* RUST_LOG=debug cargo run -p prover_client -- -i 127.0.0.1 -p 50051 -a 0xd8da6bf26964af9d7eed9e03e53415d37aa96045 get-user-tier-info
## Debug
### Debug
* grpcurl -plaintext 127.0.0.1:50051 list
* grpcurl -plaintext -d '{"sender": "Alice", "tx_id": "42"}' '[::1]:50051' prover.RlnProver/SendTransaction
* grpcurl -plaintext '[::1]:50051' prover.RlnProver/GetProofs
## Bench
### Bench
* SUBSCRIBER_COUNT=2 SUBSCRIBER_IP=10.235.185.198 RAYON_NUM_THREADS=4 PROOF_SERVICE_COUNT=4 PROOF_COUNT=6 cargo bench -p prover --bench prover_many_subscribers
## Unit tests
### Unit tests
* cargo test
* cargo test --features anvil

View File

@@ -8,5 +8,5 @@ args_array=("$@")
#done
#echo "args_count = $#"
export RUST_LOG=debug
# export RUST_LOG=debug
exec ./prover_cli "${@}"

View File

@@ -188,7 +188,7 @@ impl UserDb {
"New - Creating merkle tree folder: {}",
tree_folder.display()
);
std::fs::create_dir(&tree_folder)?;
std::fs::create_dir_all(&tree_folder)?;
}
let tree_config = PmtreeConfig::builder()