<?php
// include iota lib
require_once("autoload.php");
// create client
$client = new IOTA\Client\SingleNodeClient();
echo "Health: " . ($client->health() ? "ok" : "error");
This example will output a json string
echo $client->info();
Each method returns an Object to get the direct parameter
$info = $client->info();
echo $info->name;
echo $info->version;
echo $info->isHealthy;
echo $info->networkId;
echo $info->bech32HRP;
echo $info->minPoWScore;
echo $info->messagesPerSecond;
echo $info->referencedMessagesPerSecond;
echo $info->referencedRate;
echo $info->latestMilestoneTimestamp;
echo $info->latestMilestoneIndex;
echo $info->confirmedMilestoneIndex;
echo $info->pruningIndex;
print_r($info->features);
Short example
echo ($client->info())->name;
echo $client->tips();
Please find other examples in the examples folder.
<- Back to Overview