Skip to content

feat: add script for miner stats snapshot#71

Open
dewabisma wants to merge 2 commits into
mainfrom
beast/script-for-miner-stats-snapshot
Open

feat: add script for miner stats snapshot#71
dewabisma wants to merge 2 commits into
mainfrom
beast/script-for-miner-stats-snapshot

Conversation

@dewabisma

@dewabisma dewabisma commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Summary

Simple script for getting miner stats and convert to csv.


Note

Low Risk
Offline tooling and snapshot data only; no production runtime, auth, or on-chain logic changes.

Overview
Adds a small testnet miner stats workflow under testnet_data_snapshots/: fetch live data from Quantus GraphQL, keep JSON snapshots, and export spreadsheets for reward analysis.

fetch_current_miners.py POSTs the minerStats query (account_stats with total_mined_blocks > 0, sorted by blocks) to https://sub2.quantus.com/v1/graphql and writes planck_miners.json by default. Supports --endpoint, --output, and --export-csv to chain into the exporter.

export_miners_to_csv.py scans *_miners.json in the same folder and writes matching .csv files with id, totalMinedBlocks, and totalRewards.

TESTNET_DATA_README.md documents past testnets (resonance_network, schrodinger, dirac) and the current planck_miners.json snapshot, plus the two commands above.

The PR also checks in a fresh planck_miners.json snapshot and CSV exports for dirac, planck, resonance_network, and schrodinger miners (large static data additions).

Reviewed by Cursor Bugbot for commit 7cd58a0. Configure here.

@dewabisma dewabisma requested a review from n13 June 19, 2026 08:45

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 7cd58a0. Configure here.

totalRewards: total_rewards
}
}
""".strip()

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GraphQL query omits row limit

Medium Severity

The account_stats query in MINER_STATS_QUERY has no limit or pagination, so the Hasura-style endpoint may return only its default maximum rows. The script treats that partial page as a full snapshot, which can undercount miners and skew reward analysis without any warning.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 7cd58a0. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant