Closed sleep9 closed 9 months ago
which example is this for? I can't find that code anywhere via https://github.com/search?q=org%3Alibp2p+%27const+%5Bnode1%2C+node2%5D+%3D+await+Promise.all%28%5B%27&type=code or searching locally
Slightly modified from this example which is outdated it seems? https://github.com/libp2p/js-libp2p/blob/v0.28.4/examples/pubsub/1.js
I'm not sure this is a problem, this is just how console.log
prints objects instantiated from ES6 classes.
You may find it more useful to log the peer id instead?
console.log('node1', node1.peerId)
// node1 PeerId(12D3Foo...)
Your are correct good sir.
Severity:
Severity: High
Description:
` import { createLibp2p } from 'libp2p' import { tcp } from '@libp2p/tcp' import { mplex } from '@libp2p/mplex' import { noise } from '@chainsafe/libp2p-noise' import { yamux } from '@chainsafe/libp2p-yamux' import{ mdns } from '@libp2p/mdns';
const createNode = () => { return createLibp2p({ addresses: { listen: ['/ip4/0.0.0.0/tcp/0'] }, transports: [ tcp() ], streamMuxers: [ yamux(),mplex() ], connectionEncryption: [ noise() ], peerDiscovery: [ mdns() ] }) }
export const main = async () => {
}
main() ` console outputs the following empty objects node1: Libp2pNode {} node2: Libp2pNode {}