Zig

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

Install

.dependencies = .{
    .antd = .{
        .url = "https://github.com/WithAutonomi/ant-sdk/archive/<commit>.tar.gz",
        .hash = "...",
    },
},

Connect to the daemon

const std = @import("std");
const antd = @import("antd");

pub fn main() !void {
    var gpa = std.heap.GeneralPurposeAllocator(.{}){};
    defer _ = gpa.deinit();
    const allocator = gpa.allocator();

    var client = antd.Client.init(allocator, antd.default_base_url);
    defer client.deinit();

    const status = try client.health();
    defer status.deinit(allocator);
    std.debug.print("{s}\n", .{status.network});
}

Store and retrieve data

Type mappings

Autonomi type
Zig type

HealthStatus

Zig struct

PutResult

Zig struct

Raw data

[]const u8

Error handling

Full API reference

For all available daemon endpoints, see the REST API.

Last updated