Returns a new instance of the Libp2p interface, generating a new PeerId if one is not passed as part of the options.
The node will be started unless start: false is passed as an option.
start: false
import { createLibp2p } from 'libp2p'import { tcp } from '@libp2p/tcp'import { mplex } from '@libp2p/mplex'import { noise } from '@chainsafe/libp2p-noise'// specify optionsconst options = { transports: [tcp()], streamMuxers: [mplex()], connectionEncryption: [noise()]}// create libp2pconst libp2p = await createLibp2p(options)
Returns a new instance of the Libp2p interface, generating a new PeerId if one is not passed as part of the options.
The node will be started unless
start: false
is passed as an option.Example