Following @libp2p/pnet | libp2p on how to create a swarm.key programatically.
How can I use a previously created swarm key. I already got the key I need to pass it to
const node = await createLibp2p({
// ...other options
connectionProtector: preSharedKey({
psk: swarmKey
})
})
I’ve tried just reading the file with fs, but it doesn’t work. I cannot find any examples.