Skip to content

Commit

Permalink
fix: generate valid psk for backend test libp2p param
Browse files Browse the repository at this point in the history
  • Loading branch information
EmiM committed Oct 24, 2023
1 parent 33d4b6b commit 800b4f3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/backend/src/nest/common/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,15 +198,16 @@ export const libp2pInstanceParams = async (): Promise<Libp2pNodeParams> => {
const address = '0.0.0.0'
const peerIdRemote = await createPeerId()
const remoteAddress = createLibp2pAddress(address, peerIdRemote.toString())

const key = new Uint8Array(95)
generateLibp2pPSK(key)
return {
peerId,
listenAddresses: [createLibp2pListenAddress('localhost')],
agent: createHttpsProxyAgent({ port: 1234, host: 'localhost' }),
localAddress: createLibp2pAddress('localhost', peerId.toString()),
targetPort: port,
peers: [remoteAddress],
psk: new Uint8Array(95),
psk: key,
}
}

Expand Down

0 comments on commit 800b4f3

Please sign in to comment.