-r, --replicas <REPLICAS>
Query all the data replicas matching the given indexes to check they hold a copy of the
content. E.g. -r0 -r2 will query replicas at index 0 and 2. The network sorts nodes
(data replicas) in a section by comparing the data's name with nodes' names, it's a
measure of "closeness to the data" in XOR-namespace. The index of a node in such list is
what it's referred as a data replica index. At least the first 'data_copy_count' nodes
should hold this data, more may well hold it too
So got the following when playing with this new -r flag. Shows replicas 0, 1, 2 and 3 exist OK and that testing for replica 4 gives the expected error.
willie@gagarin:~$ safe files put ~/yarn.lock
FilesContainer created at: "safe://hyryyryib1cioghtwgcpafsrrgjo9azx4cncp47jp5e38jmcpt81ipyo5tynra?v=h4y7fnmix3sdpg1jppydd9pxjam59sritadnwrbd3rp3baw6fwejo"
+---+------------------------+--------------------------------------------------------------------+
| + | /home/willie/yarn.lock | safe://hyryyyyj1t6qk37fqc4ki5tw8g5p1oup3p4ezceoa888cdb43wwh75enp7w |
+---+------------------------+--------------------------------------------------------------------+
willie@gagarin:~$ safe dog safe://hyryyyyj1t6qk37fqc4ki5tw8g5p1oup3p4ezceoa888cdb43wwh75enp7w
== URL resolution step 1 ==
Resolved from: safe://hyryyyyj1t6qk37fqc4ki5tw8g5p1oup3p4ezceoa888cdb43wwh75enp7w
= File =
XOR-URL: safe://hyryyyyj1t6qk37fqc4ki5tw8g5p1oup3p4ezceoa888cdb43wwh75enp7w
XOR name: 0x328f9cacf4ae66955dc68736db284db96e9176221839cec18759a539dda04ded
Native data type: PublicFile
Media type: Unknown
willie@gagarin:~$ safe dog -r 0 safe://hyryyyyj1t6qk37fqc4ki5tw8g5p1oup3p4ezceoa888cdb43wwh75enp7w
== URL resolution step 1 ==
Resolved from: safe://hyryyyyj1t6qk37fqc4ki5tw8g5p1oup3p4ezceoa888cdb43wwh75enp7w
= File =
XOR-URL: safe://hyryyyyj1t6qk37fqc4ki5tw8g5p1oup3p4ezceoa888cdb43wwh75enp7w
XOR name: 0x328f9cacf4ae66955dc68736db284db96e9176221839cec18759a539dda04ded
Native data type: PublicFile
Media type: Unknown
== Checking data replicas of resolved content ==
XOR-URL: safe://hyryyyyj1t6qk37fqc4ki5tw8g5p1oup3p4ezceoa888cdb43wwh75enp7w
Replicas indexes queried: [0]
Content composed of 1 chunk/s:
= Chunk at XOR name 0x328f9cacf4ae66955dc68736db284db96e9176221839cec18759a539dda04ded =
Replica #0: Ok!
willie@gagarin:~$ safe dog -r 1 safe://hyryyyyj1t6qk37fqc4ki5tw8g5p1oup3p4ezceoa888cdb43wwh75enp7w
== URL resolution step 1 ==
Resolved from: safe://hyryyyyj1t6qk37fqc4ki5tw8g5p1oup3p4ezceoa888cdb43wwh75enp7w
= File =
XOR-URL: safe://hyryyyyj1t6qk37fqc4ki5tw8g5p1oup3p4ezceoa888cdb43wwh75enp7w
XOR name: 0x328f9cacf4ae66955dc68736db284db96e9176221839cec18759a539dda04ded
Native data type: PublicFile
Media type: Unknown
== Checking data replicas of resolved content ==
XOR-URL: safe://hyryyyyj1t6qk37fqc4ki5tw8g5p1oup3p4ezceoa888cdb43wwh75enp7w
Replicas indexes queried: [1]
Content composed of 1 chunk/s:
= Chunk at XOR name 0x328f9cacf4ae66955dc68736db284db96e9176221839cec18759a539dda04ded =
Replica #1: Ok!
willie@gagarin:~$ safe dog -r 2 safe://hyryyyyj1t6qk37fqc4ki5tw8g5p1oup3p4ezceoa888cdb43wwh75enp7w
== URL resolution step 1 ==
Resolved from: safe://hyryyyyj1t6qk37fqc4ki5tw8g5p1oup3p4ezceoa888cdb43wwh75enp7w
= File =
XOR-URL: safe://hyryyyyj1t6qk37fqc4ki5tw8g5p1oup3p4ezceoa888cdb43wwh75enp7w
XOR name: 0x328f9cacf4ae66955dc68736db284db96e9176221839cec18759a539dda04ded
Native data type: PublicFile
Media type: Unknown
== Checking data replicas of resolved content ==
XOR-URL: safe://hyryyyyj1t6qk37fqc4ki5tw8g5p1oup3p4ezceoa888cdb43wwh75enp7w
Replicas indexes queried: [2]
Content composed of 1 chunk/s:
= Chunk at XOR name 0x328f9cacf4ae66955dc68736db284db96e9176221839cec18759a539dda04ded =
Replica #2: Ok!
willie@gagarin:~$ safe dog -r 3 safe://hyryyyyj1t6qk37fqc4ki5tw8g5p1oup3p4ezceoa888cdb43wwh75enp7w
== URL resolution step 1 ==
Resolved from: safe://hyryyyyj1t6qk37fqc4ki5tw8g5p1oup3p4ezceoa888cdb43wwh75enp7w
= File =
XOR-URL: safe://hyryyyyj1t6qk37fqc4ki5tw8g5p1oup3p4ezceoa888cdb43wwh75enp7w
XOR name: 0x328f9cacf4ae66955dc68736db284db96e9176221839cec18759a539dda04ded
Native data type: PublicFile
Media type: Unknown
== Checking data replicas of resolved content ==
XOR-URL: safe://hyryyyyj1t6qk37fqc4ki5tw8g5p1oup3p4ezceoa888cdb43wwh75enp7w
Replicas indexes queried: [3]
Content composed of 1 chunk/s:
= Chunk at XOR name 0x328f9cacf4ae66955dc68736db284db96e9176221839cec18759a539dda04ded =
Replica #3: Ok!
willie@gagarin:~$ safe dog -r 4 safe://hyryyyyj1t6qk37fqc4ki5tw8g5p1oup3p4ezceoa888cdb43wwh75enp7w
== URL resolution step 1 ==
Resolved from: safe://hyryyyyj1t6qk37fqc4ki5tw8g5p1oup3p4ezceoa888cdb43wwh75enp7w
= File =
XOR-URL: safe://hyryyyyj1t6qk37fqc4ki5tw8g5p1oup3p4ezceoa888cdb43wwh75enp7w
XOR name: 0x328f9cacf4ae66955dc68736db284db96e9176221839cec18759a539dda04ded
Native data type: PublicFile
Media type: Unknown
== Checking data replicas of resolved content ==
XOR-URL: safe://hyryyyyj1t6qk37fqc4ki5tw8g5p1oup3p4ezceoa888cdb43wwh75enp7w
Replicas indexes queried: [4]
Content composed of 1 chunk/s:
= Chunk at XOR name 0x328f9cacf4ae66955dc68736db284db96e9176221839cec18759a539dda04ded =
Replica #4: Error received from the network: InsufficientNodeCount { prefix: Prefix(), expected: 5, found: 4 }
Is InsufficientNodeCount really the correct phrase to use in this error message?
It might not be. That’s more about there not being enough nodes to store data. I would have thought youd get a 'DataNotFound` error here. cc @bochaco can you cast an
Technically its correct - there was an InsufficientNodeCount to provide the replica (#4) that I requested safe dog -r 4 but Im sure we could come up with a more helpful error msg.
I had to read the --help a few times to convince myself it was factually correct
Apparently this recognition was a bit too much for @Anselme 's petty and jealous workmates, and they are now trying to take away his achievement by reverting his PR
Well, you are welcome to try, but what once happened, cannot unhappen! And the PR numbers will only increase, no matter what you try!
(Although I must admit I doubted the original PR to begin with, as it was only four lines… Maybe it was done only to achieve the matching a current year event, without any real significance for the project… But a PR is a PR and if no one else seized the opportunity, it’s only their own fault.)
Dunno how many of the issues uncovered by last nights testnet have been addressed in this - but its extremely fast work in any case - well done and I look forward to poking at this either locally or in a testnet