I’m having trouble establishing a connection to the Rococo parachain network.
It seems like I’m dropping the connection as soon as I try to establish a connection. I’m not sure if I’m missing a step. If anyone has experienced this issue, please reach out with what has helped you.
const options = {
peerId: peerId,
addresses: {
listen: [‘/ip4/0.0.0.0/tcp/9944/ws’]
},
transports: [
tcp(),
webSockets(),
circuitRelayTransport({
discoverRelays: 2,
})
],
connectionEncryption: [noise()],
streamMuxers: [yamux(), mplex()],
dht: kadDHT(),
peerDiscovery: [
mdns(),
bootstrap({
list: bootstrapNodes
}),
],
services: {
identify: identify(),
ping: ping({
protocolPrefix: ‘ipfs’,
}),
dht: kadDHT({
kBucketSize: 20,
clientMode: false,
broadcast: true,
}),
},
config: {
dht: {
enabled: true,
},
},
connectionManager: {
autoDial: true,
maxConnections: 100,
minConnections: 20,
},
}
// start libp2p
const node = await createLibp2p(options);
const nodeMultiAddr = node.getMultiaddrs()
// Ping the blockchain
const parachainAddr = '/ip4/192.168.1.212/tcp/30334/ws/p2p/12D3KooWMitGLpxdpMR3jB1RQ7Sy1fkzQwThUCN2G94bDAo2iNY3'
const parachainMultiAddr = multiaddr(parachainAddr)
const pingPeers = await node.dialProtocol(parachainMultiAddr, '/ipfs/ping/1.0.0')
My current blockchain logs are as follows:
2024-03-04 16:56:04.300 TRACE tokio-runtime-worker peerset: [Parachain] Adding a new known peer 12D3KooWCN2iV5tLA4TQiRCm1MJSjHg7B92cspxwgqjAQo2r5zQG.
2024-03-04 16:56:04.408 TRACE tokio-runtime-worker peerset: [Relaychain] Connecting to 12D3KooWCN2iV5tLA4TQiRCm1MJSjHg7B92cspxwgqjAQo2r5zQG on SetId(2) (8/11 num_out/max_out).
2024-03-04 16:56:04.408 TRACE tokio-runtime-worker peerset: [Parachain] Connecting to 12D3KooWCN2iV5tLA4TQiRCm1MJSjHg7B92cspxwgqjAQo2r5zQG on SetId(0) (8/8 num_out/max_out).
2024-03-04 16:56:04.408 TRACE tokio-runtime-worker peerset: [Relaychain] Connecting to 12D3KooWCN2iV5tLA4TQiRCm1MJSjHg7B92cspxwgqjAQo2r5zQG on SetId(0) (6/8 num_out/max_out).
2024-03-04 16:56:04.511 TRACE tokio-runtime-worker peerset: [Relaychain] Peer 12D3KooWCN2iV5tLA4TQiRCm1MJSjHg7B92cspxwgqjAQo2r5zQG (Outbound) dropped from SetId(0).
2024-03-04 16:56:04.512 TRACE tokio-runtime-worker peerset: [Relaychain] Peer 12D3KooWCN2iV5tLA4TQiRCm1MJSjHg7B92cspxwgqjAQo2r5zQG disconnected, reputation: -256 to -256