https://github.com/maticnetwork/prover-cli
CLI tool for running block proving tasks and collecting performance metrics.
https://github.com/maticnetwork/prover-cli
Last synced: 10 months ago
JSON representation
CLI tool for running block proving tasks and collecting performance metrics.
- Host: GitHub
- URL: https://github.com/maticnetwork/prover-cli
- Owner: maticnetwork
- Created: 2024-07-24T02:32:48.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-23T09:58:05.000Z (almost 2 years ago)
- Last Synced: 2025-06-22T01:47:57.652Z (12 months ago)
- Language: Python
- Size: 1.2 MB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Prover-CLI
Prover-CLI is a command-line tool for processing and validating blockchain proofs.
## General Prerequisites
- Python 3.6+
- Prometheus set up and running on your service
- Witness files generated using Jerigon
## Required Package Dependencies and Installation
```bash
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" \
&& install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | gpg --dearmor -o /usr/share/keyrings/cloud.google.gpg \
&& echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" \
| tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
apt-get update \
&& apt-get install -y python3 python3-pip python3-venv screen google-cloud-cli google-cloud-cli-gke-gcloud-auth-plugin
git clone https://github.com/rebelArtists/prover_cli.git /opt/prover_cli
cd /opt/prover_cli
pip install -r requirements.txt && pip install -e .
```
## Required Auth Setup
```bash
gcloud auth login
gcloud container clusters get-credentials --region=europe-west3
screen -dmS prometheus-port-forward bash -c 'kubectl port-forward --namespace kube-prometheus --address localhost svc/prometheus-operated 9090:9090'
```
## Usage
### Prove Range of Witnesses
```bash
prover-cli run --begin_block 123 --end_block 124 --witness_dir /path/to/witnesses
```
### Validate and Extract Proof
```bash
prover-cli validate --input_file /path/to/leader.out --output_file /path/to/cleaned_proof.json
```
### Plot Prover Metrics
```bash
prover-cli plot --csv_file metrics.csv --metric_name memory_usage --block_number 123
```
### Creating Final Performance Report
```bash
prover-cli report --witness_dir /tmp/prover_cli --metrics_csv /tmp/prover_cli/metrics.csv
```
## Review Metrics
CPU and memory metrics, per worker pod, are saved in `metrics_{timestamp}.csv` in the current directory. Each row contains a unique metric tagged by witness ID.
## Performance Report
A per-witness summary performance report is auto-generated after each job. It is found in `performance_report_{timestamp}.csv`, detailing the average and max CPU/memory used to prove each witness ID.
## Plots
A series of Matplotlib visuals are auto-generated after each run, depicting the timeseries change of CPU/memory per witness ID, per worker.
## Contributing
Contributions are welcome! Please open an issue or submit a pull request on GitHub.
## License
This project is licensed under the MIT License.