@xyo-network/xl1-driver-lmdb 4.0.12 → 4.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +67 -40
  2. package/package.json +10 -10
package/README.md CHANGED
@@ -5,13 +5,16 @@
5
5
  [![npm-badge][]][npm-link]
6
6
  [![license-badge][]][license-link]
7
7
 
8
- > LMDB-backed map driver for XL1 protocol storage — a synchronous, embedded `SyncMap` implementation for Node.
8
+ > Node LMDB map driver for XL1 protocol storage.
9
9
 
10
- ## About
10
+ ## Description
11
11
 
12
- XL1 SDK components persist data through the `MapType` (`SyncMap | AsyncMap`) abstraction. This package provides `SynchronousLmdbMap`, a synchronous [LMDB](https://github.com/kriszyp/lmdb-js)-backed `SyncMap` for Node, plus helpers (`getLocalPersistentMap`, `deleteLocalPersistentMap`, `getStoreDirectory`) for convention-based on-disk stores. A single LMDB environment supports multiple named stores for multi-tenancy.
12
+ XL1 is the XYO Layer One blockchain protocol. This package provides a Node-only
13
+ LMDB-backed `SyncMap` implementation for XL1 stores that need durable local
14
+ storage without a separate database service.
13
15
 
14
- Inject it wherever an SDK component accepts a `MapType` to back that store with durable, embedded, file-based storage no external database process required.
16
+ Use it for local nodes, CLIs, test fixtures, and services that can keep
17
+ synchronous embedded storage on disk.
15
18
 
16
19
  ## Install
17
20
 
@@ -39,52 +42,76 @@ Using bun:
39
42
  bun add @xyo-network/xl1-driver-lmdb
40
43
  ```
41
44
 
42
- > `lmdb` is an optional peer dependency — install it in the consuming application. This package is Node-only.
45
+ This package is Node-only and depends on `lmdb`.
43
46
 
44
- ## What's Inside
47
+ ## Usage
45
48
 
46
- - **`SynchronousLmdbMap`** — a synchronous LMDB-backed `SyncMap<K, V>`: `get`/`set`/`has`/`getMany`/`setMany`/`delete`/`clear`/`all`, with multi-store support inside one environment.
47
- - **`getLocalPersistentMap` / `deleteLocalPersistentMap`** — create/remove a convention-based local store.
48
- - **`getStoreDirectory`**, **`StoreKind`**, **`LmdbMapParams`** — store path and configuration helpers.
49
+ Create a convention-based local persistent map:
49
50
 
50
- ## Building Locally
51
+ ```ts
52
+ import { getLocalPersistentMap } from '@xyo-network/xl1-driver-lmdb'
53
+
54
+ const map = await getLocalPersistentMap<string, { height: number }>('xl1', 'blocks')
55
+
56
+ await map.set('head', { height: 42 })
57
+ console.log(await map.get('head'))
58
+ ```
59
+
60
+ Or construct the map directly:
61
+
62
+ ```ts
63
+ import { SynchronousLmdbMap } from '@xyo-network/xl1-driver-lmdb'
64
+
65
+ const map = await SynchronousLmdbMap.create({
66
+ location: '.store',
67
+ dbName: 'xl1',
68
+ storeName: 'blocks',
69
+ })
70
+ await map.start()
71
+ ```
72
+
73
+ ## Documentation
74
+
75
+ Exports include:
76
+
77
+ - `SynchronousLmdbMap` - synchronous LMDB-backed map.
78
+ - `getLocalPersistentMap` and `deleteLocalPersistentMap` - convention-based local stores.
79
+ - `getStoreDirectory`, `StoreKind`, and `LmdbMapParams` - path and configuration helpers.
80
+
81
+ Use the memory driver in `@xyo-network/xl1-sdk/driver-memory` when durability is
82
+ not required.
83
+
84
+ ## AI Agent Skills
85
+
86
+ Install the recommended XL1/XYO skills with [Skills.sh](https://skills.sh):
87
+
88
+ ```sh
89
+ npx skills add XYOracleNetwork/xyo-skills --all
90
+ ```
91
+
92
+ In XY toolchain repos, the equivalent convenience command is:
51
93
 
52
94
  ```sh
53
- xy build @xyo-network/xl1-driver-lmdb
54
- xy test @xyo-network/xl1-driver-lmdb
55
- xy lint @xyo-network/xl1-driver-lmdb
95
+ pnpm xy skills defaults
96
+ pnpm xy skills lint --fix
56
97
  ```
57
98
 
58
- ## Maintainers
59
-
60
- <table>
61
- <tr>
62
- <td align="center" valign="top" width="120">
63
- <a href="https://github.com/arietrouw">
64
- <img src="https://github.com/arietrouw.png" width="80" height="80" alt="Arie Trouw" /><br />
65
- <sub><b>Arie Trouw</b></sub>
66
- </a>
67
- <br />
68
- <a href="https://arietrouw.com">arietrouw.com</a>
69
- </td>
70
- <td align="center" valign="top" width="120">
71
- <a href="https://github.com/jonesmac">
72
- <img src="https://github.com/jonesmac.png" width="80" height="80" alt="Matt Jones" /><br />
73
- <sub><b>Matt Jones</b></sub>
74
- </a>
75
- </td>
76
- <td align="center" valign="top" width="120">
77
- <a href="https://github.com/JoelBCarter">
78
- <img src="https://github.com/JoelBCarter.png" width="80" height="80" alt="Joel Carter" /><br />
79
- <sub><b>Joel Carter</b></sub>
80
- </a>
81
- </td>
82
- </tr>
83
- </table>
99
+ For XL1 work, ask your agent to use `xyo-knowledge`, `xl1-knowledge`, and
100
+ `xl1-patterns`. These skills cover XYO primitives, XL1 chain and gateway APIs,
101
+ and application patterns for XL1 dApps.
102
+
103
+ ## Building Locally
104
+
105
+ ```sh
106
+ pnpm xy build @xyo-network/xl1-driver-lmdb
107
+ pnpm xy test @xyo-network/xl1-driver-lmdb
108
+ pnpm xy lint @xyo-network/xl1-driver-lmdb
109
+ ```
84
110
 
85
111
  ## License
86
112
 
87
- See the [LICENSE](./LICENSE) file (LGPL-3.0-only).
113
+ See the [LICENSE](./LICENSE) file for license rights and limitations
114
+ (LGPL-3.0-only).
88
115
 
89
116
  ## Credits
90
117
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "http://json.schemastore.org/package.json",
3
3
  "name": "@xyo-network/xl1-driver-lmdb",
4
- "version": "4.0.12",
4
+ "version": "4.0.15",
5
5
  "description": "XYO Layer One SDK Protocol LMDB Driver",
6
6
  "homepage": "https://xylabs.com",
7
7
  "bugs": {
@@ -36,11 +36,13 @@
36
36
  ],
37
37
  "dependencies": {
38
38
  "lmdb": "~3.5.6",
39
- "@xyo-network/xl1-protocol": "~4.0.12"
39
+ "@xyo-network/xl1-protocol": "~4.0.15"
40
40
  },
41
41
  "devDependencies": {
42
- "@ariestools/sdk": "~8.0.3",
43
- "@ariestools/threads": "~8.0.3",
42
+ "@ariestools/sdk": "~8.0.5",
43
+ "@ariestools/threads": "~8.0.5",
44
+ "@ariestools/toolchain": "~8.7.4",
45
+ "@ariestools/tsconfig": "~8.7.4",
44
46
  "@bitauth/libauth": "~3.0.0",
45
47
  "@metamask/providers": "~22.1.1",
46
48
  "@noble/post-quantum": "~0.6.1",
@@ -48,10 +50,8 @@
48
50
  "@opentelemetry/sdk-trace-base": "~2.9.0",
49
51
  "@scure/base": "~2.2.0",
50
52
  "@scure/bip39": "~2.2.0",
51
- "@xylabs/toolchain": "~8.6.10",
52
- "@xylabs/tsconfig": "~8.6.10",
53
53
  "@xyo-network/sdk": "~7.0.11",
54
- "@xyo-network/sdk-protocol": "~7.0.15",
54
+ "@xyo-network/sdk-protocol": "~7.0.16",
55
55
  "ajv": "~8.20.0",
56
56
  "async-mutex": "~0.5.0",
57
57
  "debug": "~4.4.3",
@@ -66,8 +66,8 @@
66
66
  "zod": "~4.4.3"
67
67
  },
68
68
  "peerDependencies": {
69
- "@ariestools/sdk": "^8.0.3",
70
- "@ariestools/threads": "^8.0.3",
69
+ "@ariestools/sdk": "^8.0.5",
70
+ "@ariestools/threads": "^8.0.5",
71
71
  "@bitauth/libauth": "^3.0.0",
72
72
  "@metamask/providers": "^22.1.1",
73
73
  "@noble/post-quantum": "^0.6.1",
@@ -76,7 +76,7 @@
76
76
  "@scure/base": "^2.2.0",
77
77
  "@scure/bip39": "^2.2.0",
78
78
  "@xyo-network/sdk": "^7.0.11",
79
- "@xyo-network/sdk-protocol": "^7.0.15",
79
+ "@xyo-network/sdk-protocol": "^7.0.16",
80
80
  "ajv": "^8.20.0",
81
81
  "async-mutex": "^0.5.0",
82
82
  "debug": "^4.4.3",