cairn-p2p
v0.7.0
Published
TypeScript implementation of the cairn P2P connectivity library.
Downloads
1,481
Readme
cairn-p2p
TypeScript implementation of the cairn P2P connectivity library.
Installation
npm install cairn-p2pRequirements
- Node.js 18+ or modern browser
- TypeScript 5.5+ (for development)
Quick Start
import { CairnNode } from 'cairn-p2p';
const node = await CairnNode.create();
const peer = await node.pairWithPin('123456');
await peer.send(Buffer.from('hello'));API Overview
CairnNode-- Main entry point, manages identity, sessions, and discoverySession-- Persistent encrypted session with a peerPeerIdentity-- Ed25519 identity with Peer ID derivationCairnConfig-- Configuration with tier presets
Key Dependencies
libp2p-- Transport, NAT traversal, DHT discovery@noble/curves/@noble/hashes-- Cryptographic primitives@noble/ciphers-- AEAD encryptioncborg-- CBOR wire protocol encodingeventemitter3-- Event-driven API
License
Licensed under the MIT License.
