fix: keypair needs to be a private extended key

This commit is contained in:
Derrick Hammer 2023-07-04 20:59:01 -04:00
parent 9b2387b517
commit 57496da5cc
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 2 additions and 1 deletions

View File

@ -16,6 +16,7 @@ import { EventEmitter2 as EventEmitter } from "eventemitter2";
// @ts-ignore
import Protomux from "protomux";
import defer, { DeferredPromise } from "p-defer";
import { concatBytes } from "@lumeweb/libkernel";
const MAX_PEER_LISTENERS = 20;
@ -105,7 +106,7 @@ async function createSwarm(): Promise<number> {
const swarmInstance = new Hyperswarm({
keyPair: {
publicKey: ed25519.getPublicKey(privateKey),
secretKey: privateKey,
secretKey: concatBytes(privateKey, ed25519.getPublicKey(privateKey)),
},
});
const id = getSwarmId();