banca / client / src / js / libp2p-config-shim.mjs
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
// helia's root entry imports `loadOrCreateSelfKey` from @libp2p/config, purely
// for the code path that builds a DEFAULT libp2p node. This app never takes that
// path: lib/log's open-helia always passes the libp2p that lib/net created and
// owns (Helia must not re-create or stop it), so `heliaDefaults`'s
// `isLibp2p(init.libp2p)` branch is always the one taken.
//
// Aliasing the package away keeps ~200 transitive modules — an entire second
// libp2p v3-era dependency tree, including a nested @libp2p/crypto that shadow
// cannot parse — out of the bundle. Throwing (rather than returning something
// plausible) is deliberate: if a future change ever does let helia build its own
// node, it must fail loudly here instead of quietly forking the transport.
export function loadOrCreateSelfKey() {
  throw new Error("libp2p-config-shim: helia must never create its own libp2p (pass Net's node)");
}

static mirror of HEAD · about · clone: git clone https://git.ardegazu.ro/banca.git