A migration guide for refactoring your application code from libp2p v0.38.x to v0.39.0.
Libp2p had a loadKeychain
method that should be invoked after the node has been created which reads keychain config from the configured datastore. The default datastore is in-memory and is transient in nature so it's possible you've never had to use this.
It was necessary to have this be a separate method as it it async which means it cannot be invoked in a constructor.
Since libp2p uses an async factory function, the keychain can be loaded in the factory so the extra method is redundant.
Before
import { createLibp2p } from 'libp2p'
const node = await createLibp2p({
// ... config
})
await node.loadKeychain()
await node.start()
// ...
After
import { createLibp2p } from 'libp2p'
const node = await createLibp2p({
// ... config
})
await node.start()
// ...