ci: outdated

This commit is contained in:
nym21
2026-01-27 17:52:40 +01:00
parent 88145d08e5
commit 730e83472a
12 changed files with 500 additions and 36 deletions

View File

@@ -1,18 +1,5 @@
[build]
rustflags = ["-C", "target-cpu=native"]
# pco (pcodec) decompression is significantly faster with these SIMD instructions
[target.x86_64-unknown-linux-gnu]
rustflags = ["-C", "target-cpu=native", "-C", "target-feature=+bmi1,+bmi2,+avx2"]
[target.x86_64-apple-darwin]
rustflags = ["-C", "target-cpu=native", "-C", "target-feature=+bmi1,+bmi2,+avx2"]
[target.x86_64-pc-windows-msvc]
rustflags = ["-C", "target-cpu=native", "-C", "target-feature=+bmi1,+bmi2,+avx2"]
[target.x86_64-pc-windows-gnu]
rustflags = ["-C", "target-cpu=native", "-C", "target-feature=+bmi1,+bmi2,+avx2"]
[alias]
dev = "run -p brk_cli --features brk_server/bindgen"

15
.github/workflows/outdated.yml vendored Normal file
View File

@@ -0,0 +1,15 @@
name: Check outdated dependencies
on:
schedule:
- cron: '0 9 * * *'
workflow_dispatch:
jobs:
outdated:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: cargo install cargo-outdated
- run: cargo outdated --exit-code 1 --depth 1

View File

@@ -18,7 +18,7 @@ Command-line interface for running a Bitcoin Research Kit instance.
```bash
rustup update
RUSTFLAGS="-C target-cpu=native -C target-feature=+bmi1,+bmi2,+avx2" cargo install --locked brk_cli --version "$(cargo search brk_cli | head -1 | awk -F'"' '{print $2}')"
RUSTFLAGS="-C target-cpu=native" cargo install --locked brk_cli --version "$(cargo search brk_cli | head -1 | awk -F'"' '{print $2}')"
```
The SIMD flags (`bmi1`, `bmi2`, `avx2`) significantly improve pcodec decompression performance.

View File

@@ -57,8 +57,10 @@ pub fn run() -> anyhow::Result<()> {
let indexed_height = indexer.vecs.starting_height();
let blocks_behind = chain_height.saturating_sub(*indexed_height);
if blocks_behind > 10_000 {
info!("---");
info!("Indexing {blocks_behind} blocks before starting server...");
sleep(Duration::from_secs(3));
info!("---");
sleep(Duration::from_secs(10));
indexer.index(&blocks, &client, &exit)?;
drop(indexer);
Mimalloc::collect();

View File

@@ -1,6 +1,7 @@
use std::time::Duration;
use std::{net::SocketAddr, time::Duration};
use axum::{
Extension,
body::Body,
extract::{Query, State},
http::{HeaderMap, StatusCode, Uri},
@@ -11,7 +12,7 @@ use quick_cache::sync::GuardResult;
use crate::{
Result,
api::metrics::{CACHE_CONTROL, MAX_WEIGHT},
api::metrics::{CACHE_CONTROL, max_weight},
extended::HeaderMapExtended,
};
@@ -20,11 +21,12 @@ use super::AppState;
pub async fn handler(
uri: Uri,
headers: HeaderMap,
Extension(addr): Extension<SocketAddr>,
Query(params): Query<MetricSelection>,
State(AppState { query, cache, .. }): State<AppState>,
) -> Result<Response> {
// Phase 1: Search and resolve metadata (cheap)
let resolved = query.run(move |q| q.resolve(params, MAX_WEIGHT)).await?;
let resolved = query.run(move |q| q.resolve(params, max_weight(&addr))).await?;
let format = resolved.format();
let etag = resolved.etag();

View File

@@ -1,6 +1,7 @@
use std::time::Duration;
use std::{net::SocketAddr, time::Duration};
use axum::{
Extension,
body::Body,
extract::{Query, State},
http::{HeaderMap, StatusCode, Uri},
@@ -11,7 +12,7 @@ use quick_cache::sync::GuardResult;
use crate::{
Result,
api::metrics::{CACHE_CONTROL, MAX_WEIGHT},
api::metrics::{CACHE_CONTROL, max_weight},
extended::HeaderMapExtended,
};
@@ -20,11 +21,12 @@ use super::AppState;
pub async fn handler(
uri: Uri,
headers: HeaderMap,
Extension(addr): Extension<SocketAddr>,
Query(params): Query<MetricSelection>,
State(AppState { query, cache, .. }): State<AppState>,
) -> Result<Response> {
// Phase 1: Search and resolve metadata (cheap)
let resolved = query.run(move |q| q.resolve(params, MAX_WEIGHT)).await?;
let resolved = query.run(move |q| q.resolve(params, max_weight(&addr))).await?;
let format = resolved.format();
let etag = resolved.etag();

View File

@@ -1,6 +1,7 @@
use std::time::Duration;
use std::{net::SocketAddr, time::Duration};
use axum::{
Extension,
body::Body,
extract::{Query, State},
http::{HeaderMap, StatusCode, Uri},
@@ -11,7 +12,7 @@ use quick_cache::sync::GuardResult;
use crate::{
Result,
api::metrics::{CACHE_CONTROL, MAX_WEIGHT},
api::metrics::{CACHE_CONTROL, max_weight},
extended::HeaderMapExtended,
};
@@ -20,11 +21,12 @@ use super::AppState;
pub async fn handler(
uri: Uri,
headers: HeaderMap,
Extension(addr): Extension<SocketAddr>,
Query(params): Query<MetricSelection>,
State(AppState { query, cache, .. }): State<AppState>,
) -> Result<Response> {
// Phase 1: Search and resolve metadata (cheap)
let resolved = query.run(move |q| q.resolve(params, MAX_WEIGHT)).await?;
let resolved = query.run(move |q| q.resolve(params, max_weight(&addr))).await?;
let format = resolved.format();
let etag = resolved.etag();

View File

@@ -1,5 +1,8 @@
use std::net::SocketAddr;
use aide::axum::{ApiRouter, routing::get_with};
use axum::{
Extension,
extract::{Path, Query, State},
http::{HeaderMap, Uri},
response::{IntoResponse, Response},
@@ -23,6 +26,16 @@ const MAX_WEIGHT: usize = 65 * 10_000;
/// Cache control header for metric data responses
const CACHE_CONTROL: &str = "public, max-age=1, must-revalidate";
/// Returns the max weight for a request based on the client address.
/// Localhost requests have no weight limit.
fn max_weight(addr: &SocketAddr) -> usize {
if addr.ip().is_loopback() {
usize::MAX
} else {
MAX_WEIGHT
}
}
pub trait ApiMetricsRoutes {
fn add_metrics_routes(self) -> Self;
}
@@ -159,6 +172,7 @@ impl ApiMetricsRoutes for ApiRouter<AppState> {
get_with(
async |uri: Uri,
headers: HeaderMap,
addr: Extension<SocketAddr>,
state: State<AppState>,
Path(path): Path<MetricWithIndex>,
Query(range): Query<DataRangeFormat>|
@@ -166,6 +180,7 @@ impl ApiMetricsRoutes for ApiRouter<AppState> {
data::handler(
uri,
headers,
addr,
Query(MetricSelection::from((path.index, path.metric, range))),
state,
)
@@ -189,8 +204,8 @@ impl ApiMetricsRoutes for ApiRouter<AppState> {
.api_route(
"/api/metrics/bulk",
get_with(
|uri, headers, query, state| async move {
bulk::handler(uri, headers, query, state).await.into_response()
|uri, headers, addr, query, state| async move {
bulk::handler(uri, headers, addr, query, state).await.into_response()
},
|op| op
.id("get_metrics")
@@ -210,6 +225,7 @@ impl ApiMetricsRoutes for ApiRouter<AppState> {
get_with(
async |uri: Uri,
headers: HeaderMap,
addr: Extension<SocketAddr>,
Path(variant): Path<String>,
Query(range): Query<DataRangeFormat>,
state: State<AppState>|
@@ -228,7 +244,7 @@ impl ApiMetricsRoutes for ApiRouter<AppState> {
Metrics::from(split.collect::<Vec<_>>().join(separator)),
range,
));
legacy::handler(uri, headers, Query(params), state)
legacy::handler(uri, headers, addr, Query(params), state)
.await
.into_response()
},
@@ -251,11 +267,12 @@ impl ApiMetricsRoutes for ApiRouter<AppState> {
get_with(
async |uri: Uri,
headers: HeaderMap,
addr: Extension<SocketAddr>,
Query(params): Query<MetricSelectionLegacy>,
state: State<AppState>|
-> Response {
let params: MetricSelection = params.into();
legacy::handler(uri, headers, Query(params), state)
legacy::handler(uri, headers, addr, Query(params), state)
.await
.into_response()
},

View File

@@ -1,6 +1,7 @@
#![doc = include_str!("../README.md")]
use std::{
net::SocketAddr,
path::PathBuf,
sync::Arc,
time::{Duration, Instant},
@@ -8,7 +9,7 @@ use std::{
use aide::axum::ApiRouter;
use axum::{
Extension, ServiceExt,
Extension,
body::Body,
http::{Request, Response, StatusCode, Uri},
middleware::Next,
@@ -24,7 +25,6 @@ use tower_http::{
compression::CompressionLayer, cors::CorsLayer, normalize_path::NormalizePathLayer,
timeout::TimeoutLayer, trace::TraceLayer,
};
use tower_layer::Layer;
use tracing::{error, info};
mod api;
@@ -66,6 +66,16 @@ impl Server {
let compression_layer = CompressionLayer::new().br(true).gzip(true).zstd(true);
let connect_info_layer = axum::middleware::from_fn(
async |connect_info: axum::extract::ConnectInfo<SocketAddr>,
mut request: Request<Body>,
next: Next|
-> Response<Body> {
request.extensions_mut().insert(connect_info.0);
next.run(request).await
},
);
let response_uri_layer = axum::middleware::from_fn(
async |request: Request<Body>, next: Next| -> Response<Body> {
let uri = request.uri().clone();
@@ -114,7 +124,9 @@ impl Server {
StatusCode::GATEWAY_TIMEOUT,
Duration::from_secs(5),
))
.layer(CorsLayer::permissive());
.layer(CorsLayer::permissive())
.layer(connect_info_layer)
.layer(NormalizePathLayer::trim_trailing_slash());
let (listener, port) = match port {
Some(port) => {
@@ -173,11 +185,9 @@ impl Server {
.layer(Extension(Arc::new(openapi)))
.layer(Extension(api_json));
let service = NormalizePathLayer::trim_trailing_slash().layer(router);
serve(
listener,
ServiceExt::<Request<Body>>::into_make_service(service),
router.into_make_service_with_connect_info::<SocketAddr>(),
)
.await?;

View File

@@ -4,6 +4,433 @@ All notable changes to the Bitcoin Research Kit (BRK) project will be documented
> *This changelog was generated by Claude Code*
## [v0.1.1](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.1.1) - 2026-01-27
### Bug Fixes
#### `brk_website`
- Fixed HTML file caching rules to properly detect `.html` files and apply `must-revalidate` cache policy instead of immutable caching ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.1/crates/brk_website/src/handlers.rs))
#### `brk_client`
- Fixed metric name mappings in `ClassDaysInLossPattern` (changed from `max_drawdown` to `days_in_profit`)
- Regenerated client code with corrected metric patterns
### Internal Changes
#### `scripts`
- Split release scripts into separate components for better modularity
[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.1.0...v0.1.1)
## [v0.1.0](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.1.0) - 2026-01-27
### New Features
#### `brk_computer`
- Added sats-denominated versions of all price metrics alongside USD versions ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0/crates/brk_computer/src/internal/multi/from_date/price.rs))
- New `Price` wrapper struct provides both `.dollars` and `.sats` representations
- Derefs to dollars for backward compatibility with existing code
- Sats values computed via `DollarsToSatsFract` transform
- Added address activity tracking metrics ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0/crates/brk_computer/src/distribution/address/activity.rs))
- `receiving` - Unique addresses that received funds in each block
- `sending` - Unique addresses that sent funds in each block
- `reactivated` - Addresses that were empty and now have funds
- `both` - Addresses that both sent AND received in same block
- `balance_increased` - Receive-only addresses
- `balance_decreased` - Send-only addresses
- Available globally and per address type (P2PKH, P2SH, P2WPKH, etc.)
- Added address growth rate metrics ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0/crates/brk_computer/src/distribution/address/growth_rate.rs))
- Computes `new_addr_count / total_addr_count` ratio globally and per type
- Includes distribution statistics (min, max, average, percentiles)
- Added new address count metrics per block
- Added total address count tracking
- Added `RatioU64F32` transform for u64 to f32 ratio calculations
- Added `U64Plus` transform for u64 addition operations
- Added price-aware multi modules: `lazy_binary_price`, `lazy_price`, `unary_last`
- Added height-based distribution and price modules
[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.1.0-beta.1...v0.1.0)
## [v0.1.0-beta.1](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.1.0-beta.1) - 2026-01-26
### New Features
#### `brk_types`
- Added `SatsFract` type for fractional satoshi representation ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-beta.1/crates/brk_types/src/satsfract.rs))
- Stores f64 values representing sub-satoshi amounts
- Useful for expressing USD prices in sats when price is high (e.g., at $100k, $0.0001 = 0.1 sats)
- Includes arithmetic operations and NaN handling
#### `brk_computer`
- Added `DollarsToSatsFract` transform for converting USD prices to sats exchange rate ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-beta.1/crates/brk_computer/src/internal/single/transform/dollars_to_sats_fract.rs))
- Added `CloseDollarsToSatsFract` variant for close price conversion
#### `website`
- Added more investing data and charts
### Internal Changes
#### `scripts`
- Updated release workflow scripts
[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.1.0-beta.0...v0.1.0-beta.1)
## [v0.1.0-beta.0](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.1.0-beta.0) - 2026-01-25
### Breaking Changes
#### `brk_mcp`
- Removed `brk_mcp` crate from workspace (MCP server functionality removed)
### New Features
#### `brk_computer`
- Added Reserve Risk metric to cointime module ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-beta.0/crates/brk_computer/src/cointime/reserve_risk/mod.rs))
- Computes VOCDD 365-day SMA (Value-weighted Outstanding Coin Days Destroyed)
- Calculates HODL Bank accumulation metric
- Derives Reserve Risk indicator for market cycle analysis
- Added `return_i8` transform for small integer returns
#### `brk_website` (New Crate)
- Created standalone website serving crate without BRK data layer dependencies ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-beta.0/crates/brk_website/src/lib.rs))
- Supports both embedded website and filesystem path serving
- Provides `router()` function for Axum integration
- Added example demonstrating standalone server usage
#### `brk_playground` (New Standalone Crate)
- Created experimental playground crate for on-chain price analysis (not published to crates.io) ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-beta.0/crates/brk_playground/src/lib.rs))
- Implements phase histogram analysis of UTXO patterns
- Provides filter-based output selection for price signal extraction
- Includes on-chain OHLC price oracle derivation with confidence metrics
- Features anchor-based price calibration using weekly OHLC data
#### `brk_logger`
- Added log hook system for custom log message handling ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-beta.0/crates/brk_logger/src/hook.rs))
- Added rate-limited file writer (100 writes/second max) to prevent log flooding ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-beta.0/crates/brk_logger/src/rate_limit.rs))
- Added custom log format module
#### `brk_client`
- Added `fetch_prices.rs` example demonstrating price data fetching
#### `brk_types`
- Added `StoredI8` type for signed 8-bit integer storage
#### `brk_server`
- Added Scalar API documentation JavaScript
### Internal Changes
#### `brk_computer`
- Refactored vecs.rs files to remove verbose comments
- Reduced verbosity and switched to vecdb cumulative function for cleaner code
#### `website`
- Replaced uFuzzy search library with quickmatch for better performance
- Major cleanup and refactoring of frontend code
#### `scripts`
- Updated release scripts with improved workflow
[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.1.0-alpha.6...v0.1.0-beta.0)
## [v0.1.0-alpha.6](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.1.0-alpha.6) - 2026-01-18
### Bug Fixes
#### `brk_client`
- Fixed minreq HTTP client feature flag: changed from `serde_json` to `json-using-serde` for proper JSON serialization support
- Regenerated client code with corrected HTTP handling
#### `scripts`
- Added full workspace compilation check to release script to catch feature flag errors before publishing
[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.1.0-alpha.5...v0.1.0-alpha.6)
## [v0.1.0-alpha.5](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.1.0-alpha.5) - 2026-01-17
### Bug Fixes
#### `brk_query`
- Fixed `tokio` feature flag to properly propagate to `brk_error` dependency, enabling async error handling when tokio feature is enabled
[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.1.0-alpha.4...v0.1.0-alpha.5)
## [v0.1.0-alpha.4](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.1.0-alpha.4) - 2026-01-17
### New Features
#### `brk_computer`
- Implemented Phase Oracle V2 algorithm using round USD template cross-correlation for on-chain price discovery ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.4/crates/brk_computer/src/price/oracle/phase_v2.rs))
- Uses 200-bin phase histogram with weighted round USD template ($1, $5, $10, $20, etc.)
- Weekly OHLC anchors constrain search range for accuracy
- Cross-correlates satoshi values with expected USD fingerprint patterns
- Added `cents_to_dollars` transform for price conversions ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.4/crates/brk_computer/src/internal/single/transform/cents_to_dollars.rs))
#### `brk_query`
- Added `ResolvedQuery` struct for efficient metric query resolution with ETag generation ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.4/crates/brk_query/src/resolved.rs))
- Two-phase query processing: resolve metadata (cheap) then format output (expensive, cached)
#### `brk_server`
- Added bulk metrics API endpoint with ETag-based caching and 304 Not Modified support ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.4/crates/brk_server/src/api/metrics/bulk.rs))
- Implemented `CacheStrategy` module with Height, Static, and MaxAge caching strategies ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.4/crates/brk_server/src/cache.rs))
- Added compact OpenAPI spec generator optimized for LLM consumption ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.4/crates/brk_server/src/api/openapi/compact.rs))
- Removes redundant fields (error responses, descriptions, examples)
- Simplifies schemas and flattens allOf/anyOf constructs
- Compacts responses to "returns": "Type" format
- Added dedicated error handling module
- Added website file serving module with symlink to website directory
#### `brk_types`
- Added `Etag` type for HTTP ETag header handling ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.4/crates/brk_types/src/etag.rs))
- Added `Output` enum for JSON and CSV metric output formats ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.4/crates/brk_types/src/output.rs))
- Added `MetricOutput` struct wrapping output with metadata for ETag generation ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.4/crates/brk_types/src/metricoutput.rs))
- Added `OracleBins` type for 100-bin phase histogram storage used in price discovery ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.4/crates/brk_types/src/oracle_bins.rs))
- Added `PairOutputIndex` for indexing 2-output transactions (oracle pair candidates) ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.4/crates/brk_types/src/pairoutputindex.rs))
- Added `Port` type with default server port 3110 ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.4/crates/brk_types/src/port.rs))
#### `brk_fetcher`
- Added fetcher example demonstrating price data fetching
### Internal Changes
#### `brk_server`
- Reorganized OpenAPI generation into dedicated `openapi/` module
- Added Scalar API documentation HTML template
#### `modules/brk-client`
- Regenerated documentation with new types (OracleBins, PairOutputIndex, SyncStatus)
- Added README with usage examples
#### `packages/brk_client`
- Regenerated documentation and updated README
[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.1.0-alpha.3...v0.1.0-alpha.4)
## [v0.1.0-alpha.3](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.1.0-alpha.3) - 2026-01-14
### Breaking Changes
#### `brk_bundler`
- Removed `brk_bundler` crate from workspace (JavaScript bundling functionality removed)
### New Features
#### `brk_computer`
- Implemented UTXOracle trustless on-chain price discovery algorithm that derives Bitcoin prices from transaction data without external price feeds ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.3/crates/brk_computer/src/price/oracle/mod.rs))
- Detects round USD amounts ($10, $20, $50, $100, etc.) in transaction outputs
- Uses histogram-based stencil matching with Gaussian smoothing
- Refines prices via geometric median convergence
- Filters "clean" transactions: 2 outputs, ≤5 inputs, no OP_RETURN, simple signatures
- Added `price/cents/` module for cent-based price storage with split components ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.3/crates/brk_computer/src/price/cents/mod.rs))
- Created dedicated index modules for time-based metric aggregation:
- `indexes/dateindex.rs` - Daily index with date, first_height, height_count, weekindex, monthindex mappings
- `indexes/weekindex.rs` - Weekly aggregation
- `indexes/monthindex.rs` - Monthly aggregation
- `indexes/quarterindex.rs` - Quarterly aggregation
- `indexes/semesterindex.rs` - Semester (half-year) aggregation
- `indexes/yearindex.rs` - Yearly aggregation
- `indexes/decadeindex.rs` - Decade aggregation
- `indexes/halvingepoch.rs` - Halving epoch indexing
- `indexes/difficultyepoch.rs` - Difficulty adjustment epoch indexing
- `indexes/height.rs` - Block height indexing
- `indexes/txindex.rs`, `txinindex.rs`, `txoutindex.rs` - Transaction-level indexing
- `indexes/address.rs` - Address type indexing with vecs for all output types (P2PK33, P2PK65, P2PKH, P2SH, P2TR, P2WPKH, P2WSH, P2A, P2MS, empty, unknown, OP_RETURN)
- Added comprehensive `internal/multi/` module with 100+ metric aggregation strategies ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.3/crates/brk_computer/src/internal/multi/mod.rs)):
- `from_height/` - Height-based metric derivation with lazy, binary, and value variants
- `from_date/` - Date-based aggregation with percentiles, ratios, statistics
- `from_height_and_date/` - Combined height+date metrics including OHLC
- `from_tx/` - Transaction-level distributions
- `height_derived/` - Height-to-higher-index derivations
- `date_derived/` - Date-to-higher-index derivations (average, first, last, min, max, spread, sum)
- `tx_derived/` - Transaction-derived distributions
- `height_and_date/` - Combined aggregations for OHLC and bytes
- Added `internal/single/` module with specialized metric computations ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.3/crates/brk_computer/src/internal/single/mod.rs)):
- `transform/` - 35+ value transformations (price conversions, ratios, percentages, RSI, volatility)
- `lazy/` - Lazy evaluation for sum, average, cumulative, first, last, min, max, spread
- `lazy_transform/` - Lazy binary operations with percentiles and statistics
- `vec/` - Vector-based aggregations (percentiles, sum, average)
- `group/` - Group statistics (min/max, average, percentiles, distribution)
- `height/` - Height-indexed value derivations
- `tx/` - Transaction-level distributions
- `difficultyepoch/` - Difficulty epoch lazy values
- Added `internal/compute.rs` for unified computation orchestration
- Added `internal/traits.rs` for shared metric computation traits
- Added `distribution/metrics/outputs.rs` for output-specific distribution metrics
#### `brk_client`
- Added `basic.rs` example demonstrating typed metrics API with method chaining ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.3/crates/brk_client/examples/basic.rs))
- Added `tree.rs` example for navigating the metrics tree structure
#### `brk_fetcher`
- Implemented retry mechanism for network requests with exponential backoff ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.3/crates/brk_fetcher/src/retry.rs))
- Added permanent network error detection to skip retries for blocked endpoints
#### `brk_indexer`
- Added `vecs/addresses.rs` for address-specific vector storage
- Added `vecs/inputs.rs` for input vector organization
- Added `vecs/outputs.rs` for output vector organization
- Added `vecs/transactions.rs` for transaction vector organization
- Added `vecs/scripts.rs` for script vector organization
#### `brk_types`
- Added `DiskUsage` type for tracking storage consumption per component ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.3/crates/brk_types/src/diskusage.rs))
- Added `FormatResponse` type for API response formatting ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.3/crates/brk_types/src/formatresponse.rs))
- Added `SyncStatus` type for indexer synchronization status ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.3/crates/brk_types/src/syncstatus.rs))
#### `brk_bindgen`
- Added `generate/constants.rs` for constant generation
- Added `generate/tree.rs` for tree structure generation
- Added catalog test suite ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.3/crates/brk_bindgen/tests/catalog_test.rs))
#### `brk_server`
- Added `/api/server/sync` endpoint returning `SyncStatus` with indexed_height, tip_height, blocks_behind, and last indexed timestamp ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.3/crates/brk_server/src/api/server/mod.rs))
- Added `/api/server/disk` endpoint returning `DiskUsage` with storage consumption per component
- Added `/api/server/health` endpoint for health checks
#### `brk_store`
- Added `any.rs` for type-erased store access
#### `modules/brk-client`
- Generated comprehensive TypeScript-style documentation with 300+ interface and type definitions
- Added test suites: `basic.js` and `tree.js`
- Added CLAUDE.md with development instructions
#### `packages/brk_client`
- Added Python documentation generation with pydoc-markdown
- Added DOCS.md with generated API documentation
- Added test suites: `test_basic.py`, `test_tree.py`
#### `website`
- Restructured from `websites/bitview/` to unified `website/` directory
- Added Progressive Web App (PWA) support with manifest and service worker ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.3/website/manifest.webmanifest))
- Added 40+ Apple splash screen images for iOS home screen support
- Added search pane (`panes/search.js`) and navigation pane (`panes/nav.js`)
- Added units utility (`utils/units.js`) for value formatting
- Reorganized options system with dedicated modules for chain, cohorts, cointime, market, and series configuration
#### `scripts`
- Added `js-docs.sh` for JavaScript documentation generation
- Added `js-publish.sh` for JavaScript package publishing
- Added `python-docs.sh` for Python documentation generation
- Added `python-publish.sh` for Python package publishing to PyPI
- Added `rust-publish.sh` for Rust crate publishing
- Added `release.sh` for coordinated multi-language releases
### Internal Changes
#### `workspace`
- Added build.rs scripts to all crates for consistent build configuration
- Shortened percentiles path in metric tree for cleaner API
#### `brk_computer`
- Reorganized traits into dedicated `traits/` module with `pricing.rs`
- Removed specialized percentiles, ratio, stddev modules from `internal/specialized/`
#### `brk_logger`
- Added example demonstrating logger usage
[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.1.0-alpha.2...v0.1.0-alpha.3)
## [v0.1.0-alpha.2](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.1.0-alpha.2) - 2026-01-04
### Breaking Changes
#### `brk_binder` → `brk_bindgen`
- Replaced `brk_binder` crate with completely rewritten `brk_bindgen` crate featuring new architecture with separate `generators/`, `backends/`, and `analysis/` modules ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.2/crates/brk_bindgen/src/lib.rs))
#### `brk_grouper` → `brk_cohort`
- Migrated cohort filtering functionality from `brk_grouper` to new `brk_cohort` crate with expanded filtering capabilities ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.2/crates/brk_cohort/src/lib.rs))
#### `brk_computer`
- Replaced `brk_grouper` dependency with `brk_cohort` throughout the crate
- Removed monolithic `chain/` module containing compute.rs, import.rs, and mod.rs
- Removed monolithic `cointime.rs` in favor of modular `cointime/` directory structure
- Removed `stateful/` module tree including address cohorts, UTXO cohorts, and state management
- Removed `fetched.rs`, `grouped/`, `indexes.rs`, and `price.rs` modules
### New Features
#### `brk_alloc` (New Crate)
- Created global allocator crate using mimalloc for consistent memory allocation across all brk crates ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.2/crates/brk_alloc/src/lib.rs))
- Added `Mimalloc::collect()` function for eager memory release back to OS at natural pause points
#### `brk_bindgen` (New Crate)
- Implemented `ClientOutputPaths` builder for configuring output file paths per language ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.2/crates/brk_bindgen/src/lib.rs))
- Added `generate_clients()` function that generates all configured language clients from OpenAPI spec
- Created analysis module with name resolution, pattern detection, position tracking, and tree traversal ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.2/crates/brk_bindgen/src/analysis/mod.rs))
- Implemented language-specific backends for JavaScript, Python, and Rust code generation ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.2/crates/brk_bindgen/src/backends/mod.rs))
- Created generators module with separate API, client, tree, and types generation per language ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.2/crates/brk_bindgen/src/generators/mod.rs))
- Added syntax utilities for code generation formatting
- Implemented schema extraction and type metadata handling ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.2/crates/brk_bindgen/src/types/mod.rs))
#### `brk_client` (New Crate)
- Created Rust client crate with build-time CPU optimization for release builds ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.2/crates/brk_client/build.rs))
- Generated client library using brk_types for strong typing
#### `brk_cohort` (New Crate)
- Implemented comprehensive UTXO and address cohort filtering system ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.2/crates/brk_cohort/src/lib.rs))
- Added address type filtering for all output types: P2PK65, P2PK33, P2PKH, P2SH, P2WPKH, P2WSH, P2TR, P2A ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.2/crates/brk_cohort/src/by_address_type.rs))
- Added spendable and unspendable type filtering ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.2/crates/brk_cohort/src/by_spendable_type.rs))
- Implemented `CohortContext` for automatic metric name prefix generation based on cohort type ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.2/crates/brk_cohort/src/cohort_context.rs))
- Added `CohortName` system for generating consistent cohort identifiers
- Implemented `StateLevel` tracking for cohort state management
- Added year-based filtering with `ByYear` grouper
- Added `ByAnyAddress` for filtering across all address types
- Migrated and extended age range, amount range, epoch, term, min/max age, ge/lt amount filters from brk_grouper
#### `brk_computer`
- Created modular `blocks/` module with separate submodules for count, difficulty, halving, interval, mining, rewards, size, time, and weight metrics ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.2/crates/brk_computer/src/blocks/mod.rs))
- Created modular `cointime/` module with submodules for activity, adjusted, cap, pricing, supply, and value calculations ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.2/crates/brk_computer/src/cointime/mod.rs))
- Created `distribution/` module for UTXO distribution metrics with address, block, cohorts, compute, metrics, and state submodules ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.2/crates/brk_computer/src/distribution/mod.rs))
- Reorganized `indexes/` into modular structure with address, block, time, and transaction submodules
- Reorganized `inputs/` into count and spent submodules
- Reorganized `outputs/` into count and spent submodules
- Reorganized `market/` into ath, dca, indicators, lookback, moving_average, range, returns, and volatility submodules
- Reorganized `price/` into ohlc, sats, and usd submodules
- Reorganized `supply/` into burned, circulating, inflation, market_cap, and velocity submodules
- Reorganized `transactions/` into count, fees, size, versions, and volume submodules
- Reorganized `scripts/` into count and value submodules
- Added internal module with builder, computed, lazy, specialized, and value submodules for metric computation infrastructure
#### `brk_indexer`
- Refactored processor into modular structure with separate metadata, tx, txin, txout, and types submodules ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.2/crates/brk_indexer/src/processor/mod.rs))
#### `brk_bundler`
- Added bundle example demonstrating bundler usage ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.2/crates/brk_bundler/examples/bundle.rs))
#### `brk_types`
- Added `Age` type for UTXO age representation
- Added `CentsCompact` type for compact cent storage
- Added `Hex` type for hexadecimal string handling
- Added `Indexes` module for index type collections
- Added `OptionExt` trait for option extensions
- Added `Percentile` type for percentile values
- Added `SupplyState` type for supply tracking state
- Added `Term` type for short-term/long-term holder classification
#### `packages/brk_client` (Python)
- Created Python client package with httpx for HTTP requests ([source](https://github.com/bitcoinresearchkit/brk/blob/v0.1.0-alpha.2/packages/brk_client/pyproject.toml))
- Added typed dataclass-based client with full metric catalog support
- Included test suite for client functionality
### Internal Changes
#### `brk_computer`
- Removed debug_indexer.rs and pools.rs examples
- Simplified constants.rs by removing unused constant definitions
- Consolidated address data structures into distribution module
#### `brk_indexer`
- Removed BENCH.md benchmarking documentation
#### `brk_mempool`
- Removed DESIGN.md design documentation
#### `workspace`
- Added brk_alloc as dev-dependency for benchmarks using mimalloc
[View changes](https://github.com/bitcoinresearchkit/brk/compare/v0.1.0-alpha.1...v0.1.0-alpha.2)
## [v0.1.0-alpha.1](https://github.com/bitcoinresearchkit/brk/releases/tag/v0.1.0-alpha.1) - 2025-12-21
### New Features

View File

@@ -34,5 +34,5 @@
"url": "git+https://github.com/bitcoinresearchkit/brk.git"
},
"type": "module",
"version": "0.1.0"
"version": "0.1.1"
}

View File

@@ -1,6 +1,6 @@
[project]
name = "brk-client"
version = "0.1.0"
version = "0.1.1"
description = "Python client for the Bitcoin Research Kit"
readme = "README.md"
requires-python = ">=3.9"