iroh
iroh copied to clipboard
iroh CLI configuration
The iroh CLI needs to know what iroh RPC services it's talking to. This needs to be configured.
The path to the configuration can be indicated explicitly using a --config option.
If no --config is given, the configuration is looked up in a well-known location on the filesystem.
If no config file is found, it falls back to built-in configuration.
The built-in configuration uses well-known default ports for each service.
Both iroh-one as well as the individual gateway/p2p/store services default to using these well-known ports.
iroh-one can be started through iroh start, and iroh start takes its own --config argument, which is passes along to iroh-one. iroh-one then uses the same rules as above.
So a super explicit way to do iroh start looks like this:
iroh --config ./iroh.config.toml start --config iroh-one.config.toml
Other services like iroh-p2p follow the same rules concerning configuration.
We avoid configuration of services through the CLI; the CLI for starting services would have -h and -V and --config and not much more. iroh start just has -h and --config, but at least for now, not -V to get version information (we prefer iroh status to get that)
Since iroh start now starts multiple services (p2p, store, gateway), each with their own config, I wonder how we're going to pass config information to it.
we now have cli.config.toml, which configures the services that iroh start starts. We can expand for more