Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ Data, chunks and files are immutable: new content gets a new address. Pointers a

### Pointers

A pointer is a small, owner-signed, mutable reference. Its address is derived from the owner's key and never changes; what it points at (a chunk, such as a public file's address, or another pointer) can be changed by the owner. Publish the pointer's address once, then move it to each new version. Pointers need the first antd release with pointers (after 0.15.0).
A pointer is a small, owner-signed, mutable reference. Its address is derived from the owner's key and never changes; what it points at (a chunk, such as a public file's address, or another pointer) can be changed by the owner. Publish the pointer's address once, then move it to each new version. Pointers need antd 0.16.0 or later (the first release with pointers).

- **antd holds the owner keys.** Create one with `ant pointer keygen --output <file>` (the Autonomi `ant` CLI) and start antd with `--pointer-keys <file-or-dir>` (env `ANTD_POINTER_KEYS_DIR`); it loads them at startup. Requests name a pointer by its address, never by a key. Without the flag, pointers can be read but not written. A pointer key cannot be rotated: see [SECURITY.md](SECURITY.md).
- **Every write pays.** A create, update or transfer costs about the price of one chunk, from the daemon wallet or an external signer (`pointer_prepare` / `pointer_finalize`). Every attempt pays again, so the SDKs never retry a paid pointer write. Reads (`get`, `resolve`, `finality`, `controller`, `keys`) are free.
Expand Down Expand Up @@ -463,7 +463,7 @@ The MCP server has 10 pointer tools: the reads are free, `pointer_create`, `poin

### Manifests

A manifest describes a set of files as one `.ant` document, or as one `ant://manifest/` link when it is small enough. Each entry has an optional path and size and either a public file's address or an embedded DataMap (a private file: the manifest is then its key). Share the link and the receiver can decode it, learn what is in the set and download each file with the existing download calls. Manifests need the antd release after 0.15.0.
A manifest describes a set of files as one `.ant` document, or as one `ant://manifest/` link when it is small enough. Each entry has an optional path and size and either a public file's address or an embedded DataMap (a private file: the manifest is then its key). Share the link and the receiver can decode it, learn what is in the set and download each file with the existing download calls. Manifests need antd 0.16.0 or later.

- **Nothing is uploaded or paid for.** Upload the files first, then build from the addresses and DataMaps the uploads returned. Build and decode read the network only to resolve DataMaps, so they can time out; retrying is safe. The daemon needs no wallet for them.
- **Three calls**, in every SDK: `build_manifest`, `decode_manifest` (raw `.ant` bytes) and `decode_manifest_link` (a manifest link, file link or bare address), cased per language. `resolve` also reads each entry's DataMap from the network to report its `exact_size`. REST carries the `.ant` bytes as base64; the SDKs always take and return raw bytes.
Expand Down
6 changes: 3 additions & 3 deletions ant-dev/src/ant_dev/cmd_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,12 +255,12 @@ def _venv_python() -> str:
# Examples that `all` skips. Run them by name instead. The pointers example
# pays from the daemon wallet on every run and needs a never-written owner
# address in ANTD_POINTER_OWNER (a pointer is created once per owner). The
# manifests example needs an antd with the manifest API (the release after
# 0.15.0) and each run pays for two small public uploads.
# manifests example needs antd 0.16.0 or later (the manifest API) and each
# run pays for two small public uploads.
OPT_IN_EXAMPLES: dict[str, str] = {
"pointers": "needs ANTD_POINTER_OWNER set to an unused owner address whose "
"key antd holds; each run pays",
"manifests": "needs the antd release after 0.15.0 (manifest API); each run "
"manifests": "needs antd 0.16.0 or later (manifest API); each run "
"pays for two small uploads",
}

Expand Down
6 changes: 3 additions & 3 deletions antd-cpp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,8 @@ On `Client`, `AsyncClient` (as `std::future`s) and `GrpcClient`. See [Pointers](

## Pointers

A pointer is a small, owner-signed, mutable reference (needs the antd release
after 0.15.0, the first with pointers). Its address is derived from its
A pointer is a small, owner-signed, mutable reference (needs antd 0.16.0 or
later, the first release with pointers). Its address is derived from its
owner's key and never changes. What it points at (a chunk, such as a public
file's data map, or another pointer) can be updated by the owner, and the
owner can hand the pointer over to another pointer for good. The daemon signs
Expand Down Expand Up @@ -451,7 +451,7 @@ A manifest (ADR-0006) is a `.ant` file, or an `ant://manifest/` link, that
describes a set of files: each with an optional path and size, and either an
embedded DataMap (a private upload; the manifest is its key) or a public
DataMap address. The daemon builds and decodes them, so the format is never
re-implemented here. Needs the antd release after 0.15.0.
re-implemented here. Needs antd 0.16.0 or later.

**Nothing is uploaded or paid for.** Upload the files first (`data_put`,
`file_put_public`, ...), then describe them. The daemon reads the network
Expand Down
8 changes: 4 additions & 4 deletions antd-cpp/include/antd/client.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,8 @@ class Client {

// --- Manifests ---
//
// `.ant` manifests and `ant://` links (ADR-0006; needs the antd release
// after 0.15.0). Nothing is uploaded or paid for. The `.ant` bytes are
// `.ant` manifests and `ant://` links (ADR-0006; needs antd 0.16.0
// or later). Nothing is uploaded or paid for. The `.ant` bytes are
// raw bytes here; the client handles REST's base64. See manifests.hpp for
// the types.

Expand Down Expand Up @@ -298,8 +298,8 @@ class Client {

// --- Pointers ---
//
// Owner-signed, paid, mutable references (antd with the pointer API,
// after 0.15.0). The daemon signs with owner keys it loaded at startup
// Owner-signed, paid, mutable references (antd 0.16.0 or
// later). The daemon signs with owner keys it loaded at startup
// (`antd --pointer-keys`); a write names the pointer by its address
// (`owner`), and an owner the daemon holds no key for is a
// BadRequestError.
Expand Down
2 changes: 1 addition & 1 deletion antd-cpp/include/antd/errors.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ inline void throw_for_error_code(std::string_view code, const std::string& messa
if (code == "CLOSE_GROUP_SHORTFALL") throw CloseGroupShortfallError(message, retryable);
}

/// Metadata key the daemon (with the pointer API, after 0.15.0) sets on gRPC
/// Metadata key the daemon (0.16.0 or later) sets on gRPC
/// statuses whose code is shared with older errors, carrying the REST `code`.
inline constexpr std::string_view kErrorCodeMetadataKey = "x-antd-error-code";

Expand Down
2 changes: 1 addition & 1 deletion antd-csharp/Antd.Sdk/IAntdClient.Manifests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ namespace Antd.Sdk;

public partial interface IAntdClient
{
// Manifests (the antd release after 0.15.0, the first with the manifest
// Manifests (antd 0.16.0 or later, the first release with the manifest
// API): ADR-0006 `.ant` files and `ant://` links.
//
// Nothing is uploaded or paid for. Build and a resolving decode read
Expand Down
2 changes: 1 addition & 1 deletion antd-csharp/Antd.Sdk/IAntdClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public partial interface IAntdClient : IDisposable, IAsyncDisposable
/// </exception>
Task<FinalizeMerkleUploadResult> FinalizeMerkleUploadAsync(string uploadId, string winnerPoolHash);

// Pointers (antd with the pointer API, after 0.15.0).
// Pointers (antd 0.16.0 or later).
//
// Every write (create, update, transfer, finalize) pays, about the price
// of one chunk, and every attempt pays again: the SDK never retries them,
Expand Down
2 changes: 1 addition & 1 deletion antd-csharp/Examples/Example09Manifests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ partial class Program
/// size.
///
/// Building and decoding upload and pay for nothing; only the two uploads
/// pay. Needs the antd release after 0.15.0 and a wallet;
/// pay. Needs antd 0.16.0 or later and a wallet;
/// <c>ANTD_BASE_URL</c> overrides the daemon URL (default
/// http://localhost:8082). Run explicitly (<c>dotnet run -- 9</c>); "all"
/// leaves it out, so it still runs against older daemons.
Expand Down
2 changes: 1 addition & 1 deletion antd-csharp/Examples/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ static async Task Main(string[] args)
await Example06_PrivateData();
await Example07_ExternalSigner();
break;
// Not part of "all": it needs the antd release after 0.15.0.
// Not part of "all": it needs antd 0.16.0 or later.
case "9" or "manifests": await Example09_Manifests(); break;
default:
Console.WriteLine($"Unknown example: {example}. Use 1-9, 'pointers', 'manifests' or 'all'.");
Expand Down
8 changes: 4 additions & 4 deletions antd-csharp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ dotnet add package Autonomi.Antd

## Compatibility

This package talks to a running [antd](https://github.com/WithAutonomi/ant-sdk/tree/main/antd) daemon; it does not join the network itself. Targets .NET 8. Tested against antd 0.12.x; the pointer methods need the antd release after 0.15.0, the first with pointers. The gRPC transport uses `Grpc.Net.Client`, which is a package dependency, so both transports work out of the box. For a daemon-less client see [`Autonomi.Ffi`](https://www.nuget.org/packages/Autonomi.Ffi).
This package talks to a running [antd](https://github.com/WithAutonomi/ant-sdk/tree/main/antd) daemon; it does not join the network itself. Targets .NET 8. Tested against antd 0.12.x; the pointer methods need antd 0.16.0 or later, the first release with pointers. The gRPC transport uses `Grpc.Net.Client`, which is a package dependency, so both transports work out of the box. For a daemon-less client see [`Autonomi.Ffi`](https://www.nuget.org/packages/Autonomi.Ffi).

## Prerequisites

Expand Down Expand Up @@ -261,7 +261,7 @@ See `Examples/FinalizeRetry.cs` (`FinalizeWithRetryAsync`, used by example 7) an

## Manifests

A manifest (ADR-0006) is a `.ant` file, or an `ant://manifest/` link when it is small enough, that describes a set of files. Each entry has an optional path and size, and either an embedded DataMap (the manifest is then the key to a private file) or a public file's DataMap address. The daemon builds and decodes manifests with ant-core, so the format, content addresses, link encoding and portable path rules are never re-implemented here. The manifest methods need the antd release after 0.15.0.
A manifest (ADR-0006) is a `.ant` file, or an `ant://manifest/` link when it is small enough, that describes a set of files. Each entry has an optional path and size, and either an embedded DataMap (the manifest is then the key to a private file) or a public file's DataMap address. The daemon builds and decodes manifests with ant-core, so the format, content addresses, link encoding and portable path rules are never re-implemented here. The manifest methods need antd 0.16.0 or later.

**Nothing is uploaded or paid for.** Building and decoding are free. The daemon reads the network only to resolve DataMaps (the root-embedding policy on build, and `resolve` on decode), so a call can time out; it is safe to retry.

Expand Down Expand Up @@ -320,7 +320,7 @@ dotnet run -- all # Run all of the above

# Pointers: run explicitly; "all" leaves it out, because every write pays.
ANTD_POINTER_OWNER=<address from GET /v1/pointers/keys> dotnet run -- 8 # or: dotnet run -- pointers
dotnet run -- 9 # Manifests (or: dotnet run -- manifests; needs the antd release after 0.15.0)
dotnet run -- 9 # Manifests (or: dotnet run -- manifests; needs antd 0.16.0 or later)
```

Example 8 uploads two pieces of public data, creates a pointer at the first, updates it to the second, resolves and reads it, and prints its finality. It needs an antd started with `--pointer-keys` and a wallet; `ANTD_BASE_URL` overrides the daemon URL (default `http://localhost:8082`). Without `ANTD_POINTER_OWNER` it prints a note and skips. A rerun with the same owner skips the create and only updates.
Expand All @@ -332,7 +332,7 @@ ant dev example data -l csharp
ant dev example all -l csharp
```

Example 9 (`dotnet run -- 9`, or `dotnet run -- manifests`) uploads two pieces of public data, builds a manifest of them with paths `notes/one.txt` and `notes/two.txt`, prints its link and entries, and decodes the link with `resolve` to print each entry's exact size. Only the two uploads pay. It is left out of "all" because it needs the antd release after 0.15.0; `ANTD_BASE_URL` overrides the daemon URL (default `http://localhost:8082`).
Example 9 (`dotnet run -- 9`, or `dotnet run -- manifests`) uploads two pieces of public data, builds a manifest of them with paths `notes/one.txt` and `notes/two.txt`, prints its link and entries, and decodes the link with `resolve` to print each entry's exact size. Only the two uploads pay. It is left out of "all" because it needs antd 0.16.0 or later; `ANTD_BASE_URL` overrides the daemon URL (default `http://localhost:8082`).

## Project Structure

Expand Down
6 changes: 3 additions & 3 deletions antd-dart/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

## Unreleased

- Pointers, on both `AntdClient` and `GrpcAntdClient` (needs the antd
release after 0.15.0): `pointerKeys`, `pointerCreate`, `pointerUpdate`,
- Pointers, on both `AntdClient` and `GrpcAntdClient` (needs antd 0.16.0
or later): `pointerKeys`, `pointerCreate`, `pointerUpdate`,
`pointerTransfer`, `pointerGet`, `pointerResolve`, `pointerFinality`,
`pointerController`, and `pointerPrepare` / `pointerFinalize` for an
external signer. Every write pays and every attempt pays again; the SDK
Expand All @@ -25,7 +25,7 @@
the status code, on every call.
- gRPC stubs regenerated with `pointers.proto`. `example/09_pointers.dart`.
- Manifests (ADR-0006 `.ant` files and `ant://` links), on both `AntdClient`
and `GrpcAntdClient` (needs the antd release after 0.15.0):
and `GrpcAntdClient` (needs antd 0.16.0 or later):
`buildManifest(entries, {name, torrentInfoHashes, embedRoots})`,
`decodeManifest(bytes, {resolve})` and `decodeManifestLink(link,
{resolve})`. Nothing is uploaded or paid for. New models
Expand Down
4 changes: 2 additions & 2 deletions antd-dart/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ dependencies:

## Compatibility

This package talks to a running antd daemon; it does not join the network itself. Dart 3.0+. Tested against antd 0.13.x; the `retryable` field behind `PartialUploadError.retryable` / `retentionKnown` is sent by antd 0.14.0 and later (over REST, partial uploads from older daemons read as retention unknown). The [pointer methods](#pointers) need the antd release after 0.15.0, the first with pointers. Both the REST client (`AntdClient`) and the gRPC client (`GrpcAntdClient`) are included; the gRPC stubs are pre-generated, so `protoc` is only needed if you regenerate them.
This package talks to a running antd daemon; it does not join the network itself. Dart 3.0+. Tested against antd 0.13.x; the `retryable` field behind `PartialUploadError.retryable` / `retentionKnown` is sent by antd 0.14.0 and later (over REST, partial uploads from older daemons read as retention unknown). The [pointer methods](#pointers) need antd 0.16.0 or later, the first release with pointers. Both the REST client (`AntdClient`) and the gRPC client (`GrpcAntdClient`) are included; the gRPC stubs are pre-generated, so `protoc` is only needed if you regenerate them.

## Quick Start

Expand Down Expand Up @@ -247,7 +247,7 @@ See [`example/09_pointers.dart`](example/09_pointers.dart) for a full round trip

### Manifests

A manifest (ADR-0006) is a `.ant` file that names a set of files: each entry has an optional path and size and either an embedded DataMap (a private upload; the manifest is the key to it) or a public file's DataMap address. A small one also fits in an `ant://manifest/...` link. The daemon builds and decodes them, so you never handle the format yourself. **Nothing is uploaded or paid for:** a manifest describes data that is already stored. The methods need the antd release after 0.15.0, and both `AntdClient` and `GrpcAntdClient` have them.
A manifest (ADR-0006) is a `.ant` file that names a set of files: each entry has an optional path and size and either an embedded DataMap (a private upload; the manifest is the key to it) or a public file's DataMap address. A small one also fits in an `ant://manifest/...` link. The daemon builds and decodes them, so you never handle the format yourself. **Nothing is uploaded or paid for:** a manifest describes data that is already stored. The methods need antd 0.16.0 or later, and both `AntdClient` and `GrpcAntdClient` have them.

| Method | Description |
|--------|-------------|
Expand Down
10 changes: 5 additions & 5 deletions antd-dart/lib/src/client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ class AntdClient {
/// DataMaps exactly as given. That resolution reads from the network, so
/// the call can time out; it is safe to retry.
///
/// Requires the antd release after 0.15.0.
/// Requires antd 0.16.0 or later.
Future<BuiltManifest> buildManifest(
List<ManifestEntryInput> entries, {
String? name,
Expand Down Expand Up @@ -533,7 +533,7 @@ class AntdClient {
/// out; it is safe to retry. Bytes that are not a manifest throw
/// [BadRequestError].
///
/// Requires the antd release after 0.15.0.
/// Requires antd 0.16.0 or later.
Future<DecodedManifest> decodeManifest(
Uint8List manifest, {
bool resolve = false,
Expand All @@ -553,7 +553,7 @@ class AntdClient {
/// [DecodedManifest.source] `"file_link"`: one public entry with no path.
/// See [decodeManifest] for [resolve].
///
/// Requires the antd release after 0.15.0.
/// Requires antd 0.16.0 or later.
Future<DecodedManifest> decodeManifestLink(
String link, {
bool resolve = false,
Expand Down Expand Up @@ -691,8 +691,8 @@ class AntdClient {

// --- Pointers ---
//
// Owner-signed, paid, mutable references (needs an antd with the pointer
// API, the first release after 0.15.0). A pointer's address is derived from
// Owner-signed, paid, mutable references (needs antd 0.16.0 or
// later, the first release with pointers). A pointer's address is derived from
// its owner's key and never changes; what it points at can be updated by
// the owner, who can also hand it over to another pointer for good.
//
Expand Down
6 changes: 3 additions & 3 deletions antd-dart/lib/src/grpc_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ class GrpcAntdClient {
/// [BadRequestError] before anything is sent; the daemon's INVALID_ARGUMENT
/// for the rest (naming `entries[i]`) is a [BadRequestError].
///
/// Requires the antd release after 0.15.0.
/// Requires antd 0.16.0 or later.
Future<BuiltManifest> buildManifest(
List<ManifestEntryInput> entries, {
String? name,
Expand Down Expand Up @@ -644,7 +644,7 @@ class GrpcAntdClient {
/// Decodes `.ant` bytes. Nothing is uploaded or paid for. See
/// [AntdClient.decodeManifest] for [resolve].
///
/// Requires the antd release after 0.15.0.
/// Requires antd 0.16.0 or later.
Future<DecodedManifest> decodeManifest(
Uint8List manifest, {
bool resolve = false,
Expand All @@ -660,7 +660,7 @@ class GrpcAntdClient {
/// Decodes an `ant://` manifest link, file link or bare 64-hex address.
/// See [AntdClient.decodeManifestLink].
///
/// Requires the antd release after 0.15.0.
/// Requires antd 0.16.0 or later.
Future<DecodedManifest> decodeManifestLink(
String link, {
bool resolve = false,
Expand Down
6 changes: 3 additions & 3 deletions antd-elixir/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,8 @@ All functions take a `%Antd.Client{}` as the first argument. Each returns `{:ok,

### Pointers

A pointer is a small, owner-signed, mutable reference (needs the antd release
after 0.15.0, the first with pointers). Its address is derived from its
A pointer is a small, owner-signed, mutable reference (needs antd 0.16.0 or
later, the first release with pointers). Its address is derived from its
owner's key and never changes. What it points at (a chunk, such as a public
file's or public data's address, or another pointer) can be changed by the
owner, and the owner can hand the pointer over to another pointer for good.
Expand Down Expand Up @@ -448,7 +448,7 @@ A manifest (ADR-0006) is one `.ant` file, or an `ant://manifest/` link, that
describes a set of files: each entry has an optional path and size and either
an embedded DataMap (the key to a private upload) or a public DataMap address.
The daemon builds and decodes manifests through ant-core, so the SDK never
re-implements the format. Needs the antd release after 0.15.0.
re-implements the format. Needs antd 0.16.0 or later.

**Nothing is uploaded or paid for.** Building and decoding read the network
only to resolve DataMaps (the embedding policy on build, `resolve: true` on
Expand Down
Loading
Loading