refactor: add registry message handling back in
This commit is contained in:
parent
68b7ffa855
commit
56bb5007f6
|
@ -11,6 +11,7 @@ import {
|
||||||
protocolMethodHandshakeOpen,
|
protocolMethodHandshakeOpen,
|
||||||
protocolMethodHashQuery,
|
protocolMethodHashQuery,
|
||||||
protocolMethodSignedMessage,
|
protocolMethodSignedMessage,
|
||||||
|
recordTypeRegistryEntry,
|
||||||
recordTypeStorageLocation,
|
recordTypeStorageLocation,
|
||||||
storageLocationTypeFull,
|
storageLocationTypeFull,
|
||||||
} from "../constants.js";
|
} from "../constants.js";
|
||||||
|
@ -111,11 +112,12 @@ export class P2PService {
|
||||||
// p.packInt(protocolVersion);
|
// p.packInt(protocolVersion);
|
||||||
peer.sendMessage(await this.signMessageSimple(p.takeBytes()));
|
peer.sendMessage(await this.signMessageSimple(p.takeBytes()));
|
||||||
return;
|
return;
|
||||||
} /*else if (method === recordTypeRegistryEntry) {
|
} else if (method === recordTypeRegistryEntry) {
|
||||||
const sre = node.registry.deserializeRegistryEntry(event);
|
const sre =
|
||||||
await node.registry.set(sre, { receivedFrom: peer });
|
this.config.services.registry.deserializeRegistryEntry(event);
|
||||||
|
await this.config.services.registry.set(sre, false, peer);
|
||||||
return;
|
return;
|
||||||
}*/ else if (method === recordTypeStorageLocation) {
|
} else if (method === recordTypeStorageLocation) {
|
||||||
const hash = new Multihash(event.subarray(1, 34));
|
const hash = new Multihash(event.subarray(1, 34));
|
||||||
const type = event[34];
|
const type = event[34];
|
||||||
const expiry = decodeEndian(event.subarray(35, 39));
|
const expiry = decodeEndian(event.subarray(35, 39));
|
||||||
|
|
Loading…
Reference in New Issue