Expand description
Global constants and helpers for filenames/paths, networking defaults, compression, index settings, and position conversions
Constants§
- BINARY_
NAME - Binary name used in user agents and metadata
- BUNDLE_
SIZE - Number of operations per bundle
- DEFAULT_
HANDLE_ RESOLVER_ URL - Default handle resolver URL for AT Protocol handle resolution
- DEFAULT_
ORIGIN - Default origin identifier for local repositories
- DEFAULT_
PLC_ DIRECTORY_ URL - Default PLC directory URL
- DEFAULT_
RATE_ LIMIT - Default rate limit for PLC API requests (requests per minute) Set to 80% of quota (72 req/min) to provide safety margin and prevent rate limiting
- DID_
INDEX_ CONFIG - DID index config file name
- DID_
INDEX_ DELTAS - DID index delta segments subdirectory name
- DID_
INDEX_ DIR - DID index directory name (hidden directory in bundle repository)
- DID_
INDEX_ FLUSH_ INTERVAL - Default flush interval for DID index building (number of bundles before flushing to disk) A value of 0 means flush only at the end (maximum memory usage)
- DID_
INDEX_ SHARDS - DID index shards subdirectory name
- FRAME_
SIZE - Number of operations per frame (for multi-frame compression)
- HTTP_
BUNDLE_ TIMEOUT_ SECS - HTTP request timeout for bundle fetching
- HTTP_
INDEX_ TIMEOUT_ SECS - HTTP request timeout for index fetching
- HTTP_
PING_ TIMEOUT_ SECS - HTTP request timeout for ping operations
- HTTP_
RESOLVER_ TIMEOUT_ SECS - HTTP request timeout for handle resolver
- HTTP_
TIMEOUT_ SECS - Default HTTP request timeout
- MEMPOOL_
FILE_ PREFIX - Mempool file prefix (e.g., “plc_mempool_000001.jsonl”)
- MEMPOOL_
STALE_ THRESHOLD_ SECS - Mempool file staleness threshold (1 hour in seconds)
- MIN_
BUNDLE_ CREATION_ INTERVAL_ SECS - Minimum time between bundle creation attempts (60 seconds)
- VERSION
- Package version from Cargo.toml (set at compile time)
- ZSTD_
COMPRESSION_ LEVEL - Zstd compression level (1 = fast, 3 = balanced, 19 = maximum)
Functions§
- bundle_
filename - Returns the canonical bundle filename for a bundle number
- bundle_
path - Resolves an on-disk bundle path relative to the provided directory
- bundle_
position_ to_ global - Calculate global position from bundle number and position within bundle Global position = ((bundle_number - 1) * BUNDLE_SIZE) + position
- created_
by - Returns the created_by string for bundle metadata
- global_
to_ bundle_ position - Convert global position to bundle number and position Returns (bundle_number, position) where bundle_number is 1-indexed and position is 0-indexed
- mempool_
position_ to_ global - Calculate global position for a mempool operation Global position = total_operations_from_bundles + mempool_position
- total_
operations_ from_ bundles - Calculate total number of operations from all bundles Total = last_bundle * BUNDLE_SIZE
- user_
agent - Returns the user agent string for HTTP requests