fix: keypair needs to be a private extended key
This commit is contained in:
parent
9b2387b517
commit
57496da5cc
|
@ -16,6 +16,7 @@ import { EventEmitter2 as EventEmitter } from "eventemitter2";
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import Protomux from "protomux";
|
import Protomux from "protomux";
|
||||||
import defer, { DeferredPromise } from "p-defer";
|
import defer, { DeferredPromise } from "p-defer";
|
||||||
|
import { concatBytes } from "@lumeweb/libkernel";
|
||||||
|
|
||||||
const MAX_PEER_LISTENERS = 20;
|
const MAX_PEER_LISTENERS = 20;
|
||||||
|
|
||||||
|
@ -105,7 +106,7 @@ async function createSwarm(): Promise<number> {
|
||||||
const swarmInstance = new Hyperswarm({
|
const swarmInstance = new Hyperswarm({
|
||||||
keyPair: {
|
keyPair: {
|
||||||
publicKey: ed25519.getPublicKey(privateKey),
|
publicKey: ed25519.getPublicKey(privateKey),
|
||||||
secretKey: privateKey,
|
secretKey: concatBytes(privateKey, ed25519.getPublicKey(privateKey)),
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
const id = getSwarmId();
|
const id = getSwarmId();
|
||||||
|
|
Loading…
Reference in New Issue