Skip to content

Benchmarking tools for smart contract

License

Notifications You must be signed in to change notification settings

ELPEEF/stc-bench

 
 

Repository files navigation

⚡STC Bench

STC Bench adalah modul benchmarking ringan untuk smart contract di jaringan Ethereum (testnet/mainnet). Tujuannya: mengeksekusi skenario uji, mencatat detail transaksi, lalu men-translate hasilnya ke format standar (CSV/NDJSON) yang siap divisualisasikan di STC Analytics.


✨ Fitur

  • Eksekusi skenario benchmark berbasis YAML.

  • Mendukung input contract address dan ABI.

  • Output ke outputs/*.json + terjemahan ke:

    • bench_runs.csv

    • bench_tx.csv

    • (opsional) NDJSON untuk pipeline analitik.

  • Bisa dijalankan lewat CLI atau UI berbasis Streamlit.


📦 Instalasi

Clone repo ini lalu install lokal:

git clone https://github.com/mrbrightsides/stc-bench.git
cd stc-bench
pip install -e .

🚀 Cara Pakai

  1. Jalankan Benchmark
python -m bench_core.runner scenarios/example_scenario.yaml

Hasil akan tersimpan di folder outputs/ dengan format run-YYYY-MM-DD_HH-MM-SS.json.

  1. Translate ke CSV
python parse_bench.py
  1. UI Streamlit (opsional)
streamlit run ui_streamlit/app.py

Masukkan contract address, ABI, dan skenario → hasil otomatis tersimpan di outputs/.


📊 Format Output

bench_runs.csv

run_id timestamp network scenario contract function_name concurrency tx_per_user tps_avg tps_peak p50_ms p95_ms success_rate

bench_tx.csv

run_id tx_hash submitted_at mined_at latency_ms status gas_used gas_price_wei block_number function_name

🛠️ Roadmap

  • Multi-network config (Sepolia, Ganache, Hardhat).

  • Integrasi CI/CD.

  • Contoh skenario lebih kompleks.


📜 Lisensi

MIT License.

About

Benchmarking tools for smart contract

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%