Skip to content

Commit

Permalink
ipfs api can now return ipfs's version number #35
Browse files Browse the repository at this point in the history
  • Loading branch information
cloutier committed Mar 12, 2016
1 parent 7da9c70 commit 298623c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions app/class/ipfs.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,17 @@ public function pinAdd ($hash) {
return $data;
}

public function version () {

$ip = $this->gatewayIP;
$port = $this->gatewayApiPort;

$response = $this->curl("http://$ip:$port/api/v0/version");
$data = json_decode($response, TRUE);

return $data["Version"];
}

private function curl ($url, $data = "") {
$ch = curl_init();

Expand Down

0 comments on commit 298623c

Please sign in to comment.