diff options
| author | soryu <soryu@soryu.co> | 2026-02-04 01:07:14 +0000 |
|---|---|---|
| committer | soryu <soryu@soryu.co> | 2026-02-04 01:07:14 +0000 |
| commit | a734bf1a472b19d63341769d26a66628575df7f4 (patch) | |
| tree | ec78f57e5721d157c620df0c99de5b5efe485231 /makima/src/daemon/api | |
| parent | c732dd048128808cd9f67f6e1176a5b565df5678 (diff) | |
| download | soryu-a734bf1a472b19d63341769d26a66628575df7f4.tar.gz soryu-a734bf1a472b19d63341769d26a66628575df7f4.zip | |
Add chain checkpoint contracts
Diffstat (limited to 'makima/src/daemon/api')
| -rw-r--r-- | makima/src/daemon/api/chain.rs | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/makima/src/daemon/api/chain.rs b/makima/src/daemon/api/chain.rs index 7f7826f..c37c980 100644 --- a/makima/src/daemon/api/chain.rs +++ b/makima/src/daemon/api/chain.rs @@ -49,4 +49,30 @@ impl ApiClient { self.delete_with_response(&format!("/api/v1/chains/{}", chain_id)) .await } + + /// Start a chain (creates root contracts and optionally a supervisor). + pub async fn start_chain(&self, chain_id: Uuid) -> Result<JsonValue, ApiError> { + self.post_empty(&format!("/api/v1/chains/{}/start", chain_id)) + .await + } + + /// Start a chain with supervisor enabled. + pub async fn start_chain_with_supervisor( + &self, + chain_id: Uuid, + repository_url: Option<&str>, + ) -> Result<JsonValue, ApiError> { + #[derive(serde::Serialize)] + #[serde(rename_all = "camelCase")] + struct StartRequest<'a> { + with_supervisor: bool, + repository_url: Option<&'a str>, + } + let req = StartRequest { + with_supervisor: true, + repository_url, + }; + self.post(&format!("/api/v1/chains/{}/start", chain_id), &req) + .await + } } |
