mirror of
https://github.com/fluencelabs/js-libp2p
synced 2025-06-19 20:21:22 +00:00
fix!: load self key into keychain on startup if not present (#1357)
To prevent triggering keychain attack prevention on startup, refactor the `KeyChain` class to load the current PeerId as the `'self'` key on startup. Fixes #1315 BREAKING CHANGE: the `loadKeychain` method has been removed as it is no longer necessary
This commit is contained in:
@ -9,12 +9,10 @@ import type { Message, PublishResult, PubSubInit, PubSubRPC, PubSubRPCMessage }
|
||||
import type { Libp2pInit, Libp2pOptions } from '../../src/index.js'
|
||||
import type { PeerId } from '@libp2p/interface-peer-id'
|
||||
import * as cborg from 'cborg'
|
||||
import { peerIdFromString } from '@libp2p/peer-id'
|
||||
|
||||
const relayAddr = MULTIADDRS_WEBSOCKETS[0]
|
||||
|
||||
export const baseOptions: Partial<Libp2pInit> = {
|
||||
peerId: peerIdFromString('12D3KooWJKCJW8Y26pRFNv78TCMGLNTfyN8oKaFswMRYXTzSbSst'),
|
||||
transports: [new WebSockets()],
|
||||
streamMuxers: [new Mplex()],
|
||||
connectionEncryption: [new Plaintext()]
|
||||
|
Reference in New Issue
Block a user