@@ -28,6 +28,9 @@ class Client(object):
28
28
block_stat -- returns a dict with the size of the block with the given hash
29
29
block_get -- returns the raw contents of a block
30
30
block_put -- stores input as an IPFS block
31
+ bitswap_wantlist -- show blocks currently on the wantlist
32
+ bitswap_stat -- show some diagnostic information on the bitswap agent
33
+ bitswap_unwant -- remove a given block from wantlist
31
34
object_data -- returns the raw bytes in an IPFS object
32
35
object_new -- creates a new object from an ipfs template
33
36
object_links -- returns the links pointed to by the specified object
@@ -121,6 +124,10 @@ def __init__(self, host=None, port=None,
121
124
self ._block_get = ArgCommand ('/block/get' )
122
125
self ._block_put = FileCommand ('/block/put' )
123
126
self ._object_new = ArgCommand ('/object/new' )
127
+ self ._bitswap_wantlist = ArgCommand ('/bitswap/wantlist' )
128
+ self ._bitswap_stat = Command ('/bitswap/stat' )
129
+ self ._bitswap_unwant = ArgCommand ('/bitswap/unwant' )
130
+
124
131
self ._object_data = ArgCommand ('/object/data' )
125
132
self ._object_links = ArgCommand ('/object/links' )
126
133
self ._object_get = ArgCommand ('/object/get' )
@@ -318,6 +325,30 @@ def block_put(self, file, **kwargs):
318
325
"""
319
326
return self ._block_put .request (self ._client , (), file , ** kwargs )
320
327
328
+ def bitswap_wantlist (self , peer = None , ** kwargs ):
329
+ """
330
+ Show blocks currently on the wantlist.
331
+
332
+ :param peer: Peer to show wantlist for.
333
+ """
334
+ return self ._bitswap_wantlist .request (self ._client , peer , ** kwargs )
335
+
336
+ def bitswap_stat (self , ** kwargs ):
337
+ """
338
+ Show some diagnostic information on the bitswap agent.
339
+ """
340
+
341
+ return self ._bitswap_stat .request (self ._client , ** kwargs )
342
+
343
+ def bitswap_unwant (self , key , ** kwargs ):
344
+ """
345
+ Remove a given block from wantlist.
346
+
347
+ :param key: Key to remove from wantlist.
348
+ """
349
+
350
+ return self ._bitswap_unwant .request (self ._client , key , ** kwargs )
351
+
321
352
def object_data (self , multihash , ** kwargs ):
322
353
r"""Returns the raw bytes in an IPFS object.
323
354
0 commit comments