User Experience for the CLIs

What gpu are you considering?

The most affordable at the moment. The existing GeForce GTX 1650 SUPER been stable for the last 24 hrs but something occaisionally causes the desktop to freeze and I need to ssh in to try to unfreeze it - or usually reboot cos Ctrl-Alt-Del is so 90s and wont work anyway

And I have again with the latest - just stored 3.8GB in very few mins and all seems well-behaved.

Now for some messing with DBCs …

@chriso when I clone your fork with #2173 and try to build I very quickly get these errors

willie@gagarin:~/projects/maidsafe/jacerida/safe_network$ cargo build --release --features data-network
   Compiling proc-macro2 v1.0.51
   Compiling unicode-ident v1.0.6
   Compiling quote v1.0.23
   Compiling syn v1.0.109
   Compiling libc v0.2.139
   Compiling cfg-if v1.0.0
   Compiling version_check v0.9.4
   Compiling autocfg v1.1.0
   Compiling serde_derive v1.0.152
   Compiling serde v1.0.152
   Compiling cc v1.0.79
   Compiling memchr v2.5.0
error[E0463]: can't find crate for `std`

error[E0463]: can't find crate for `core`

error[E0463]: can't find crate for `compiler_builtins`

error[E0463]: can't find crate for `std`
 --> /home/willie/.cargo/registry/src/github.com-1ecc6299db9ec823/syn-1.0.109/build.rs:1:5

and so on for several hundred lines.

What elementary error am I making, please?

Maybe it’s this error…

willie@gagarin:~/projects/maidsafe/jacerida/safe_network$ rustup default stable
info: using existing install for 'stable-x86_64-unknown-linux-gnu'
info: default toolchain set to 'stable-x86_64-unknown-linux-gnu'

  stable-x86_64-unknown-linux-gnu unchanged - rustc 1.67.1 (d5a82bbd2 2023-02-07)

info: note that the toolchain 'nightly-x86_64-unknown-linux-gnu' is currently in use (directory override for '/home/willie/projects')

EDIT: compiles fine when I get ensure I am using stable rust
I’ll kill this latest I have running and try to play with the actual safenode command

@chriso For now should I cp target/release/safenode ~/.safe/node/ as if it was sn_node?

Hmm, I’m not sure about those errors.

I am on Rust version 1.68.0 and we use the stable version, not the nightly one or anything.

Btw, I am very close to getting this PR merged. Just waiting for this current test run to complete.

1 Like

No it was all my fault, in playing with Ribir I had accidentally set rustup to nightly.
Once I sorted that, it compiles as expected and I am about to play with safenode.
Should I store that binary in ~/.safe/node/ - as with sn_node?

willie@gagarin:~/projects/maidsafe/jacerida/safe_network$ rustc -V
rustc 1.67.1 (d5a82bbd2 2023-02-07)
1 Like

If you are looking to use testnet, it looks for safenode on PATH, otherwise it has a --node-path argument that can specify the location of the node. Or if you are running it from the safe_network repo, you can use the --build-node argument to build the node, which is how some of the devs use it.

Deeply agog :slight_smile:

3 Likes

safenode --clear-data on its own to clear up previous runs fails

willie@gagarin:~$ safenode --clear-data
Starting logging to stdout
Node started
Error: 
   0: Configuration error: Either the --first or --network-contacts-file argument is required, and they are mutually exclusive. Please run the command again and use one or the other, but not both, of these arguments.

Location:
   sn_node/src/bin/sn_node/main.rs:127

Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.

To be fair this is probably not the most common use-case for this command. For me, it looked handy for use at the start of an installation script to “clear the decks”

Hmm, I don’t know what that argument is supposed to do.

With the testnet tool, it clears out the previously existing local-test-network directory if you are creating a new network (as opposed to having new nodes join an existing one).

1 Like

Indeed, I was just hoping I could use it in my scripts to simplify this function

clean_up () {
    #clean up from any previous run
    $SAFE_BIN/safe node killall > /dev/null
     [ -f "$WALLET_DATA " ] && rm -v $WALLET_DATA   #make sure this is cleared    
    echo ""
    echo ""
    sleep 1
    cd $SAFE_ROOT/node
    trash-put -r -v ./baby* ./local*
    spacer
}

Its certainly no biggie - just mentioned it for completeness. :slight_smile:

Remember that node will be gone when this PR is merged. That command is effectively just pgrep safenode | xargs kill -9 anyway.

1 Like

Understood, I need to get familiar with all of safenode so I can replace node correctly in the scripts

1 Like

Yeah, I think the node arguments could possibly do with a bit of spring cleaning too.

2 Likes

looking good so far :slight_smile:

  --completions <COMPLETIONS>
            dump shell completions for: [bash, fish, zsh, powershell, elvish]

Has anyone ever actually used this option in earnest? It’s likely out of date now anyway.

   -j, --json-logs
            Outputs logs in json format for easier processing

Perhaps make this the default?

All these log options make sense bar the last - perhaps set the default to 10 uncompressed 10MB files?

        --log-dir <LOG_DIR>
            Send logs to a file within the specified directory

        --logs-max-bytes <LOGS_MAX_BYTES>
            Maximum bytes per log file
            
            [default: 10485760]

        --logs-max-lines <LOGS_MAX_LINES>
            Maximum lines per log file (overrides logs_max_bytes)
            
            [default: 0]

        --logs-retained <LOGS_RETAINED>
            Number of rotated log files to keep (0 to keep all)
            
            [default: 0]

        --logs-uncompressed <LOGS_UNCOMPRESSED>
            Number of rotated files left not compressed
            
            [default: 100]

Thats potentially ~1GB of uncompressed logs cluttering up the disk

Yeah, I don’t think the shell completions are used and they certainly will be out of date. If people still desire them, my plan was to move that to safeup.

I don’t think JSON logs would be desirable as the default. They are not as human readable as the normal logging format, and right now a big part of the development process involves the inspection of logs.

This much is true but for scripting the output of safe commands --json means I can normally use jq and avoid sed/awk unpleasantaries.

I should just use -j myself consistently in scripts

Yeah, JSON is excellent for machine use. I think that means you need to direct your scripts that way.

1 Like

Yaay - now we can all play with your changes

Beware, I may delete this release. It has publishing problems.

Shouldn’t be anything wrong with using testnet from the main branch though.

2 Likes