dumbpipe icon indicating copy to clipboard operation
dumbpipe copied to clipboard

Added persistence of node-key

Open jeroenvanmaanen opened this issue 1 month ago • 4 comments

I added the possibility to persists the node-key, so that the listener can be restarted after a reboot or container restart. I use this for a dumbpipe that forwards a port from my development laptop to a dev-container that serves a Dioxus-app.

Together with the similar persisted node-id in the Iroh-P2P enabled remote_server for Zed (courtesy of dignifiedquire) this enables me to remotely develop an app without having to copy and paste a new connection-string each time the dev-container is restarted. See also the definition of the dev-rust-dioxus container-image.

This is the first time I used snafu (I am used to anyhow). The error-structs and associated trait-impls are quite verbose. Is this idiomatic, of do you have suggestions on how to improve it?

jeroenvanmaanen avatar Oct 20 '25 18:10 jeroenvanmaanen

Thanks, we usually use openssh key format, for storing the keys, you can see how here: https://github.com/n0-computer/iroh-n0des/blob/main/src/client.rs#L64

dignifiedquire avatar Oct 21 '25 19:10 dignifiedquire

Verified that the node-id can be persisted using a Linux remote and a MacOs client. The persisted file is now a PEM file with an OPENSSH PRIVATE KEY in it.

jeroenvanmaanen avatar Oct 22 '25 22:10 jeroenvanmaanen

I published a crate iroh-persist. ~~(I did not publish it yet.) It makes persisting Iroh node-ids quite trivial. What do you think of it? Shall I replace the current implementation by a call of a function in this crate?~~

jeroenvanmaanen avatar Oct 26 '25 22:10 jeroenvanmaanen

I just went ahead and used my new crate 😉

jeroenvanmaanen avatar Oct 30 '25 20:10 jeroenvanmaanen