Skip to main content

updateDockerCompose

PATCH /cvms/{cvmId}/docker-compose Updates the Docker Compose file for a running CVM. The request body is sent as text/yaml. This function uses a two-phase flow for CVMs with on-chain KMS:
  1. Phase 1: Call with the new docker_compose_file. If the CVM uses on-chain KMS, the API returns precondition_required with a compose_hash.
  2. Register on-chain: Call addComposeHash to register the new compose hash on the blockchain.
  3. Phase 2: Retry the call with the original YAML plus compose_hash and transaction_hash.
Parameters: Returns: Union of two possible responses: Success (in_progress): Precondition required (precondition_required): Example — PHALA KMS:
Example — On-chain KMS (two phases):

safeUpdateDockerCompose

Safe variant that returns a SafeResult instead of throwing on errors.