@xyo-network/xl1-driver-lmdb 4.0.12 → 4.0.14
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.
- package/README.md +67 -40
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -5,13 +5,16 @@
|
|
|
5
5
|
[![npm-badge][]][npm-link]
|
|
6
6
|
[![license-badge][]][license-link]
|
|
7
7
|
|
|
8
|
-
> LMDB
|
|
8
|
+
> Node LMDB map driver for XL1 protocol storage.
|
|
9
9
|
|
|
10
|
-
##
|
|
10
|
+
## Description
|
|
11
11
|
|
|
12
|
-
XL1
|
|
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
|
-
|
|
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
|
-
|
|
45
|
+
This package is Node-only and depends on `lmdb`.
|
|
43
46
|
|
|
44
|
-
##
|
|
47
|
+
## Usage
|
|
45
48
|
|
|
46
|
-
|
|
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
|
-
|
|
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
|
|
54
|
-
xy
|
|
55
|
-
xy lint @xyo-network/xl1-driver-lmdb
|
|
95
|
+
pnpm xy skills defaults
|
|
96
|
+
pnpm xy skills lint --fix
|
|
56
97
|
```
|
|
57
98
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
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
|
|
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.
|
|
4
|
+
"version": "4.0.14",
|
|
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.
|
|
39
|
+
"@xyo-network/xl1-protocol": "~4.0.14"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@ariestools/sdk": "~8.0.3",
|
|
43
43
|
"@ariestools/threads": "~8.0.3",
|
|
44
|
+
"@ariestools/toolchain": "~8.6.12",
|
|
45
|
+
"@ariestools/tsconfig": "~8.6.12",
|
|
44
46
|
"@bitauth/libauth": "~3.0.0",
|
|
45
47
|
"@metamask/providers": "~22.1.1",
|
|
46
48
|
"@noble/post-quantum": "~0.6.1",
|
|
@@ -48,8 +50,6 @@
|
|
|
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
54
|
"@xyo-network/sdk-protocol": "~7.0.15",
|
|
55
55
|
"ajv": "~8.20.0",
|