ipfs/kubo

unix-friendly output for 'ipfs dht' commands

Open

#2,494 建立於 2016年3月23日

在 GitHub 查看
 (6 留言) (0 反應) (0 負責人)Go (13,906 star) (2,725 fork)batch import
exp/novicehelp wanted

描述

Work Items

Summary

Today:

$ ipfs dht findprovs QmNmL1foPtvw25dWR41eeqW5YcLZJA5b3XoKrrBYUwKhnv
QmRc5iJERYKMjFsJ57jsxJhUjf86HL1WyqrQBTJrCCAnKN
* <peer.ID QmT3B2> says use <peer.ID QmPhm1> <peer.ID QmaL57> <peer.ID QmRv1G> <peer.ID QmYHk2> <peer.ID QmSoLn> <peer.ID QmXSyB> <peer.ID QmZyo1> <peer.ID QmRPhq> <peer.ID QmV7E3> <peer.ID QmNMeh> 
* <peer.ID QmRv1G> says use <peer.ID QmPhm1> <peer.ID QmaL57> <peer.ID QmT3B2> <peer.ID QmSNEN> <peer.ID QmYHk2> <peer.ID QmSoLn> <peer.ID QmXSyB> <peer.ID QmZyo1> <peer.ID QmUZax> <peer.ID QmRPhq> <peer.ID QmV7E3> <peer.ID QmNMeh> <peer.ID QmUDHg> <peer.ID QmSoLj> <peer.ID Qmda2A> <peer.ID QmVhJf> <peer.ID QmfBPE> <peer.ID QmZY7M> <peer.ID QmR5Cr> <peer.ID QmaSfi>

Imagined output:

$ ipfs dht findprovs QmNmL1foPtvw25dWR41eeqW5YcLZJA5b3XoKrrBYUwKhnv
QmNh2nZ3tWc8hbAbGNmfQQN9TmPAkpwKztjH8xZvcrv3eF
QmSoLju6m7xTh3DuokvT3886QRYqxAzb1kShaanJgW36yx
QmSoLnSGccFuZQJzRadHn95W2CrSFmZuTdDWP8HXaHca9z
...

Important properties:

  1. no errors inlined into output (or, use stderr at least)
  2. simple, newline-delimited output that is immediately usable for unix programs

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

貢獻者指南