@cogcoin/vectors
v1.0.0
Published
Self-contained Cogcoin indexer vectors, runner utilities, and published generation fixtures.
Maintainers
Readme
@cogcoin/vectors
@cogcoin/[email protected] publishes self-contained Cogcoin indexer vectors together with the runner and schema used to replay them. Each vector bundles its own setup blocks, test blocks, expected state hash, transaction outcomes, and query assertions so it can be replayed directly against @cogcoin/indexer.
Use Node 18 or newer.
Links
- Website: cogcoin.org
- Whitepaper: cogcoin.org/whitepaper.md
- Source: github.com/cogcoin/vectors
- Indexer package: npmjs.com/package/@cogcoin/indexer
- Scoring package: npmjs.com/package/@cogcoin/scoring
Quick Start
Install the package:
npm install @cogcoin/vectorsThe installed package includes the runner, published generated vectors, schema, and helper datasets needed by consumers. The runtime API is published as compiled ESM with bundled type declarations.
Dependency Surface
The published package depends on:
@cogcoin/[email protected]@cogcoin/[email protected]
@cogcoin/genesis is pulled transitively through @cogcoin/indexer.
API
Runtime utilities:
loadVector(path)runVector(vector, options?)
Published JSON exports:
@cogcoin/vectors/history-queries.json@cogcoin/vectors/real-mining-pass.json@cogcoin/vectors/scoring-pass-fixtures.json@cogcoin/vectors/vector-schema.json@cogcoin/vectors/displayBlockHashes.json@cogcoin/vectors/recipientScriptPubKeys.json
Load a Vector from Disk
import { loadVector, runVector } from "@cogcoin/vectors";
const vector = await loadVector("/absolute/path/to/vector.json");
const result = await runVector(vector);runVector(...) drives the full prepare -> score -> finalize -> rewind flow and checks query assertions against the resulting state.
Import a Published Vector
import { createRequire } from "node:module";
import { runVector } from "@cogcoin/vectors";
const require = createRequire(import.meta.url);
const historyVector = require("@cogcoin/vectors/history-queries.json");
const result = await runVector(historyVector);Contents
Generated vectors:
history-queries.json: anchoring, reviews, data history, resolved locks, and domain event log coveragereal-mining-pass.json: published pass sentence replayed through the indexer with a compact synthetic setupscoring-pass-fixtures.json: extracted pass cases from the published scoring conformance vectors
Supporting data:
displayBlockHashes.json: real display-order Bitcoin block hashes used by vector generationrecipientScriptPubKeys.json: real recipient scriptPubKey samples used by fixtures and generatorsschema/vector.schema.json: JSON schema for vector files
The package intentionally ships finalized, self-contained vectors only.
Practical Notes
- Vectors are designed for
@cogcoin/indexer, not as standalone consensus logic. - Query assertions cover both current-state selectors and the whitepaper's optional historical interfaces.
- Generated vector data is intentionally shipped as release artifacts; this package does not regenerate vectors during install or publish.
