For the complete documentation index, see llms.txt. This page is also available as Markdown.

Retrieve Data from the Network

Download a public image from the Autonomi Network without a wallet, a payment, or an address of your own. This walkthrough uses a local daemon, a background service called antd, so your application can request data without managing its own network connection.

For libraries that connect directly without this service, use the Python SDK or Node SDK. The steps here use cURL or a client for antd; Language Bindings covers other supported client languages.

Steps

1

Start the local service

Follow Start the Local Daemon through its installation, wallet-free startup, and connection check, choosing the instructions for your operating system. Return here once the first terminal shows REST server listening on 127.0.0.1:8082 and the health response contains "status": "ok".

Keep antd running in that same first terminal. If you already completed that guide, reuse the running service; do not start a second copy. The health response confirms the local API responds, while the download below tests retrieval from the Autonomi Network.

2

Install your chosen client

In a second terminal, create a project directory. These two commands work in macOS/Linux shells and Windows PowerShell:

mkdir autonomi-read
cd autonomi-read

If you already have a project from another SDK guide, open its directory instead. Keep using that directory for installation, the example file, and the run command. Choose the same language tab in this step and the download step. These installations add application clients, not the antd executable. The Python and Node.js examples use antd client 0.2 with antd 0.14; the Rust example uses the v0.12.1 client source.

Use cURL to make HTTP requests without a language library. Check that it is available on macOS or Linux:

curl --version

On Windows, use PowerShell and the executable name curl.exe, not the curl alias:

curl.exe --version

Expect a cURL version line. If the command is missing, install cURL before continuing.

Use Python 3.10 or later. Create and activate a virtual environment so the client is installed only for this project.

On macOS or Linux:

python3 -m venv .venv
. .venv/bin/activate
python -m pip install 'antd[rest]'

On Windows PowerShell:

py -m venv .venv
if ($LASTEXITCODE -ne 0) { throw 'Virtual environment creation failed.' }
.\.venv\Scripts\Activate.ps1
if (-not $?) { throw 'Activation failed; use the virtual environment executable directly as described below.' }
python -m pip install 'antd[rest]'

If PowerShell blocks activation, do not change your system policy: use .\.venv\Scripts\python.exe -m pip install 'antd[rest]', then .\.venv\Scripts\python.exe download.py for the run command. If you reopen a terminal, activate the environment again or use its Python executable directly.

Use Node.js 18 or later with npm. Install the client and the tools to run the TypeScript file:

npm install @withautonomi/antd
npm install --save-dev @types/node tsx typescript

These commands also work in Windows PowerShell. npm creates the local package files for a new project; an existing project keeps its package settings.

Install Rust and Cargo, Git, and protoc (the Protocol Buffers compiler). The client build needs protoc even when your application uses REST. Your Rust toolchain also needs your platform's linker and C/C++ build tools.

The antd-client crate is not published on crates.io. Use the exact v0.12.1 source below; this client source pin is separate from the antd executable version. These setup commands use Bash or zsh on macOS/Linux:

In Windows PowerShell, use:

For a new project, replace Cargo.toml with the following complete file. For an existing Rust project, skip cargo init and add only these dependency entries, adjusting the source path if necessary. Keep the full cloned source tree: its antd/proto directory is required during compilation.

3

Download the example image

Use the supplied public address to save autonomi-example.jpg in your project directory. You do not need to upload anything first. The examples refuse to replace an existing file with that name; choose another output filename if needed.

On macOS or Linux, run this in Bash or zsh. The /stream endpoint returns the image bytes directly:

ADDRESS="711c7e20006ff3e0ac6c1f3063286a0c1a3e4c409642e8c526173fa60bb7078a"
if [ -e autonomi-example.jpg ] || [ -L autonomi-example.jpg ]; then
  printf 'autonomi-example.jpg already exists; choose another output name.\n' >&2
else
  curl --fail --show-error \
    "http://localhost:8082/v1/data/public/$ADDRESS/stream" \
    --output autonomi-example.jpg &&
    printf 'Saved autonomi-example.jpg\n'
fi

On Windows PowerShell:

$address = '711c7e20006ff3e0ac6c1f3063286a0c1a3e4c409642e8c526173fa60bb7078a'
if (Test-Path -LiteralPath autonomi-example.jpg) {
    throw 'autonomi-example.jpg already exists; choose another output name.'
}
curl.exe --fail --show-error "http://localhost:8082/v1/data/public/$address/stream" --output autonomi-example.jpg
if ($LASTEXITCODE -ne 0) { throw 'Download failed.' }
Write-Output 'Saved autonomi-example.jpg'

Create download.py in your project directory:

from pathlib import Path

from antd import AntdClient

address = "711c7e20006ff3e0ac6c1f3063286a0c1a3e4c409642e8c526173fa60bb7078a"
output = Path("autonomi-example.jpg")

try:
    with AntdClient() as client:
        data = client.data_get_public(address)
    with output.open("xb") as image:
        image.write(data)
except Exception as error:
    raise SystemExit(f"Download failed: {error}") from error

print(f"Saved {len(data)} bytes to {output}")

Run it with the virtual environment active:

python download.py

Create download.ts in your project directory:

Run it on macOS, Linux, or Windows PowerShell:

Replace the new project's src/main.rs with this complete program:

From the directory containing Cargo.toml, run:

4

Open the image

Open autonomi-example.jpg from your project directory in an image viewer. You have downloaded a 138,931-byte JPEG from the Autonomi Network without configuring a wallet.

The Python, Node.js / TypeScript, and Rust programs print:

Saved 138931 bytes to autonomi-example.jpg

cURL prints Saved autonomi-example.jpg after a successful download. If a download reports an error, do not treat any partial output file as complete; choose a new filename before retrying.

5

Retrieve data at your own address

Replace the example's address value (ADDRESS in Bash) with a public data address supplied by a publisher or returned by an earlier upload. Choose an output filename and extension that match that content, then run the same command again. A public data address is 64 hexadecimal characters; it is not a wallet address or a raw chunk address.

For private content, you need the caller-held DataMap instead of a public address. Continue to Build Read-Only Features for that workflow.

What happened

Your application requested existing public content from the local service. antd fetched it from the Autonomi Network and returned the bytes; the storage payment was handled when the content was uploaded. Keep the first terminal running for more requests, or press Ctrl+C there to stop antd.

Common errors

Symptom
What to do

Connection refused or failed to connect

Check the first terminal: antd must still be running on http://localhost:8082. Wait for its API-listening message before retrying. A healthy local API does not guarantee that every public address is retrievable.

File already exists, EEXIST, or an output-name warning

Choose a new output filename in the example. The programs preserve your existing file.

404 NOT_FOUND during retrieval

No public DataMap was found at the address (NOT_FOUND over gRPC). Confirm the address with its publisher. If /health shows no connected peers, restore connectivity first: without peers, a lookup can also report not found. See REST API errors for more detail.

Next steps

Last updated