fix: switch mkeyEd25519 to CID_HASH_TYPES

This commit is contained in:
Derrick Hammer 2023-09-02 14:54:56 -04:00
parent bb40e51eee
commit 87800422e3
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 5 additions and 2 deletions

View File

@ -4,9 +4,9 @@ import {
createKeyPair,
createNode,
NodeId,
CID_HASH_TYPES,
} from "@lumeweb/libs5";
import HyperTransportPeer from "@lumeweb/libs5-transport-hyper";
import { mkeyEd25519 } from "@lumeweb/libs5";
import { concatBytes } from "@noble/curves/abstract/utils";
import { Level } from "level";
@ -49,7 +49,10 @@ const plugin = {
});
s5peer.id = new NodeId(
concatBytes(Uint8Array.from([mkeyEd25519]), peer.remotePublicKey),
concatBytes(
Uint8Array.from([CID_HASH_TYPES.ED25519]),
peer.remotePublicKey,
),
);
await s5peer.init();