1 | <?php |
||
24 | final class Dht implements Api |
||
25 | { |
||
26 | /** |
||
27 | * Query the DHT for all of the multiaddresses associated with a Peer ID. |
||
28 | * |
||
29 | * @Endpoint(name="dht:findpeer") |
||
30 | * |
||
31 | * @param string $arg the ID of the peer to search for |
||
32 | * @param bool $verbose print extra information |
||
33 | * |
||
34 | * @return Command |
||
35 | */ |
||
36 | public function findpeer(string $arg, bool $verbose = false): Command |
||
40 | |||
41 | /** |
||
42 | * Find peers in the DHT that can provide a specific value, given a key. |
||
43 | * |
||
44 | * @Endpoint(name="dht:findprovs") |
||
45 | * |
||
46 | * @param string $arg the key to find providers for |
||
47 | * @param bool $verbose print extra information |
||
48 | * |
||
49 | * @return Command |
||
50 | */ |
||
51 | public function findprovs(string $arg, bool $verbose = false): Command |
||
55 | |||
56 | /** |
||
57 | * Given a key, query the DHT for its best value. |
||
58 | * |
||
59 | * @Endpoint(name="dht:get") |
||
60 | * |
||
61 | * @param string $arg the key to find a value for |
||
62 | * @param bool $verbose print extra information |
||
63 | * |
||
64 | * @return Command |
||
65 | */ |
||
66 | public function get(string $arg, bool $verbose = false): Command |
||
70 | |||
71 | /** |
||
72 | * Announce to the network that you are providing given values. |
||
73 | * |
||
74 | * @Endpoint(name="dht:provide") |
||
75 | * |
||
76 | * @param string $arg the key[s] to send provide records for |
||
77 | * @param bool $verbose print extra information |
||
78 | * @param bool $recursive recursively provide entire graph |
||
79 | * |
||
80 | * @return Command |
||
81 | */ |
||
82 | public function provide(string $arg, bool $verbose = false, bool $recursive = false): Command |
||
86 | |||
87 | /** |
||
88 | * Write a key/value pair to the DHT. |
||
89 | * |
||
90 | * @Endpoint(name="dht:put") |
||
91 | * |
||
92 | * @param string $arg the key to store the value at |
||
93 | * @param string $arg1 the value to store |
||
94 | * @param bool $verbose print extra information |
||
95 | * |
||
96 | * @return Command |
||
97 | */ |
||
98 | public function put(string $arg, string $arg1, bool $verbose = false): Command |
||
102 | |||
103 | /** |
||
104 | * Find the closest Peer IDs to a given Peer ID by querying the DHT. |
||
105 | * |
||
106 | * @Endpoint(name="dht:query") |
||
107 | * |
||
108 | * @param string $arg the peerID to run the query against |
||
109 | * @param bool $verbose print extra information |
||
110 | * |
||
111 | * @return Command |
||
112 | */ |
||
113 | public function query(string $arg, bool $verbose = false): Command |
||
117 | } |
||
118 |