tangle-network / gadget

A framework for building modular AVS and Tangle Blueprints: https://docs.tangle.tools/developers/blueprints.
https://tangle.tools
Apache License 2.0
12 stars 3 forks source link

[TASK] Create `gadget!` macro #253

Closed shekohex closed 4 weeks ago

shekohex commented 1 month ago

Motivation

Create a gadget!({ ... }) macro to specify the gadget field in the blueprint.json file.

Examples

Wasm Gadget

gadget!(
    IncredibleSquaringGadget,
    kind = Wasm,
    runtime = Wasmtime,
    fetchers = [
        IPFS(cid!("QmPK1s3pNYLi9ERiq3BDxKa4XosgWwFRQUydHUtz4YgpqB")),
        GithubFetcher {
            owner: "webb-tools",
            repo: "incredible-squaring",
            binaries: [{ arch: Wasm, os: Unknown, name: "incredible-squaring-gadget.wasm" }]
        },
    ],
);

Native Gadget

gadget!(
    IncredibleSquaringGadget,
    kind = Native,
    fetchers = [
        GithubFetcher {
            owner: "webb-tools",
            repo: "incredible-squaring",
            binaries: [
                { arch: Amd64, os: Linux, name: "incredible-squaring-gadget-linux-amd64" },
            ]
        },
    ],
);

Checklist

shekohex commented 4 weeks ago

This was a bit overlooked task. Instead we should generate these from the blueprint-metadata crate.