From 4c4654c89d6c6add002a6a94ddc3da7898465a22 Mon Sep 17 00:00:00 2001 From: dr-frmr Date: Mon, 15 Jul 2024 02:39:48 +0200 Subject: [PATCH 1/3] prints --- kinode/src/main.rs | 2 ++ kinode/src/register.rs | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/kinode/src/main.rs b/kinode/src/main.rs index c4a1b0e81..bacd09cd4 100644 --- a/kinode/src/main.rs +++ b/kinode/src/main.rs @@ -224,6 +224,8 @@ async fn main() { } }; + println!("our: {:?}\r", our); + // the boolean flag determines whether the runtime module is *public* or not, // where public means that any process can always message it. #[allow(unused_mut)] diff --git a/kinode/src/register.rs b/kinode/src/register.rs index 21cb42b02..12964bf04 100644 --- a/kinode/src/register.rs +++ b/kinode/src/register.rs @@ -757,6 +757,11 @@ pub async fn assign_routing( ip & 0xFF ); + println!("routers: {:?}\r", routers); + println!("node_ip: {:?}\r", node_ip); + println!("ws: {:?}\r", ws); + println!("tcp: {:?}\r", tcp); + if !routers.is_empty() { // indirect node return Ok(()); From 2f93467bc9e923dd395f4813d3bb1c6a667c1bd4 Mon Sep 17 00:00:00 2001 From: dr-frmr Date: Mon, 15 Jul 2024 03:04:35 +0200 Subject: [PATCH 2/3] attempt to fix --- kinode/src/main.rs | 2 -- kinode/src/register.rs | 20 +------------------- 2 files changed, 1 insertion(+), 21 deletions(-) diff --git a/kinode/src/main.rs b/kinode/src/main.rs index bacd09cd4..c4a1b0e81 100644 --- a/kinode/src/main.rs +++ b/kinode/src/main.rs @@ -224,8 +224,6 @@ async fn main() { } }; - println!("our: {:?}\r", our); - // the boolean flag determines whether the runtime module is *public* or not, // where public means that any process can always message it. #[allow(unused_mut)] diff --git a/kinode/src/register.rs b/kinode/src/register.rs index 12964bf04..954c99c71 100644 --- a/kinode/src/register.rs +++ b/kinode/src/register.rs @@ -707,7 +707,6 @@ pub async fn assign_routing( let namehash = FixedBytes::<32>::from_slice(&keygen::namehash(&our.name)); let ip_call = ipCall { _0: namehash }.abi_encode(); let key_call = keyCall { _0: namehash }.abi_encode(); - let router_call = routersCall { _0: namehash }.abi_encode(); let tx_input = TransactionInput::new(Bytes::from(ip_call)); let tx = TransactionRequest::default() .to(kns_address) @@ -737,18 +736,6 @@ pub async fn assign_routing( )); } - let router_tx_input = TransactionInput::new(Bytes::from(router_call)); - let router_tx = TransactionRequest::default() - .to(kns_address) - .input(router_tx_input); - - let Ok(routers) = provider.call(&router_tx).await else { - return Err(anyhow::anyhow!("Failed to fetch node routers from PKI")); - }; - let Ok(routers) = >>::abi_decode(&routers, false) else { - return Err(anyhow::anyhow!("Failed to decode node routers from PKI")); - }; - let node_ip = format!( "{}.{}.{}.{}", (ip >> 24) & 0xFF, @@ -757,12 +744,7 @@ pub async fn assign_routing( ip & 0xFF ); - println!("routers: {:?}\r", routers); - println!("node_ip: {:?}\r", node_ip); - println!("ws: {:?}\r", ws); - println!("tcp: {:?}\r", tcp); - - if !routers.is_empty() { + if !our.is_direct() { // indirect node return Ok(()); } From 6bac6b544be4c32086ae38e8c4a32433ba558bac Mon Sep 17 00:00:00 2001 From: dr-frmr Date: Mon, 15 Jul 2024 03:16:03 +0200 Subject: [PATCH 3/3] fixed, also, ignore SIGPIPE --- kinode/src/terminal/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kinode/src/terminal/mod.rs b/kinode/src/terminal/mod.rs index 8b8326e90..02c080e1b 100644 --- a/kinode/src/terminal/mod.rs +++ b/kinode/src/terminal/mod.rs @@ -587,7 +587,7 @@ pub async fn terminal( _ = sigalrm.recv() => return Err(anyhow::anyhow!("exiting due to SIGALRM")), _ = sighup.recv() => return Err(anyhow::anyhow!("exiting due to SIGHUP")), _ = sigint.recv() => return Err(anyhow::anyhow!("exiting due to SIGINT")), - _ = sigpipe.recv() => return Err(anyhow::anyhow!("exiting due to SIGPIPE")), + _ = sigpipe.recv() => continue, // IGNORE SIGPIPE! _ = sigquit.recv() => return Err(anyhow::anyhow!("exiting due to SIGQUIT")), _ = sigterm.recv() => return Err(anyhow::anyhow!("exiting due to SIGTERM")), _ = sigusr1.recv() => return Err(anyhow::anyhow!("exiting due to SIGUSR1")),