@xyo-network/xl1-driver-mongodb
v5.1.4
Published
XYO Layer One SDK Protocol MongoDB Driver
Keywords
Readme
@xyo-network/xl1-driver-mongodb
MongoDB map and index providers for XL1 protocol storage.
Description
XL1 is the XYO Layer One blockchain protocol. This package provides MongoDB
backed storage for XL1 AsyncIterableMap consumers and Mongo-backed index
viewer/publisher providers for Node services.
Use it when derived chain data, indexes, or provider state need durable, queryable storage outside the process.
Install
Using npm:
npm i --save @xyo-network/xl1-driver-mongodbUsing yarn:
yarn add @xyo-network/xl1-driver-mongodbUsing pnpm:
pnpm add @xyo-network/xl1-driver-mongodbUsing bun:
bun add @xyo-network/xl1-driver-mongodbInstall mongodb in the consuming service when it is not already present.
Usage
Create a Mongo-backed map from an @ariestools/storage-adapters/mongo SDK instance:
import { MongoMap } from '@xyo-network/xl1-driver-mongodb'
const map = await MongoMap.create({
sdk,
getCache: { enabled: true, maxEntries: 5000 },
})
await map.start()
await map.set('head', { block: 42 })Provider services can also register MongoIndexViewer and
MongoIndexPublishRunner directly in a Node-side locator.
Documentation
Exports include:
MongoMap- Mongo-backedAsyncIterableMap.MongoIndexViewer- index viewer over published Mongo index documents.MongoIndexPublishRunner- publisher for block, balance, schema, and transfer indexes.mongoConnectionSdkConfig- connection-config adapter for the Mongo SDK.
This package is for Node-side services. Browser clients should read chain data through SDK gateways or static REST viewers.
AI Agent Skills
Install the recommended XL1/XYO skills with Skills.sh:
npx skills add XYOracleNetwork/xyo-skills --allIn XY toolchain repos, the equivalent convenience command is:
pnpm xy skills defaults
pnpm xy skills lint --fixFor XL1 work, ask your agent to use xyo-knowledge, xl1-knowledge, and
xl1-patterns. These skills cover XYO primitives, XL1 chain and gateway APIs,
and application patterns for XL1 dApps.
Building Locally
pnpm xy build @xyo-network/xl1-driver-mongodb
pnpm xy test @xyo-network/xl1-driver-mongodb
pnpm xy lint @xyo-network/xl1-driver-mongodbLicense
See the LICENSE file for license rights and limitations (LGPL-3.0-only).

