Skip to content

aethelred-foundation/aethelred-sdk-go

Repository files navigation

aethelred-sdk-go

Official Go SDK for the Aethelred blockchain

Security Docs Hygiene Go Reference License

Go Cosmos SDK Docs


Install

go get github.com/aethelred-foundation/aethelred-sdk-go

Quick Start

package main

import (
    "context"
    "fmt"
    "log"

    aethelred "github.com/aethelred-foundation/aethelred-sdk-go"
)

func main() {
    ctx := context.Background()

    // Connect to testnet
    client, err := aethelred.NewClient("https://rpc.testnet.aethelred.io")
    if err != nil {
        log.Fatal(err)
    }
    defer client.Close()

    // Load wallet from mnemonic
    wallet, err := aethelred.WalletFromMnemonic("your twelve word mnemonic...")
    if err != nil {
        log.Fatal(err)
    }

    // Submit a compute job
    job, err := client.PoUW().SubmitJob(ctx, &aethelred.SubmitJobRequest{
        ModelHash:        []byte("abc123..."),
        InputData:        []byte(`{"prompt":"Hello AI"}`),
        VerificationType: "hybrid",
        Priority:         "standard",
        Signer:           wallet,
    })
    if err != nil {
        log.Fatal(err)
    }
    fmt.Printf("Job submitted: %s\n", job.JobID)

    // Query the resulting seal
    seal, err := client.Seal().GetSealByJob(ctx, job.JobID)
    if err != nil {
        log.Fatal(err)
    }
    fmt.Printf("Output hash: %x\n", seal.OutputHash)
    fmt.Printf("Agreement: %d/%d\n", seal.AgreementPower, seal.TotalPower)
}

Full API docs: pkg.go.dev/github.com/aethelred-foundation/aethelred-sdk-go


Development

go test ./...
go vet ./...
golangci-lint run

About

Official Go SDK for the Aethelred network.

Topics

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages