Add "Home"
commit
258fdf26c4
1 changed files with 53 additions and 0 deletions
53
Home.md
Normal file
53
Home.md
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
# go-p2p
|
||||
|
||||
**P2P Networking for Lethean**
|
||||
|
||||
`go-p2p` provides peer-to-peer networking infrastructure for the Lethean network. It implements the UEPS (Universal Encrypted Payload System) wire protocol for consent-gated TLV framing, and a full-featured node management layer with encrypted WebSocket transport, challenge-response authentication, and KD-tree-based peer selection.
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
go get forge.lthn.ai/core/go-p2p
|
||||
```
|
||||
|
||||
## Package Map
|
||||
|
||||
| Package | Purpose |
|
||||
|---------|---------|
|
||||
| `ueps/` | Universal Encrypted Payload System -- TLV packet builder and HMAC-verified reader |
|
||||
| `node/` | P2P node management -- transport, identity, peer registry, controller, worker, message protocol, bundles |
|
||||
| `logging/` | Structured logging with levels and fields |
|
||||
|
||||
## Quick Start
|
||||
|
||||
### UEPS Packet
|
||||
|
||||
```go
|
||||
builder := ueps.NewBuilder(0x20, payload)
|
||||
frame, err := builder.MarshalAndSign(sharedSecret)
|
||||
```
|
||||
|
||||
### P2P Node
|
||||
|
||||
```go
|
||||
nm, _ := node.NewNodeManager()
|
||||
nm.GenerateIdentity("my-node", node.RoleDual)
|
||||
|
||||
registry, _ := node.NewPeerRegistry()
|
||||
transport := node.NewTransport(nm, registry, node.DefaultTransportConfig())
|
||||
transport.Start()
|
||||
```
|
||||
|
||||
## Architecture Overview
|
||||
|
||||
The system operates on two levels:
|
||||
|
||||
1. **UEPS Protocol** ([[UEPS-Protocol]]) -- Low-level TLV framing with HMAC-SHA256 integrity, intent-based routing, and threat scoring. Designed for the 7-layer Lethean stack.
|
||||
|
||||
2. **Node Architecture** ([[Node-Architecture]]) -- High-level P2P mesh built on WebSockets with SMSG encryption, X25519 ECDH key exchange, challenge-response authentication, and Poindexter KD-tree peer selection.
|
||||
|
||||
Nodes operate in one of three roles: `controller` (manages remote workers), `worker` (receives commands and runs tasks), or `dual` (both).
|
||||
|
||||
## Licence
|
||||
|
||||
EUPL-1.2
|
||||
Loading…
Add table
Reference in a new issue