-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2b00d72
commit ba37a97
Showing
1 changed file
with
80 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,21 @@ | ||
<?php | ||
|
||
declare (strict_types=1); | ||
declare(strict_types=1); | ||
|
||
/* | ||
* This file is part of the "php-ipfs" package. | ||
* | ||
* (c) Robert Schönthal <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace IPFS\Api; | ||
|
||
use IPFS\Annotation\Api as Endpoint; | ||
use IPFS\Command\Command; | ||
|
||
/** | ||
* @author Robert Schönthal <[email protected]> | ||
* @autogenerated | ||
|
@@ -13,89 +24,94 @@ | |
final class Dht implements Api | ||
{ | ||
/** | ||
* Query the DHT for all of the multiaddresses associated with a Peer ID. | ||
* | ||
* @Endpoint(name="dht:findpeer") | ||
* | ||
* @param string $arg The ID of the peer to search for. | ||
* @param bool $verbose Print extra information. | ||
* | ||
* @return Command | ||
*/ | ||
public function findpeer(string $arg, bool $verbose = false) : Command | ||
* Query the DHT for all of the multiaddresses associated with a Peer ID. | ||
* | ||
* @Endpoint(name="dht:findpeer") | ||
* | ||
* @param string $arg the ID of the peer to search for | ||
* @param bool $verbose print extra information | ||
* | ||
* @return Command | ||
*/ | ||
public function findpeer(string $arg, bool $verbose = false): Command | ||
{ | ||
return new Command(__METHOD__, get_defined_vars()); | ||
} | ||
|
||
/** | ||
* Find peers in the DHT that can provide a specific value, given a key. | ||
* | ||
* @Endpoint(name="dht:findprovs") | ||
* | ||
* @param string $arg The key to find providers for. | ||
* @param bool $verbose Print extra information. | ||
* | ||
* @return Command | ||
*/ | ||
public function findprovs(string $arg, bool $verbose = false) : Command | ||
* Find peers in the DHT that can provide a specific value, given a key. | ||
* | ||
* @Endpoint(name="dht:findprovs") | ||
* | ||
* @param string $arg the key to find providers for | ||
* @param bool $verbose print extra information | ||
* | ||
* @return Command | ||
*/ | ||
public function findprovs(string $arg, bool $verbose = false): Command | ||
{ | ||
return new Command(__METHOD__, get_defined_vars()); | ||
} | ||
|
||
/** | ||
* Given a key, query the DHT for its best value. | ||
* | ||
* @Endpoint(name="dht:get") | ||
* | ||
* @param string $arg The key to find a value for. | ||
* @param bool $verbose Print extra information. | ||
* | ||
* @return Command | ||
*/ | ||
public function get(string $arg, bool $verbose = false) : Command | ||
* Given a key, query the DHT for its best value. | ||
* | ||
* @Endpoint(name="dht:get") | ||
* | ||
* @param string $arg the key to find a value for | ||
* @param bool $verbose print extra information | ||
* | ||
* @return Command | ||
*/ | ||
public function get(string $arg, bool $verbose = false): Command | ||
{ | ||
return new Command(__METHOD__, get_defined_vars()); | ||
} | ||
|
||
/** | ||
* Announce to the network that you are providing given values. | ||
* | ||
* @Endpoint(name="dht:provide") | ||
* | ||
* @param string]: The key[s $arg The key[s] to send provide records for. | ||
* @param bool $verbose Print extra information. | ||
* @param bool $recursive Recursively provide entire graph. | ||
* | ||
* @return Command | ||
*/ | ||
public function provide(string]: The key[s $arg, bool $verbose = false, bool $recursive = false) : Command | ||
* Announce to the network that you are providing given values. | ||
* | ||
* @Endpoint(name="dht:provide") | ||
* | ||
* @param string $arg the key[s] to send provide records for | ||
* @param bool $verbose print extra information | ||
* @param bool $recursive recursively provide entire graph | ||
* | ||
* @return Command | ||
*/ | ||
public function provide(string $arg, bool $verbose = false, bool $recursive = false): Command | ||
{ | ||
return new Command(__METHOD__, get_defined_vars()); | ||
} | ||
|
||
/** | ||
* Write a key/value pair to the DHT. | ||
* | ||
* @Endpoint(name="dht:put") | ||
* | ||
* @param string $arg The key to store the value at. | ||
* @param string $arg1 The value to store. | ||
* @param bool $verbose Print extra information. | ||
* | ||
* @return Command | ||
*/ | ||
public function put(string $arg, string $arg1, bool $verbose = false) : Command | ||
* Write a key/value pair to the DHT. | ||
* | ||
* @Endpoint(name="dht:put") | ||
* | ||
* @param string $arg the key to store the value at | ||
* @param string $arg1 the value to store | ||
* @param bool $verbose print extra information | ||
* | ||
* @return Command | ||
*/ | ||
public function put(string $arg, string $arg1, bool $verbose = false): Command | ||
{ | ||
return new Command(__METHOD__, get_defined_vars()); | ||
} | ||
|
||
/** | ||
* Find the closest Peer IDs to a given Peer ID by querying the DHT. | ||
* | ||
* @Endpoint(name="dht:query") | ||
* | ||
* @param string $arg The peerID to run the query against. | ||
* @param bool $verbose Print extra information. | ||
* | ||
* @return Command | ||
*/ | ||
public function query(string $arg, bool $verbose = false) : Command | ||
* Find the closest Peer IDs to a given Peer ID by querying the DHT. | ||
* | ||
* @Endpoint(name="dht:query") | ||
* | ||
* @param string $arg the peerID to run the query against | ||
* @param bool $verbose print extra information | ||
* | ||
* @return Command | ||
*/ | ||
public function query(string $arg, bool $verbose = false): Command | ||
{ | ||
return new Command(__METHOD__, get_defined_vars()); | ||
} | ||
} | ||
} |