keri-ts 2.0.0 → 2.1.0
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/esm/keri/npm/src/acdc/chaining.js +223 -89
- package/esm/keri/npm/src/acdc/observing.js +2 -2
- package/esm/keri/npm/src/acdc/regbasing.js +20 -29
- package/esm/keri/npm/src/acdc/regengine.js +4 -6
- package/esm/keri/npm/src/acdc/registering.js +13 -10
- package/esm/keri/npm/src/acdc/registraring.js +4 -9
- package/esm/keri/npm/src/acdc/salting.js +127 -25
- package/esm/keri/npm/src/acdc/unblinding.js +2 -4
- package/esm/keri/npm/src/app/bootstrap/oobiery.js +1 -1
- package/esm/keri/npm/src/app/credentials/root-replicating.js +123 -0
- package/esm/keri/npm/src/app/credentials/verifying.js +21 -3
- package/esm/keri/npm/src/app/delivery/forwarding.js +49 -7
- package/esm/keri/npm/src/app/exchanges/exchanging.js +11 -12
- package/esm/keri/npm/src/app/identity/configing.js +17 -43
- package/esm/keri/npm/src/app/identity/habbing.js +54 -35
- package/esm/keri/npm/src/app/identity/keeping.js +1 -1
- package/esm/keri/npm/src/app/identity/lmdb-habery.js +12 -0
- package/esm/keri/npm/src/app/ipex/ipex-graph.js +7 -70
- package/esm/keri/npm/src/app/ipex/ipex-grouping.js +8 -5
- package/esm/keri/npm/src/app/ipex/ipex-v2.js +21 -5
- package/esm/keri/npm/src/app/ipex/ipexing.js +1 -1
- package/esm/keri/npm/src/app/mailbox/mailboxing.js +5 -9
- package/esm/keri/npm/src/app/multisig/group-members.js +14 -0
- package/esm/keri/npm/src/app/multisig/grouping.js +4 -3
- package/esm/keri/npm/src/app/multisig/multisig-workflows.js +7 -2
- package/esm/keri/npm/src/app/notifications/notifying.js +5 -9
- package/esm/keri/npm/src/app/protocol/protocol-processing.js +35 -3
- package/esm/keri/npm/src/app/queries/witness-inquisitor.js +2 -2
- package/esm/keri/npm/src/app/runtime/agent-runtime.js +7 -10
- package/esm/keri/npm/src/app/transport/byte-source.js +6 -42
- package/esm/keri/npm/src/app/transport/cesr-egress.js +77 -13
- package/esm/keri/npm/src/app/transport/file-bytes.js +41 -0
- package/esm/keri/npm/src/app/transport/http-messenger.js +14 -9
- package/esm/keri/npm/src/app/transport/message-source.js +1 -1
- package/esm/keri/npm/src/app/transport/messengering.js +3 -4
- package/esm/keri/npm/src/app/transport/node-http-client.js +21 -0
- package/esm/keri/npm/src/app/transport/tcp-dialer.js +14 -0
- package/esm/keri/npm/src/app/witness/receipt-client.js +2 -2
- package/esm/keri/npm/src/cli/common/context.js +2 -2
- package/esm/keri/npm/src/cli/common/existing.js +3 -5
- package/esm/keri/npm/src/cli/credentials/ipex.js +2 -1
- package/esm/keri/npm/src/cli/endpoints/oobi-clean.js +4 -3
- package/esm/keri/npm/src/cli/endpoints/oobi.js +2 -2
- package/esm/keri/npm/src/cli/identity/challenge.js +2 -2
- package/esm/keri/npm/src/cli/identity/incept.js +2 -2
- package/esm/keri/npm/src/cli/identity/init.js +4 -3
- package/esm/keri/npm/src/cli/identity/interact.js +2 -2
- package/esm/keri/npm/src/cli/identity/rotate.js +2 -2
- package/esm/keri/npm/src/cli/messaging/exchange.js +2 -2
- package/esm/keri/npm/src/cli/messaging/multisig.js +61 -3
- package/esm/keri/npm/src/cli/tools/annotate.js +2 -1
- package/esm/keri/npm/src/cli/tools/benchmark.js +2 -1
- package/esm/keri/npm/src/cli/tools/db-dump.js +1 -4
- package/esm/keri/npm/src/core/bytes.js +9 -0
- package/esm/keri/npm/src/core/kel/delegation-ancestry.js +92 -0
- package/esm/keri/npm/src/core/kel/eventing.js +1 -2
- package/esm/keri/npm/src/core/kel/kever.js +11 -9
- package/esm/keri/npm/src/core/mailbox/kram-policy.js +2 -3
- package/esm/keri/npm/src/core/mailbox/kram-pruning.js +15 -22
- package/esm/keri/npm/src/core/mailbox/kram-staging.js +2 -2
- package/esm/keri/npm/src/core/routing.js +2 -2
- package/esm/keri/npm/src/db/basing.js +149 -203
- package/esm/keri/npm/src/db/core/dber.js +1062 -0
- package/esm/keri/npm/src/db/core/index.js +4 -2
- package/esm/keri/npm/src/db/core/lmdb-opener.js +30 -0
- package/esm/keri/npm/src/db/core/lmdber.js +199 -1067
- package/esm/keri/npm/src/db/core/memstore.js +532 -0
- package/esm/keri/npm/src/db/core/path-manager.js +109 -223
- package/esm/keri/npm/src/db/core/store-owner.js +104 -0
- package/esm/keri/npm/src/db/core/webdber.js +252 -0
- package/esm/keri/npm/src/db/escrowing.js +2 -2
- package/esm/keri/npm/src/db/exchange/exchange-nests.js +3 -2
- package/esm/keri/npm/src/db/keeping.js +27 -121
- package/esm/keri/npm/src/db/koming.js +1 -1
- package/esm/keri/npm/src/db/lmdb-stores.js +68 -0
- package/esm/keri/npm/src/db/lmdb.js +6 -0
- package/esm/keri/npm/src/db/mailbox/mailboxing.js +12 -65
- package/esm/keri/npm/src/db/noting.js +11 -55
- package/esm/keri/npm/src/db/reger.js +43 -105
- package/esm/keri/npm/src/db/replay/witness-replay.js +2 -20
- package/esm/keri/npm/src/db/subing.js +1 -1
- package/esm/keri/npm/src/npm/db-lmdb.js +3 -0
- package/esm/keri/npm/src/npm/runtime-node.js +3 -0
- package/esm/keri/npm/src/runtime/index.js +9 -10
- package/esm/keri/npm/src/runtime/node.js +14 -0
- package/esm/keri/npm/src/vdr/eventing.js +1 -1
- package/esm/keri/npm/src/vdr/tel-publication.js +3 -3
- package/esm/keri/npm/src/version.js +2 -2
- package/package.json +11 -4
- package/types/acdc/chaining.d.ts +56 -6
- package/types/acdc/chaining.d.ts.map +1 -1
- package/types/acdc/regbasing.d.ts +7 -6
- package/types/acdc/regbasing.d.ts.map +1 -1
- package/types/acdc/regengine.d.ts.map +1 -1
- package/types/acdc/registering.d.ts +8 -4
- package/types/acdc/registering.d.ts.map +1 -1
- package/types/acdc/registraring.d.ts.map +1 -1
- package/types/acdc/salting.d.ts +53 -6
- package/types/acdc/salting.d.ts.map +1 -1
- package/types/acdc/unblinding.d.ts.map +1 -1
- package/types/app/credentials/root-replicating.d.ts +85 -0
- package/types/app/credentials/root-replicating.d.ts.map +1 -0
- package/types/app/credentials/verifying.d.ts +2 -1
- package/types/app/credentials/verifying.d.ts.map +1 -1
- package/types/app/delivery/forwarding.d.ts +10 -0
- package/types/app/delivery/forwarding.d.ts.map +1 -1
- package/types/app/exchanges/exchanging.d.ts +2 -0
- package/types/app/exchanges/exchanging.d.ts.map +1 -1
- package/types/app/identity/configing.d.ts +7 -5
- package/types/app/identity/configing.d.ts.map +1 -1
- package/types/app/identity/habbing.d.ts +23 -5
- package/types/app/identity/habbing.d.ts.map +1 -1
- package/types/app/identity/keeping.d.ts +1 -1
- package/types/app/identity/lmdb-habery.d.ts +6 -0
- package/types/app/identity/lmdb-habery.d.ts.map +1 -0
- package/types/app/ipex/ipex-graph.d.ts +4 -4
- package/types/app/ipex/ipex-graph.d.ts.map +1 -1
- package/types/app/ipex/ipex-grouping.d.ts.map +1 -1
- package/types/app/ipex/ipex-v2.d.ts +11 -2
- package/types/app/ipex/ipex-v2.d.ts.map +1 -1
- package/types/app/ipex/ipexing.d.ts +3 -0
- package/types/app/ipex/ipexing.d.ts.map +1 -1
- package/types/app/mailbox/mailboxing.d.ts +1 -1
- package/types/app/mailbox/mailboxing.d.ts.map +1 -1
- package/types/app/multisig/group-members.d.ts +9 -0
- package/types/app/multisig/group-members.d.ts.map +1 -1
- package/types/app/multisig/grouping.d.ts.map +1 -1
- package/types/app/multisig/multisig-workflows.d.ts +2 -1
- package/types/app/multisig/multisig-workflows.d.ts.map +1 -1
- package/types/app/notifications/notifying.d.ts +1 -1
- package/types/app/notifications/notifying.d.ts.map +1 -1
- package/types/app/protocol/parsering.d.ts +3 -1
- package/types/app/protocol/parsering.d.ts.map +1 -1
- package/types/app/protocol/protocol-processing.d.ts +2 -0
- package/types/app/protocol/protocol-processing.d.ts.map +1 -1
- package/types/app/runtime/agent-runtime.d.ts +7 -0
- package/types/app/runtime/agent-runtime.d.ts.map +1 -1
- package/types/app/transport/byte-source.d.ts +13 -10
- package/types/app/transport/byte-source.d.ts.map +1 -1
- package/types/app/transport/cesr-egress.d.ts +21 -7
- package/types/app/transport/cesr-egress.d.ts.map +1 -1
- package/types/app/transport/file-bytes.d.ts +11 -0
- package/types/app/transport/file-bytes.d.ts.map +1 -0
- package/types/app/transport/http-client.d.ts +3 -0
- package/types/app/transport/http-client.d.ts.map +1 -1
- package/types/app/transport/http-messenger.d.ts +15 -10
- package/types/app/transport/http-messenger.d.ts.map +1 -1
- package/types/app/transport/message-source.d.ts +1 -1
- package/types/app/transport/messengering.d.ts +2 -2
- package/types/app/transport/messengering.d.ts.map +1 -1
- package/types/app/transport/node-http-client.d.ts +10 -0
- package/types/app/transport/node-http-client.d.ts.map +1 -0
- package/types/app/transport/tcp-dialer.d.ts +21 -0
- package/types/app/transport/tcp-dialer.d.ts.map +1 -0
- package/types/cli/common/existing.d.ts.map +1 -1
- package/types/cli/credentials/ipex.d.ts.map +1 -1
- package/types/cli/endpoints/oobi-clean.d.ts.map +1 -1
- package/types/cli/identity/init.d.ts.map +1 -1
- package/types/cli/index.d.ts +1 -1
- package/types/cli/index.d.ts.map +1 -1
- package/types/cli/messaging/multisig.d.ts +10 -1
- package/types/cli/messaging/multisig.d.ts.map +1 -1
- package/types/cli/tools/annotate.d.ts.map +1 -1
- package/types/cli/tools/benchmark.d.ts.map +1 -1
- package/types/cli/tools/db-dump.d.ts.map +1 -1
- package/types/core/bytes.d.ts +2 -0
- package/types/core/bytes.d.ts.map +1 -1
- package/types/core/kel/delegation-ancestry.d.ts +41 -0
- package/types/core/kel/delegation-ancestry.d.ts.map +1 -0
- package/types/core/kel/eventing.d.ts.map +1 -1
- package/types/core/kel/kever.d.ts +5 -4
- package/types/core/kel/kever.d.ts.map +1 -1
- package/types/core/mailbox/kram-policy.d.ts.map +1 -1
- package/types/core/mailbox/kram-pruning.d.ts +1 -3
- package/types/core/mailbox/kram-pruning.d.ts.map +1 -1
- package/types/db/basing.d.ts +14 -23
- package/types/db/basing.d.ts.map +1 -1
- package/types/db/core/dber.d.ts +505 -0
- package/types/db/core/dber.d.ts.map +1 -0
- package/types/db/core/index.d.ts +4 -2
- package/types/db/core/index.d.ts.map +1 -1
- package/types/db/core/lmdb-opener.d.ts +17 -0
- package/types/db/core/lmdb-opener.d.ts.map +1 -0
- package/types/db/core/lmdber.d.ts +60 -383
- package/types/db/core/lmdber.d.ts.map +1 -1
- package/types/db/core/memstore.d.ts +129 -0
- package/types/db/core/memstore.d.ts.map +1 -0
- package/types/db/core/path-manager.d.ts +22 -45
- package/types/db/core/path-manager.d.ts.map +1 -1
- package/types/db/core/store-owner.d.ts +59 -0
- package/types/db/core/store-owner.d.ts.map +1 -0
- package/types/db/core/webdber.d.ts +127 -0
- package/types/db/core/webdber.d.ts.map +1 -0
- package/types/db/escrowing.d.ts +3 -3
- package/types/db/escrowing.d.ts.map +1 -1
- package/types/db/exchange/exchange-nests.d.ts.map +1 -1
- package/types/db/keeping.d.ts +9 -23
- package/types/db/keeping.d.ts.map +1 -1
- package/types/db/koming.d.ts +7 -8
- package/types/db/koming.d.ts.map +1 -1
- package/types/db/lmdb-stores.d.ts +45 -0
- package/types/db/lmdb-stores.d.ts.map +1 -0
- package/types/db/lmdb.d.ts +7 -0
- package/types/db/lmdb.d.ts.map +1 -0
- package/types/db/mailbox/mailboxing.d.ts +7 -21
- package/types/db/mailbox/mailboxing.d.ts.map +1 -1
- package/types/db/noting.d.ts +7 -12
- package/types/db/noting.d.ts.map +1 -1
- package/types/db/reger.d.ts +7 -11
- package/types/db/reger.d.ts.map +1 -1
- package/types/db/replay/witness-replay.d.ts +0 -2
- package/types/db/replay/witness-replay.d.ts.map +1 -1
- package/types/db/subing.d.ts +24 -25
- package/types/db/subing.d.ts.map +1 -1
- package/types/npm/db-lmdb.d.ts +4 -0
- package/types/npm/db-lmdb.d.ts.map +1 -0
- package/types/npm/runtime-node.d.ts +4 -0
- package/types/npm/runtime-node.d.ts.map +1 -0
- package/types/runtime/index.d.ts +9 -10
- package/types/runtime/index.d.ts.map +1 -1
- package/types/runtime/node.d.ts +15 -0
- package/types/runtime/node.d.ts.map +1 -0
- package/types/version.d.ts +2 -2
- package/esm/keri/npm/src/acdc/relating.js +0 -59
- package/esm/keri/npm/src/db/baser-defaults.js +0 -11
- package/types/acdc/relating.d.ts +0 -21
- package/types/acdc/relating.d.ts.map +0 -1
- package/types/db/baser-defaults.d.ts +0 -5
- package/types/db/baser-defaults.d.ts.map +0 -1
|
@@ -2,14 +2,13 @@
|
|
|
2
2
|
import { b, Cigar, Dater, Diger, Ilks, Labeler, Noncer, NumberPrimitive, NumDex, Prefixer, Saider, SealEvent, SerderKERI, Siger, t, Texter, Verfer, Verser, Vrsn_1_0, } from "cesr-ts";
|
|
3
3
|
import { action } from "effection";
|
|
4
4
|
import { attachmentCounterPayloadQb64b, attachmentCounterQb64b, attachmentOrdinal, resolveAttachmentGvrsn, } from "../core/attachment-countering.js";
|
|
5
|
-
import {
|
|
5
|
+
import { DatabaseOperationError, ValidationError } from "../core/errors.js";
|
|
6
6
|
import { Kever } from "../core/kel/kever.js";
|
|
7
7
|
import { consoleLogger } from "../core/logger.js";
|
|
8
8
|
import { CacheTypeRecord, EndpointRecord, EventSourceRecord, HabitatRecord, KeyStateRecord, LocationRecord, MsgCacheRecord, ObservedRecord, OobiRecord, TopicsRecord, TxnMsgCacheRecord, WellKnownAuthN, } from "../core/records.js";
|
|
9
9
|
import { encodeDateTimeToDater, makeNowIso8601 } from "../time/mod.js";
|
|
10
|
-
import { baserDefaults } from "./baser-defaults.js";
|
|
11
10
|
import { dgKey, splitOnKey } from "./core/keys.js";
|
|
12
|
-
import {
|
|
11
|
+
import { StoreOwner } from "./core/store-owner.js";
|
|
13
12
|
import { ExchangeRecord, ExchangeRegistryStateRecord } from "./exchange/exchange-records.js";
|
|
14
13
|
import { IoSetKomer, Komer } from "./koming.js";
|
|
15
14
|
import { CapturedKelReplay } from "./replay/kel-replay.js";
|
|
@@ -87,7 +86,7 @@ function hugeOrdinalRaw(num) {
|
|
|
87
86
|
* - the full store surface is now bound, but only the local habitat/runtime
|
|
88
87
|
* subset is actively driven by `Habery`/CLI in this arc
|
|
89
88
|
*/
|
|
90
|
-
export class Baser {
|
|
89
|
+
export class Baser extends StoreOwner {
|
|
91
90
|
/**
|
|
92
91
|
* Read pinned-main ESSR evidence only while an accepted or pending EXN owns it.
|
|
93
92
|
* Return hydrated Texters in first-insertion order, or null for absent/unowned
|
|
@@ -102,13 +101,8 @@ export class Baser {
|
|
|
102
101
|
const fragments = this.essrs.get([said]);
|
|
103
102
|
return fragments.length ? fragments : null;
|
|
104
103
|
}
|
|
105
|
-
constructor(
|
|
106
|
-
|
|
107
|
-
enumerable: true,
|
|
108
|
-
configurable: true,
|
|
109
|
-
writable: true,
|
|
110
|
-
value: void 0
|
|
111
|
-
});
|
|
104
|
+
constructor(store, logger = consoleLogger) {
|
|
105
|
+
super(store);
|
|
112
106
|
Object.defineProperty(this, "logger", {
|
|
113
107
|
enumerable: true,
|
|
114
108
|
configurable: true,
|
|
@@ -816,48 +810,28 @@ export class Baser {
|
|
|
816
810
|
writable: true,
|
|
817
811
|
value: void 0
|
|
818
812
|
}); // Type-media quadruples.
|
|
819
|
-
this.logger =
|
|
820
|
-
this.lmdber = new LMDBer(options, baserDefaults(options.compat));
|
|
821
|
-
}
|
|
822
|
-
/** Expose the resolved logical database name delegated from the root LMDBer. */
|
|
823
|
-
get name() {
|
|
824
|
-
return this.lmdber.name;
|
|
825
|
-
}
|
|
826
|
-
/** Expose the resolved database base prefix delegated from the root LMDBer. */
|
|
827
|
-
get base() {
|
|
828
|
-
return this.lmdber.base;
|
|
829
|
-
}
|
|
830
|
-
/** Report whether the root LMDB environment and typed subdb bindings are open. */
|
|
831
|
-
get opened() {
|
|
832
|
-
return this.lmdber.opened;
|
|
813
|
+
this.logger = logger;
|
|
833
814
|
}
|
|
834
815
|
/** Test a schema dependency ownership marker without hydrating its stored exchange. */
|
|
835
816
|
hasSchemaEscrow(said) {
|
|
836
817
|
if (this.emse) {
|
|
837
|
-
for (const key of this.emse.sdb
|
|
818
|
+
for (const key of this.store.scanKeys(this.emse.sdb, { start: b(`${said}.`), limit: 1 })) {
|
|
838
819
|
return t(key).startsWith(`${said}.`);
|
|
820
|
+
}
|
|
839
821
|
}
|
|
840
822
|
return false;
|
|
841
823
|
}
|
|
842
|
-
/** Report whether this `Baser` uses a temporary backing directory. */
|
|
843
|
-
get temp() {
|
|
844
|
-
return this.lmdber.temp;
|
|
845
|
-
}
|
|
846
|
-
/** Expose the resolved filesystem path of the active backing environment. */
|
|
847
|
-
get path() {
|
|
848
|
-
return this.lmdber.path;
|
|
849
|
-
}
|
|
850
|
-
/** Expose the raw LMDB environment for low-level tests and debugging only. */
|
|
851
|
-
get env() {
|
|
852
|
-
return this.lmdber.env;
|
|
853
|
-
}
|
|
854
|
-
/** Report an active caller writer without exposing native transaction internals. */
|
|
855
|
-
get inWriteTransaction() {
|
|
856
|
-
return this.lmdber.inWriteTransaction;
|
|
857
|
-
}
|
|
858
824
|
/** Read an owned binary row through the backing database's normal copy path. */
|
|
859
825
|
getVal(table, key) {
|
|
860
|
-
return this.
|
|
826
|
+
return this.store.getVal(table, key);
|
|
827
|
+
}
|
|
828
|
+
/** Scan owned keys through the backing database. */
|
|
829
|
+
scanKeys(table, options) {
|
|
830
|
+
return this.store.scanKeys(table, options);
|
|
831
|
+
}
|
|
832
|
+
/** Seek within one key's duplicates through the backing database. */
|
|
833
|
+
seekVal(table, key, start) {
|
|
834
|
+
return this.store.seekVal(table, key, start);
|
|
861
835
|
}
|
|
862
836
|
/**
|
|
863
837
|
* Reopen the root LMDB environment and bind the KERIpy-style named subdbs.
|
|
@@ -868,481 +842,481 @@ export class Baser {
|
|
|
868
842
|
* than hand-rolled raw LMDB handles.
|
|
869
843
|
*/
|
|
870
844
|
*reopen(options = {}) {
|
|
871
|
-
const opened = yield* this.
|
|
845
|
+
const opened = yield* this.store.reopen(options);
|
|
872
846
|
if (!opened) {
|
|
873
847
|
return false;
|
|
874
848
|
}
|
|
875
849
|
try {
|
|
876
850
|
// Serialized KEL events keyed by `(pre, said)` digest keys.
|
|
877
|
-
this.evts = new SerderSuber(this.
|
|
851
|
+
this.evts = new SerderSuber(this.store, { subkey: "evts." });
|
|
878
852
|
this.evtsRaw = this.evts.sdb;
|
|
879
853
|
// First-seen event logs map `(pre, fn)` ordinals to event digests.
|
|
880
|
-
this.fels = new OnSuber(this.
|
|
854
|
+
this.fels = new OnSuber(this.store, { subkey: "fels." });
|
|
881
855
|
// Key-event logs map `(pre, sn)` sequence numbers to event digests.
|
|
882
|
-
this.kels = new OnIoDupSuber(this.
|
|
856
|
+
this.kels = new OnIoDupSuber(this.store, { subkey: "kels." });
|
|
883
857
|
// Event timestamps keyed by digest, used when escrowing and timeout logic
|
|
884
858
|
// needs the first-seen datetime.
|
|
885
|
-
this.dtss = new CesrSuber(this.
|
|
859
|
+
this.dtss = new CesrSuber(this.store, {
|
|
886
860
|
subkey: "dtss.",
|
|
887
861
|
ctor: Dater,
|
|
888
862
|
});
|
|
889
863
|
// Authorizing event source seal couples keyed by event digest.
|
|
890
|
-
this.aess = new CatCesrSuber(this.
|
|
864
|
+
this.aess = new CatCesrSuber(this.store, {
|
|
891
865
|
subkey: "aess.",
|
|
892
866
|
ctor: [NumberPrimitive, Diger],
|
|
893
867
|
});
|
|
894
868
|
// Fully qualified indexed controller signatures for one event digest.
|
|
895
|
-
this.sigs = new CesrIoSetSuber(this.
|
|
869
|
+
this.sigs = new CesrIoSetSuber(this.store, {
|
|
896
870
|
subkey: "sigs.",
|
|
897
871
|
ctor: Siger,
|
|
898
872
|
});
|
|
899
873
|
// Indexed witness signatures for one event digest.
|
|
900
|
-
this.wigs = new CesrIoSetSuber(this.
|
|
874
|
+
this.wigs = new CesrIoSetSuber(this.store, {
|
|
901
875
|
subkey: "wigs.",
|
|
902
876
|
ctor: Siger,
|
|
903
877
|
});
|
|
904
878
|
// Event receipt couples from non-transferable signers that are not
|
|
905
879
|
// witnesses, such as watchers or jurors.
|
|
906
|
-
this.rcts = new CatCesrIoSetSuber(this.
|
|
880
|
+
this.rcts = new CatCesrIoSetSuber(this.store, {
|
|
907
881
|
subkey: "rcts.",
|
|
908
882
|
ctor: [Prefixer, Cigar],
|
|
909
883
|
});
|
|
910
884
|
// Unverified event receipt escrow triples from non-transferable signers.
|
|
911
|
-
this.ures = new CatCesrIoSetSuber(this.
|
|
885
|
+
this.ures = new CatCesrIoSetSuber(this.store, {
|
|
912
886
|
subkey: "ures.",
|
|
913
887
|
ctor: [Diger, Prefixer, Cigar],
|
|
914
888
|
});
|
|
915
889
|
// Event validator receipt quadruples from transferable signers.
|
|
916
|
-
this.vrcs = new CatCesrIoSetSuber(this.
|
|
890
|
+
this.vrcs = new CatCesrIoSetSuber(this.store, {
|
|
917
891
|
subkey: "vrcs.",
|
|
918
892
|
ctor: [Prefixer, NumberPrimitive, Diger, Siger],
|
|
919
893
|
});
|
|
920
894
|
// Unverified event validator receipt escrow tuples from transferable
|
|
921
895
|
// signers.
|
|
922
|
-
this.vres = new CatCesrIoSetSuber(this.
|
|
896
|
+
this.vres = new CatCesrIoSetSuber(this.store, {
|
|
923
897
|
subkey: "vres.",
|
|
924
898
|
ctor: [Diger, Prefixer, NumberPrimitive, Diger, Siger],
|
|
925
899
|
});
|
|
926
900
|
// Partially signed key-event escrows mapping `(pre, sn)` to event digests.
|
|
927
|
-
this.pses = new OnIoDupSuber(this.
|
|
901
|
+
this.pses = new OnIoDupSuber(this.store, { subkey: "pses." });
|
|
928
902
|
// Partially witnessed key-event escrows mapping `(pre, sn)` to event
|
|
929
903
|
// digests.
|
|
930
|
-
this.pwes = new OnIoDupSuber(this.
|
|
904
|
+
this.pwes = new OnIoDupSuber(this.store, { subkey: "pwes." });
|
|
931
905
|
// Partially delegated key-event escrows mapping `(pre, sn)` to event
|
|
932
906
|
// digests.
|
|
933
|
-
this.pdes = new OnIoDupSuber(this.
|
|
907
|
+
this.pdes = new OnIoDupSuber(this.store, { subkey: "pdes." });
|
|
934
908
|
// Unverified delegation seal source couples keyed by delegated event
|
|
935
909
|
// digest.
|
|
936
|
-
this.udes = new CatCesrSuber(this.
|
|
910
|
+
this.udes = new CatCesrSuber(this.store, {
|
|
937
911
|
subkey: "udes.",
|
|
938
912
|
ctor: [NumberPrimitive, Diger],
|
|
939
913
|
});
|
|
940
914
|
// Unverified witness escrow couples from witness signers.
|
|
941
|
-
this.uwes = new B64OnIoDupSuber(this.
|
|
915
|
+
this.uwes = new B64OnIoDupSuber(this.store, { subkey: "uwes." });
|
|
942
916
|
// Out-of-order escrowed event tables mapping `(pre, sn)` to event digests.
|
|
943
|
-
this.ooes = new OnIoDupSuber(this.
|
|
917
|
+
this.ooes = new OnIoDupSuber(this.store, { subkey: "ooes." });
|
|
944
918
|
// Duplicitous event log tables mapping `(pre, sn)` to conflicting digests.
|
|
945
|
-
this.dels = new OnIoDupSuber(this.
|
|
919
|
+
this.dels = new OnIoDupSuber(this.store, { subkey: "dels." });
|
|
946
920
|
// Likely-duplicitous escrowed event tables keyed by `(pre, sn)`.
|
|
947
|
-
this.ldes = new OnIoDupSuber(this.
|
|
921
|
+
this.ldes = new OnIoDupSuber(this.store, { subkey: "ldes." });
|
|
948
922
|
// Query-not-found escrows keyed by queried event digest.
|
|
949
|
-
this.qnfs = new IoSetSuber(this.
|
|
923
|
+
this.qnfs = new IoSetSuber(this.store, { subkey: "qnfs." });
|
|
950
924
|
// First-seen ordinal numbers for events, used in superseding and recovery
|
|
951
925
|
// rotation logic.
|
|
952
|
-
this.fons = new CesrSuber(this.
|
|
926
|
+
this.fons = new CesrSuber(this.store, {
|
|
953
927
|
subkey: "fons.",
|
|
954
928
|
ctor: NumberPrimitive,
|
|
955
929
|
});
|
|
956
930
|
// Database migration datetimes keyed by migration name.
|
|
957
|
-
this.migs = new CesrSuber(this.
|
|
931
|
+
this.migs = new CesrSuber(this.store, {
|
|
958
932
|
subkey: "migs.",
|
|
959
933
|
ctor: Dater,
|
|
960
934
|
});
|
|
961
935
|
// Database version table retained for parity even though it is currently
|
|
962
936
|
// unused.
|
|
963
|
-
this.vers = new Suber(this.
|
|
937
|
+
this.vers = new Suber(this.store, { subkey: "vers." });
|
|
964
938
|
// Event source records describing whether an event is local/protected or
|
|
965
939
|
// remote/not protected.
|
|
966
|
-
this.esrs = new Komer(this.
|
|
940
|
+
this.esrs = new Komer(this.store, {
|
|
967
941
|
subkey: "esrs.",
|
|
968
942
|
recordClass: EventSourceRecord,
|
|
969
943
|
});
|
|
970
944
|
// Misfit escrows for remote events that should be dropped unless they
|
|
971
945
|
// become authenticated.
|
|
972
|
-
this.misfits = new IoSetSuber(this.
|
|
946
|
+
this.misfits = new IoSetSuber(this.store, { subkey: "mfes." });
|
|
973
947
|
// Delegable event escrows for KEL events whose local delegator still
|
|
974
948
|
// needs to approve them.
|
|
975
|
-
this.delegables = new IoSetSuber(this.
|
|
949
|
+
this.delegables = new IoSetSuber(this.store, {
|
|
976
950
|
subkey: "dees.",
|
|
977
951
|
});
|
|
978
952
|
// Latest key-state record for each identifier prefix.
|
|
979
|
-
this.states = new Komer(this.
|
|
953
|
+
this.states = new Komer(this.store, {
|
|
980
954
|
subkey: "stts.",
|
|
981
955
|
recordClass: KeyStateRecord,
|
|
982
956
|
});
|
|
983
957
|
// Witness lists for a given event digest.
|
|
984
|
-
this.wits = new CesrIoSetSuber(this.
|
|
958
|
+
this.wits = new CesrIoSetSuber(this.store, {
|
|
985
959
|
subkey: "wits.",
|
|
986
960
|
ctor: Prefixer,
|
|
987
961
|
});
|
|
988
962
|
// Habitat application records keyed by habitat name and namespace.
|
|
989
|
-
this.habs = new Komer(this.
|
|
963
|
+
this.habs = new Komer(this.store, {
|
|
990
964
|
subkey: "habs.",
|
|
991
965
|
recordClass: HabitatRecord,
|
|
992
966
|
});
|
|
993
967
|
// Habitat name database mapping `(domain, name)` to identifier prefixes.
|
|
994
|
-
this.names = new Suber(this.
|
|
968
|
+
this.names = new Suber(this.store, { subkey: "names.", sep: "^" });
|
|
995
969
|
// SAD datetime stamps keyed by SAID.
|
|
996
|
-
this.sdts = new CesrSuber(this.
|
|
970
|
+
this.sdts = new CesrSuber(this.store, {
|
|
997
971
|
subkey: "sdts.",
|
|
998
972
|
ctor: Dater,
|
|
999
973
|
});
|
|
1000
974
|
// SAD indexed signatures keyed by the reply/event quadkey.
|
|
1001
|
-
this.ssgs = new CesrIoSetSuber(this.
|
|
975
|
+
this.ssgs = new CesrIoSetSuber(this.store, {
|
|
1002
976
|
subkey: "ssgs.",
|
|
1003
977
|
ctor: Siger,
|
|
1004
978
|
});
|
|
1005
979
|
// SAD non-indexed signature couples keyed by SAD SAID.
|
|
1006
|
-
this.scgs = new CatCesrIoSetSuber(this.
|
|
980
|
+
this.scgs = new CatCesrIoSetSuber(this.store, {
|
|
1007
981
|
subkey: "scgs.",
|
|
1008
982
|
ctor: [Verfer, Cigar],
|
|
1009
983
|
});
|
|
1010
984
|
// Reply messages keyed by reply SAID.
|
|
1011
985
|
// Datetimes and signatures live in the companion `sdts.`, `ssgs.`, and
|
|
1012
986
|
// `scgs.` stores.
|
|
1013
|
-
this.rpys = new SerderSuber(this.
|
|
987
|
+
this.rpys = new SerderSuber(this.store, { subkey: "rpys." });
|
|
1014
988
|
// Reply escrow indices of partially signed reply messages, mapping reply
|
|
1015
989
|
// routes such as `/end/role` or `/loc/schema` to reply SAIDs.
|
|
1016
|
-
this.rpes = new CesrIoSetSuber(this.
|
|
990
|
+
this.rpes = new CesrIoSetSuber(this.store, {
|
|
1017
991
|
subkey: "rpes.",
|
|
1018
992
|
ctor: Diger,
|
|
1019
993
|
});
|
|
1020
994
|
// AuthN/AuthZ by local controller at `cid` of endpoint provider at `eid`.
|
|
1021
995
|
// Maps `cid.role.eid` to the SAID of the relevant `/end/role` reply.
|
|
1022
|
-
this.eans = new CesrSuber(this.
|
|
996
|
+
this.eans = new CesrSuber(this.store, {
|
|
1023
997
|
subkey: "eans.",
|
|
1024
998
|
ctor: Diger,
|
|
1025
999
|
});
|
|
1026
1000
|
// AuthN/AuthZ by endpoint provider at `eid` of a location at URL scheme.
|
|
1027
1001
|
// Maps `cid.role.eid` to the SAID of the relevant `/loc` reply.
|
|
1028
|
-
this.lans = new CesrSuber(this.
|
|
1002
|
+
this.lans = new CesrSuber(this.store, {
|
|
1029
1003
|
subkey: "lans.",
|
|
1030
1004
|
ctor: Diger,
|
|
1031
1005
|
});
|
|
1032
1006
|
// Service endpoint identifier auth records extracted from `/end/role`
|
|
1033
1007
|
// replies.
|
|
1034
|
-
this.ends = new Komer(this.
|
|
1008
|
+
this.ends = new Komer(this.store, {
|
|
1035
1009
|
subkey: "ends.",
|
|
1036
1010
|
recordClass: EndpointRecord,
|
|
1037
1011
|
});
|
|
1038
1012
|
// Service endpoint locations keyed by endpoint identifier and URL scheme.
|
|
1039
|
-
this.locs = new Komer(this.
|
|
1013
|
+
this.locs = new Komer(this.store, {
|
|
1040
1014
|
subkey: "locs.",
|
|
1041
1015
|
recordClass: LocationRecord,
|
|
1042
1016
|
});
|
|
1043
1017
|
// Observed identifier records keyed by controller, watcher, and observed
|
|
1044
1018
|
// identifier.
|
|
1045
|
-
this.obvs = new Komer(this.
|
|
1019
|
+
this.obvs = new Komer(this.store, {
|
|
1046
1020
|
subkey: "obvs.",
|
|
1047
1021
|
recordClass: ObservedRecord,
|
|
1048
1022
|
});
|
|
1049
1023
|
// Index of the last retrieved message from a witness mailbox.
|
|
1050
|
-
this.tops = new Komer(this.
|
|
1024
|
+
this.tops = new Komer(this.store, {
|
|
1051
1025
|
subkey: "witm.",
|
|
1052
1026
|
recordClass: TopicsRecord,
|
|
1053
1027
|
});
|
|
1054
1028
|
// Group partial signature escrow entries.
|
|
1055
|
-
this.gpse = new CatCesrIoSetSuber(this.
|
|
1029
|
+
this.gpse = new CatCesrIoSetSuber(this.store, {
|
|
1056
1030
|
subkey: "gpse.",
|
|
1057
1031
|
ctor: [NumberPrimitive, Diger],
|
|
1058
1032
|
});
|
|
1059
1033
|
// Group delegate escrow entries.
|
|
1060
|
-
this.gdee = new CatCesrIoSetSuber(this.
|
|
1034
|
+
this.gdee = new CatCesrIoSetSuber(this.store, {
|
|
1061
1035
|
subkey: "gdee.",
|
|
1062
1036
|
ctor: [NumberPrimitive, Diger],
|
|
1063
1037
|
});
|
|
1064
1038
|
// Group partial witness escrow entries.
|
|
1065
|
-
this.gpwe = new CatCesrIoSetSuber(this.
|
|
1039
|
+
this.gpwe = new CatCesrIoSetSuber(this.store, {
|
|
1066
1040
|
subkey: "gdwe.",
|
|
1067
1041
|
ctor: [NumberPrimitive, Diger],
|
|
1068
1042
|
});
|
|
1069
1043
|
// Completed group multisig references.
|
|
1070
|
-
this.cgms = new CesrSuber(this.
|
|
1044
|
+
this.cgms = new CesrSuber(this.store, {
|
|
1071
1045
|
subkey: "cgms.",
|
|
1072
1046
|
ctor: Diger,
|
|
1073
1047
|
});
|
|
1074
1048
|
// Exchange-message partial signature escrow messages.
|
|
1075
|
-
this.epse = new SerderSuber(this.
|
|
1049
|
+
this.epse = new SerderSuber(this.store, { subkey: "epse." });
|
|
1076
1050
|
// Exchange-message partial signature escrow datetimes.
|
|
1077
|
-
this.epsd = new CesrSuber(this.
|
|
1051
|
+
this.epsd = new CesrSuber(this.store, {
|
|
1078
1052
|
subkey: "epsd.",
|
|
1079
1053
|
ctor: Dater,
|
|
1080
1054
|
});
|
|
1081
|
-
this.emse = !this.
|
|
1082
|
-
? new SerderSuber(this.
|
|
1055
|
+
this.emse = !this.store.readonly || this.store.hasTable("emse.")
|
|
1056
|
+
? new SerderSuber(this.store, { subkey: "emse." })
|
|
1083
1057
|
: null;
|
|
1084
|
-
this.emsd = !this.
|
|
1085
|
-
? new CesrSuber(this.
|
|
1058
|
+
this.emsd = !this.store.readonly || this.store.hasTable("emsd.")
|
|
1059
|
+
? new CesrSuber(this.store, { subkey: "emsd.", ctor: Dater })
|
|
1086
1060
|
: null;
|
|
1087
1061
|
// Exchange messages keyed by digest.
|
|
1088
|
-
this.exns = new SerderSuber(this.
|
|
1062
|
+
this.exns = new SerderSuber(this.store, { subkey: "exns." });
|
|
1089
1063
|
// Bind metadata during store opening, never lazily inside an admission that may abort.
|
|
1090
|
-
this.exchangeMeta = new Komer(this.
|
|
1091
|
-
this.exrs = new Komer(this.
|
|
1064
|
+
this.exchangeMeta = new Komer(this.store, { subkey: "exchange.meta.", recordClass: ExchangeRecord });
|
|
1065
|
+
this.exrs = new Komer(this.store, { subkey: "exrs.", recordClass: ExchangeRegistryStateRecord });
|
|
1092
1066
|
// Forward pointers to provided reply messages.
|
|
1093
|
-
this.erpy = new CesrSuber(this.
|
|
1067
|
+
this.erpy = new CesrSuber(this.store, {
|
|
1094
1068
|
subkey: "erpy.",
|
|
1095
1069
|
ctor: Saider,
|
|
1096
1070
|
});
|
|
1097
1071
|
// Exchange-message indexed signatures.
|
|
1098
|
-
this.esigs = new CesrIoSetSuber(this.
|
|
1072
|
+
this.esigs = new CesrIoSetSuber(this.store, {
|
|
1099
1073
|
subkey: "esigs.",
|
|
1100
1074
|
ctor: Siger,
|
|
1101
1075
|
});
|
|
1102
1076
|
// Exchange-message non-indexed signature couples.
|
|
1103
|
-
this.ecigs = new CatCesrIoSetSuber(this.
|
|
1077
|
+
this.ecigs = new CatCesrIoSetSuber(this.store, {
|
|
1104
1078
|
subkey: "ecigs.",
|
|
1105
1079
|
ctor: [Verfer, Cigar],
|
|
1106
1080
|
});
|
|
1107
1081
|
// Historical source coordinates remain interoperable CESR couples, never private pointers.
|
|
1108
|
-
this.ests = new CatCesrIoSetSuber(this.
|
|
1082
|
+
this.ests = new CatCesrIoSetSuber(this.store, {
|
|
1109
1083
|
subkey: "ests.",
|
|
1110
1084
|
ctor: [NumberPrimitive, Diger],
|
|
1111
1085
|
});
|
|
1112
|
-
this.eidx = new CesrIoSetSuber(this.
|
|
1086
|
+
this.eidx = new CesrIoSetSuber(this.store, { subkey: "eidx.", ctor: Diger });
|
|
1113
1087
|
// Exchange-message pathed attachments.
|
|
1114
|
-
this.epath = new IoSetSuber(this.
|
|
1115
|
-
this.enst = new IoSetSuber(this.
|
|
1088
|
+
this.epath = new IoSetSuber(this.store, { subkey: ".epath" });
|
|
1089
|
+
this.enst = new IoSetSuber(this.store, { subkey: "enst." });
|
|
1116
1090
|
// Encrypt-Sender-Sign-Receiver payloads keyed by exchange digest.
|
|
1117
|
-
this.essrs = new CesrIoSetSuber(this.
|
|
1091
|
+
this.essrs = new CesrIoSetSuber(this.store, {
|
|
1118
1092
|
subkey: "essrs.",
|
|
1119
1093
|
ctor: Texter,
|
|
1120
1094
|
});
|
|
1121
1095
|
// Registry root copies awaiting automatic retention, keyed by exchange SAID.
|
|
1122
|
-
this.rrpe = new CesrSuber(this.
|
|
1096
|
+
this.rrpe = new CesrSuber(this.store, { subkey: "rrpe.", ctor: Dater });
|
|
1123
1097
|
// Accepted signed challenge-response exchange-message SAIDs keyed by the
|
|
1124
1098
|
// signer prefix.
|
|
1125
|
-
this.chas = new CesrIoSetSuber(this.
|
|
1099
|
+
this.chas = new CesrIoSetSuber(this.store, {
|
|
1126
1100
|
subkey: "chas.",
|
|
1127
1101
|
ctor: Diger,
|
|
1128
1102
|
});
|
|
1129
1103
|
// Successful signed challenge-response exchange-message SAIDs keyed by
|
|
1130
1104
|
// the signer prefix.
|
|
1131
|
-
this.reps = new CesrIoSetSuber(this.
|
|
1105
|
+
this.reps = new CesrIoSetSuber(this.store, {
|
|
1132
1106
|
subkey: "reps.",
|
|
1133
1107
|
ctor: Diger,
|
|
1134
1108
|
});
|
|
1135
1109
|
// Authorized well-known OOBI records.
|
|
1136
|
-
this.wkas = new IoSetKomer(this.
|
|
1110
|
+
this.wkas = new IoSetKomer(this.store, {
|
|
1137
1111
|
subkey: "wkas.",
|
|
1138
1112
|
recordClass: WellKnownAuthN,
|
|
1139
1113
|
});
|
|
1140
1114
|
// Key-state notice datetime stamps keyed by key-state SAID.
|
|
1141
|
-
this.kdts = new CesrSuber(this.
|
|
1115
|
+
this.kdts = new CesrSuber(this.store, {
|
|
1142
1116
|
subkey: "kdts.",
|
|
1143
1117
|
ctor: Dater,
|
|
1144
1118
|
});
|
|
1145
1119
|
// Key-state messages keyed by key-state SAID.
|
|
1146
1120
|
// Datetimes and signatures are held in the companion key-state stores.
|
|
1147
|
-
this.ksns = new Komer(this.
|
|
1121
|
+
this.ksns = new Komer(this.store, {
|
|
1148
1122
|
subkey: "ksns.",
|
|
1149
1123
|
recordClass: KeyStateRecord,
|
|
1150
1124
|
});
|
|
1151
1125
|
// Successful key-state notice SAID index mapping `(controller, aid)` to
|
|
1152
1126
|
// saved key-state SAIDs.
|
|
1153
|
-
this.knas = new CesrSuber(this.
|
|
1127
|
+
this.knas = new CesrSuber(this.store, {
|
|
1154
1128
|
subkey: "knas.",
|
|
1155
1129
|
ctor: Diger,
|
|
1156
1130
|
});
|
|
1157
1131
|
// Watcher watched-SAID index mapping `(cid, aid, oid)` to the saved reply
|
|
1158
1132
|
// message SAID for a watched identifier.
|
|
1159
|
-
this.wwas = new CesrSuber(this.
|
|
1133
|
+
this.wwas = new CesrSuber(this.store, {
|
|
1160
1134
|
subkey: "wwas.",
|
|
1161
1135
|
ctor: Diger,
|
|
1162
1136
|
});
|
|
1163
1137
|
// Config-loaded OOBIs to be processed asynchronously.
|
|
1164
|
-
this.oobis = new Komer(this.
|
|
1138
|
+
this.oobis = new Komer(this.store, {
|
|
1165
1139
|
subkey: "oobis.",
|
|
1166
1140
|
sep: ">",
|
|
1167
1141
|
recordClass: OobiRecord,
|
|
1168
1142
|
});
|
|
1169
1143
|
// Retriable OOBIs that failed to load.
|
|
1170
|
-
this.eoobi = new Komer(this.
|
|
1144
|
+
this.eoobi = new Komer(this.store, {
|
|
1171
1145
|
subkey: "eoobi.",
|
|
1172
1146
|
sep: ">",
|
|
1173
1147
|
recordClass: OobiRecord,
|
|
1174
1148
|
});
|
|
1175
1149
|
// OOBIs with outstanding client requests.
|
|
1176
|
-
this.coobi = new Komer(this.
|
|
1150
|
+
this.coobi = new Komer(this.store, {
|
|
1177
1151
|
subkey: "coobi.",
|
|
1178
1152
|
sep: ">",
|
|
1179
1153
|
recordClass: OobiRecord,
|
|
1180
1154
|
});
|
|
1181
1155
|
// Successfully resolved OOBIs.
|
|
1182
|
-
this.roobi = new Komer(this.
|
|
1156
|
+
this.roobi = new Komer(this.store, {
|
|
1183
1157
|
subkey: "roobi.",
|
|
1184
1158
|
sep: ">",
|
|
1185
1159
|
recordClass: OobiRecord,
|
|
1186
1160
|
});
|
|
1187
1161
|
// Well-known OOBIs used for multifactor authentication against resolved
|
|
1188
1162
|
// OOBIs.
|
|
1189
|
-
this.woobi = new Komer(this.
|
|
1163
|
+
this.woobi = new Komer(this.store, {
|
|
1190
1164
|
subkey: "woobi.",
|
|
1191
1165
|
sep: ">",
|
|
1192
1166
|
recordClass: OobiRecord,
|
|
1193
1167
|
});
|
|
1194
1168
|
// Multi-OOBI associations where one AID is tied to multiple OOBIs.
|
|
1195
|
-
this.moobi = new Komer(this.
|
|
1169
|
+
this.moobi = new Komer(this.store, {
|
|
1196
1170
|
subkey: "moobi.",
|
|
1197
1171
|
sep: ">",
|
|
1198
1172
|
recordClass: OobiRecord,
|
|
1199
1173
|
});
|
|
1200
1174
|
// Multifactor well-known OOBI auth records awaiting processing, keyed by
|
|
1201
1175
|
// controller URL.
|
|
1202
|
-
this.mfa = new Komer(this.
|
|
1176
|
+
this.mfa = new Komer(this.store, {
|
|
1203
1177
|
subkey: "mfa.",
|
|
1204
1178
|
sep: ">",
|
|
1205
1179
|
recordClass: OobiRecord,
|
|
1206
1180
|
});
|
|
1207
1181
|
// Resolved multifactor well-known OOBI auth records keyed by controller
|
|
1208
1182
|
// URL.
|
|
1209
|
-
this.rmfa = new Komer(this.
|
|
1183
|
+
this.rmfa = new Komer(this.store, {
|
|
1210
1184
|
subkey: "rmfa.",
|
|
1211
1185
|
sep: ">",
|
|
1212
1186
|
recordClass: OobiRecord,
|
|
1213
1187
|
});
|
|
1214
1188
|
// JSON Schema SADs keyed by schema SAID.
|
|
1215
|
-
this.schema = new SchemerSuber(this.
|
|
1189
|
+
this.schema = new SchemerSuber(this.store, {
|
|
1216
1190
|
subkey: "schema.",
|
|
1217
1191
|
});
|
|
1218
1192
|
// Field values for contact information for remote identifiers.
|
|
1219
|
-
this.cfld = new Suber(this.
|
|
1193
|
+
this.cfld = new Suber(this.store, { subkey: "cfld." });
|
|
1220
1194
|
// Global settings for the Habery environment.
|
|
1221
|
-
this.hbys = new Suber(this.
|
|
1195
|
+
this.hbys = new Suber(this.store, { subkey: "hbys." });
|
|
1222
1196
|
// Signed contact data keyed by identifier prefix.
|
|
1223
|
-
this.cons = new Suber(this.
|
|
1197
|
+
this.cons = new Suber(this.store, { subkey: "cons." });
|
|
1224
1198
|
// Signature cigars for signed contact data.
|
|
1225
|
-
this.ccigs = new CesrSuber(this.
|
|
1199
|
+
this.ccigs = new CesrSuber(this.store, {
|
|
1226
1200
|
subkey: "ccigs.",
|
|
1227
1201
|
ctor: Cigar,
|
|
1228
1202
|
});
|
|
1229
1203
|
// Blinded media tuples for remote contact information.
|
|
1230
|
-
this.imgs = new CatCesrSuber(this.
|
|
1204
|
+
this.imgs = new CatCesrSuber(this.store, {
|
|
1231
1205
|
subkey: "imgs.",
|
|
1232
1206
|
ctor: [Noncer, Noncer, Labeler, Texter],
|
|
1233
1207
|
});
|
|
1234
1208
|
// Field values for local identifier information.
|
|
1235
|
-
this.ifld = new Suber(this.
|
|
1209
|
+
this.ifld = new Suber(this.store, { subkey: "ifld." });
|
|
1236
1210
|
// Signed local identifier data keyed by prefix.
|
|
1237
|
-
this.sids = new Suber(this.
|
|
1211
|
+
this.sids = new Suber(this.store, { subkey: "sids." });
|
|
1238
1212
|
// Signature cigars for signed local identifier data.
|
|
1239
|
-
this.icigs = new CesrSuber(this.
|
|
1213
|
+
this.icigs = new CesrSuber(this.store, {
|
|
1240
1214
|
subkey: "icigs.",
|
|
1241
1215
|
ctor: Cigar,
|
|
1242
1216
|
});
|
|
1243
1217
|
// Blinded media tuples for local identifier information.
|
|
1244
|
-
this.iimgs = new CatCesrSuber(this.
|
|
1218
|
+
this.iimgs = new CatCesrSuber(this.store, {
|
|
1245
1219
|
subkey: "iimgs.",
|
|
1246
1220
|
ctor: [Noncer, Noncer, Labeler, Texter],
|
|
1247
1221
|
});
|
|
1248
1222
|
// Delegated partial-witness escrow messages.
|
|
1249
|
-
this.dpwe = new SerderSuber(this.
|
|
1223
|
+
this.dpwe = new SerderSuber(this.store, { subkey: "dpwe." });
|
|
1250
1224
|
// Delegated unanchored escrow messages.
|
|
1251
|
-
this.dune = new SerderSuber(this.
|
|
1225
|
+
this.dune = new SerderSuber(this.store, { subkey: "dune." });
|
|
1252
1226
|
// Delegate publication escrow messages for sending delegator information
|
|
1253
1227
|
// to local witnesses.
|
|
1254
|
-
this.dpub = new SerderSuber(this.
|
|
1228
|
+
this.dpub = new SerderSuber(this.store, { subkey: "dpub." });
|
|
1255
1229
|
// Completed group delegated AIDs keyed by ordinal.
|
|
1256
|
-
this.cdel = new CesrOnSuber(this.
|
|
1230
|
+
this.cdel = new CesrOnSuber(this.store, {
|
|
1257
1231
|
subkey: "cdel.",
|
|
1258
1232
|
ctor: Diger,
|
|
1259
1233
|
});
|
|
1260
1234
|
// Multisig embed payload SAIDs mapped to containing exchange-message
|
|
1261
1235
|
// SAIDs across group multisig participants.
|
|
1262
|
-
this.meids = new CesrIoSetSuber(this.
|
|
1236
|
+
this.meids = new CesrIoSetSuber(this.store, {
|
|
1263
1237
|
subkey: "meids.",
|
|
1264
1238
|
ctor: Saider,
|
|
1265
1239
|
});
|
|
1266
1240
|
// Multisig embed payload SAIDs mapped to group multisig participant AIDs.
|
|
1267
|
-
this.maids = new CesrIoSetSuber(this.
|
|
1241
|
+
this.maids = new CesrIoSetSuber(this.store, {
|
|
1268
1242
|
subkey: "maids.",
|
|
1269
1243
|
ctor: Prefixer,
|
|
1270
1244
|
});
|
|
1271
1245
|
// KRAM cache-type records keyed by expression string.
|
|
1272
|
-
this.ctyp = new Komer(this.
|
|
1246
|
+
this.ctyp = new Komer(this.store, {
|
|
1273
1247
|
subkey: "ctyp.",
|
|
1274
1248
|
recordClass: CacheTypeRecord,
|
|
1275
1249
|
});
|
|
1276
1250
|
// KRAM message-cache records keyed by `(AID, MID)`.
|
|
1277
|
-
this.msgc = new Komer(this.
|
|
1251
|
+
this.msgc = new Komer(this.store, {
|
|
1278
1252
|
subkey: "msgc.",
|
|
1279
1253
|
recordClass: MsgCacheRecord,
|
|
1280
1254
|
});
|
|
1281
|
-
this.xdt = new CesrSuber(this.
|
|
1255
|
+
this.xdt = new CesrSuber(this.store, { subkey: "xdt.", ctor: Dater });
|
|
1282
1256
|
// KRAM transactioned message-cache records keyed by `(AID, XID, MID)`.
|
|
1283
|
-
this.tmsc = new Komer(this.
|
|
1257
|
+
this.tmsc = new Komer(this.store, {
|
|
1284
1258
|
subkey: "tmsc.",
|
|
1285
1259
|
recordClass: TxnMsgCacheRecord,
|
|
1286
1260
|
});
|
|
1287
|
-
this.ulgs = new CesrIoSetSuber(this.
|
|
1288
|
-
this.cigs = new CatCesrIoSetSuber(this.
|
|
1261
|
+
this.ulgs = new CesrIoSetSuber(this.store, { subkey: "ulgs.", ctor: Prefixer });
|
|
1262
|
+
this.cigs = new CatCesrIoSetSuber(this.store, { subkey: "cigs.", ctor: [Verfer, Cigar] });
|
|
1289
1263
|
// KRAM partially signed multi-key messages keyed by `(AID, MID)`.
|
|
1290
|
-
this.pmkm = new SerderSuber(this.
|
|
1264
|
+
this.pmkm = new SerderSuber(this.store, { subkey: "pmkm." });
|
|
1291
1265
|
// KRAM partially signed multi-key signatures keyed by `(AID, MID)`.
|
|
1292
|
-
this.pmks = new CesrIoSetSuber(this.
|
|
1266
|
+
this.pmks = new CesrIoSetSuber(this.store, {
|
|
1293
1267
|
subkey: "pmks.",
|
|
1294
1268
|
ctor: Siger,
|
|
1295
1269
|
});
|
|
1296
1270
|
// KRAM partially signed multi-key sender key-state seals keyed by
|
|
1297
1271
|
// `(AID, MID)`.
|
|
1298
|
-
this.pmsk = new CatCesrSuber(this.
|
|
1272
|
+
this.pmsk = new CatCesrSuber(this.store, {
|
|
1299
1273
|
subkey: "pmsk.",
|
|
1300
1274
|
ctor: [NumberPrimitive, Diger],
|
|
1301
1275
|
});
|
|
1302
1276
|
// Transferable receipt quadruples used by the KRAM attachment path.
|
|
1303
|
-
this.trqs = new CatCesrIoSetSuber(this.
|
|
1277
|
+
this.trqs = new CatCesrIoSetSuber(this.store, {
|
|
1304
1278
|
subkey: "trqs.",
|
|
1305
1279
|
ctor: [Prefixer, NumberPrimitive, Diger, Siger],
|
|
1306
1280
|
});
|
|
1307
1281
|
// Transferable last-signature groups used by the KRAM attachment path.
|
|
1308
|
-
this.tsgs = new CatCesrIoSetSuber(this.
|
|
1282
|
+
this.tsgs = new CatCesrIoSetSuber(this.store, {
|
|
1309
1283
|
subkey: "tsgs.",
|
|
1310
1284
|
ctor: [Prefixer, NumberPrimitive, Diger, Siger],
|
|
1311
1285
|
});
|
|
1312
1286
|
// First-seen seal couples for issuing or delegating events.
|
|
1313
|
-
this.sscs = new CatCesrIoSetSuber(this.
|
|
1287
|
+
this.sscs = new CatCesrIoSetSuber(this.store, {
|
|
1314
1288
|
subkey: "sscs.",
|
|
1315
1289
|
ctor: [NumberPrimitive, Diger],
|
|
1316
1290
|
});
|
|
1317
1291
|
// Source seal triples for issued or delegated events.
|
|
1318
|
-
this.ssts = new CatCesrIoSetSuber(this.
|
|
1292
|
+
this.ssts = new CatCesrIoSetSuber(this.store, {
|
|
1319
1293
|
subkey: "ssts.",
|
|
1320
1294
|
ctor: [Prefixer, NumberPrimitive, Diger],
|
|
1321
1295
|
});
|
|
1322
1296
|
// First-seen replay couples storing ordinal and datetime pairs.
|
|
1323
|
-
this.frcs = new CatCesrIoSetSuber(this.
|
|
1297
|
+
this.frcs = new CatCesrIoSetSuber(this.store, {
|
|
1324
1298
|
subkey: "frcs.",
|
|
1325
1299
|
ctor: [NumberPrimitive, Dater],
|
|
1326
1300
|
});
|
|
1327
1301
|
// Typed digest seal couples.
|
|
1328
|
-
this.tdcs = new CatCesrIoSetSuber(this.
|
|
1302
|
+
this.tdcs = new CatCesrIoSetSuber(this.store, {
|
|
1329
1303
|
subkey: "tdcs.",
|
|
1330
1304
|
ctor: [Verser, Noncer],
|
|
1331
1305
|
});
|
|
1332
1306
|
// Pathed streams stored as raw bytes.
|
|
1333
|
-
this.ptds = new BytesIoSetSuber(this.
|
|
1307
|
+
this.ptds = new BytesIoSetSuber(this.store, { subkey: "ptds." });
|
|
1334
1308
|
// Blind state quadruples.
|
|
1335
|
-
this.bsqs = new CatCesrIoSetSuber(this.
|
|
1309
|
+
this.bsqs = new CatCesrIoSetSuber(this.store, {
|
|
1336
1310
|
subkey: "bsqs.",
|
|
1337
1311
|
ctor: [Noncer, Noncer, Noncer, Labeler],
|
|
1338
1312
|
});
|
|
1339
1313
|
// Bound state sextuples.
|
|
1340
|
-
this.bsss = new CatCesrIoSetSuber(this.
|
|
1314
|
+
this.bsss = new CatCesrIoSetSuber(this.store, {
|
|
1341
1315
|
subkey: "bsss.",
|
|
1342
1316
|
ctor: [Noncer, Noncer, Noncer, Labeler, NumberPrimitive, Noncer],
|
|
1343
1317
|
});
|
|
1344
1318
|
// Type-media quadruples.
|
|
1345
|
-
this.tmqs = new CatCesrIoSetSuber(this.
|
|
1319
|
+
this.tmqs = new CatCesrIoSetSuber(this.store, {
|
|
1346
1320
|
subkey: "tmqs.",
|
|
1347
1321
|
ctor: [Noncer, Noncer, Labeler, Texter],
|
|
1348
1322
|
});
|
|
@@ -1359,39 +1333,39 @@ export class Baser {
|
|
|
1359
1333
|
this.kevers.clear();
|
|
1360
1334
|
this.prefixes.clear();
|
|
1361
1335
|
this.groups.clear();
|
|
1362
|
-
return yield* this.
|
|
1336
|
+
return yield* this.store.close(clear);
|
|
1363
1337
|
}
|
|
1364
1338
|
/** Read the root LMDB version marker through the shared lifecycle owner. */
|
|
1365
1339
|
getVer() {
|
|
1366
|
-
return this.
|
|
1340
|
+
return this.store.getVer();
|
|
1367
1341
|
}
|
|
1368
1342
|
/** Write the root LMDB version marker through the shared lifecycle owner. */
|
|
1369
1343
|
setVer(val) {
|
|
1370
|
-
this.
|
|
1344
|
+
this.store.setVer(val);
|
|
1371
1345
|
}
|
|
1372
1346
|
/** Count raw physical entries in `evts.` for test/debug visibility. */
|
|
1373
1347
|
cntEvts() {
|
|
1374
|
-
return this.
|
|
1348
|
+
return this.store.cnt(this.evtsRaw);
|
|
1375
1349
|
}
|
|
1376
1350
|
/** Raw insert helper kept for tests/debug tooling. */
|
|
1377
1351
|
putEvt(key, val) {
|
|
1378
|
-
return this.
|
|
1352
|
+
return this.store.putVal(this.evtsRaw, key, val);
|
|
1379
1353
|
}
|
|
1380
1354
|
/** Raw upsert helper kept for tests/debug tooling. */
|
|
1381
1355
|
setEvt(key, val) {
|
|
1382
|
-
return this.
|
|
1356
|
+
return this.store.setVal(this.evtsRaw, key, val);
|
|
1383
1357
|
}
|
|
1384
1358
|
/** Raw fetch helper kept for tests/debug tooling. */
|
|
1385
1359
|
getEvt(key) {
|
|
1386
|
-
return this.
|
|
1360
|
+
return this.store.getVal(this.evtsRaw, key);
|
|
1387
1361
|
}
|
|
1388
1362
|
/** Raw delete helper kept for tests/debug tooling. */
|
|
1389
1363
|
delEvt(key) {
|
|
1390
|
-
return this.
|
|
1364
|
+
return this.store.delVal(this.evtsRaw, key);
|
|
1391
1365
|
}
|
|
1392
1366
|
/** Iterate `evts.` entries with optional byte-prefix filter. */
|
|
1393
1367
|
*getAllEvtsIter(top = new Uint8Array(0)) {
|
|
1394
|
-
yield* this.
|
|
1368
|
+
yield* this.store.getTopItemIter(this.evtsRaw, top);
|
|
1395
1369
|
}
|
|
1396
1370
|
/**
|
|
1397
1371
|
* Persist one serialized event body in `evts.` under its digest key.
|
|
@@ -1917,7 +1891,7 @@ export class Baser {
|
|
|
1917
1891
|
if (sn === null)
|
|
1918
1892
|
return new CapturedKelReplay(this, [[pre, 0, felEnd]]);
|
|
1919
1893
|
const start = b(`${pre}.${"f".repeat(32)}`);
|
|
1920
|
-
for (const entry of this.kels.sdb
|
|
1894
|
+
for (const entry of this.store.scan(this.kels.sdb, { start, reverse: true, limit: 1 })) {
|
|
1921
1895
|
const [prefix, end] = splitOnKey(entry.key);
|
|
1922
1896
|
if (t(prefix) !== pre)
|
|
1923
1897
|
return null;
|
|
@@ -1970,7 +1944,7 @@ export class Baser {
|
|
|
1970
1944
|
replayEnd(pre) {
|
|
1971
1945
|
// Fixed-width CESR ordinal keys sort lexically, so the maximal suffix bounds this prefix's tail.
|
|
1972
1946
|
const start = b(`${pre}.${"f".repeat(32)}`);
|
|
1973
|
-
for (const entry of this.fels.sdb
|
|
1947
|
+
for (const entry of this.store.scan(this.fels.sdb, { start, reverse: true, limit: 1 })) {
|
|
1974
1948
|
const [prefix, ordinal] = splitOnKey(entry.key);
|
|
1975
1949
|
return t(prefix) === pre ? ordinal : null;
|
|
1976
1950
|
}
|
|
@@ -2033,6 +2007,13 @@ export class Baser {
|
|
|
2033
2007
|
return this.hbys.get(name);
|
|
2034
2008
|
}
|
|
2035
2009
|
}
|
|
2010
|
+
/** Placement of this store kind. */
|
|
2011
|
+
Object.defineProperty(Baser, "Family", {
|
|
2012
|
+
enumerable: true,
|
|
2013
|
+
configurable: true,
|
|
2014
|
+
writable: true,
|
|
2015
|
+
value: { tail: "db", maxTables: 128 }
|
|
2016
|
+
});
|
|
2036
2017
|
/**
|
|
2037
2018
|
* Thin Effection-native lifecycle host for one `Baser`.
|
|
2038
2019
|
*
|
|
@@ -2084,38 +2065,3 @@ export class BaserDoer {
|
|
|
2084
2065
|
}
|
|
2085
2066
|
}
|
|
2086
2067
|
}
|
|
2087
|
-
/** Constructor-safe async factory for a fully reopened `Baser`. */
|
|
2088
|
-
export function* createBaser(options = {}) {
|
|
2089
|
-
const baser = new Baser(options);
|
|
2090
|
-
let delivered = false;
|
|
2091
|
-
let failure;
|
|
2092
|
-
try {
|
|
2093
|
-
const opened = yield* baser.reopen(options);
|
|
2094
|
-
if (!opened) {
|
|
2095
|
-
throw new DatabaseNotOpenError("Failed to open Baser");
|
|
2096
|
-
}
|
|
2097
|
-
delivered = true;
|
|
2098
|
-
return baser;
|
|
2099
|
-
}
|
|
2100
|
-
catch (error) {
|
|
2101
|
-
failure = { error };
|
|
2102
|
-
throw error;
|
|
2103
|
-
}
|
|
2104
|
-
finally {
|
|
2105
|
-
if (!delivered) {
|
|
2106
|
-
try {
|
|
2107
|
-
yield* baser.close();
|
|
2108
|
-
}
|
|
2109
|
-
catch (error) {
|
|
2110
|
-
if (failure) {
|
|
2111
|
-
// deno-lint-ignore no-unsafe-finally -- Preserve the operation failure alongside shutdown failure.
|
|
2112
|
-
throw new AggregateError([failure.error, error], "Database acquisition and close failed", {
|
|
2113
|
-
cause: failure.error,
|
|
2114
|
-
});
|
|
2115
|
-
}
|
|
2116
|
-
// deno-lint-ignore no-unsafe-finally -- A shutdown failure must propagate.
|
|
2117
|
-
throw error;
|
|
2118
|
-
}
|
|
2119
|
-
}
|
|
2120
|
-
}
|
|
2121
|
-
}
|