Replies: 1 comment
-
How do you envision this works? I think it would be nice to keep avoiding starting the node in the background, because that opens the doors to "daemonising" which is something that's should no longer happen in-application anymore IMHO. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Background
Iroh requires a running node to do anything interesting. We have the ability spin up an iroh node quickly, either in-memory or bound to a local filesystem. We've developed this for both fast internal testing and to support "one off" use cases that quickly get or provide data. The classic example is
iroh get
, a "curl for iroh data" that runs a node just long enough to fetch the data, and then turn off again. In fact, this incarnation of iroh started off as a tool calledsendme
that only worked this way.The problem is mixing UX. Some commands requiring
iroh start
and others not having this requirement is very confusing to the end user.Our original plan for solving this was to build
iroh console
, and always requireiroh start
be running. We wanted to give users a consistent interface that yes adds an early learning hurdle ("you need to run iroh before you can do anything"), but once they clear that hurdle.We've gotten muddled up & ended up implementing both the console and CLI versions of all the same commands, largely because
clap
made it easy to do it, so we did. The CLI experience is far worse than the console for all things except theiroh start $PATH
->iroh get
pattern, which has seen all sorts of real world use.Users have clearly expressed a desire for both "one off" and "long lived" commands. At the same time, I really don't think anyone is using the CLI versions of console commands, which leaves room to clean things up a bit.
Proposal
This proposal aims to remedy the situation by stripping away what doesn't work, and introducing the new hueristic that all iroh commands will start a node if one is not running.
doctor, doc, author, blob, node
, andtag
are removediroh exec
that accepts console command(s) & prints the outputiroh start
command toiroh
iroh console
command to start iroh node if one is not running, presents a warning to the user with a documentation linkAfter these changes:
Concerns
Shorter-lived nodes
The big "concern" here is a trend toward shorter-lived nodes. I'd argue this is a non-issue. I don't think we should be optimizing for nodes to be online for as long as possible. Instead we should be optimizing for nodes to be online exactly as long as they need to be to do meaningful work.
iroh exec
puts us on a path to a scripting languageiroh exec
is much weaker than the full console, and users will likely ask for things like variables to makeiroh exec
more powerful. This runs the risk of putting pressure on the iroh team to implement an entire language just to make iroh exec useful.working with
iroh exec
should be painful. It's an escape hatch. Users should be directed to use the console, and if that's not enough, well, that's why iroh is an SDK.Beta Was this translation helpful? Give feedback.
All reactions