Introduce foreigner network (#25)

* support network identity for instance

* introduce foreign network

foreign network allow a node serving as one public node. other nodes can
connect to this node to discover peers and exchange route info.
This commit is contained in:
Sijie.Sun
2024-03-06 20:59:17 +08:00
committed by GitHub
parent 9261d0d32d
commit d8d1c64df7
13 changed files with 868 additions and 57 deletions
+3
View File
@@ -146,6 +146,8 @@ impl Peer {
impl Drop for Peer {
fn drop(&mut self) {
self.shutdown_notifier.notify_one();
self.global_ctx
.issue_event(GlobalCtxEvent::PeerRemoved(self.peer_node_id));
tracing::info!("peer {} drop", self.peer_node_id);
}
}
@@ -172,6 +174,7 @@ mod tests {
"test",
ConfigFs::new("/tmp/easytier-test"),
NetNS::new(None),
None,
));
let local_peer = Peer::new(uuid::Uuid::new_v4(), local_packet_send, global_ctx.clone());
let remote_peer = Peer::new(uuid::Uuid::new_v4(), remote_packet_send, global_ctx.clone());