Hey Ive done some looking around and cant find any helpful info as to how to implement a static peerId for a BootNode.
From what i have found so fare i have generated an id priv and pub key using (peer-id).
`const PeerId =require('peer-id')
const createId = async () => {
const id = await PeerId.create({ bits: 1024, keyType: 'RSA' })
console.log((id.toJSON()))
}
createId()`
Then i copied the out put in the terminal in to my BootNode peerId section.
const createLibp2p = require('libp2p')
const TCP = require('libp2p-tcp')
const Mplex = require('libp2p-mplex')
const { NOISE } = require('libp2p-noise')
const Gossipsub = require('libp2p-gossipsub')
const MulticastDNS = require('libp2p-mdns')
const { fromString } = require('uint8arrays/from-string')
const { toString } = require('uint8arrays/to-string')
const createNode = async () => {
const node = await createLibp2p.create({
peerId: {
id: 'QmeRhaUCD71y3fi43EDnoeX2MP7gGUNBFmGqAK5mcKhbce',
privKey: 'CAAS3wQwggJbAgEAAoGBAMKf7QL0zbTd4bHfOHz4+H4vxV...',
pubKey: 'CAASogEwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBA...'
},
addresses: {
listen: ['/ip4/0.0.0.0/tcp/0']
},
modules: {
transport: [TCP],
streamMuxer: [Mplex],
connEncryption: [NOISE],
pubsub: Gossipsub,
peerDiscovery: [MulticastDNS]
},
config:{
peerDiscovery: {
autoDial: true,
[MulticastDNS.tag]: {
broadcast: true,
interval: 1000,
enabled: true
}
},
pubsub:{
emitSelf: true,
enabled: true
},
}
})
}
But i get the error.
/home/tank/MyCode/Posibly-Usfule-Code/js-libp2p/node_modules/libp2p/src/connection-manager/index.js:76
this._peerId = libp2p.peerId.toB58String()
^
TypeError: libp2p.peerId.toB58String is not a function
What am i doing wrong !! ha thanks in advance.