'safe node' vs. sn_node

Per user request, 20 chars.


maybe we can make

safe node xyz

just forward directly to the sn_node bin? Seems a reasonable convenience to have it there? I don’t think you’d want sn_node as a command all over your system? (maybe I’m wrong)


For me personally I would rather just work with the node directly. I’d want it installed in /usr/local/bin along with safe there too.

I just don’t really see why it’s an advantage to use safe node xyz rather than sn_node xyz.

From a code point of view safe node xyz also may be a bit awkward if we do still want to retain commands like node run-baby-fleming, which is not going to be forwarded to the node. We also won’t be able to document the arguments for the node unless we done that manually, in which case we have two things we need to update. Whereas if you run sn_node --help you are just getting direct access to whatever the current available arguments are.

1 Like

Couldn’t the CLI help be supported automatically if safe node effectively becomes an alias for sn_node which I think is what was being suggested?

This menu gets generated automatically based on the code:

❯ cargo run --bin safe -- node --help
    Finished dev [unoptimized + debuginfo] target(s) in 0.26s
     Running `target/debug/safe node --help`
Commands to manage Safe Network Nodes

    safe node [OPTIONS] [SUBCOMMAND]

        --config-dir-path <CONFIG_DIR_PATH>
            Set the location for the config directory.

            Defaults to $HOME/.safe on Linux/macOS or %USERPROFILE%\.safe on Windows

            [env: SAFE_CONFIG_DIR_PATH=]

    -h, --help
            Print help information

            Use JSON as output serialisation format (alias of '--output json')

    -n, --dry-run
            Perform a dry run of the command. No data will be written

    -o, --output <OUTPUT_FMT>
            Output data serialisation: [json, jsoncompact, yaml]

        --xorurl <XORURL_BASE>
            Base encoding for XOR-URLs. Currently supported: base32z (default), base32 and base64

            Gets the version of `sn_node` binary
            Print this message or the help of the given subcommand(s)
            Install an sn_node binary
            Join an existing network
            Shutdown all running nodes processes
            Run nodes to form a local single-section Safe network
            Update to latest sn_node released version

I’m not sure exactly what we would do here if we are just going to forward everything.

I don’t think anyone is providing a compelling reason for the safe node alias. If for some strange reason you really wanted to retain that, you could setup your own shell alias.

Edit: scratch the shell alias actually. I don’t think that would work if node run-baby-fleming was to be retained.

Edit2: now that I’m thinking about it, I actually think just safe run-baby-fleming is better than having that be a sub command of node. So my preference is for ditching node entirely.