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
+4 -1
View File
@@ -222,7 +222,10 @@ impl PeerRpcManager {
let client_resp_receivers = self.client_resp_receivers.clone();
tokio::spawn(async move {
loop {
let o = tspt.recv().await.unwrap();
let Ok(o) = tspt.recv().await else {
tracing::warn!("peer rpc transport read aborted, exiting");
break;
};
let packet = Packet::decode(&o);
let packet: Packet = packet.deserialize(&mut rkyv::Infallible).unwrap();
let info = Self::parse_rpc_packet(&packet).unwrap();