import { InvalidParametersError } from '@libp2p/interface' import type { Libp2pInit } from './index.ts' import type { ServiceMap } from '@libp2p/interface' export async function validateConfig > (opts: Libp2pInit): Promise> { if (opts.connectionProtector === null && globalThis.process?.env?.LIBP2P_FORCE_PNET != null) { throw new InvalidParametersError('Private network is enforced, but no protector was provided') } return opts }