User Experience for the CLIs

Thanks for the suggestion, but I think we’ll stick with safeup.

There will be commands, like client, node, and if neither is supplied, it will run interactive.

5 Likes

Can we get some consensus on how the cli should be and behave? Can we have an rfc or a discussion of the most efficient use of commands?

Rfc way should be useful as it will be serious thought on this

I’m not sure exactly what you mean by that.

Suggestions are OK, but deciding everything by committee is too slow and tedious.

I am thinking of anyone that can input a proposal on an rfc there could be a convergence in useability and ease of use but yeah i digress a bit drunk and this should be one mans evening of thought as its 3 parts to it , safe safenode and safeup.

2 Likes

To be honest, I don’t think that’s a suggestion I would take forward to the rest of the team.

If you have any queries on any particular commands, by all means, feel free to raise them. All suggestions will be welcomed, but we don’t necessarily need to take all of them on. Sometimes we will decide something as a team and for the sake of pragmatism, we just need to stick with our decision and move forward.

Trying to please everyone is impossible.

6 Likes

Sure i reckon a safeup that is in its own repo would be ideal and use safe and safe node releases as a way of easily getting up to date. A tool that does one job and it does it well will bring a boostrap to the safe network that is release agnostic

Also an official way of building safe and safenode would be welcomed as people can be involved in the latest code itrations and features

2 Likes

This much is true

3 Likes

Testnet will launch 30 nodes by default but no genesis node.
Baby-fleming launches 11 by default and does all the genesis setup.

Im guessing the original intention was that you launch a single node with --first, then when happy that started ok then run testnet to create a usable network

But its months since I used testnet so maybe I remember wrong

1 Like

Cool, thanks for the summary.

To be honest though, it doesn’t really matter too much as the node command will be gone shortly. The testnet interface is looking like this now:

❯ cargo run --bin testnet -- --help
   Compiling testnet v0.1.0 (/home/chris/dev/github.com/jacderida/safe_network/testnet)
    Finished dev [unoptimized + debuginfo] target(s) in 1.17s
     Running `target/debug/testnet --help`
testnet 0.1.0

USAGE:
    testnet [OPTIONS] [-- <NODE_ARGS>...]

ARGS:
    <NODE_ARGS>...
            Specify any additional arguments to pass to the node launch, e.g., --json-logs

OPTIONS:
    -a, --add
            Launched nodes will join an existing testnet

    -b, --build-node
            Build the node from source.

            This assumes you're running the process from the `safe_network` repository.

    -f, --flame
            Use flamegraph setup.

            Flamegraph will elevate to root, so log output will need to be deleted as root.

    -h, --help
            Print help information

    -i, --interval <NODE_LAUNCH_INTERVAL>
            Interval between node launches in ms. Defaults to 5000

    -n, --node-count <NODE_COUNT>
            The number of nodes for the testnet. Defaults to 30

            [env: NODE_COUNT=]

    -p, --node-path <FILE_PATH>
            Optional path to the safenode binary.

            This will take precedence over the --build-node flag and effectively ignore it.

            If not supplied we will assume that safenode is on PATH.

    -V, --version
            Print version information
4 Likes

Is there a way to make a comnet with 1 node per core in a 16 core system? and other people be able to use the network or even add their own nodes?

2 Likes

This is just a simple tool that launches the specified number of node processes on a single machine. It will be the operating system that will determine where the code on each process runs.

You could maybe use containers or something if you wanted to isolate specific CPU cores.

3 Likes

My issue is not thread/core isolation but to make a smoothnet with e.g. 16 nodes on my system/vps that others can join from home if they got public ip or from a vps

3 Likes

This tool would be able to launch node processes on another machine that could join a network, given a certain contacts file. However, I haven’t finished that part of it yet.

3 Likes

Could you enable --public-addr for sn_node? or with testnet or flamegraph (but I think testnet and flame graph both use sn_node to start the genesis and other nodes)

pretty please? :face_holding_back_tears:

There is no --public-addr argument any more. The genesis node is now started like this:

sn_node \
  --first {{ instance_public_ip }}:{{ node_port }} \
  --local-addr 0.0.0.0:{{ node_port }} \
  --root-dir {{ node_data_dir_path }} \
  --log-dir {{ node_logs_dir_path }}

Those placeholder values would be replaced. Subsequent nodes are launched like so:

sn_node \
  --network-contacts-file {{ network_contacts_path }} \
  --root-dir {{ node_data_dir_path }} \
  --log-dir {{ node_logs_dir_path }}

Bearing in mind, next week, sn_node will be renamed safenode along with the reworked testnet binary.

I personally can’t speak to why the --public-addr argument was removed. It was Benno who worked on that.

The testnet binary will wrap all that stuff away for the creation of local test networks.

6 Likes

Following on with some more safe wallet ux ergonomics

safe wallet reissue --help

--owned
    Set this flag to reissue as an owned DBC, using the public key
    configured for use with
    safe. This argument and the --public-key argument are mutually
    exclusive

There is no --public-key argument in safe wallet reissue --help. Maybe the text needs a bit of editing?

ARGS:
    <AMOUNT>
            The amount to reissue

Maybe include a unit here so it’s clear exactly how much. Decimals or integers.

3 Likes

Ah yeah, thanks!

That --public-key argument was renamed --to, so the documentation needs updated to reflect that.

I will also get the units changed.

I’ve finished my PR on renaming sn_node, reworking testnet and removing the node command:

After that, I’m gonna add in a release process for the testnet binary. Now that we’re encouraging the use of this tool for replacing node run-baby-fleming, I want it to be properly versioned. Let’s keep it working and the UX good.

That shouldn’t take long, then after I’m finished, I will ask Josh if I can work on the wallet commands, as there are now various different issues that people have pointed out.

4 Likes

Thank you, thats a power of work you put in there, Chris :+1:

3 Likes

Cheers.

Please let me know what you think about the testnet binary and feedback any issues or anything you might like to see changed.

3 Likes

On Github, @oetyng writes re @chriso 's PR

Great work! On many levels.
I really like how you write the docs, written as they should IMO. Thoroughly, describing what it is, how it is used and some motivations on why this or that choice has been made/not made.

IMHO it’s certainly worth diving into Github to get a look at whats happening in between updates.

I had cargo run --bin testnet humming along with 30 nodes when the desktop crashed BUT I suspect this may be due to other factors, like my video card being due for replacement - still trawling through logs for clues but seeing nothing safe-related yet.

4 Likes