@@ -13,7 +13,7 @@ def findpeer(self, peer_id, *peer_ids, **kwargs):
13
13
14
14
.. code-block:: python
15
15
16
- >>> client.dht_findpeer ("QmaxqKpiYNr62uSFBhxJAMmEMkT6dvc3oHkrZN … MTLZ")
16
+ >>> client.dht.findpeer ("QmaxqKpiYNr62uSFBhxJAMmEMkT6dvc3oHkrZN … MTLZ")
17
17
[{'ID': 'QmfVGMFrwW6AV6fTWmD6eocaTybffqAvkVLXQEFrYdk6yc',
18
18
'Extra': '', 'Type': 6, 'Responses': None},
19
19
{'ID': 'QmTKiUdjbRjeN9yPhNhG1X38YNuBdjeiV9JXYWzCAJ4mj5',
@@ -38,7 +38,8 @@ def findpeer(self, peer_id, *peer_ids, **kwargs):
38
38
39
39
Returns
40
40
-------
41
- dict : List of multiaddrs
41
+ dict
42
+ List of multiaddrs
42
43
"""
43
44
args = (peer_id ,) + peer_ids
44
45
return self ._client .request ('/dht/findpeer' , args , decoder = 'json' , ** kwargs )
@@ -49,7 +50,7 @@ def findprovs(self, cid, *cids, **kwargs):
49
50
50
51
.. code-block:: python
51
52
52
- >>> client.dht_findprovs ("QmNPXDC6wTXVmZ9Uoc8X1oqxRRJr4f1sDuyQu … mpW2")
53
+ >>> client.dht.findprovs ("QmNPXDC6wTXVmZ9Uoc8X1oqxRRJr4f1sDuyQu … mpW2")
53
54
[{'ID': 'QmaxqKpiYNr62uSFBhxJAMmEMkT6dvc3oHkrZNpH2VMTLZ',
54
55
'Extra': '', 'Type': 6, 'Responses': None},
55
56
{'ID': 'QmaK6Aj5WXkfnWGoWq7V8pGUYzcHPZp4jKQ5JtmRvSzQGk',
@@ -72,12 +73,13 @@ def findprovs(self, cid, *cids, **kwargs):
72
73
73
74
Parameters
74
75
----------
75
- cid : Union[str, cid.BaseCID ]
76
+ cid : Union[str, cid.CIDv0, cid.CIDv1 ]
76
77
The DHT key to find providers for
77
78
78
79
Returns
79
80
-------
80
- dict : List of provider Peer IDs
81
+ dict
82
+ List of provider Peer IDs
81
83
"""
82
84
args = (str (cid ),) + tuple (str (c ) for c in cids )
83
85
return self ._client .request ('/dht/findprovs' , args , decoder = 'json' , ** kwargs )
@@ -138,7 +140,7 @@ def put(self, key, value, **kwargs):
138
140
139
141
.. code-block:: python
140
142
141
- >>> client.dht_put ("QmVgNoP89mzpgEAAqK8owYoDEyB97Mkc … E9Uc", "test123")
143
+ >>> client.dht.put ("QmVgNoP89mzpgEAAqK8owYoDEyB97Mkc … E9Uc", "test123")
142
144
[{'ID': 'QmfLy2aqbhU1RqZnGQyqHSovV8tDufLUaPfN1LNtg5CvDZ',
143
145
'Extra': '', 'Type': 5, 'Responses': None},
144
146
{'ID': 'QmZ5qTkNvvZ5eFq9T4dcCEK7kX8L7iysYEpvQmij9vokGE',
@@ -169,7 +171,7 @@ def query(self, peer_id, *peer_ids, **kwargs):
169
171
170
172
.. code-block:: python
171
173
172
- >>> client.dht_query ("/ip4/104.131.131.82/tcp/4001/ipfs/QmaCpDM … uvuJ")
174
+ >>> client.dht.query ("/ip4/104.131.131.82/tcp/4001/ipfs/QmaCpDM … uvuJ")
173
175
[{'ID': 'QmPkFbxAQ7DeKD5VGSh9HQrdS574pyNzDmxJeGrRJxoucF',
174
176
'Extra': '', 'Type': 2, 'Responses': None},
175
177
{'ID': 'QmR1MhHVLJSLt9ZthsNNhudb1ny1WdhY4FPW21ZYFWec4f',
@@ -187,7 +189,8 @@ def query(self, peer_id, *peer_ids, **kwargs):
187
189
188
190
Returns
189
191
-------
190
- dict : List of peers IDs
192
+ dict
193
+ List of peers IDs
191
194
"""
192
195
args = (peer_id ,) + peer_ids
193
196
return self ._client .request ('/dht/query' , args , decoder = 'json' , ** kwargs )
0 commit comments