@origintrail-official/dkg-core
v0.0.1-dev.1773614346.8bc4e9c
Published
Foundation package for DKG V9. Provides P2P networking, protocol messaging, cryptographic primitives, and shared utilities used by every other package in the stack.
Readme
@origintrail-official/dkg-core
Foundation package for DKG V9. Provides P2P networking, protocol messaging, cryptographic primitives, and shared utilities used by every other package in the stack.
Features
- libp2p node — full P2P networking: TCP + WebSocket transports, Noise encryption, Yamux multiplexing, AutoNAT, circuit relay, DCUtR hole-punching
- GossipSub — pub/sub message broadcast across the network, with per-topic subscription management
- Protocol router — request/response protocol streams over libp2p with handler registration
- Peer discovery — mDNS for local networks, Kademlia DHT + bootstrap peers for global discovery
- Ed25519 crypto — peer identity generation, signing, and verification
- Protobuf messages — efficient serialization for all DKG protocol messages
- Event bus — centralized internal event system (
DKGEvent) for decoupled component communication - Logger — structured logging with operation context tracking
- Genesis ontology — built-in DKG ontology quads and system paranet definitions
- Constants — network IDs, protocol paths, topic naming conventions
Usage
import { DKGNode, EventBus, Logger, DKG_ONTOLOGY } from '@origintrail-official/dkg-core';
const node = new DKGNode(config);
await node.start();
EventBus.on('PEER_DISCOVERED', (peer) => {
console.log('Found peer:', peer.id);
});Internal Dependencies
None — this is the base package. All other @origintrail-official/dkg-* packages depend on it.
