pub async fn run(home: &Path, secret: SecretKey) -> Result<(), NodeError>Expand description
Run the node in the foreground until it receives a shutdown signal
or a Command::Shutdown.
On entry the function:
- bootstraps the seeder under
<home>/artifacts/ - probes the control socket — if a live owner answers, returns
NodeError::AlreadyRunning; if the socket file exists but nothing answers, unlinks it - binds the socket with 0600 perms
- installs SIGTERM/SIGINT handlers and runs the accept loop
On exit the function drains in-flight handlers (up to
DRAIN_TIMEOUT) and shuts the iroh router down (capped by
ROUTER_SHUTDOWN_TIMEOUT). The socket file is unlinked. Seeded
tags are intentionally left in place so a restart resumes the prior
set.