From a2a00c85de44ae1b5ea85548db6b18f93cd93821 Mon Sep 17 00:00:00 2001 From: Leomrqdd Date: Thu, 26 Nov 2026 14:10:16 +0100 Subject: [PATCH 1/2] update examples with public bucket CF --- .../examples/read_epoch.rs | 14 +++++++++----- .../examples/sdk_ceiling.rs | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/crates/compact-v2/blockzilla-compact-v2-reader/examples/read_epoch.rs b/crates/compact-v2/blockzilla-compact-v2-reader/examples/read_epoch.rs index 94a7c9ff..1a64e012 100644 --- a/crates/compact-v2/blockzilla-compact-v2-reader/examples/read_epoch.rs +++ b/crates/compact-v2/blockzilla-compact-v2-reader/examples/read_epoch.rs @@ -1,8 +1,10 @@ -//! Read blocks from the public Blockzilla archive through Cloudflare. +//! Read blocks from the public Foundation Compact V2 archive. //! //! Run from the workspace root: -//! cargo run --locked -p blockzilla-compact-v2-reader --features http \ +//! RUSTFLAGS='-C target-cpu=native' cargo run --locked -p blockzilla-compact-v2-reader --features http \ //! --example read_epoch -- +//! +//! The default epoch is 1094. Its first slot is 472608000. use std::{error::Error, num::NonZeroU32}; @@ -11,17 +13,19 @@ use blockzilla_compact_v2_reader::archive::{ }; use solana_signature::Signature; -const ARCHIVE: &str = "https://blockzilla-archive-samples-v1.cheron-augustin.workers.dev"; +const ARCHIVE_BASE: &str = + "https://pub-97348740d6ef467aa2f1b4b62daa98dc.r2.dev/compact-v2/blockzilla-20261004"; fn main() -> Result<(), Box> { let mut args = std::env::args().skip(1); - let epoch: u64 = args.next().as_deref().unwrap_or("200").parse()?; + let epoch: u64 = args.next().as_deref().unwrap_or("1094").parse()?; let max_blocks: u32 = args.next().as_deref().unwrap_or("10").parse()?; let max_blocks = NonZeroU32::new(max_blocks).ok_or("max-blocks must be at least 1")?; // START read-epoch let cache = std::env::current_dir()?.join(".blockzilla-cache"); - let mut archive = CompactV2Archive::open(ARCHIVE, epoch, cache)?; + let epoch_url = format!("{ARCHIVE_BASE}/epoch-{epoch}"); + let mut archive = CompactV2Archive::open_epoch_url(&epoch_url, epoch, &cache)?; let range = archive.bounded_range(0, max_blocks)?; let request = ScanRequest::bounded(range); diff --git a/crates/compact-v2/blockzilla-compact-v2-reader/examples/sdk_ceiling.rs b/crates/compact-v2/blockzilla-compact-v2-reader/examples/sdk_ceiling.rs index 75159adf..8a1c5e80 100644 --- a/crates/compact-v2/blockzilla-compact-v2-reader/examples/sdk_ceiling.rs +++ b/crates/compact-v2/blockzilla-compact-v2-reader/examples/sdk_ceiling.rs @@ -6,7 +6,7 @@ //! or, for an HTTPS epoch directory: //! //! cargo run --release -p blockzilla-compact-v2-reader --features http --example sdk_ceiling -- \ -//! --url https://archive.example/compact-v2/build/epoch-200 --cache-dir /tmp/bz-cache --epoch 200 --max-blocks 1000 +//! --url https://pub-97348740d6ef467aa2f1b4b62daa98dc.r2.dev/compact-v2/blockzilla-20261004/epoch-1094 --cache-dir /tmp/bz-cache --epoch 1094 --max-blocks 1000 //! //! Legs, on the same block-row range: //! - `input`: only read the compressed bytes of the range, with the same request From 747cebd67ce07b3807ab7dd33cd52af9eb6447a5 Mon Sep 17 00:00:00 2001 From: Leomrqdd Date: Thu, 26 Nov 2026 14:16:12 +0100 Subject: [PATCH 2/2] add rustflags --- .../blockzilla-compact-v2-reader/examples/sdk_ceiling.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/compact-v2/blockzilla-compact-v2-reader/examples/sdk_ceiling.rs b/crates/compact-v2/blockzilla-compact-v2-reader/examples/sdk_ceiling.rs index 8a1c5e80..e5e5bc1c 100644 --- a/crates/compact-v2/blockzilla-compact-v2-reader/examples/sdk_ceiling.rs +++ b/crates/compact-v2/blockzilla-compact-v2-reader/examples/sdk_ceiling.rs @@ -1,11 +1,11 @@ //! Measure whether the SDK or the input limits a scan on this machine. //! -//! cargo run --release -p blockzilla-compact-v2-reader --features http --example sdk_ceiling -- \ +//! RUSTFLAGS='-C target-cpu=native' cargo run --release -p blockzilla-compact-v2-reader --features http --example sdk_ceiling -- \ //! --archive-dir /data/epoch-200 --source-id my-build --epoch 200 --first-block 150000 --max-blocks 1000 //! //! or, for an HTTPS epoch directory: //! -//! cargo run --release -p blockzilla-compact-v2-reader --features http --example sdk_ceiling -- \ +//! RUSTFLAGS='-C target-cpu=native' cargo run --release -p blockzilla-compact-v2-reader --features http --example sdk_ceiling -- \ //! --url https://pub-97348740d6ef467aa2f1b4b62daa98dc.r2.dev/compact-v2/blockzilla-20261004/epoch-1094 --cache-dir /tmp/bz-cache --epoch 1094 --max-blocks 1000 //! //! Legs, on the same block-row range: