@dxos/echo-db 2.33.8-dev.8609bc45 → 2.33.9-dev.e605934d
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/dist/src/echo.test.js +10 -10
- package/dist/src/echo.test.js.map +1 -1
- package/dist/src/halo/halo-factory.d.ts +1 -1
- package/dist/src/halo/halo-factory.d.ts.map +1 -1
- package/dist/src/halo/halo-factory.js +8 -8
- package/dist/src/halo/halo-factory.js.map +1 -1
- package/dist/src/halo/halo-party.d.ts +4 -6
- package/dist/src/halo/halo-party.d.ts.map +1 -1
- package/dist/src/halo/halo-party.js +10 -4
- package/dist/src/halo/halo-party.js.map +1 -1
- package/dist/src/halo/halo.d.ts.map +1 -1
- package/dist/src/halo/halo.js +2 -1
- package/dist/src/halo/halo.js.map +1 -1
- package/dist/src/halo/identity-manager.d.ts.map +1 -1
- package/dist/src/halo/identity-manager.js +8 -2
- package/dist/src/halo/identity-manager.js.map +1 -1
- package/dist/src/halo/party-opener.d.ts.map +1 -1
- package/dist/src/halo/party-opener.js +2 -4
- package/dist/src/halo/party-opener.js.map +1 -1
- package/dist/src/halo/preferences.d.ts.map +1 -1
- package/dist/src/halo/preferences.js +3 -6
- package/dist/src/halo/preferences.js.map +1 -1
- package/dist/src/invitations/greeting-initiator.d.ts +5 -4
- package/dist/src/invitations/greeting-initiator.d.ts.map +1 -1
- package/dist/src/invitations/greeting-initiator.js +4 -5
- package/dist/src/invitations/greeting-initiator.js.map +1 -1
- package/dist/src/invitations/greeting-protocol-provider.js +2 -2
- package/dist/src/invitations/greeting-protocol-provider.js.map +1 -1
- package/dist/src/invitations/greeting-responder.d.ts +4 -7
- package/dist/src/invitations/greeting-responder.d.ts.map +1 -1
- package/dist/src/invitations/greeting-responder.js +7 -21
- package/dist/src/invitations/greeting-responder.js.map +1 -1
- package/dist/src/invitations/halo-recovery-initiator.js +2 -2
- package/dist/src/invitations/halo-recovery-initiator.js.map +1 -1
- package/dist/src/invitations/invitation-descriptor.js +3 -3
- package/dist/src/invitations/invitation-descriptor.js.map +1 -1
- package/dist/src/invitations/invitation-factory.d.ts +2 -1
- package/dist/src/invitations/invitation-factory.d.ts.map +1 -1
- package/dist/src/invitations/invitation-factory.js +3 -5
- package/dist/src/invitations/invitation-factory.js.map +1 -1
- package/dist/src/invitations/offline-invitation-claimer.js +2 -2
- package/dist/src/invitations/offline-invitation-claimer.js.map +1 -1
- package/dist/src/packlets/database/data-mirror.test.js +1 -1
- package/dist/src/packlets/database/data-mirror.test.js.map +1 -1
- package/dist/src/packlets/database/item-demuxer.test.js +1 -1
- package/dist/src/packlets/database/item-demuxer.test.js.map +1 -1
- package/dist/src/packlets/database/testing.js +1 -1
- package/dist/src/packlets/database/testing.js.map +1 -1
- package/dist/src/packlets/database/timeframe-clock.d.ts +2 -1
- package/dist/src/packlets/database/timeframe-clock.d.ts.map +1 -1
- package/dist/src/packlets/database/timeframe-clock.js +15 -5
- package/dist/src/packlets/database/timeframe-clock.js.map +1 -1
- package/dist/src/parties/data-party.d.ts +4 -3
- package/dist/src/parties/data-party.d.ts.map +1 -1
- package/dist/src/parties/data-party.js +9 -5
- package/dist/src/parties/data-party.js.map +1 -1
- package/dist/src/parties/data-party.test.js +12 -12
- package/dist/src/parties/data-party.test.js.map +1 -1
- package/dist/src/parties/party-factory.d.ts +2 -4
- package/dist/src/parties/party-factory.d.ts.map +1 -1
- package/dist/src/parties/party-factory.js +14 -11
- package/dist/src/parties/party-factory.js.map +1 -1
- package/dist/src/parties/party-manager.d.ts +1 -1
- package/dist/src/parties/party-manager.d.ts.map +1 -1
- package/dist/src/parties/party-manager.js +13 -13
- package/dist/src/parties/party-manager.js.map +1 -1
- package/dist/src/parties/party-manager.test.js +16 -12
- package/dist/src/parties/party-manager.test.js.map +1 -1
- package/dist/src/pipeline/feed-muxer.d.ts.map +1 -1
- package/dist/src/pipeline/feed-muxer.js +3 -3
- package/dist/src/pipeline/feed-muxer.js.map +1 -1
- package/dist/src/pipeline/feed-muxer.test.js +2 -2
- package/dist/src/pipeline/feed-muxer.test.js.map +1 -1
- package/dist/src/pipeline/message-selector.d.ts +1 -2
- package/dist/src/pipeline/message-selector.d.ts.map +1 -1
- package/dist/src/pipeline/message-selector.js +4 -31
- package/dist/src/pipeline/message-selector.js.map +1 -1
- package/dist/src/pipeline/metadata-store.d.ts +7 -2
- package/dist/src/pipeline/metadata-store.d.ts.map +1 -1
- package/dist/src/pipeline/metadata-store.js +9 -0
- package/dist/src/pipeline/metadata-store.js.map +1 -1
- package/dist/src/pipeline/party-feed-provider.d.ts +2 -2
- package/dist/src/pipeline/party-feed-provider.d.ts.map +1 -1
- package/dist/src/pipeline/party-feed-provider.js +2 -1
- package/dist/src/pipeline/party-feed-provider.js.map +1 -1
- package/dist/src/pipeline/party-pipeline.d.ts +5 -5
- package/dist/src/pipeline/party-pipeline.d.ts.map +1 -1
- package/dist/src/pipeline/party-pipeline.js +6 -7
- package/dist/src/pipeline/party-pipeline.js.map +1 -1
- package/dist/src/pipeline/party-pipeline.test.js +13 -18
- package/dist/src/pipeline/party-pipeline.test.js.map +1 -1
- package/dist/src/protocol/identity-credentials.d.ts.map +1 -1
- package/dist/src/protocol/identity-credentials.js +2 -2
- package/dist/src/protocol/identity-credentials.js.map +1 -1
- package/dist/src/protocol/party-protocol-factory.js +1 -1
- package/dist/src/protocol/party-protocol-factory.js.map +1 -1
- package/dist/src/protocol/replicator-plugin.d.ts.map +1 -1
- package/dist/src/protocol/replicator-plugin.js +1 -2
- package/dist/src/protocol/replicator-plugin.js.map +1 -1
- package/dist/src/snapshots/snapshot-generator.js +2 -2
- package/dist/src/snapshots/snapshot-generator.js.map +1 -1
- package/dist/src/snapshots/snapshot-store.d.ts.map +1 -1
- package/dist/src/snapshots/snapshot-store.js +2 -2
- package/dist/src/snapshots/snapshot-store.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +20 -20
- package/src/echo.test.ts +1 -1
- package/src/halo/halo-factory.ts +7 -8
- package/src/halo/halo-party.ts +14 -6
- package/src/halo/halo.ts +3 -1
- package/src/halo/identity-manager.ts +11 -2
- package/src/halo/party-opener.ts +2 -4
- package/src/halo/preferences.ts +4 -8
- package/src/invitations/greeting-initiator.ts +10 -5
- package/src/invitations/greeting-protocol-provider.ts +2 -2
- package/src/invitations/greeting-responder.ts +11 -30
- package/src/invitations/halo-recovery-initiator.ts +3 -3
- package/src/invitations/invitation-descriptor.ts +5 -5
- package/src/invitations/invitation-factory.ts +2 -2
- package/src/invitations/offline-invitation-claimer.ts +3 -3
- package/src/packlets/database/data-mirror.test.ts +2 -2
- package/src/packlets/database/item-demuxer.test.ts +2 -2
- package/src/packlets/database/testing.ts +2 -2
- package/src/packlets/database/timeframe-clock.ts +4 -1
- package/src/parties/data-party.test.ts +12 -12
- package/src/parties/data-party.ts +14 -6
- package/src/parties/party-factory.ts +20 -12
- package/src/parties/party-manager.test.ts +12 -8
- package/src/parties/party-manager.ts +14 -12
- package/src/pipeline/feed-muxer.test.ts +2 -2
- package/src/pipeline/feed-muxer.ts +4 -4
- package/src/pipeline/message-selector.ts +4 -35
- package/src/pipeline/metadata-store.ts +15 -2
- package/src/pipeline/party-feed-provider.ts +2 -2
- package/src/pipeline/party-pipeline.test.ts +13 -19
- package/src/pipeline/party-pipeline.ts +13 -12
- package/src/protocol/identity-credentials.ts +5 -2
- package/src/protocol/party-protocol-factory.ts +2 -2
- package/src/protocol/replicator-plugin.ts +1 -2
- package/src/snapshots/snapshot-generator.ts +1 -1
- package/src/snapshots/snapshot-store.ts +2 -2
|
@@ -7,9 +7,11 @@ import assert from 'assert';
|
|
|
7
7
|
import { synchronized } from '@dxos/async';
|
|
8
8
|
import { KeyType, Message as HaloMessage } from '@dxos/credentials';
|
|
9
9
|
import { timed } from '@dxos/debug';
|
|
10
|
-
import {
|
|
10
|
+
import {
|
|
11
|
+
createFeedWriter, DatabaseSnapshot, FeedSelector, FeedWriter, PartyKey, PartySnapshot
|
|
12
|
+
} from '@dxos/echo-protocol';
|
|
11
13
|
import { ModelFactory } from '@dxos/model-factory';
|
|
12
|
-
import { PublicKey } from '@dxos/protocols';
|
|
14
|
+
import { PublicKey, Timeframe } from '@dxos/protocols';
|
|
13
15
|
import { SubscriptionGroup } from '@dxos/util';
|
|
14
16
|
|
|
15
17
|
import { createMessageSelector, PartyProcessor, PartyFeedProvider, FeedMuxer } from '.';
|
|
@@ -30,9 +32,9 @@ export interface PipelineOptions {
|
|
|
30
32
|
|
|
31
33
|
export interface OpenOptions {
|
|
32
34
|
/**
|
|
33
|
-
*
|
|
35
|
+
* Initial feed that contains PartyGenesis message and acts as the root for the feed DAG.
|
|
34
36
|
*/
|
|
35
|
-
|
|
37
|
+
genesisFeedKey: PublicKey
|
|
36
38
|
/**
|
|
37
39
|
* Timeframe to start processing feed messages from.
|
|
38
40
|
*/
|
|
@@ -123,9 +125,9 @@ export class PartyPipeline {
|
|
|
123
125
|
*/
|
|
124
126
|
@synchronized
|
|
125
127
|
@timed(1_000)
|
|
126
|
-
async open (options: OpenOptions
|
|
128
|
+
async open (options: OpenOptions) {
|
|
127
129
|
const {
|
|
128
|
-
|
|
130
|
+
genesisFeedKey,
|
|
129
131
|
initialTimeframe,
|
|
130
132
|
targetTimeframe
|
|
131
133
|
} = options;
|
|
@@ -147,17 +149,16 @@ export class PartyPipeline {
|
|
|
147
149
|
void this._feedProvider.createOrOpenReadOnlyFeed(feed);
|
|
148
150
|
}));
|
|
149
151
|
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
}
|
|
152
|
+
// TODO(dmaretskyi): We still need to hint at the genesis feed for some reason, not doing this breaks invitation tests.
|
|
153
|
+
await this._partyProcessor.takeHints([{ type: KeyType.FEED, publicKey: genesisFeedKey }]);
|
|
153
154
|
|
|
154
155
|
//
|
|
155
156
|
// Pipeline
|
|
156
157
|
//
|
|
157
158
|
|
|
158
159
|
const iterator = await this._feedProvider.createIterator(
|
|
159
|
-
createMessageSelector(this.
|
|
160
|
-
createFeedSelector(this._partyProcessor,
|
|
160
|
+
createMessageSelector(this._timeframeClock),
|
|
161
|
+
createFeedSelector(this._partyProcessor, genesisFeedKey),
|
|
161
162
|
initialTimeframe
|
|
162
163
|
);
|
|
163
164
|
|
|
@@ -256,4 +257,4 @@ export class PartyPipeline {
|
|
|
256
257
|
}
|
|
257
258
|
}
|
|
258
259
|
|
|
259
|
-
const createFeedSelector = (partyProcessor: PartyProcessor,
|
|
260
|
+
const createFeedSelector = (partyProcessor: PartyProcessor, genesisFeed: PublicKey): FeedSelector => feed => genesisFeed.equals(feed.key) || partyProcessor.isFeedAdmitted(feed.key);
|
|
@@ -2,8 +2,11 @@
|
|
|
2
2
|
// Copyright 2022 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
6
|
-
|
|
5
|
+
import {
|
|
6
|
+
createIdentityInfoMessage, createKeyAdmitMessage, createPartyGenesisMessage,
|
|
7
|
+
KeyChain, KeyRecord, Keyring, KeyType, SignedMessage
|
|
8
|
+
} from '@dxos/credentials';
|
|
9
|
+
import { humanize } from '@dxos/util';
|
|
7
10
|
|
|
8
11
|
import { ContactManager, Preferences } from '../halo';
|
|
9
12
|
import { CredentialsSigner } from './credentials-signer';
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import debug from 'debug';
|
|
6
6
|
|
|
7
|
-
import { discoveryKey
|
|
7
|
+
import { discoveryKey } from '@dxos/crypto';
|
|
8
8
|
import { PartyKey } from '@dxos/echo-protocol';
|
|
9
9
|
import { Protocol } from '@dxos/mesh-protocol';
|
|
10
10
|
import { MMSTTopology, NetworkManager, Plugin } from '@dxos/network-manager';
|
|
@@ -93,7 +93,7 @@ export class PartyProtocolFactory {
|
|
|
93
93
|
|
|
94
94
|
userSession: {
|
|
95
95
|
// TODO(burdon): See deprecated `protocolFactory` in HALO.
|
|
96
|
-
peerId:
|
|
96
|
+
peerId: this._peerId.toHex(),
|
|
97
97
|
// TODO(telackey): This ought to be the CredentialsProvider itself, so that fresh credentials can be minted.
|
|
98
98
|
credentials: this._credentials.get().toString('base64')
|
|
99
99
|
},
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
|
|
5
5
|
import debug from 'debug';
|
|
6
6
|
|
|
7
|
-
import { keyToString } from '@dxos/crypto';
|
|
8
7
|
import { Replicator } from '@dxos/protocol-plugin-replicator';
|
|
9
8
|
|
|
10
9
|
import { PartyFeedProvider } from '../pipeline';
|
|
@@ -18,7 +17,7 @@ export const createReplicatorPlugin = (feedProvider: PartyFeedProvider) =>
|
|
|
18
17
|
new Replicator({
|
|
19
18
|
load: async () => {
|
|
20
19
|
const feeds = feedProvider.getFeeds();
|
|
21
|
-
log(`Loading feeds: ${feeds.map(feed =>
|
|
20
|
+
log(`Loading feeds: ${feeds.map(feed => feed.key.toHex())}`);
|
|
22
21
|
return feeds.map((feed) => ({ discoveryKey: feed.feed.discoveryKey }));
|
|
23
22
|
},
|
|
24
23
|
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
import assert from 'assert';
|
|
6
6
|
import debug from 'debug';
|
|
7
7
|
|
|
8
|
-
import { keyToString } from '@dxos/crypto';
|
|
9
8
|
import { schema, PartyKey, PartySnapshot } from '@dxos/echo-protocol';
|
|
9
|
+
import { PublicKey } from '@dxos/protocols';
|
|
10
10
|
import { Directory } from '@dxos/random-access-multi-storage';
|
|
11
11
|
|
|
12
12
|
const log = debug('dxos:snapshot-store');
|
|
@@ -44,7 +44,7 @@ export class SnapshotStore {
|
|
|
44
44
|
|
|
45
45
|
async save (snapshot: PartySnapshot) {
|
|
46
46
|
assert(snapshot.partyKey);
|
|
47
|
-
const file = this._directory.createOrOpen(
|
|
47
|
+
const file = this._directory.createOrOpen(PublicKey.stringify(snapshot.partyKey), { truncate: true, size: 0 });
|
|
48
48
|
|
|
49
49
|
try {
|
|
50
50
|
const data = schema.getCodecForType('dxos.echo.snapshot.PartySnapshot').encode(snapshot);
|