|
| 1 | +# Native Sources |
| 2 | + |
| 3 | +The `Native` source is used for blueprints that compile to a native binary and release via the [`release.yml`] GitHub workflow |
| 4 | +from the blueprint template. |
| 5 | + |
| 6 | +## Requirements |
| 7 | + |
| 8 | +The requirements for running native blueprints are available [here](/operators/manager/requirements#native-sources) |
| 9 | + |
| 10 | +## Format |
| 11 | + |
| 12 | +The `Native` source has the following format: |
| 13 | + |
| 14 | +```rust |
| 15 | +pub struct NativeSource { |
| 16 | + pub owner: String, |
| 17 | + pub repo: String, |
| 18 | + pub tag: String, |
| 19 | + pub binaries: Vec<BlueprintBinary>, |
| 20 | +} |
| 21 | + |
| 22 | +pub struct BlueprintBinary { |
| 23 | + pub arch: Architecture, |
| 24 | + pub os: OperatingSystem, |
| 25 | + pub name: String, |
| 26 | +} |
| 27 | +``` |
| 28 | + |
| 29 | +Where: |
| 30 | + |
| 31 | +- `owner` - The owner of the GitHub repository (e.g., `tangle-network`) |
| 32 | +- `repo` - The name of the repository (e.g., `some-blueprint`) |
| 33 | +- `tag` - The release tag of the binary (e.g., `0.1.0`) |
| 34 | +- `binaries` - A list of binaries (e.g., see below) |
| 35 | + |
| 36 | +And in `BlueprintBinary`: |
| 37 | + |
| 38 | +- `arch` - The architecture the blueprint was built for (see [Architecture]) |
| 39 | +- `os` - The operating system the blueprint was built for (see [OperatingSystem]) |
| 40 | +- `name` - The name of the binary in the GitHub release (e.g., `my-blueprint-bin`) |
| 41 | + |
| 42 | +And they can be specified in the manifest of your binary crate like so: |
| 43 | + |
| 44 | +```toml |
| 45 | +[package.metadata.blueprint] |
| 46 | +sources = [ |
| 47 | + { type = "Native", owner = "some-github-user", repo = "some-blueprint", tag = "0.1.0", binaries = [ |
| 48 | + { arch = "Amd64", os = "Linux", name = "my-blueprint-bin" }, |
| 49 | + ] }, |
| 50 | +] |
| 51 | +``` |
| 52 | + |
| 53 | +[`release.yml`]: https://github.com/tangle-network/blueprint-template/blob/main/.github/workflows/release.yml |
| 54 | +[Architecture]: https://docs.rs/tangle-subxt/latest/tangle_subxt/tangle_testnet_runtime/api/runtime_types/tangle_primitives/services/sources/enum.Architecture.html |
| 55 | +[OperatingSystem]: https://docs.rs/tangle-subxt/latest/tangle_subxt/tangle_testnet_runtime/api/runtime_types/tangle_primitives/services/sources/enum.OperatingSystem.html |
0 commit comments