Skip to content

Commit 25e6015

Browse files
feat(csipfs): bitswap wantlist for a peer
1 parent a02e040 commit 25e6015

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

IpfsCli/Commands/BitswapCommand.cs

+7-1
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,18 @@ protected override Task<int> OnExecute(CommandLineApplication app)
2626
[Command(Description = "Show blocks currently on the wantlist")]
2727
class BitswapWantListCommand : CommandBase
2828
{
29+
[Option("-p|--peer", Description = "Peer to show wantlist for. Default: self.")]
30+
public string PeerId { get; set; }
31+
2932
BitswapCommand Parent { get; set; }
3033

3134
protected override async Task<int> OnExecute(CommandLineApplication app)
3235
{
3336
var Program = Parent.Parent;
34-
var cids = await Program.CoreApi.Bitswap.WantsAsync();
37+
var peer = PeerId == null
38+
? null
39+
: new MultiHash(PeerId);
40+
var cids = await Program.CoreApi.Bitswap.WantsAsync(peer);
3541
return Program.Output(app, cids, (data, writer) =>
3642
{
3743
foreach (var cid in data)

0 commit comments

Comments
 (0)