Build Read-Only Features
Last updated
Build read-only Autonomi features when you only need to retrieve data that has already been stored and paid for.
This guide compares the SDK, CLI, and direct Rust ways to build read-only retrieval features so you can choose the right read-only architecture for your application.
Read-only features are simpler than upload-enabled ones.
If your application only reads data that has already been written to the network:
you do not need ANT
you do not need gas
you do not need a wallet
you do not need upload permissions
That can make retrieval-only tools, dashboards, content browsers, and other read-heavy features much easier to build and operate.
A known public address to retrieve, or a DataMap for private data
One of these routes:
SDKs through antd
the ant CLI
native Rust with ant-core
If you do not already have an address or DataMap, create one first by following Store and Retrieve Data with the SDKs or by storing data through the CLI or direct Rust.
With the SDK:
With the CLI:
With Direct Rust:
For public data, you need a public address.
For private data, you need the DataMap or equivalent private retrieval material.
With the SDK, antd can run without AUTONOMI_WALLET_KEY when you only need retrieval.
Public retrieval through the daemon:
Private retrieval through the daemon:
The private retrieval response is JSON with the content returned as base64 in the data field.
With the CLI, public and private file retrieval use ant file download with either a public address or a local .datamap file:
For native Rust, use the retrieval APIs in ant-core after connecting to the network client.
If your application only reads data that has already been stored, it does not need:
AUTONOMI_WALLET_KEY
SECRET_KEY
token approvals
upload payment flows
That means you can keep the architecture focused on retrieval and content handling instead of wallet management.
Your read-only feature is configured correctly when it can retrieve the expected content from a known public address or private DataMap without any wallet setup.
404 Not Found: Check the address.
Trying to use private retrieval without a DataMap: Private content still requires the retrieval metadata even though the content has already been paid for.
Last updated
curl http://localhost:8082/v1/data/public/<address>curl -X POST http://localhost:8082/v1/data/get \
-H "Content-Type: application/json" \
-d '{"data_map":"<hex_encoded_datamap>"}'ant --bootstrap 1.2.3.4:12000 file download <public_address> -o downloaded.bin
ant --bootstrap 1.2.3.4:12000 file download --datamap my_data.bin.datamap -o downloaded.bin