
Security News
The Changelog Podcast: Practical Steps to Stay Safe on npm
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.
@projectlibertylabs/p2p-peer-test
Advanced tools
CLI tool to test libp2p connections and discover peer protocols
A CLI tool for testing libp2p connections and discovering what protocols a peer supports. Useful for debugging P2P networks, checking configs, and making sure nodes are reachable.
npx @projectlibertylabs/p2p-peer-test <multiaddr>
npm install -g @projectlibertylabs/p2p-peer-test
p2p-peer-test <multiaddr>
# Test a specific peer
npx @projectlibertylabs/p2p-peer-test /ip4/127.0.0.1/tcp/4001
# Test multiple peers
npx @projectlibertylabs/p2p-peer-test /ip4/127.0.0.1/tcp/4001 /ip4/127.0.0.1/tcp/4002
# Interactive mode (prompts for multiaddr - supports pasting multiple!)
npx @projectlibertylabs/p2p-peer-test
# Custom timeout (ms)
npx @projectlibertylabs/p2p-peer-test /ip4/127.0.0.1/tcp/4001 --timeout 5000
# Retry a few times
npx @projectlibertylabs/p2p-peer-test /ip4/127.0.0.1/tcp/4001 --retries 3
# JSON output (great for multiple addresses)
npx @projectlibertylabs/p2p-peer-test /ip4/127.0.0.1/tcp/4001 /ip4/127.0.0.1/tcp/4002 --json
# Verbose errors
npx @projectlibertylabs/p2p-peer-test /ip4/127.0.0.1/tcp/4001 --verbose
# Show example multiaddrs
npx @projectlibertylabs/p2p-peer-test examples
# Show help
npx @projectlibertylabs/p2p-peer-test --help
You can test multiple multiaddrs in two ways:
Pass multiple multiaddrs as arguments:
npx @projectlibertylabs/p2p-peer-test \
/dns4/3.collator.frequency.xyz/tcp/30333/p2p/12D3KooW... \
/ip4/127.0.0.1/tcp/30333/p2p/12D3KooW... \
/ip4/10.0.0.1/tcp/30334/ws/p2p/12D3KooW...
Run without arguments and paste a list of multiaddrs:
npx @projectlibertylabs/p2p-peer-test
# Then paste:
/dns4/3.collator.frequency.xyz/tcp/30333/p2p/12D3KooWLsZTXsv1eY6U9YhowipQ73R5D1zQTaWECUCkxLawWpoB
/ip4/10.40.10.23/tcp/30333/p2p/12D3KooWLsZTXsv1eY6U9YhowipQ73R5D1zQTaWECUCkxLawWpoB
/ip4/3.129.100.199/tcp/30333/p2p/12D3KooWLsZTXsv1eY6U9YhowipQ73R5D1zQTaWECUCkxLawWpoB
Output includes:
-t, --timeout <ms> – Connection timeout (default: 10000)-r, --retries <n> – Retry attempts (default: 0)-j, --json – Output as JSON-v, --verbose – More error info-h, --help – Show helpECONNREFUSED
Timeout
--timeoutProtocol mismatch
Invalid multiaddr
examples for referenceCommon ports:
30333 / 30334 – Substrate/libp2p4001 – Standard libp2p443 – WSS8080 – WSScripts:
npm run format – Prettiernpm run lint – ESLintnpm run test – Run tests (Vitest)npm run lint && npm testFAQs
CLI tool to test libp2p connections and discover peer protocols
We found that @projectlibertylabs/p2p-peer-test demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.

Security News
Ruby's creator Matz assumes control of RubyGems and Bundler repositories while former maintainers agree to step back and transfer all rights to end the dispute.