updateCvmEnvs
PATCH /cvms/{cvmId}/envs
Updates the encrypted environment variables for a running CVM.
This function uses a two-phase flow when the set of allowed env keys changes on a CVM with on-chain KMS:
- Phase 1: Call with
encrypted_envandenv_keys. If the env keys changed and the CVM uses on-chain KMS, the API returnsprecondition_requiredwith acompose_hash. - Register on-chain: Call
addComposeHashto register the new compose hash on the blockchain. - Phase 2: Retry the call with the original parameters plus
compose_hashandtransaction_hash.
Returns: Union of two possible responses:
Success (
in_progress):
Precondition required (
precondition_required):
Example — PHALA KMS (single phase):
safeUpdateCvmEnvs
Safe variant that returns aSafeResult instead of throwing on errors.
