PHP

The PHP SDK is the PHP client for the antd daemon.

Install

composer require autonomi/antd

Connect to the daemon

<?php

require_once 'vendor/autoload.php';

use Autonomi\Antd\AntdClient;

$client = new AntdClient('http://localhost:8082');
$health = $client->health();
echo $health->network . PHP_EOL;

Store and retrieve data

<?php

require_once 'vendor/autoload.php';

use Autonomi\Antd\AntdClient;

$client = new AntdClient();
$result = $client->dataPutPublic('Hello, Autonomi!');
echo $result->address . PHP_EOL;

$data = $client->dataGetPublic($result->address);
echo $data . PHP_EOL;

Type mappings

Autonomi type
PHP type

HealthStatus

response object

PutResult

response object

Raw data

string

Error handling

Full API reference

For all available daemon endpoints, see the REST API.

Last updated