The circuitRelayTransport allows libp2p to dial and listen on Circuit Relay addresses.
circuitRelayTransport
Configuring a transport will let you dial other circuit relay addresses.
import { createLibp2p } from 'libp2p'import { circuitRelayTransport } from '@libp2p/circuit-relay-v2'const node = await createLibp2p({ transports: [ circuitRelayTransport() ]}) Copy
import { createLibp2p } from 'libp2p'import { circuitRelayTransport } from '@libp2p/circuit-relay-v2'const node = await createLibp2p({ transports: [ circuitRelayTransport() ]})
The circuitRelayServer function allows libp2p to function as a Circuit Relay server. This will not work in browsers.
circuitRelayServer
Configuring a server will let you function as a network relay for other nodes.
import { createLibp2p } from 'libp2p'import { circuitRelayServer } from '@libp2p/circuit-relay-v2'const node = await createLibp2p({ services: { circuitRelay: circuitRelayServer() }}) Copy
import { createLibp2p } from 'libp2p'import { circuitRelayServer } from '@libp2p/circuit-relay-v2'const node = await createLibp2p({ services: { circuitRelay: circuitRelayServer() }})
The
circuitRelayTransport
allows libp2p to dial and listen on Circuit Relay addresses.Example: Use as a transport
Configuring a transport will let you dial other circuit relay addresses.
The
circuitRelayServer
function allows libp2p to function as a Circuit Relay server. This will not work in browsers.Example: Use as a server
Configuring a server will let you function as a network relay for other nodes.