User Experience for the CLIs

If you run safenode to start a single node it does not make an entry in network_contacts. Thats why I had to faff about copying node/local-test-network/section_tree to network_contacts and renaming it.

Although I should have done safe networks add my_lan_safe ~/.safe/node/local-test-network/section_tree

While I am moaning…

Can we harmonise the use of the -j and --json flags across the range of commands?

willie@gagarin:~$ safe files put -n -j /fgfs/Scenery/EGODarea
error: Found argument '-j' which wasn't expected, or isn't valid in this context

	If you tried to supply `-j` as a value rather than a flag, use `-- -j`

USAGE:
    safe files put [OPTIONS] <LOCATION> [DST]

For more information try --help
willie@gagarin:~$ safe files put -n --json /fgfs/Scenery/EGODarea
[
  "safe://hyryyryio6eitutpojduqk6uiiqeia186o7wofhz3zx1b1ccs6e78c3dswonra",
  {}
]

And another request…

After a recursive files put on a large dir can the FilesContainer be repeated? Saves scrolling all the way up to the top to discover you have filled the terminal buffer and now you have 3Gb of files stored on the network but you are not sure just where :slight_smile:

even when you have 10k lines in the scrollback buffer

2 Likes

I know I have been irrationally eager to see this working… and now it is. moving on with my life :slight_smile:
@chriso :clap: :clap:

josh@evo:~/safeup/target/release$ ./safeup client
Installing safe for x86_64-unknown-linux-musl at /home/josh/.safe/cli...
  [########################################] 10.65 MiB/10.65 MiB                                         safe 0.75.0 is now available at /home/josh/.safe/cli/safe
Modified shell profile at /home/josh/.bashrc
To make safe available in this session run 'source /home/josh/.safe/env'
josh@evo:~/safeup/target/release$ ./safeup node
Installing safenode for x86_64-unknown-linux-musl at /home/josh/.safe/node...
  [########################################] 11.34 MiB/11.34 MiB                                         safenode 0.81.0 is now available at /home/josh/.safe/node/safenode
josh@evo:~/safeup/target/release$ ./safeup testnet
Installing testnet for x86_64-unknown-linux-musl at /home/josh/.safe/node...
  [########################################] 2.50 MiB/2.50 MiB                                           testnet 0.1.4 is now available at /home/josh/.safe/node/testnet
3 Likes

OK what did you do to get that?

warning: `safeup` (bin "safeup") generated 1 warning
    Finished release [optimized] target(s) in 1.23s
willie@gagarin:~/projects/maidsafe/safeup$ cd target/release/
willie@gagarin:~/projects/maidsafe/safeup/target/release$ ./safeup client
Installing safe for x86_64-unknown-linux-musl at "/home/willie/.safe/cli"...
Error: Release has no client asset for platform x86_64-unknown-linux-musl

Location:
    src/github.rs:82:13
willie@gagarin:~/projects/maidsafe/safeup/target/release$ ./safeup node
error: unrecognized subcommand 'node'

Usage: safeup [COMMAND]

For more information, try '--help'.
willie@gagarin:~/projects/maidsafe/safeup/target/release$ ./safeup testnet
error: unrecognized subcommand 'testnet'

Not surprised by the first error - cos I pulled and built last night but I’m getting unrecognised subcommand on both node and testnet…

you need to go deeper undercover Mr Willie, straight to the teat git clone -b install-node https://github.com/jacderida/safeup.git

I am so out of the loop.

Im barely awake - had to get up before noon to take the motor round to the garage, now in a state of shock at what it will cost…

1 Like

how are you using the testnet binary, I am missing something, somewhere.

1 Like

Sorry for the delay

I am still faffing with setting up a single genesis node and then copying the generated section tree to ~/.safe/network_contacts/default
Then I run testnet with -n ~/.safe/network_contacts/default

safenode --clear-data --first 192.168.100.100:0 -j -vvv -r ~/.safe/node/local-test-network/safenode-genesis

safe networks add local-test-network ~/.safe/node/local-test-network/safenode-genesis/section_tree

testnet -c36 --interval 4000 --join -n /home/willie/.safe/network_contacts/default

@Josh
EDIT – this is only necessary for a LAN network - testnet works just fine for a localhost network on one machine

1 Like

you run NODE_COUNT=15 RUST_LOG=sn_node=trace cargo run --release --bin testnet and it works?

1 Like

No
I copied target/release/testnet to /usr/local/bin

then testnet -c15

and it JustWorks :slight_smile:

:pensive:

josh@evo:~/.safe/node$ ls
local-test-network  safenode  testnet
josh@evo:~/.safe/node$ ./testnet -c15
2023-03-28T11:03:13.507545Z  INFO sn_testnet: Clearing "/home/josh/.safe/node/local-test-network" for new network
2023-03-28T11:03:13.507616Z  INFO sn_testnet: Launching genesis node using address 127.0.0.1:12000...
2023-03-28T11:03:13.507651Z DEBUG sn_testnet: Running "safenode" with [
    "--first",
    "127.0.0.1:12000",
    "--local-addr",
    "0.0.0.0:12000",
    "--root-dir",
    "/home/josh/.safe/node/local-test-network/safenode-genesis",
    "--log-dir",
    "/home/josh/.safe/node/local-test-network/safenode-genesis",
]
Error: 
   0: No such file or directory (os error 2)

Location:
   sn_testnet/src/lib.rs:38

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

Hmmm… I got

willie@gagarin:~$ testnet -c15
2023-03-28T10:57:23.817405Z  INFO sn_testnet: Clearing "/home/willie/.safe/node/local-test-network" for new network
2023-03-28T10:57:23.821910Z  INFO sn_testnet: Launching genesis node using address 127.0.0.1:12000...
2023-03-28T10:57:23.821964Z DEBUG sn_testnet: Running "safenode" with [
    "--first",
    "127.0.0.1:12000",
    "--local-addr",
    "0.0.0.0:12000",
    "--root-dir",
    "/home/willie/.safe/node/local-test-network/safenode-genesis",
    "--log-dir",
    "/home/willie/.safe/node/local-test-network/safenode-genesis",
]
2023-03-28T10:57:23.822207Z  INFO sn_testnet: Delaying for 5 seconds before launching other nodes
Starting logging to directory: "/home/willie/.safe/node/local-test-network/safenode-genesis"
Node started
Node PID: 98637, prefix: Prefix(), name: 7af125(01111010).., age: 255, connection info: 127.0.0.1:12000
RPC Server listening on 127.0.0.1:12001
2023-03-28T10:57:28.822327Z  INFO sn_testnet: Launching node 1 of 15...
2023-03-28T10:57:28.822476Z DEBUG sn_testnet: Running "safenode" with [
    "--network-contacts-file",
    "/home/willie/.safe/node/local-test-network/safenode-genesis/section_tree",
    "--root-dir",
    "/home/willie/.safe/node/local-test-network/safenode-1",
    "--log-dir",
    "/home/willie/.safe/node/local-test-network/safenode-1",
]
2023-03-28T10:57:28.822893Z  INFO sn_testnet: Delaying for 5 seconds before launching the next node
Starting logging to directory: "/home/willie/.safe/node/local-test-network/safenode-1"
Node started
Node PID: 98678, prefix: Prefix(), name: 57e35f(01010111).., age: 5, connection info: 0.0.0.0:54750
RPC Server listening on 0.0.0.0:54751
2023-03-28T10:57:33.823419Z  INFO sn_testnet: Launching node 2 of 15...

@Josh

run @chriso’s safeup again with sudo so it sticks the binaries in /usr/local/bin (which IMNSHO should be the default) and see if that changes anything.

Only difference I can see for now…

yes I was thinking the same. brb

Edit: @Southside it is singing and dancing now. is run-baby-fleming getting the boot and replaced by this?

I hope not. If run-baby-fleming is retired I will alias it to testnet -c15

1 Like

@chriso
Can we get killall back please?

willie@gagarin:~$ safenode killall
error: Found argument 'killall' which wasn't expected, or isn't valid in this context

USAGE:
    sn_node [OPTIONS]

For more information try --help

Pedant mode on : Still need to change that usage line to safenode…

1 Like

@Josh The safenode binary needs to be on PATH for use with testnet, so if you’re not running safeup as root, you would need to source ~/.safe/env in your shell session, or start a new one, after you had used safeup. There is also a --node-path argument you can use to point it directly to the binary.

@Southside The whole node command has been removed from safe, so run-baby-fleming is gone. This is replaced by testnet. There’s no point in having both of them.

The killall command was never on the node, it was a subcommand of safe node. You can just run pgrep safenode | kill -9.

4 Likes

I’m sure this can be accommodated.

1 Like

I’m actually looking for opinions on something regarding safeup.

My plan for it was to operate in the same way as rustup. So there will be a script that you run like curl <url> | sh, which will download the latest safeup and run it. I had thought that if it runs without any arguments, then it will run in interactive mode to prompt the user to ask which of the components they want to install. However, today, myself and @roland were discussing whether there would be any real value in the interactive UI.

So when you use the script, the default might be to run safeup client or maybe both safeup client and safeup node, and we wouldn’t bother with any interactive option.

Would welcome any thoughts or suggestions on this.

2 Likes

Right off the top of my head
safeup client should be default, safeup node and safeup testnet are more minority interests and if you can run a testnet then you should be able to handle a few rough edges, within reason ofc

4 Likes