How marcpage/libranet works
Libranet is a decentralized, HTTP-based content-sharing node. A browser or peer requests content from a node; content is identified and checked by its bytes, read locally or sought from peers, then served or relayed. Nodes also accept and store content, self-organize storage, and expose application, backup, identity, drop, and Karma capabilities. The graph reflects documented runtime boundaries and event relationships; several feature implementations are represented by their exact source directories because their files were not sampled.
Main entry points: server.py HTTP API · events.py Event messaging · peer_session.py Peer connections · module.py Content fetching
Components 22
HTTP and applications
- HTTP API
src/libranet/webserver/server.py - Search requests
src/libranet/webserver/search_handler.py - Web applications
src/libranet/applications/packaged.py - Application resolution
src/libranet/unbundler/module.py
Content and bundles
- Content identifiers
src/libranet/cas/content_id.py - Content store
src/libranet/cas/store.py - Bundle encoding
src/libranet/bundle/layering.py - Bundle storage
src/libranet/bundle/storing.py - Shunned content
src/libranet/cas/shunned.py
Peer network
- Peer connections
src/libranet/connections/peer_session.py - Content fetching
src/libranet/fetcher/module.py - Event messaging
src/libranet/messaging/events.py - Node identity
src/libranet/identity/node_identity.py
Node operations
- Network statistics
src/libranet/stats/database.py - Storage eviction
src/libranet/eviction/module.py - Process supervision
src/libranet/supervision/process_supervisor.py - Node configuration
src/libranet/config/models.py
Product features
- Encrypted backups
src/libranet/backup - Named drops
src/libranet/webserver/drop_handler.py - Karma fairness
src/libranet/karma - People and trust
src/libranet/identity
Other components
- Browser or client
Connections 26
- Browser or client → HTTP API: requests content
README.md - Search requests → Event messaging: publishes search
src/libranet/webserver/search_handler.py - HTTP API → Event messaging: publishes data events
src/libranet/messaging/events.py - HTTP API → Application resolution: resolves app paths
- Web applications → Bundle storage: stores app bundles
src/libranet/applications/packaged.py - Application resolution → Bundle encoding: loads bundle parts
src/libranet/unbundler/module.py - Bundle encoding → Content identifiers: names content
src/libranet/bundle/layering.py - Bundle storage → Content store: writes objects
- HTTP API → Content store: serves stored data
src/libranet/webserver/server.py - Search requests → Shunned content: filters results
src/libranet/webserver/search_handler.py - Content fetching → Peer connections: requests fetches
- Peer connections → Content fetching: reports fetch result
- HTTP API → Content fetching: announces missing data
- HTTP API → Peer connections: announces searches
- Peer connections → Event messaging: publishes peer events
src/libranet/messaging/events.py - Event messaging → Network statistics: delivers events
src/libranet/messaging/events.py - Network statistics → Peer connections: updates node lists
- Node identity → Content store: publishes public key
src/libranet/identity/node_identity.py - Storage eviction → Network statistics: requests storage ranking
src/libranet/eviction/module.py - Process supervision → Event messaging: starts dispatcher
- Encrypted backups → Content identifiers: tracks stored content
src/libranet/backup/tasks.py - HTTP API → Encrypted backups: dispatches backup events
- Named drops → Event messaging: publishes drop events
src/libranet/webserver/drop_handler.py - HTTP API → Karma fairness: dispatches Karma events
- People and trust → HTTP API: provides identity API
src/libranet/webserver/server.py - Node configuration → Process supervision: configures node startup
src/libranet/supervision/process_supervisor.py