Skip to content

Commit d231b26

Browse files
authored
feat: add docs for new CLI debug commands (#132)
1 parent 107f635 commit d231b26

File tree

3 files changed

+94
-0
lines changed

3 files changed

+94
-0
lines changed

pages/developers/cli/_meta.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ const meta: Meta = {
55
quickstart: "Quickstart",
66
tangle: "Tangle Blueprints",
77
eigenlayer: "Eigenlayer AVSs",
8+
debugging: "Debugging Blueprints",
89
keys: "Key Management",
910
};
1011

pages/developers/cli/debugging.mdx

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# Debugging Blueprints
2+
3+
Blueprints can be deployed to multiple different [sources](/developers/deployment/sources/introduction), with each one
4+
having its own constraints. The CLI has commands to test your blueprint in these environments, assuming your machine is
5+
capable of hosting them, see [requirements](/operators/manager/requirements).
6+
7+
Supported spawn methods:
8+
9+
- `native` (no-vm)
10+
- `vm`
11+
- `container`
12+
- `tee` (WIP)
13+
14+
Note that in any case, the commands need to be run at the root of the blueprint's directory, as the CLI will read the
15+
generated `blueprint.json`.
16+
17+
# Native Debugging
18+
19+
See the [requirements](/operators/manager/requirements#native-sources)
20+
21+
To test your blueprint natively (as a host process):
22+
23+
1. Build the binary
24+
```shell
25+
$ cargo build
26+
```
27+
2. Find the path to the binary
28+
For example, `./target/debug/my-blueprint-bin`
29+
3. Spawn it with the CLI
30+
```shell
31+
$ cargo tangle debug spawn --method native --binary "./target/debug/my-blueprint-bin"
32+
```
33+
34+
# VM Debugging
35+
36+
See the [requirements](/operators/manager/requirements#native-sources)
37+
38+
To test your blueprint in a VM sandbox:
39+
40+
1. Build the binary
41+
```shell
42+
$ cargo build
43+
```
44+
2. Find the path to the binary
45+
For example, `./target/debug/my-blueprint-bin`
46+
3. Spawn it with the CLI
47+
```shell
48+
$ cargo tangle debug spawn --method vm --binary "./target/debug/my-blueprint-bin"
49+
```
50+
51+
Once spawned, the VM's output will be printed to the terminal (you may need to press `enter` first).
52+
53+
# Container Debugging
54+
55+
See the [requirements](/operators/manager/requirements#container-sources)
56+
57+
For testing, you'll likely want to set up a [local registry](https://www.docker.com/blog/how-to-use-your-own-registry-2/).
58+
59+
1. Build, tag, and push the image to your registry
60+
If your blueprint is based off the [blueprint template], it will come with a basic [Dockerfile] that should be suitable
61+
for most blueprints, and can be edited if necessary.
62+
2. Spawn it with the CLI
63+
```shell
64+
$ cargo tangle debug spawn --method container --image "my.registry:5000/my-blueprint:latest"
65+
```
66+
67+
This will start a Pod named `service` under the `blueprint-manager` namespace.
68+
69+
You can view its logs with:
70+
71+
```shell
72+
$ kubectl logs service -n blueprint-manager
73+
```
74+
75+
And its status with:
76+
77+
```shell
78+
$ kubectl describe pod service -n blueprint-manager
79+
```
80+
81+
# TEE Debugging
82+
83+
See the [requirements](/operators/manager/requirements#tee-sources-wip-linux-only)
84+
85+
1. Create a Docker image for your blueprint, see [Container Debugging](#container-debugging)
86+
2. TODO
87+
88+
[blueprint template]: https://github.com/tangle-network/blueprint-template
89+
[Dockerfile]: https://github.com/tangle-network/blueprint-template/blob/main/Dockerfile

pages/developers/deployment/introduction.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ In order for a blueprint to be instance-able, it'll need to be deployed and have
77
Before deploying, you must specify the sources from which to fetch the blueprint binaries.
88
See [Sources](/developers/deployment/sources/introduction).
99

10+
### Testing Your Sources
11+
12+
To verify that your sources are valid, see [Debugging Blueprints](/developers/cli/debugging).
13+
1014
## Deploying via the CLI
1115

1216
Once you're ready to deploy your blueprint, simply:

0 commit comments

Comments
 (0)