@dxos/echo-db 2.33.4-dev.faf06c70 → 2.33.5-dev.1fc05a51
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/api/selection/queries.d.ts.map +1 -1
- package/dist/src/api/selection/queries.js +13 -17
- package/dist/src/api/selection/queries.js.map +1 -1
- package/dist/src/api/selection/selection.d.ts.map +1 -1
- package/dist/src/api/selection/selection.js +1 -3
- package/dist/src/api/selection/selection.js.map +1 -1
- package/dist/src/api/selection/selection.test.js +4 -12
- package/dist/src/api/selection/selection.test.js.map +1 -1
- package/dist/src/database/item-demuxer.d.ts +1 -1
- package/dist/src/database/item-demuxer.d.ts.map +1 -1
- package/dist/src/database/item-demuxer.js +3 -5
- package/dist/src/database/item-demuxer.js.map +1 -1
- package/dist/src/database/item-manager.js +2 -2
- package/dist/src/database/item-manager.js.map +1 -1
- package/dist/src/database/testing.js +1 -1
- package/dist/src/database/testing.js.map +1 -1
- package/dist/src/echo.d.ts +5 -12
- package/dist/src/echo.d.ts.map +1 -1
- package/dist/src/echo.js +9 -20
- package/dist/src/echo.js.map +1 -1
- package/dist/src/halo/halo-factory.d.ts.map +1 -1
- package/dist/src/halo/halo-factory.js +5 -11
- package/dist/src/halo/halo-factory.js.map +1 -1
- package/dist/src/halo/halo-party.d.ts +3 -3
- package/dist/src/halo/halo-party.d.ts.map +1 -1
- package/dist/src/halo/halo-party.js +6 -4
- package/dist/src/halo/halo-party.js.map +1 -1
- package/dist/src/halo/halo.test.js +5 -4
- package/dist/src/halo/halo.test.js.map +1 -1
- package/dist/src/halo/identity.js +2 -2
- package/dist/src/halo/identity.js.map +1 -1
- package/dist/src/halo/party-opener.d.ts +1 -1
- package/dist/src/halo/party-opener.d.ts.map +1 -1
- package/dist/src/halo/party-opener.js +2 -2
- 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 +7 -10
- package/dist/src/halo/preferences.js.map +1 -1
- package/dist/src/index.d.ts +0 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +0 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/invitations/greeting-protocol-provider.d.ts.map +1 -1
- package/dist/src/invitations/greeting-protocol-provider.js +5 -9
- package/dist/src/invitations/greeting-protocol-provider.js.map +1 -1
- package/dist/src/invitations/greeting-responder.d.ts +2 -2
- package/dist/src/invitations/greeting-responder.d.ts.map +1 -1
- package/dist/src/invitations/greeting-responder.js +8 -12
- package/dist/src/invitations/greeting-responder.js.map +1 -1
- package/dist/src/invitations/invitation-factory.d.ts +2 -2
- package/dist/src/invitations/invitation-factory.d.ts.map +1 -1
- package/dist/src/invitations/invitation-factory.js.map +1 -1
- package/dist/src/invitations/offline-invitation-claimer.d.ts.map +1 -1
- package/dist/src/invitations/offline-invitation-claimer.js +5 -7
- package/dist/src/invitations/offline-invitation-claimer.js.map +1 -1
- package/dist/src/parties/data-party.d.ts +7 -5
- package/dist/src/parties/data-party.d.ts.map +1 -1
- package/dist/src/parties/data-party.js +12 -9
- package/dist/src/parties/data-party.js.map +1 -1
- package/dist/src/parties/data-party.test.js +16 -16
- package/dist/src/parties/data-party.test.js.map +1 -1
- package/dist/src/parties/party-factory.d.ts +0 -6
- package/dist/src/parties/party-factory.d.ts.map +1 -1
- package/dist/src/parties/party-factory.js +17 -45
- package/dist/src/parties/party-factory.js.map +1 -1
- package/dist/src/parties/party-manager.d.ts.map +1 -1
- package/dist/src/parties/party-manager.js +2 -1
- package/dist/src/parties/party-manager.js.map +1 -1
- package/dist/src/parties/party-manager.test.js +7 -7
- package/dist/src/parties/party-manager.test.js.map +1 -1
- package/dist/src/pipeline/message-selector.d.ts +2 -2
- package/dist/src/pipeline/message-selector.d.ts.map +1 -1
- package/dist/src/pipeline/message-selector.js +29 -39
- package/dist/src/pipeline/message-selector.js.map +1 -1
- package/dist/src/pipeline/metadata-store.d.ts +3 -3
- package/dist/src/pipeline/metadata-store.d.ts.map +1 -1
- package/dist/src/pipeline/metadata-store.js +5 -5
- package/dist/src/pipeline/metadata-store.js.map +1 -1
- package/dist/src/pipeline/metadata-store.test.js +9 -5
- package/dist/src/pipeline/metadata-store.test.js.map +1 -1
- package/dist/src/pipeline/party-core.d.ts +3 -2
- package/dist/src/pipeline/party-core.d.ts.map +1 -1
- package/dist/src/pipeline/party-core.js +5 -0
- package/dist/src/pipeline/party-core.js.map +1 -1
- package/dist/src/pipeline/party-core.test.js +17 -43
- package/dist/src/pipeline/party-core.test.js.map +1 -1
- package/dist/src/pipeline/party-processor.d.ts +23 -5
- package/dist/src/pipeline/party-processor.d.ts.map +1 -1
- package/dist/src/pipeline/party-processor.js.map +1 -1
- package/dist/src/pipeline/pipeline.d.ts +2 -4
- package/dist/src/pipeline/pipeline.d.ts.map +1 -1
- package/dist/src/pipeline/pipeline.js +0 -3
- package/dist/src/pipeline/pipeline.js.map +1 -1
- package/dist/src/pipeline/pipeline.test.js +2 -2
- package/dist/src/pipeline/pipeline.test.js.map +1 -1
- package/dist/src/protocol/auth-plugin.d.ts +1 -1
- package/dist/src/protocol/auth-plugin.d.ts.map +1 -1
- package/dist/src/protocol/auth-plugin.js +1 -3
- package/dist/src/protocol/auth-plugin.js.map +1 -1
- package/dist/src/protocol/authenticator.d.ts +2 -2
- package/dist/src/protocol/authenticator.d.ts.map +1 -1
- package/dist/src/protocol/authenticator.js +12 -16
- package/dist/src/protocol/authenticator.js.map +1 -1
- package/dist/src/protocol/halo-recovery-plugin.d.ts +1 -1
- package/dist/src/protocol/halo-recovery-plugin.d.ts.map +1 -1
- package/dist/src/protocol/halo-recovery-plugin.js +1 -3
- package/dist/src/protocol/halo-recovery-plugin.js.map +1 -1
- package/dist/src/protocol/identity-credentials.d.ts +2 -2
- package/dist/src/protocol/identity-credentials.d.ts.map +1 -1
- package/dist/src/protocol/identity-credentials.js +4 -4
- package/dist/src/protocol/identity-credentials.js.map +1 -1
- package/dist/src/protocol/offline-invitation-plugin.d.ts +1 -1
- package/dist/src/protocol/offline-invitation-plugin.d.ts.map +1 -1
- package/dist/src/protocol/offline-invitation-plugin.js +1 -3
- package/dist/src/protocol/offline-invitation-plugin.js.map +1 -1
- package/dist/src/protocol/party-protocol-factory.d.ts +1 -14
- package/dist/src/protocol/party-protocol-factory.d.ts.map +1 -1
- package/dist/src/protocol/party-protocol-factory.js +2 -55
- package/dist/src/protocol/party-protocol-factory.js.map +1 -1
- package/dist/src/protocol/replicator-plugin.d.ts +7 -0
- package/dist/src/protocol/replicator-plugin.d.ts.map +1 -0
- package/dist/src/protocol/replicator-plugin.js +36 -0
- package/dist/src/protocol/replicator-plugin.js.map +1 -0
- package/dist/src/snapshots/snapshot-generator.d.ts +1 -1
- package/dist/src/snapshots/snapshot-generator.d.ts.map +1 -1
- package/dist/src/snapshots/snapshot-generator.js +13 -15
- package/dist/src/snapshots/snapshot-generator.js.map +1 -1
- package/dist/src/snapshots/snapshot-store.d.ts +3 -3
- package/dist/src/snapshots/snapshot-store.d.ts.map +1 -1
- package/dist/src/snapshots/snapshot-store.js +5 -5
- package/dist/src/snapshots/snapshot-store.js.map +1 -1
- package/dist/src/snapshots/snapshot-store.test.js +2 -2
- package/dist/src/snapshots/snapshot-store.test.js.map +1 -1
- package/dist/src/testing/benchmark.test.d.ts +2 -0
- package/dist/src/testing/benchmark.test.d.ts.map +1 -0
- package/dist/src/testing/benchmark.test.js +25 -0
- package/dist/src/testing/benchmark.test.js.map +1 -0
- package/dist/src/testing/testing-factories.js +2 -2
- package/dist/src/testing/testing-factories.js.map +1 -1
- package/dist/src/testing/testing.d.ts +3 -4
- package/dist/src/testing/testing.d.ts.map +1 -1
- package/dist/src/testing/testing.js +3 -4
- package/dist/src/testing/testing.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +21 -21
- package/src/api/selection/queries.ts +14 -18
- package/src/api/selection/selection.test.ts +4 -12
- package/src/api/selection/selection.ts +1 -7
- package/src/database/item-demuxer.ts +2 -4
- package/src/database/item-manager.ts +2 -2
- package/src/database/testing.ts +1 -1
- package/src/echo.ts +13 -35
- package/src/halo/halo-factory.ts +6 -18
- package/src/halo/halo-party.ts +8 -7
- package/src/halo/halo.test.ts +5 -4
- package/src/halo/identity.ts +2 -2
- package/src/halo/party-opener.ts +2 -2
- package/src/halo/preferences.ts +7 -10
- package/src/index.ts +0 -1
- package/src/invitations/greeting-protocol-provider.ts +5 -9
- package/src/invitations/greeting-responder.ts +10 -14
- package/src/invitations/invitation-factory.ts +2 -2
- package/src/invitations/offline-invitation-claimer.ts +5 -7
- package/src/parties/data-party.test.ts +17 -16
- package/src/parties/data-party.ts +17 -13
- package/src/parties/party-factory.ts +23 -69
- package/src/parties/party-manager.test.ts +9 -7
- package/src/parties/party-manager.ts +2 -1
- package/src/pipeline/message-selector.ts +31 -44
- package/src/pipeline/metadata-store.test.ts +9 -5
- package/src/pipeline/metadata-store.ts +5 -5
- package/src/pipeline/party-core.test.ts +19 -60
- package/src/pipeline/party-core.ts +7 -2
- package/src/pipeline/party-processor.ts +26 -2
- package/src/pipeline/pipeline.test.ts +2 -2
- package/src/pipeline/pipeline.ts +2 -6
- package/src/protocol/auth-plugin.ts +1 -3
- package/src/protocol/authenticator.ts +27 -31
- package/src/protocol/halo-recovery-plugin.ts +4 -6
- package/src/protocol/identity-credentials.ts +4 -4
- package/src/protocol/offline-invitation-plugin.ts +4 -6
- package/src/protocol/party-protocol-factory.ts +3 -56
- package/src/protocol/replicator-plugin.ts +37 -0
- package/src/snapshots/snapshot-generator.ts +12 -16
- package/src/snapshots/snapshot-store.test.ts +2 -2
- package/src/snapshots/snapshot-store.ts +5 -6
- package/src/testing/benchmark.test.ts +30 -0
- package/src/testing/testing-factories.ts +2 -2
- package/src/testing/testing.ts +4 -8
- package/dist/src/util/index.d.ts +0 -2
- package/dist/src/util/index.d.ts.map +0 -1
- package/dist/src/util/index.js +0 -17
- package/dist/src/util/index.js.map +0 -1
- package/dist/src/util/persistant-ram-storage.d.ts +0 -6
- package/dist/src/util/persistant-ram-storage.d.ts.map +0 -1
- package/dist/src/util/persistant-ram-storage.js +0 -32
- package/dist/src/util/persistant-ram-storage.js.map +0 -1
- package/src/util/index.ts +0 -5
- package/src/util/persistant-ram-storage.ts +0 -33
|
@@ -24,9 +24,7 @@ const modelFactory = new ModelFactory().registerModel(ObjectModel);
|
|
|
24
24
|
|
|
25
25
|
const createModel = (id: ItemID) => modelFactory.createModel(ObjectModel.meta.type, id, {}, PublicKey.random());
|
|
26
26
|
|
|
27
|
-
const createItem = (id: ItemID, type: ItemType, parent?: Item<any>) =>
|
|
28
|
-
return new Item(null as any, id, type, createModel(id), undefined, parent);
|
|
29
|
-
};
|
|
27
|
+
const createItem = (id: ItemID, type: ItemType, parent?: Item<any>) => new Item(null as any, id, type, createModel(id), undefined, parent);
|
|
30
28
|
|
|
31
29
|
const createLink = (id: ItemID, type: ItemType, source: Item<any>, target: Item<any>) => {
|
|
32
30
|
const link = new Link(null as any, id, type, createModel(id), {
|
|
@@ -262,17 +260,11 @@ describe('Selection', () => {
|
|
|
262
260
|
test('complex reducer', () => {
|
|
263
261
|
const query = createReducer({ numItems: 0, numLinks: 0 })
|
|
264
262
|
.filter({ type: ITEM_ORG })
|
|
265
|
-
.call((items: Item[], { numItems, ...rest }) => {
|
|
266
|
-
return { ...rest, numItems: numItems + items.length, stage: 'a' };
|
|
267
|
-
})
|
|
263
|
+
.call((items: Item[], { numItems, ...rest }) => ({ ...rest, numItems: numItems + items.length, stage: 'a' }))
|
|
268
264
|
.children({ type: ITEM_PROJECT })
|
|
269
|
-
.call((items: Item[], { numItems, ...rest }) => {
|
|
270
|
-
return { ...rest, numItems: numItems + items.length, stage: 'b' };
|
|
271
|
-
})
|
|
265
|
+
.call((items: Item[], { numItems, ...rest }) => ({ ...rest, numItems: numItems + items.length, stage: 'b' }))
|
|
272
266
|
.links({ type: LINK_MEMBER })
|
|
273
|
-
.call((links: Link[], { numLinks, ...rest }) => {
|
|
274
|
-
return { ...rest, numLinks: numLinks + links.length, stage: 'c' };
|
|
275
|
-
})
|
|
267
|
+
.call((links: Link[], { numLinks, ...rest }) => ({ ...rest, numLinks: numLinks + links.length, stage: 'c' }))
|
|
276
268
|
.target()
|
|
277
269
|
.exec();
|
|
278
270
|
|
|
@@ -57,13 +57,7 @@ export const createSelection = <R>(
|
|
|
57
57
|
* @param update
|
|
58
58
|
* @param value Initial reducer value.
|
|
59
59
|
*/
|
|
60
|
-
export const createItemSelection = <R>(
|
|
61
|
-
root: Item<any>,
|
|
62
|
-
update: Event<Entity[]>,
|
|
63
|
-
value: R
|
|
64
|
-
): Selection<Item<any>, R> => {
|
|
65
|
-
return new Selection(() => [[root], value], update, root, value !== undefined);
|
|
66
|
-
};
|
|
60
|
+
export const createItemSelection = <R>(root: Item<any>, update: Event<Entity[]>, value: R): Selection<Item<any>, R> => new Selection(() => [[root], value], update, root, value !== undefined);
|
|
67
61
|
|
|
68
62
|
/**
|
|
69
63
|
* Selections are used to construct database subscriptions.
|
|
@@ -10,7 +10,6 @@ import { failUndefined } from '@dxos/debug';
|
|
|
10
10
|
import { DatabaseSnapshot, IEchoStream, ItemID, ItemSnapshot, LinkSnapshot } from '@dxos/echo-protocol';
|
|
11
11
|
import { createWritable } from '@dxos/feed-store';
|
|
12
12
|
import { Model, ModelFactory, ModelMessage } from '@dxos/model-factory';
|
|
13
|
-
import { jsonReplacer } from '@dxos/util';
|
|
14
13
|
|
|
15
14
|
import { Entity, Item, Link } from '../api';
|
|
16
15
|
import { ItemManager, ModelConstructionOptions } from './item-manager';
|
|
@@ -46,7 +45,6 @@ export class ItemDemuxer {
|
|
|
46
45
|
// TODO(burdon): Factor out.
|
|
47
46
|
// TODO(burdon): Should this implement some "back-pressure" (hints) to the PartyProcessor?
|
|
48
47
|
return createWritable<IEchoStream>(async (message: IEchoStream) => {
|
|
49
|
-
log('Reading:', JSON.stringify(message, jsonReplacer));
|
|
50
48
|
const { data: { itemId, genesis, itemMutation, mutation, snapshot }, meta } = message;
|
|
51
49
|
assert(itemId);
|
|
52
50
|
|
|
@@ -187,7 +185,7 @@ export class ItemDemuxer {
|
|
|
187
185
|
* Sort based on parents.
|
|
188
186
|
* @param items
|
|
189
187
|
*/
|
|
190
|
-
export
|
|
188
|
+
export const sortItemsTopologically = (items: ItemSnapshot[]): ItemSnapshot[] => {
|
|
191
189
|
const snapshots: ItemSnapshot[] = [];
|
|
192
190
|
const seenIds = new Set<ItemID>();
|
|
193
191
|
|
|
@@ -206,4 +204,4 @@ export function sortItemsTopologically (items: ItemSnapshot[]): ItemSnapshot[] {
|
|
|
206
204
|
}
|
|
207
205
|
|
|
208
206
|
return snapshots;
|
|
209
|
-
}
|
|
207
|
+
};
|
|
@@ -375,7 +375,7 @@ export class ItemManager {
|
|
|
375
375
|
/**
|
|
376
376
|
* Returns a new event that groups all of the updates emitted during single tick into a single event emission.
|
|
377
377
|
*/
|
|
378
|
-
|
|
378
|
+
const debounceEntityUpdateEvent = (event: Event<Entity<any>>): Event<Entity<any>[]> => {
|
|
379
379
|
const debouncedEvent = new Event<Entity<any>[]>();
|
|
380
380
|
|
|
381
381
|
let firing = false;
|
|
@@ -395,4 +395,4 @@ function debounceEntityUpdateEvent (event: Event<Entity<any>>): Event<Entity<any
|
|
|
395
395
|
}));
|
|
396
396
|
|
|
397
397
|
return debouncedEvent;
|
|
398
|
-
}
|
|
398
|
+
};
|
package/src/database/testing.ts
CHANGED
|
@@ -15,7 +15,7 @@ import { FeedDatabaseBackend, RemoteDatabaseBackend } from './database-backend';
|
|
|
15
15
|
|
|
16
16
|
export const createInMemoryDatabase = async (modelFactory: ModelFactory) => {
|
|
17
17
|
const feed = new MockFeedWriter<EchoEnvelope>();
|
|
18
|
-
const inboundStream = new Readable({ read () {}, objectMode: true });
|
|
18
|
+
const inboundStream = new Readable({ read: () => {}, objectMode: true });
|
|
19
19
|
feed.written.on(([data, meta]) => inboundStream.push({ data, meta: { ...meta, memberKey: PublicKey.random(), timeframe: new Timeframe([[meta.feedKey, meta.seq]]) } }));
|
|
20
20
|
|
|
21
21
|
const database = new Database(
|
package/src/echo.ts
CHANGED
|
@@ -15,7 +15,7 @@ import { FeedStore } from '@dxos/feed-store';
|
|
|
15
15
|
import { ModelFactory } from '@dxos/model-factory';
|
|
16
16
|
import { NetworkManager, NetworkManagerOptions } from '@dxos/network-manager';
|
|
17
17
|
import { ObjectModel } from '@dxos/object-model';
|
|
18
|
-
import {
|
|
18
|
+
import { Storage, createStorage, StorageType } from '@dxos/random-access-multi-storage';
|
|
19
19
|
import { SubscriptionGroup } from '@dxos/util';
|
|
20
20
|
|
|
21
21
|
import { ResultSet } from './api';
|
|
@@ -27,7 +27,6 @@ import { InvitationDescriptor, OfflineInvitationClaimer } from './invitations';
|
|
|
27
27
|
import { OpenProgress, PartyFactory, DataParty, PartyManager } from './parties';
|
|
28
28
|
import { MetadataStore, STORAGE_VERSION, PartyFeedProvider } from './pipeline';
|
|
29
29
|
import { SnapshotStore } from './snapshots';
|
|
30
|
-
import { createRamStorage } from './util';
|
|
31
30
|
|
|
32
31
|
const log = debug('dxos:echo');
|
|
33
32
|
const error = log.extend('error');
|
|
@@ -39,26 +38,17 @@ export interface PartyFilter { }
|
|
|
39
38
|
* Various options passed to `ECHO.create`.
|
|
40
39
|
*/
|
|
41
40
|
export interface EchoCreationOptions {
|
|
41
|
+
|
|
42
42
|
/**
|
|
43
|
-
* Storage
|
|
43
|
+
* Storage to persist data. Defaults to in-memory.
|
|
44
44
|
*/
|
|
45
|
-
|
|
45
|
+
storage?: Storage
|
|
46
46
|
|
|
47
47
|
/**
|
|
48
48
|
* Storage used for keys. Defaults to in-memory.
|
|
49
49
|
*/
|
|
50
50
|
keyStorage?: any
|
|
51
51
|
|
|
52
|
-
/**
|
|
53
|
-
* Storage used for snapshots. Defaults to in-memory.
|
|
54
|
-
*/
|
|
55
|
-
snapshotStorage?: IStorage
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* Storage used for snapshots. Defaults to in-memory.
|
|
59
|
-
*/
|
|
60
|
-
metadataStorage?: IStorage
|
|
61
|
-
|
|
62
52
|
/**
|
|
63
53
|
* Networking provider. Defaults to in-memory networking.
|
|
64
54
|
*/
|
|
@@ -97,6 +87,7 @@ export class ECHO {
|
|
|
97
87
|
private readonly _halo: HALO;
|
|
98
88
|
private readonly _keyring: Keyring;
|
|
99
89
|
|
|
90
|
+
private readonly _storage: Storage;
|
|
100
91
|
private readonly _feedStore: FeedStore;
|
|
101
92
|
private readonly _modelFactory: ModelFactory;
|
|
102
93
|
private readonly _networkManager: NetworkManager;
|
|
@@ -113,9 +104,7 @@ export class ECHO {
|
|
|
113
104
|
// TODO(burdon): Factor out config an define type.
|
|
114
105
|
constructor ({
|
|
115
106
|
keyStorage = memdown(),
|
|
116
|
-
|
|
117
|
-
snapshotStorage = createRamStorage(),
|
|
118
|
-
metadataStorage = createRamStorage(),
|
|
107
|
+
storage = createStorage('', StorageType.RAM),
|
|
119
108
|
networkManagerOptions,
|
|
120
109
|
/// TODO(burdon): See options below.
|
|
121
110
|
snapshots = true,
|
|
@@ -126,11 +115,12 @@ export class ECHO {
|
|
|
126
115
|
this._modelFactory = new ModelFactory()
|
|
127
116
|
.registerModel(ObjectModel);
|
|
128
117
|
|
|
118
|
+
this._storage = storage;
|
|
129
119
|
this._networkManager = new NetworkManager(networkManagerOptions);
|
|
130
|
-
this._snapshotStore = new SnapshotStore(
|
|
131
|
-
this._metadataStore = new MetadataStore(
|
|
120
|
+
this._snapshotStore = new SnapshotStore(storage.directory('snapshots'));
|
|
121
|
+
this._metadataStore = new MetadataStore(storage.directory('metadata'));
|
|
132
122
|
this._keyring = new Keyring(new KeyStore(keyStorage));
|
|
133
|
-
this._feedStore = new FeedStore(
|
|
123
|
+
this._feedStore = new FeedStore(storage.directory('feeds'), { valueEncoding: codec });
|
|
134
124
|
|
|
135
125
|
const feedProviderFactory = (partyKey: PublicKey) => new PartyFeedProvider(
|
|
136
126
|
this._metadataStore,
|
|
@@ -287,26 +277,14 @@ export class ECHO {
|
|
|
287
277
|
await this.close();
|
|
288
278
|
|
|
289
279
|
try {
|
|
290
|
-
if (this.
|
|
291
|
-
await this.
|
|
280
|
+
if (this._storage.destroy) {
|
|
281
|
+
await this._storage.destroy();
|
|
292
282
|
}
|
|
293
283
|
} catch (err: any) {
|
|
294
|
-
error('Error clearing
|
|
284
|
+
error('Error clearing storage:', err);
|
|
295
285
|
}
|
|
296
286
|
|
|
297
287
|
await this.halo.reset();
|
|
298
|
-
|
|
299
|
-
try {
|
|
300
|
-
await this._snapshotStore.clear();
|
|
301
|
-
} catch (err: any) {
|
|
302
|
-
error('Error clearing snapshot storage:', err);
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
try {
|
|
306
|
-
await this._metadataStore.clear();
|
|
307
|
-
} catch (err: any) {
|
|
308
|
-
error('Error clearing metadata storage:', err);
|
|
309
|
-
}
|
|
310
288
|
}
|
|
311
289
|
|
|
312
290
|
//
|
package/src/halo/halo-factory.ts
CHANGED
|
@@ -14,8 +14,7 @@ import {
|
|
|
14
14
|
KeyType,
|
|
15
15
|
Filter,
|
|
16
16
|
SecretProvider,
|
|
17
|
-
KeyHint
|
|
18
|
-
createFeedAdmitMessage
|
|
17
|
+
KeyHint
|
|
19
18
|
} from '@dxos/credentials';
|
|
20
19
|
import { keyToString, PublicKey, keyPairFromSeedPhrase } from '@dxos/crypto';
|
|
21
20
|
import { ModelFactory } from '@dxos/model-factory';
|
|
@@ -94,21 +93,21 @@ export class HaloFactory {
|
|
|
94
93
|
* B. Device key (the first "member" of the Identity's HALO).
|
|
95
94
|
* C. Feed key (the feed owned by the Device).
|
|
96
95
|
*/
|
|
97
|
-
await halo.
|
|
96
|
+
await halo.writeCredentialsMessage(createPartyGenesisMessage(this._keyring, identityKey, feedKeyPair.publicKey, deviceKey));
|
|
98
97
|
|
|
99
98
|
/* 3. Make a special self-signed KeyAdmit message which will serve as an "IdentityGenesis" message. This
|
|
100
99
|
* message will be copied into other Parties which we create or join.
|
|
101
100
|
*/
|
|
102
|
-
await halo.
|
|
101
|
+
await halo.writeCredentialsMessage(createKeyAdmitMessage(this._keyring, identityKey.publicKey, identityKey));
|
|
103
102
|
|
|
104
103
|
if (options.identityDisplayName) {
|
|
105
104
|
// 4. Write the IdentityInfo message with descriptive details (eg, display name).
|
|
106
|
-
await halo.
|
|
105
|
+
await halo.writeCredentialsMessage(createIdentityInfoMessage(this._keyring, options.identityDisplayName, identityKey));
|
|
107
106
|
}
|
|
108
107
|
|
|
109
108
|
if (options.deviceDisplayName) {
|
|
110
109
|
// 5. Write the DeviceInfo message with descriptive details (eg, display name).
|
|
111
|
-
await halo.
|
|
110
|
+
await halo.writeCredentialsMessage(createDeviceInfoMessage(this._keyring, options.deviceDisplayName, deviceKey));
|
|
112
111
|
}
|
|
113
112
|
|
|
114
113
|
// Create special properties item.
|
|
@@ -193,22 +192,11 @@ export class HaloFactory {
|
|
|
193
192
|
);
|
|
194
193
|
|
|
195
194
|
await initiator.connect();
|
|
196
|
-
const {
|
|
195
|
+
const { hints } = await initiator.redeemInvitation(secretProvider);
|
|
197
196
|
|
|
198
|
-
/*
|
|
199
|
-
* TODO(telackey): We shouldn't have to add our key here, it should be in the hints, but our hint
|
|
200
|
-
* mechanism is broken by not waiting on the messages to be processed before returning.
|
|
201
|
-
*/
|
|
202
197
|
const halo = await this.constructParty(hints);
|
|
203
198
|
await halo.open();
|
|
204
199
|
|
|
205
|
-
// Write the Feed genesis message.
|
|
206
|
-
await halo.processor.writeHaloMessage(createFeedAdmitMessage(
|
|
207
|
-
credentialsSigner.signer,
|
|
208
|
-
partyKey,
|
|
209
|
-
await halo.getWriteFeedKey(),
|
|
210
|
-
[credentialsSigner.getDeviceKey()]
|
|
211
|
-
));
|
|
212
200
|
await initiator.destroy();
|
|
213
201
|
|
|
214
202
|
await halo.database.createItem({
|
package/src/halo/halo-party.ts
CHANGED
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
import assert from 'assert';
|
|
6
6
|
|
|
7
7
|
import { Event, synchronized } from '@dxos/async';
|
|
8
|
-
import { KeyHint } from '@dxos/credentials';
|
|
8
|
+
import { KeyHint, Message as HaloMessage } from '@dxos/credentials';
|
|
9
9
|
import { PublicKey } from '@dxos/crypto';
|
|
10
10
|
import { timed } from '@dxos/debug';
|
|
11
|
-
import { Timeframe } from '@dxos/echo-protocol';
|
|
11
|
+
import { Timeframe, WriteReceipt } from '@dxos/echo-protocol';
|
|
12
12
|
import { ModelFactory } from '@dxos/model-factory';
|
|
13
13
|
import { NetworkManager } from '@dxos/network-manager';
|
|
14
14
|
|
|
@@ -17,6 +17,7 @@ import { PARTY_ITEM_TYPE } from '../parties';
|
|
|
17
17
|
import { PartyFeedProvider, PartyProtocolFactory, PartyCore, PartyOptions } from '../pipeline';
|
|
18
18
|
import { createAuthenticator, createAuthPlugin, createCredentialsProvider, createHaloRecoveryPlugin } from '../protocol';
|
|
19
19
|
import { CredentialsSigner } from '../protocol/credentials-signer';
|
|
20
|
+
import { createReplicatorPlugin } from '../protocol/replicator-plugin';
|
|
20
21
|
import { SnapshotStore } from '../snapshots';
|
|
21
22
|
import { ContactManager } from './contact-manager';
|
|
22
23
|
import { Preferences } from './preferences';
|
|
@@ -113,10 +114,6 @@ export class HaloParty {
|
|
|
113
114
|
return this._partyCore.processor.credentialMessages.get(this._credentialsSigner.getIdentityKey().publicKey.toHex());
|
|
114
115
|
}
|
|
115
116
|
|
|
116
|
-
get memberKeys () {
|
|
117
|
-
return this._partyCore.processor.memberKeys;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
117
|
get credentialMessages () {
|
|
121
118
|
return this._partyCore.processor.credentialMessages;
|
|
122
119
|
}
|
|
@@ -161,13 +158,13 @@ export class HaloParty {
|
|
|
161
158
|
this._protocol = new PartyProtocolFactory(
|
|
162
159
|
this._partyCore.key,
|
|
163
160
|
this._networkManager,
|
|
164
|
-
this._feedProvider,
|
|
165
161
|
peerId,
|
|
166
162
|
createCredentialsProvider(this._credentialsSigner, this._partyCore.key, writeFeed.key)
|
|
167
163
|
);
|
|
168
164
|
|
|
169
165
|
// Replication.
|
|
170
166
|
await this._protocol.start([
|
|
167
|
+
createReplicatorPlugin(this._feedProvider),
|
|
171
168
|
createAuthPlugin(createAuthenticator(this._partyCore.processor, this._credentialsSigner), peerId),
|
|
172
169
|
createHaloRecoveryPlugin(this._credentialsSigner.getIdentityKey().publicKey, this._invitationManager, peerId)
|
|
173
170
|
]);
|
|
@@ -199,6 +196,10 @@ export class HaloParty {
|
|
|
199
196
|
return this;
|
|
200
197
|
}
|
|
201
198
|
|
|
199
|
+
writeCredentialsMessage (message: HaloMessage): Promise<WriteReceipt> {
|
|
200
|
+
return this._partyCore.writeCredentialsMessage(message);
|
|
201
|
+
}
|
|
202
|
+
|
|
202
203
|
async createInvitation (authenticationDetails: InvitationAuthenticator, options?: InvitationOptions): Promise<InvitationDescriptor> {
|
|
203
204
|
assert(this._invitationManager, 'HALO party not open.');
|
|
204
205
|
return this._invitationManager.createInvitation(authenticationDetails, options);
|
package/src/halo/halo.test.ts
CHANGED
|
@@ -12,12 +12,12 @@ import { FeedStore } from '@dxos/feed-store';
|
|
|
12
12
|
import { ModelFactory } from '@dxos/model-factory';
|
|
13
13
|
import { NetworkManager } from '@dxos/network-manager';
|
|
14
14
|
import { ObjectModel } from '@dxos/object-model';
|
|
15
|
+
import { createStorage, StorageType } from '@dxos/random-access-multi-storage';
|
|
15
16
|
import { afterTest, testTimeout } from '@dxos/testutils';
|
|
16
17
|
|
|
17
18
|
import { defaultInvitationAuthenticator } from '../invitations';
|
|
18
19
|
import { MetadataStore, PartyFeedProvider } from '../pipeline';
|
|
19
20
|
import { SnapshotStore } from '../snapshots';
|
|
20
|
-
import { createRamStorage } from '../util';
|
|
21
21
|
import { HALO } from './halo';
|
|
22
22
|
|
|
23
23
|
describe('HALO', () => {
|
|
@@ -26,10 +26,11 @@ describe('HALO', () => {
|
|
|
26
26
|
.registerModel(ObjectModel);
|
|
27
27
|
|
|
28
28
|
const networkManager = new NetworkManager();
|
|
29
|
-
const
|
|
30
|
-
const
|
|
29
|
+
const storage = createStorage('', StorageType.RAM);
|
|
30
|
+
const snapshotStore = new SnapshotStore(storage.directory('snapshots'));
|
|
31
|
+
const metadataStore = new MetadataStore(storage.directory('metadata'));
|
|
31
32
|
const keyring = new Keyring();
|
|
32
|
-
const feedStore = new FeedStore(
|
|
33
|
+
const feedStore = new FeedStore(storage.directory('feed'), { valueEncoding: codec });
|
|
33
34
|
|
|
34
35
|
const feedProviderFactory = (partyKey: PublicKey) => new PartyFeedProvider(
|
|
35
36
|
metadataStore,
|
package/src/halo/identity.ts
CHANGED
|
@@ -102,7 +102,7 @@ export class Identity implements IdentityCredentials {
|
|
|
102
102
|
|
|
103
103
|
export type IdentityProvider = () => Identity | undefined;
|
|
104
104
|
|
|
105
|
-
|
|
105
|
+
const getDeviceKeyChainFromHalo = (halo: HaloParty, deviceKey: KeyRecord) => {
|
|
106
106
|
try {
|
|
107
107
|
return Keyring.buildKeyChain(
|
|
108
108
|
deviceKey.publicKey,
|
|
@@ -113,4 +113,4 @@ function getDeviceKeyChainFromHalo (halo: HaloParty, deviceKey: KeyRecord) {
|
|
|
113
113
|
log('Unable to locate device KeyChain:', err);
|
|
114
114
|
throw err;
|
|
115
115
|
}
|
|
116
|
-
}
|
|
116
|
+
};
|
package/src/halo/party-opener.ts
CHANGED
|
@@ -14,7 +14,7 @@ const log = debug('dxos:echo-db:party-opener');
|
|
|
14
14
|
/**
|
|
15
15
|
* Automatically adds, opens, and clothes parties from HALO preferences.
|
|
16
16
|
*/
|
|
17
|
-
export
|
|
17
|
+
export const autoPartyOpener = (preferences: Preferences, partyManager: PartyManager): Unsubscribe => {
|
|
18
18
|
const subs = new SubscriptionGroup();
|
|
19
19
|
|
|
20
20
|
subs.push(preferences.subscribeToJoinedPartyList(async values => {
|
|
@@ -46,4 +46,4 @@ export function autoPartyOpener (preferences: Preferences, partyManager: PartyMa
|
|
|
46
46
|
}));
|
|
47
47
|
|
|
48
48
|
return () => subs.unsubscribe();
|
|
49
|
-
}
|
|
49
|
+
};
|
package/src/halo/preferences.ts
CHANGED
|
@@ -159,16 +159,13 @@ export class Preferences {
|
|
|
159
159
|
subscribeToJoinedPartyList (callback: (parties: JoinedParty[]) => void): () => void {
|
|
160
160
|
const database = this._getDatabase() ?? raise(new IdentityNotInitializedError());
|
|
161
161
|
|
|
162
|
-
const converter = (partyDesc: Item<any>) => {
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
} as KeyHint))
|
|
170
|
-
};
|
|
171
|
-
};
|
|
162
|
+
const converter = (partyDesc: Item<any>) => ({
|
|
163
|
+
partyKey: PublicKey.from(partyDesc.model.get('publicKey')),
|
|
164
|
+
keyHints: Object.values(partyDesc.model.get('hints')).map((hint: any) => ({
|
|
165
|
+
...hint,
|
|
166
|
+
publicKey: PublicKey.from(hint.publicKey)
|
|
167
|
+
} as KeyHint))
|
|
168
|
+
});
|
|
172
169
|
|
|
173
170
|
const result = database.select({ type: HALO_PARTY_DESCRIPTOR_TYPE }).exec();
|
|
174
171
|
|
package/src/index.ts
CHANGED
|
@@ -14,12 +14,8 @@ import { protocolFactory } from '@dxos/network-manager';
|
|
|
14
14
|
*/
|
|
15
15
|
// TODO(burdon): When closed?
|
|
16
16
|
// TODO(dboreham): Write a test to check resources are released (no resource leaks).
|
|
17
|
-
export const greetingProtocolProvider = (rendezvousKey: any, peerId: Buffer | Uint8Array, protocolPlugins: any[]) => {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
session: { peerId: keyToString(peerId) },
|
|
23
|
-
plugins: protocolPlugins
|
|
24
|
-
});
|
|
25
|
-
};
|
|
17
|
+
export const greetingProtocolProvider = (rendezvousKey: any, peerId: Buffer | Uint8Array, protocolPlugins: any[]) => protocolFactory({
|
|
18
|
+
getTopics: () => [rendezvousKey],
|
|
19
|
+
session: { peerId: keyToString(peerId) },
|
|
20
|
+
plugins: protocolPlugins
|
|
21
|
+
});
|
|
@@ -19,7 +19,7 @@ import { keyToString, randomBytes, PublicKey } from '@dxos/crypto';
|
|
|
19
19
|
import { SwarmKey } from '@dxos/echo-protocol';
|
|
20
20
|
import { FullyConnectedTopology, NetworkManager } from '@dxos/network-manager';
|
|
21
21
|
|
|
22
|
-
import {
|
|
22
|
+
import { CredentialWriter, PartyStateProvider } from '../pipeline';
|
|
23
23
|
import { CredentialsSigner } from '../protocol/credentials-signer';
|
|
24
24
|
import { InvitationOptions } from './common';
|
|
25
25
|
import { greetingProtocolProvider } from './greeting-protocol-provider';
|
|
@@ -57,7 +57,7 @@ export class GreetingResponder {
|
|
|
57
57
|
|
|
58
58
|
constructor (
|
|
59
59
|
private readonly _networkManager: NetworkManager,
|
|
60
|
-
private readonly _partyProcessor:
|
|
60
|
+
private readonly _partyProcessor: CredentialWriter & PartyStateProvider,
|
|
61
61
|
private readonly _credentialsSigner: CredentialsSigner
|
|
62
62
|
) {
|
|
63
63
|
this._greeter = new Greeter(
|
|
@@ -243,19 +243,15 @@ export class GreetingResponder {
|
|
|
243
243
|
_gatherHints (): KeyHint[] {
|
|
244
244
|
assert(this._state === GreetingState.SUCCEEDED);
|
|
245
245
|
|
|
246
|
-
const memberKeys = this._partyProcessor.memberKeys.map(publicKey => {
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
};
|
|
251
|
-
});
|
|
246
|
+
const memberKeys = this._partyProcessor.memberKeys.map((publicKey) => ({
|
|
247
|
+
publicKey,
|
|
248
|
+
type: KeyType.UNKNOWN
|
|
249
|
+
}));
|
|
252
250
|
|
|
253
|
-
const memberFeeds = this._partyProcessor.feedKeys.map(publicKey => {
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
};
|
|
258
|
-
});
|
|
251
|
+
const memberFeeds = this._partyProcessor.feedKeys.map((publicKey) => ({
|
|
252
|
+
publicKey,
|
|
253
|
+
type: KeyType.FEED
|
|
254
|
+
}));
|
|
259
255
|
|
|
260
256
|
return [...memberKeys, ...memberFeeds];
|
|
261
257
|
}
|
|
@@ -8,7 +8,7 @@ import { createPartyInvitationMessage } from '@dxos/credentials';
|
|
|
8
8
|
import { PublicKey } from '@dxos/crypto';
|
|
9
9
|
import { NetworkManager } from '@dxos/network-manager';
|
|
10
10
|
|
|
11
|
-
import {
|
|
11
|
+
import { CredentialWriter, PartyStateProvider } from '../pipeline';
|
|
12
12
|
import { CredentialsSigner } from '../protocol/credentials-signer';
|
|
13
13
|
import { defaultInvitationAuthenticator, InvitationAuthenticator, InvitationOptions } from './common';
|
|
14
14
|
import { GreetingResponder } from './greeting-responder';
|
|
@@ -19,7 +19,7 @@ import { InvitationDescriptor, InvitationDescriptorType } from './invitation-des
|
|
|
19
19
|
*/
|
|
20
20
|
export class InvitationFactory {
|
|
21
21
|
constructor (
|
|
22
|
-
private readonly _partyProcessor:
|
|
22
|
+
private readonly _partyProcessor: CredentialWriter & PartyStateProvider,
|
|
23
23
|
// This needs to be a provider in case this is a backend for the HALO party.
|
|
24
24
|
// Then the identity would be changed after this is instantiated.
|
|
25
25
|
private readonly _credentialsSigner: CredentialsSigner,
|
|
@@ -170,19 +170,17 @@ export class OfflineInvitationClaimer {
|
|
|
170
170
|
|
|
171
171
|
// The secretProvider should provide an `Auth` message signed directly by the Identity key.
|
|
172
172
|
static createSecretProvider (credentials: CredentialsSigner): SecretProvider {
|
|
173
|
-
return async (info?: SecretInfo) =>
|
|
174
|
-
|
|
175
|
-
/* The signed portion of the Auth message includes the ID and authNonce provided
|
|
173
|
+
return async (info?: SecretInfo) => Buffer.from(codec.encode(
|
|
174
|
+
/* The signed portion of the Auth message includes the ID and authNonce provided
|
|
176
175
|
* by the `info` object. These values will be validated on the other end.
|
|
177
176
|
*/
|
|
178
|
-
|
|
179
|
-
|
|
177
|
+
createAuthMessage(
|
|
178
|
+
credentials.signer,
|
|
180
179
|
info!.id.value,
|
|
181
180
|
credentials.getIdentityKey(),
|
|
182
181
|
credentials.getDeviceSigningKeys(),
|
|
183
182
|
undefined,
|
|
184
183
|
info!.authNonce.value)
|
|
185
|
-
|
|
186
|
-
};
|
|
184
|
+
));
|
|
187
185
|
}
|
|
188
186
|
}
|
|
@@ -19,14 +19,15 @@ import { MetadataStore, PartyFeedProvider } from '../pipeline';
|
|
|
19
19
|
import { createAuthenticator, createCredentialsProvider } from '../protocol';
|
|
20
20
|
import { createTestIdentityCredentials, deriveTestDeviceCredentials, IdentityCredentials } from '../protocol/identity-credentials';
|
|
21
21
|
import { SnapshotStore } from '../snapshots';
|
|
22
|
-
import { createRamStorage } from '../util';
|
|
23
22
|
import { DataParty } from './data-party';
|
|
24
23
|
|
|
25
24
|
describe('DataParty', () => {
|
|
26
25
|
const createParty = async (identity: IdentityCredentials, partyKey: PublicKey, hints: KeyHint[]) => {
|
|
27
|
-
|
|
28
|
-
const
|
|
29
|
-
const snapshotStore = new SnapshotStore(
|
|
26
|
+
|
|
27
|
+
const storage = createStorage('', StorageType.RAM);
|
|
28
|
+
const snapshotStore = new SnapshotStore(storage.directory('snapshots'));
|
|
29
|
+
const metadataStore = new MetadataStore(storage.directory('metadata'));
|
|
30
|
+
const feedStore = new FeedStore(storage.directory('feed'), { valueEncoding: codec });
|
|
30
31
|
const modelFactory = new ModelFactory().registerModel(ObjectModel);
|
|
31
32
|
const networkManager = new NetworkManager();
|
|
32
33
|
const partyFeedProvider = new PartyFeedProvider(metadataStore, identity.keyring, feedStore, partyKey);
|
|
@@ -60,8 +61,8 @@ describe('DataParty', () => {
|
|
|
60
61
|
const party = await createParty(identity, partyKey.publicKey, []);
|
|
61
62
|
await party.open();
|
|
62
63
|
|
|
63
|
-
const feed = await party.
|
|
64
|
-
await party.
|
|
64
|
+
const feed = await party.getWriteFeed();
|
|
65
|
+
await party.writeCredentialsMessage(createPartyGenesisMessage(
|
|
65
66
|
keyring,
|
|
66
67
|
partyKey,
|
|
67
68
|
feed.key,
|
|
@@ -80,8 +81,8 @@ describe('DataParty', () => {
|
|
|
80
81
|
|
|
81
82
|
const party = await createParty(identity, partyKey.publicKey, []);
|
|
82
83
|
await party.open();
|
|
83
|
-
const feed = await party.
|
|
84
|
-
await party.
|
|
84
|
+
const feed = await party.getWriteFeed();
|
|
85
|
+
await party.writeCredentialsMessage(createPartyGenesisMessage(
|
|
85
86
|
keyring,
|
|
86
87
|
partyKey,
|
|
87
88
|
feed.key,
|
|
@@ -104,8 +105,8 @@ describe('DataParty', () => {
|
|
|
104
105
|
|
|
105
106
|
const party = await createParty(identityA, partyKey.publicKey, []);
|
|
106
107
|
await party.open();
|
|
107
|
-
const feed = await party.
|
|
108
|
-
await party.
|
|
108
|
+
const feed = await party.getWriteFeed();
|
|
109
|
+
await party.writeCredentialsMessage(createPartyGenesisMessage(
|
|
109
110
|
keyring,
|
|
110
111
|
partyKey,
|
|
111
112
|
feed.key,
|
|
@@ -129,14 +130,14 @@ describe('DataParty', () => {
|
|
|
129
130
|
|
|
130
131
|
const partyA = await createParty(identityA, partyKey.publicKey, []);
|
|
131
132
|
await partyA.open();
|
|
132
|
-
const feedA = await partyA.
|
|
133
|
-
await partyA.
|
|
133
|
+
const feedA = await partyA.getWriteFeed();
|
|
134
|
+
await partyA.writeCredentialsMessage(createPartyGenesisMessage(
|
|
134
135
|
keyring,
|
|
135
136
|
partyKey,
|
|
136
137
|
feedA.key,
|
|
137
138
|
partyKey
|
|
138
139
|
));
|
|
139
|
-
await partyA.
|
|
140
|
+
await partyA.writeCredentialsMessage(createKeyAdmitMessage(
|
|
140
141
|
keyring,
|
|
141
142
|
partyKey.publicKey,
|
|
142
143
|
identityA.identityKey,
|
|
@@ -165,14 +166,14 @@ describe('DataParty', () => {
|
|
|
165
166
|
|
|
166
167
|
const partyA = await createParty(identityA, partyKeyA.publicKey, []);
|
|
167
168
|
await partyA.open();
|
|
168
|
-
const feedA = await partyA.
|
|
169
|
-
await partyA.
|
|
169
|
+
const feedA = await partyA.getWriteFeed();
|
|
170
|
+
await partyA.writeCredentialsMessage(createPartyGenesisMessage(
|
|
170
171
|
identityA.keyring,
|
|
171
172
|
partyKeyA,
|
|
172
173
|
feedA.key,
|
|
173
174
|
partyKeyA
|
|
174
175
|
));
|
|
175
|
-
await partyA.
|
|
176
|
+
await partyA.writeCredentialsMessage(createKeyAdmitMessage(
|
|
176
177
|
identityA.keyring,
|
|
177
178
|
partyKeyA.publicKey,
|
|
178
179
|
identityA.identityKey,
|