-
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.
1 parent
e0da087
commit 2b00d72
Showing
20 changed files
with
344 additions
and
110 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
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
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
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
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
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 |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<?php | ||
|
||
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 | ||
* @codeCoverageIgnore | ||
*/ | ||
final class Dag implements Api | ||
{ | ||
/** | ||
* Get a dag node from ipfs. | ||
* | ||
* @Endpoint(name="dag:get") | ||
* | ||
* @param string $arg the object to get Required: | ||
* | ||
* @return Command | ||
*/ | ||
public function get(string $arg): Command | ||
{ | ||
return new Command(__METHOD__, get_defined_vars()); | ||
} | ||
|
||
/** | ||
* Add a dag node to ipfs. | ||
* | ||
* @Endpoint(name="dag:put") | ||
* | ||
* @param string $file the object to put Required: | ||
* @param string $format format that the object will be added as | ||
* @param string $inputEnc format that the input object will be | ||
* | ||
* @return Command | ||
*/ | ||
public function put(string $file, string $format = 'cbor', string $inputEnc = 'json'): Command | ||
{ | ||
return new Command(__METHOD__, get_defined_vars()); | ||
} | ||
} |
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,21 +1,10 @@ | ||
<?php | ||
|
||
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. | ||
*/ | ||
|
||
declare (strict_types=1); | ||
namespace IPFS\Api; | ||
|
||
use IPFS\Annotation\Api as Endpoint; | ||
use IPFS\Command\Command; | ||
|
||
/** | ||
* @author Robert Schönthal <[email protected]> | ||
* @autogenerated | ||
|
@@ -24,78 +13,89 @@ | |
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()); | ||
} | ||
|
||
/** | ||
* 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 | ||
* 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 | ||
{ | ||
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 | ||
{ | ||
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()); | ||
} | ||
} | ||
} |
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
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
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 |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/* | ||
* This file is part of the "php-ipfs" package. | ||
* | ||
* (c) Robert Schönthal <robert.schoenthal@gmail.com> | ||
* | ||
* 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 <robert.schoenthal@gmail.com> | ||
* @autogenerated | ||
* @codeCoverageIgnore | ||
*/ | ||
final class Key implements Api | ||
{ | ||
/** | ||
* Create a new keypair. | ||
* | ||
* @Endpoint(name="key:gen") | ||
* | ||
* @param string $arg name of key to create Required: | ||
* @param string $type type of the key to create | ||
* @param int $size size of the key to generate | ||
* | ||
* @return Command | ||
*/ | ||
public function gen(string $arg, string $type = null, int $size = 0): Command | ||
{ | ||
return new Command(__METHOD__, get_defined_vars()); | ||
} | ||
|
||
/** | ||
* List all local keypairs. | ||
* | ||
* @Endpoint(name="key:list") | ||
* | ||
* @param bool $l show extra information about keys | ||
* | ||
* @return Command | ||
*/ | ||
public function list(bool $l = null): Command | ||
{ | ||
return new Command(__METHOD__, get_defined_vars()); | ||
} | ||
} |
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
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
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
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
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 |
---|---|---|
@@ -0,0 +1,81 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/* | ||
* This file is part of the "php-ipfs" package. | ||
* | ||
* (c) Robert Schönthal <robert.schoenthal@gmail.com> | ||
* | ||
* 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 <robert.schoenthal@gmail.com> | ||
* @autogenerated | ||
* @codeCoverageIgnore | ||
*/ | ||
final class Pubsub implements Api | ||
{ | ||
/** | ||
* List subscribed topics by name. | ||
* | ||
* @Endpoint(name="pubsub:ls") | ||
* | ||
* @return Command | ||
*/ | ||
public function ls(): Command | ||
{ | ||
return new Command(__METHOD__, get_defined_vars()); | ||
} | ||
|
||
/** | ||
* List peers we are currently pubsubbing with. | ||
* | ||
* @Endpoint(name="pubsub:peers") | ||
* | ||
* @param string $arg topic to list connected peers of Required: no | ||
* | ||
* @return Command | ||
*/ | ||
public function peers(string $arg = null): Command | ||
{ | ||
return new Command(__METHOD__, get_defined_vars()); | ||
} | ||
|
||
/** | ||
* Publish a message to a given pubsub topic. | ||
* | ||
* @Endpoint(name="pubsub:pub") | ||
* | ||
* @param string $arg topic to publish to | ||
* @param string $arg1 payload of message to publish | ||
* | ||
* @return Command | ||
*/ | ||
public function pub(string $arg, string $arg1): Command | ||
{ | ||
return new Command(__METHOD__, get_defined_vars()); | ||
} | ||
|
||
/** | ||
* Subscribe to messages on a given topic. | ||
* | ||
* @Endpoint(name="pubsub:sub") | ||
* | ||
* @param string $arg string name of topic to subscribe to | ||
* @param bool $discover try to discover other peers subscribed to the same topic | ||
* | ||
* @return Command | ||
*/ | ||
public function sub(string $arg, bool $discover = null): Command | ||
{ | ||
return new Command(__METHOD__, get_defined_vars()); | ||
} | ||
} |
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
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
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
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
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