Skip to content

Nightly Parquet bulk-dump of core registry + chain tables to R2 #2538

Description

@JSONbored

A scheduled (cron/Worker or CI) job that snapshots the core datasets (subnets, economics, endpoints, neurons/metagraph, blocks, extrinsics, chain-events daily rollups) to columnar Parquet and uploads dated objects to an R2 prefix (e.g. metagraph/bulk/parquet/{date}/), with a small manifest for discovery. Maintainer-only: needs an R2 bucket binding, cron scheduling/wrangler config, a Parquet writer dependency (npm audit), and D1/Postgres bulk-read access — infra + creds + scheduling that a contributor PR can't land under the gate.

Deliverables

  • Add a scheduled job (extend handleScheduled or a CI workflow) that dumps the core tables to Parquet nightly
  • Upload dated Parquet objects to an R2 prefix + write/update a bulk-manifest.json (files, row counts, generated_at, schema versions)
  • Add the R2 binding + cron trigger to wrangler config; run npm run cf-typegen and commit the regenerated types
  • Vet the Parquet writer dependency with npm audit --audit-level=moderate; document retention/pruning of old dumps
  • Publish the bulk-download path in the docs/agent-resources so data users can find it

References

  • workers/api.mjs:732 (handleScheduled — cron entry point)
  • src/contracts.mjs:1225 (r2-manifest artifact — manifest precedent)
  • src/contracts.mjs:1075 (chain-events / all-events tier — a bulk source)
  • workers/request-handlers/analytics.mjs (D1 read patterns to reuse for bulk reads)

size: M · maintainer-only (owner)

Metadata

Metadata

Assignees

Labels

backendmaintainer-onlyOwner-only work — yields no Gittensor points.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions