-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
unix-friendly output for 'ipfs dht' commands #2560
Conversation
Could you add some sharness tests using iptb for these now? Now that the output is relatively friendly, thats a much easier task. |
cc @RichardLitt |
@whyrusleeping I'm starting to look at this, but given my understanding of DHTs, tests are going to be very fragile: they're highly timing dependent (read: |
they shouldnt be too fragile. I'd go for at least testing findprovs first. Add something on one node, run a findprovs from another and make sure that node shows up. |
You were right: fragility wasn't a problem here. I guess we're good about setting up DHT population on init + local machine sockets -- awesome! |
Finally passing! I don't think it liked me running |
!remindme when merged. |
GetValue will return the value stored in the DHT at the given key. | ||
Outputs the best value for the given key. | ||
|
||
There may be several different values for a given key stored in the DHT, so this context 'best' means the record that is most desirable. There is no one metric for 'best': it depends entirely on the key type. For IPNS, 'best' is the record that is both valid and has the highest sequence number (freshest). Different key types can specify other 'best' rules. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...so in this context...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch!
@noffle Changes look good, but there's an errant |
I see the extra |
I would avoid the possessive apostrophe here, a bit confusing. |
License: MIT Signed-off-by: Stephen Whitmore <noffle@ipfs.io>
License: MIT Signed-off-by: Stephen Whitmore <noffle@ipfs.io>
License: MIT Signed-off-by: Stephen Whitmore <noffle@ipfs.io>
License: MIT Signed-off-by: Stephen Whitmore <noffle@ipfs.io>
License: MIT Signed-off-by: Stephen Whitmore <noffle@ipfs.io>
License: MIT Signed-off-by: Stephen Whitmore <noffle@ipfs.io>
License: MIT Signed-off-by: Stephen Whitmore <noffle@ipfs.io>
License: MIT Signed-off-by: Stephen Whitmore <noffle@ipfs.io>
License: MIT Signed-off-by: Stephen Whitmore <noffle@ipfs.io>
License: MIT Signed-off-by: Stephen Whitmore <noffle@ipfs.io>
License: MIT Signed-off-by: Stephen Whitmore <noffle@ipfs.io>
License: MIT Signed-off-by: Stephen Whitmore <noffle@ipfs.io>
License: MIT Signed-off-by: Stephen Whitmore <noffle@ipfs.io>
License: MIT Signed-off-by: Stephen Whitmore <noffle@ipfs.io>
License: MIT Signed-off-by: Stephen Whitmore <noffle@ipfs.io>
Removed. |
# ipfs dht findprovs <key> | ||
test_expect_success 'findprovs' ' | ||
ipfsi 4 dht findprovs planet >actual && | ||
PEERS=$(wc -l actual | cut -d '"'"' '"'"' -f 1) && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should check the output here is what we expect.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
License: MIT Signed-off-by: Stephen Whitmore <noffle@ipfs.io>
License: MIT Signed-off-by: Stephen Whitmore <noffle@ipfs.io>
License: MIT Signed-off-by: Stephen Whitmore <noffle@ipfs.io>
License: MIT Signed-off-by: Stephen Whitmore <noffle@ipfs.io>
new tests seem to be failing |
License: MIT Signed-off-by: Richard Littauer <richard.littauer@gmail.com>
License: MIT Signed-off-by: Stephen Whitmore <noffle@ipfs.io>
Got it. |
* Cleans up 'ipfs dht findpeer' output License: MIT Signed-off-by: Stephen Whitmore <noffle@ipfs.io> * Adds more docs for 'ipfs dht put'. License: MIT Signed-off-by: Stephen Whitmore <noffle@ipfs.io> * Write pretty peer ids for ipfs dht put. License: MIT Signed-off-by: Stephen Whitmore <noffle@ipfs.io> * Writes pretty peer ids for ipfs dht query. License: MIT Signed-off-by: Stephen Whitmore <noffle@ipfs.io> * Suppresses unrecognized event type for FinalPeer. License: MIT Signed-off-by: Stephen Whitmore <noffle@ipfs.io> * Improves helptext on dht commands. License: MIT Signed-off-by: Stephen Whitmore <noffle@ipfs.io> * Adds 'ipfs dht findpeer' sharness test. License: MIT Signed-off-by: Stephen Whitmore <noffle@ipfs.io> * Adds sharness tests for remaining DHT commands. License: MIT Signed-off-by: Stephen Whitmore <noffle@ipfs.io> * Uses bash tests rather than 'test' command. License: MIT Signed-off-by: Stephen Whitmore <noffle@ipfs.io> * Removes commented code. License: MIT Signed-off-by: Stephen Whitmore <noffle@ipfs.io> * Removes unneeded init_ipfs. License: MIT Signed-off-by: Stephen Whitmore <noffle@ipfs.io> * Tweaks iptb setup. License: MIT Signed-off-by: Stephen Whitmore <noffle@ipfs.io> * Tweaks wording on dht 'put' and 'get'. License: MIT Signed-off-by: Stephen Whitmore <noffle@ipfs.io> * Removes extraneous ). License: MIT Signed-off-by: Stephen Whitmore <noffle@ipfs.io> * Removes apostrophe. License: MIT Signed-off-by: Stephen Whitmore <noffle@ipfs.io> * Tests the expected peer addresses. License: MIT Signed-off-by: Stephen Whitmore <noffle@ipfs.io> * Gets peer id using iptb. License: MIT Signed-off-by: Stephen Whitmore <noffle@ipfs.io> * Checks explicitly for common put/findprovs peers. License: MIT Signed-off-by: Stephen Whitmore <noffle@ipfs.io> * Sorts expected/actual findpeer results. License: MIT Signed-off-by: Stephen Whitmore <noffle@ipfs.io> * Fix disconnect argument description License: MIT Signed-off-by: Richard Littauer <richard.littauer@gmail.com> * Fixes sort order in t0170-dht.sh. License: MIT Signed-off-by: Stephen Whitmore <noffle@ipfs.io>
* Cleans up 'ipfs dht findpeer' output License: MIT Signed-off-by: Stephen Whitmore <noffle@ipfs.io> * Adds more docs for 'ipfs dht put'. License: MIT Signed-off-by: Stephen Whitmore <noffle@ipfs.io> * Write pretty peer ids for ipfs dht put. License: MIT Signed-off-by: Stephen Whitmore <noffle@ipfs.io> * Writes pretty peer ids for ipfs dht query. License: MIT Signed-off-by: Stephen Whitmore <noffle@ipfs.io> * Suppresses unrecognized event type for FinalPeer. License: MIT Signed-off-by: Stephen Whitmore <noffle@ipfs.io> * Improves helptext on dht commands. License: MIT Signed-off-by: Stephen Whitmore <noffle@ipfs.io> * Adds 'ipfs dht findpeer' sharness test. License: MIT Signed-off-by: Stephen Whitmore <noffle@ipfs.io> * Adds sharness tests for remaining DHT commands. License: MIT Signed-off-by: Stephen Whitmore <noffle@ipfs.io> * Uses bash tests rather than 'test' command. License: MIT Signed-off-by: Stephen Whitmore <noffle@ipfs.io> * Removes commented code. License: MIT Signed-off-by: Stephen Whitmore <noffle@ipfs.io> * Removes unneeded init_ipfs. License: MIT Signed-off-by: Stephen Whitmore <noffle@ipfs.io> * Tweaks iptb setup. License: MIT Signed-off-by: Stephen Whitmore <noffle@ipfs.io> * Tweaks wording on dht 'put' and 'get'. License: MIT Signed-off-by: Stephen Whitmore <noffle@ipfs.io> * Removes extraneous ). License: MIT Signed-off-by: Stephen Whitmore <noffle@ipfs.io> * Removes apostrophe. License: MIT Signed-off-by: Stephen Whitmore <noffle@ipfs.io> * Tests the expected peer addresses. License: MIT Signed-off-by: Stephen Whitmore <noffle@ipfs.io> * Gets peer id using iptb. License: MIT Signed-off-by: Stephen Whitmore <noffle@ipfs.io> * Checks explicitly for common put/findprovs peers. License: MIT Signed-off-by: Stephen Whitmore <noffle@ipfs.io> * Sorts expected/actual findpeer results. License: MIT Signed-off-by: Stephen Whitmore <noffle@ipfs.io> * Fix disconnect argument description License: MIT Signed-off-by: Richard Littauer <richard.littauer@gmail.com> * Fixes sort order in t0170-dht.sh. License: MIT Signed-off-by: Stephen Whitmore <noffle@ipfs.io>
Thanks for this! |
addresses #2494