Open hackergrrl opened 8 years ago
Heres what I would like to see as output for the various subcommands of ipfs dht
And for each of those, a verbose flag that prints the dht debugging events as they come in, making sure there arent any missed event types.
What format would you like to see for a PeerID
?
QmRc5iJERYKMjFsJ57jsxJhUjf86HL1WyqrQBTJrCCAnKN
/ipfs/QmRc5iJERYKMjFsJ57jsxJhUjf86HL1WyqrQBTJrCCAnKN
/ip6/2601:646:8500:1f00:7256:81ff:feb1:c7bd/tcp/4001/ipfs/QmRc5iJERYKMjFsJ57jsxJhUjf86HL1WyqrQBTJrCCAnKN
peer IDs are just the Qm... hash
One more: how about ipfs dht put
?
ehm... i guess it should take input from a file or standard in, and print out the peer IDs of peers that it stored a record with
I've tackled most of these with https://github.com/ipfs/go-ipfs/pull/2560, but two trickier pieces remain:
Since all output comes from the daemon over a single channel, we'll need to wrap its output in a struct or similar so it can be multiplexed to (stdout, stderr) on the receiving end.
ipfs dht get
Records are generally binary, so newline delimited output doesn't work here. We'll need to figure out how we'd like to format this output (newline'd base64? JSON?) to be maximally useful for users of this feature.
Work Items
ipfs dht findprovs
: lists the full peerIDs of providers, one per line (https://github.com/ipfs/go-ipfs/pull/2560)ipfs dht findpeer
: lists multiaddrs discovered for the given peer, one per line (https://github.com/ipfs/go-ipfs/pull/2560)ipfs dht get
: outputs the single best value selected for that key (https://github.com/ipfs/go-ipfs/pull/2560)ipfs dht query
: lists of closest peer IDs, one per line (https://github.com/ipfs/go-ipfs/pull/2560)ipfs dht put
: lists the peer IDs of the peers that it stored a record with (https://github.com/ipfs/go-ipfs/pull/2560)Summary
Today:
Imagined output:
Important properties:
This makes the commands much friendlier to unix scripts -- IDs can be grabbed and fed into e.g.
ipfs dht findpeer
more or less directly! We could still retain a-s|--simple
option that gives short PeerIDs for existing compatibility, and keep-v|--verbose
for detailed human output.cc @whyrusleeping