Back to Site
Loading...
Searching...
No Matches
peer_network.h File Reference

The narrow contract a subsystem needs from the node — and nothing more. More...

#include "core/bytes.h"
#include "wire/frame.h"
#include "peer/peer_id.h"
#include "peer/peer_info.h"
#include "core/address.h"
#include <cstdint>
#include <functional>
#include <vector>
Include dependency graph for peer_network.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  librats::PeerNetwork
 
class  librats::Subsystem
 A pluggable network subsystem. More...
 

Namespaces

namespace  librats
 

Detailed Description

The narrow contract a subsystem needs from the node — and nothing more.

Subsystems (DHT, GossipSub, file transfer, …) talk to the network only through PeerNetwork. They never see Node's internals, never hold a Node& or are friends of it — this narrow contract is what keeps the node a small core instead of a god-class that every feature reaches into. A subsystem is mocked in tests by implementing this one interface.

Definition in file peer_network.h.