Download the PHP package autonomi/antd without Composer

On this page you can find all versions of the php package autonomi/antd. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package antd

antd-php

PHP SDK for the antd daemon — the gateway to the Autonomi decentralized network.

Source of truth: this SDK is developed in the ant-sdk monorepo. WithAutonomi/antd-php is a read-only mirror of that directory, kept in sync by CI so Packagist can index it. Open issues and pull requests against ant-sdk; anything pushed to the mirror is overwritten.

Installation

Quick Start

Prerequisites

The antd daemon must be running. Start it with:

Configuration

API Reference

Health

Method Description
health() Check daemon status

Data (Immutable)

Method Description
dataPutPublic(string $data, string $paymentMode = 'auto') Store public data — returns DataPutPublicResult (DataMap stored on-network)
dataGetPublic(string $address) Retrieve public data by address
dataPut(string $data, string $paymentMode = 'auto') Store encrypted private data — returns DataPutResult (DataMap returned to caller)
dataGet(string $dataMap) Retrieve private data using a caller-held DataMap
dataCost(string $data, string $paymentMode = 'auto') Estimate storage cost — returns UploadCostEstimate with size, chunks, gas, payment mode

Chunks

Method Description
chunkPut(string $data) Store a raw chunk
chunkGet(string $address) Retrieve a chunk

Files

Method Description
filePut(string $path, string $paymentMode = 'auto') Upload a file privately — returns FilePutResult (DataMap returned to caller)
fileGet(string $dataMap, string $destPath) Download a private file using a caller-held DataMap
filePutPublic(string $path, string $paymentMode = 'auto') Upload a file publicly — returns FilePutPublicResult (DataMap stored on-network)
fileGetPublic(string $address, string $destPath) Download a public file by address
fileCost(string $path, bool $isPublic, string $paymentMode = 'auto') Estimate upload cost — returns UploadCostEstimate with size, chunks, gas, payment mode

Async Usage

Every method has an Async variant that returns a GuzzleHttp\Promise\PromiseInterface instead of blocking. This lets you fire off multiple requests concurrently and wait for results when you need them.

Basic promise usage

Chaining with then() / otherwise()

Concurrent requests

Settling without throwing

Error Handling

All errors extend AntdError (which extends \RuntimeException) and can be caught by type:

Error Type HTTP Status When
BadRequestError 400 Invalid parameters
PaymentError 402 Insufficient funds
NotFoundError 404 Resource not found
AlreadyExistsError 409 Resource exists
ForkError 409 Version conflict
TooLargeError 413 Payload too large
InternalError 500 Server error
NetworkError 502 Network unreachable
PartialUploadError 502 A finalize stored only part of the upload (code: "PARTIAL_UPLOAD"; extends NetworkError)

Partial uploads

An external-signer finalize (finalizeUpload, finalizeChunkUpload) can fail after the payment settled: some chunks store, others miss quorum after the daemon's own retries. The SDK throws PartialUploadError with chunksStored / chunksFailed / totalChunks and two flags, retryable and retentionKnown (retryable implies retentionKnown). The on-chain payment persists and the stored chunks stay on the network; what to do next depends on the flags:

The body is read strictly: a count comes only from a non-negative JSON integer (anything else reads 0), retryable is true only for the JSON boolean true, retentionKnown is true only when retryable is a JSON boolean (missing, null or any other type reads as unknown), and a code other than the string "PARTIAL_UPLOAD" keeps the plain NetworkError. A malformed error body never escapes as a PHP TypeError; the message falls back to the raw body when error is not a string.

PartialUploadError extends NetworkError, so a pre-existing catch (NetworkError $e) still catches it; catch the subclass first when you need the counts. The full contract is in docs/external-signer-flow.md under "6. Retry a partial store".

Examples

See the examples/ directory:

Versioning and releases

Releases are cut from the monorepo: a php-vX.Y.Z tag on ant-sdk is verified, split, and pushed to the mirror as vX.Y.Z, which Packagist picks up as the package version. There is no version field in composer.json — Composer derives it from the mirror's tags.

License

Dual-licensed under either the Apache-2.0 license, at your option.


All versions of antd with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
ext-json Version *
guzzlehttp/guzzle Version ^7.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package autonomi/antd contains the following files

Loading the files please wait ...