fix: use CID_HASH_TYPES.ED25519 over mkeyEd25519

This commit is contained in:
Derrick Hammer 2023-09-02 10:57:59 -04:00
parent 3b52253164
commit 6c76768fe0
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 5 additions and 2 deletions

View File

@ -12,12 +12,12 @@ import {
} from "@lumeweb/kernel-swarm-client"; } from "@lumeweb/kernel-swarm-client";
import Protomux from "@lumeweb/kernel-protomux-client"; import Protomux from "@lumeweb/kernel-protomux-client";
import { import {
CID_HASH_TYPES,
createKeyPair, createKeyPair,
createNode, createNode,
NodeId, NodeId,
S5NodeConfig, S5NodeConfig,
} from "@lumeweb/libs5"; } from "@lumeweb/libs5";
import { mkeyEd25519 } from "@lumeweb/libs5";
import type { S5Node } from "@lumeweb/libs5"; import type { S5Node } from "@lumeweb/libs5";
import KeyPairEd25519 from "@lumeweb/libs5/lib/ed25519.js"; import KeyPairEd25519 from "@lumeweb/libs5/lib/ed25519.js";
import { Level } from "level"; import { Level } from "level";
@ -82,7 +82,10 @@ async function setup() {
}); });
s5peer.id = new NodeId( s5peer.id = new NodeId(
concatBytes(Uint8Array.from([mkeyEd25519]), peer.remotePublicKey), concatBytes(
Uint8Array.from([CID_HASH_TYPES.ED25519]),
peer.remotePublicKey,
),
); );
await s5peer.init(); await s5peer.init();