peer_mgr: add register() for rpc

This commit is contained in:
Luna Yao
2026-04-05 10:55:58 +02:00
parent e4f2078ff1
commit 1b220dd825
2 changed files with 23 additions and 18 deletions
+2 -11
View File
@@ -41,18 +41,8 @@ impl DnsNode {
global_ctx: ArcGlobalCtx,
#[cfg(feature = "tun")] nic_ctx: ArcNicCtx, // TODO: REMOVE THIS
) -> Self {
let mgr = Arc::new(DnsPeerMgr::new(peer_mgr.clone()));
peer_mgr
.get_peer_rpc_mgr()
.rpc_server()
.registry()
.register(
DnsPeerMgrRpcServer::new_arc(mgr.clone()),
&global_ctx.get_network_name(),
);
Self {
mgr,
mgr: Arc::new(DnsPeerMgr::new(peer_mgr.clone(), global_ctx.clone())),
#[cfg(feature = "tun")]
nic_ctx,
peer_mgr,
@@ -67,6 +57,7 @@ impl DnsNode {
}
pub fn start(&self) {
self.mgr.register();
let this = self.clone();
self.runtime.start(None, |token| async move {
tracing::info!("starting DnsNode");