Pulling all the CLI issues into one thread at the request of @chriso Why not sn_node in /usr/local/bin? - #3 by chriso
I’ll try to move or link previous relevant posts here
Meantime please find a tale of NRS woe or stupidity - you choose
steps to re-create
fire up a 20.node baby-fleming with the latest release
create keys and a wallet
create a new top-level domain
willie@gagarin:~/projects/maidsafe/safe_network$ safe nrs register mydomain
New NRS Map created for "safe://mydomain"
The container for the map is located at safe://hyryygy1sooy6ue4c9u1ra8bnuugyeuxwpotwfo7ncuhnr7g68bqibng7man7a
+---+----------+-----------------+
| + | mydomain | safe://mydomain |
+---+----------+-----------------+
Put a folder of files
willie@gagarin:~/projects/maidsafe/safe_network$ safe files put -r ../to-upload/
FilesContainer created at: "safe://hyryyrywd51e46pwwsewjra4ouuofz4kno3aqdpthnefc89f3ca39imuo4enra?v=hewsndu6trt65iq9jtg5a1jz9fdhorz5tskg9n5foze6a9mck3fio"
+---+------------------------------------------------+--------------------------------------------------------------------+
| + | ../to-upload/at-the-top.txt | safe://hy8oycyq7ani7se5myqbn45a76pxoee4coq46s4jawjayq4dwtqtrz1cytw |
|---+------------------------------------------------+--------------------------------------------------------------------|
| + | ../to-upload/file1.txt | safe://hy8oycyknqysiqp1h5phdf76wnraokoeqq7gben9e1rfndmi7dneuqe89my |
|---+------------------------------------------------+--------------------------------------------------------------------|
| + | ../to-upload/myfolder | |
|---+------------------------------------------------+--------------------------------------------------------------------|
| + | ../to-upload/myfolder/file2.txt | safe://hy8oycypk7o5yq3a1beyjfbjs9z5q4okyh458mw4zu8kad8k9zfg3ndbs3e |
|---+------------------------------------------------+--------------------------------------------------------------------|
| + | ../to-upload/myotherfolder | |
|---+------------------------------------------------+--------------------------------------------------------------------|
| + | ../to-upload/myotherfolder/new.txt | safe://hy8oycypyg8ubt9yywrpjckz6xgkbijr7phmz1nptcmnwbtanex1ja3csnh |
|---+------------------------------------------------+--------------------------------------------------------------------|
| + | ../to-upload/myotherfolder/subfolder | |
|---+------------------------------------------------+--------------------------------------------------------------------|
| + | ../to-upload/myotherfolder/subfolder/file3.txt | safe://hy8oycyewufyjonzy766sng9qzycz4hhuf379am88ghm99otfnqw91spgph |
+---+------------------------------------------------+--------------------------------------------------------------------+
Give this container a friendly name in my new domain.
willie@gagarin:~/projects/maidsafe/safe_network$ safe nrs add files.mydomain -l safe://hyryyrywd51e46pwwsewjra4ouuofz4kno3aqdpthnefc89f3ca39imuo4enra?v=hewsndu6trt65iq9jtg5a1jz9fdhorz5tskg9n5foze6a9mck3fio
Existing NRS Map updated.
Now at version hjmd5d56outcnmbbche7czujdptxjmexhiqq5bnqwj7wjzbzwayky.
+---+----------------+-------------------------------------------------------------------------------------------------------------------------------+
| + | files.mydomain | safe://hyryyrywd51e46pwwsewjra4ouuofz4kno3aqdpthnefc89f3ca39imuo4enra?v=hewsndu6trt65iq9jtg5a1jz9fdhorz5tskg9n5foze6a9mck3fio |
+---+----------------+-------------------------------------------------------------------------------------------------------------------------------+
Try to look at the entirety of safe://mydomain
willie@gagarin:~/projects/maidsafe/safe_network$ safe cat mydomain
NRS Map Container at safe://mydomain
Listing NRS map contents:
files.mydomain: safe://hyryyrywd51e46pwwsewjra4ouuofz4kno3aqdpthnefc89f3ca39imuo4enra?v=hewsndu6trt65iq9jtg5a1jz9fdhorz5tskg9n5foze6a9mck3fio
Feel somewhat underwhelmed and try something else
willie@gagarin:~/projects/maidsafe/safe_network$ safe cat files.mydomain
Files of FilesContainer (version hewsndu6trt65iq9jtg5a1jz9fdhorz5tskg9n5foze6a9mck3fio) at "safe://files.mydomain":
+------------------------------------+-----------------+-------+------------+------------+--------------------------------------------------------------------+
| Name | Type | Size | Created | Modified | Link |
|------------------------------------+-----------------+-------+------------+------------+--------------------------------------------------------------------|
| /at-the-top.txt | text/plain | 33 | 1678290421 | 1678290421 | safe://hy8oycyq7ani7se5myqbn45a76pxoee4coq46s4jawjayq4dwtqtrz1cytw |
|------------------------------------+-----------------+-------+------------+------------+--------------------------------------------------------------------|
| /file1.txt | text/plain | 1285 | 1678290421 | 1678290421 | safe://hy8oycyknqysiqp1h5phdf76wnraokoeqq7gben9e1rfndmi7dneuqe89my |
|------------------------------------+-----------------+-------+------------+------------+--------------------------------------------------------------------|
| /myfolder | inode/directory | 0 | 1678290421 | 1678290421 | |
|------------------------------------+-----------------+-------+------------+------------+--------------------------------------------------------------------|
| /myfolder/file2.txt | text/plain | 43532 | 1678290421 | 1678290421 | safe://hy8oycypk7o5yq3a1beyjfbjs9z5q4okyh458mw4zu8kad8k9zfg3ndbs3e |
|------------------------------------+-----------------+-------+------------+------------+--------------------------------------------------------------------|
| /myotherfolder | inode/directory | 0 | 1678290421 | 1678290421 | |
|------------------------------------+-----------------+-------+------------+------------+--------------------------------------------------------------------|
| /myotherfolder/new.txt | text/plain | 22 | 1678290421 | 1678290421 | safe://hy8oycypyg8ubt9yywrpjckz6xgkbijr7phmz1nptcmnwbtanex1ja3csnh |
|------------------------------------+-----------------+-------+------------+------------+--------------------------------------------------------------------|
| /myotherfolder/subfolder | inode/directory | 0 | 1678290421 | 1678290421 | |
|------------------------------------+-----------------+-------+------------+------------+--------------------------------------------------------------------|
| /myotherfolder/subfolder/file3.txt | text/plain | 17 | 1678290421 | 1678290421 | safe://hy8oycyewufyjonzy766sng9qzycz4hhuf379am88ghm99otfnqw91spgph |
+------------------------------------+-----------------+-------+------------+------------+--------------------------------------------------------------------+
OK my files are where I put them but why can’t I see ALL of safe://mydomain with one command? Try
safe files tree
willie@gagarin:~/projects/maidsafe/safe_network$ safe files tree mydomain
Error:
0: UrlError: InvalidXorUrl: Problem parsing the URL "mydomain": relative URL without a base
1: InvalidXorUrl: Problem parsing the URL "mydomain": relative URL without a base
Location:
sn_cli/src/subcommands/files.rs:419
Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.
willie@gagarin:~/projects/maidsafe/safe_network$ safe files tree safe://mydomain
Error:
0: Make sure the URL targets a FilesContainer
Location:
sn_cli/src/subcommands/files.rs:421
Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.
So both attempts there fail
This works as expected, however
willie@gagarin:~/projects/maidsafe/safe_network$ safe files tree safe://files.mydomain
safe://files.mydomain
├── at-the-top.txt
├── file1.txt
├── myfolder
│ └── file2.txt
└── myotherfolder
├── new.txt
└── subfolder
└── file3.txt
3 directories, 5 files
lets try adding a file to safe://mydomain
willie@gagarin:~/projects/maidsafe/safe_network$ echo "That's plenty" >> plenty.txt
willie@gagarin:~/projects/maidsafe/safe_network$ safe files put plenty.txt
FilesContainer created at: "safe://hyryyry11ipbycmkg6i6s47cs134iqrtnc6mjqr9a8berjniiya1tow1jtcnra?v=he89fqnyxpejk3ugza77k9jzpbqoz3cgrb3jdcaaja3cxgdjeb7jy"
+---+------------+--------------------------------------------------------------------+
| + | plenty.txt | safe://hy8oycyxaxd57o5zf9bacqggb9s8haxewaoqqbzoipr7am4ug3xacuosboh |
+---+------------+--------------------------------------------------------------------+
OK
willie@gagarin:~/projects/maidsafe/safe_network$ safe nrs add -l safe://hyryyry11ipbycmkg6i6s47cs134iqrtnc6mjqr9a8berjniiya1tow1jtcnra?v=he89fqnyxpejk3ugza77k9jzpbqoz3cgrb3jdcaaja3cxgdjeb7jy safe://mydomain
Error:
0: UrlError: InvalidXorUrl: path contains empty component
1: InvalidXorUrl: path contains empty component
Location:
/rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/core/src/convert/mod.rs:726
Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.
Not OK
And neither are
willie@gagarin:~/projects/maidsafe/safe_network$ safe nrs add -l safe://hy8oycyxaxd57o5zf9bacqggb9s8haxewaoqqbzoipr7am4ug3xacuosboh safe://mydomain
Error:
0: UrlError: InvalidXorUrl: path contains empty component
1: InvalidXorUrl: path contains empty component
Location:
/rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/core/src/convert/mod.rs:726
Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.
nor
willie@gagarin:~/projects/maidsafe/safe_network$ safe nrs add -l safe://hy8oycyxaxd57o5zf9bacqggb9s8haxewaoqqbzoipr7am4ug3xacuosboh safe://mydomain/plenty
Error:
0: UrlError: InvalidXorUrl: path contains empty component
1: InvalidXorUrl: path contains empty component
Location:
/rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/core/src/convert/mod.rs:726
Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.
Sanity check
willie@gagarin:~/projects/maidsafe/safe_network$ safe cat safe://hy8oycyxaxd57o5zf9bacqggb9s8haxewaoqqbzoipr7am4ug3xacuosboh
That's plenty
willie@gagarin:~/projects/maidsafe/safe_network$ safe dog safe://hy8oycyxaxd57o5zf9bacqggb9s8haxewaoqqbzoipr7am4ug3xacuosboh
== URL resolution step 1 ==
Resolved from: safe://hy8oycyxaxd57o5zf9bacqggb9s8haxewaoqqbzoipr7am4ug3xacuosboh
= File =
XOR-URL: safe://hy8oycyxaxd57o5zf9bacqggb9s8haxewaoqqbzoipr7am4ug3xacuosboh
XOR name: 0xf878f7d86ee5f870c718c1fd8fcc3d14c41ce0de15693b85ea66cbf0c9c2c187
Native data type: PublicFile
Media type: text/plain
Yep, entirely as expected…
but…
willie@gagarin:~/projects/maidsafe/safe_network$ safe nrs add -l safe://hyryyry11ipbycmkg6i6s47cs134iqrtnc6mjqr9a8berjniiya1tow1jtcnra?v=he89fqnyxpejk3ugza77k9jzpbqoz3cgrb3jdcaaja3cxgdjeb7jy safe://mydomain/plenty
Error:
0: UrlError: InvalidXorUrl: path contains empty component
1: InvalidXorUrl: path contains empty component
Location:
/rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/core/src/convert/mod.rs:726
Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.
willie@gagarin:~/projects/maidsafe/safe_network$ safe cat safe://hyryyry11ipbycmkg6i6s47cs134iqrtnc6mjqr9a8berjniiya1tow1jtcnra?v=he89fqnyxpejk3ugza77k9jzpbqoz3cgrb3jdcaaja3cxgdjeb7jy
Files of FilesContainer (version he89fqnyxpejk3ugza77k9jzpbqoz3cgrb3jdcaaja3cxgdjeb7jy) at "safe://hyryyry11ipbycmkg6i6s47cs134iqrtnc6mjqr9a8berjniiya1tow1jtcnra?v=he89fqnyxpejk3ugza77k9jzpbqoz3cgrb3jdcaaja3cxgdjeb7jy":
+-------------+------------+------+------------+------------+--------------------------------------------------------------------+
| Name | Type | Size | Created | Modified | Link |
|-------------+------------+------+------------+------------+--------------------------------------------------------------------|
| /plenty.txt | text/plain | 14 | 1678290980 | 1678290980 | safe://hy8oycyxaxd57o5zf9bacqggb9s8haxewaoqqbzoipr7am4ug3xacuosboh |
+-------------+------------+------+------------+------------+--------------------------------------------------------------------+
So I have two problems here
safe files tree safe://mydomain
does not perform as intuitively as a n00b would think as it goes NOT show the sub-domain(s)
And Im still mystified about this “empty document” error …