crypto_database/lib.rs
1// SPDX-FileCopyrightText: 2026 INTERCHAINED LLC
2// SPDX-License-Identifier: BUSL-1.1
3// crypto-database · a distribution of NEDB · © 2026 INTERCHAINED LLC × Eth-Interchained × Vex (Claude Opus 5)
4
5//! crypto-database
6//!
7//! The verifiable v2/v3 distribution of NEDB: content-addressed Merkle DAG, AS OF time-travel, causal provenance, BLAKE2b tamper-evidence.
8//!
9//! Re-exports the full `nedb-engine` API unchanged. crypto-database's
10//! distribution defaults — the verifiable v3 segment store (content-addressed,
11//! self-verifying; AS OF / TRACE time-travel) — are applied by setting the
12//! engine's existing env knobs before a `Db` is opened: programmatically via
13//! [`apply_distro_defaults`], and automatically by the npm `main` shim and the
14//! `nedbd-v2` daemon shim. No engine fork, no flags.
15pub use nedb_engine::*;
16
17/// Apply crypto-database's default engine modes — the verifiable v3 segment
18/// store — unless the caller has already chosen. Call once before opening a
19/// [`Db`]. Set-if-unset: an explicit `NEDB_DAG_V3` (including `0`) always wins.
20pub fn apply_distro_defaults() {
21 if std::env::var_os("NEDB_DAG_V3").is_none() {
22 std::env::set_var("NEDB_DAG_V3", "1");
23 }
24}