addComposeHash
Registers a new compose hash on the AppAuth smart contract. This is required when updating a CVM that uses on-chain KMS (ETHEREUM/BASE) — the updated compose hash must be registered on-chain before the Phala Cloud API will accept the update. This function interacts directly with the blockchain (not the Phala Cloud API). When to use: Call this function whenupdateDockerCompose, updateCvmEnvs, or updatePreLaunchScript returns { status: "precondition_required" }.
Parameters:
| Field | Type | Required | Description |
|---|---|---|---|
chain | Chain | Conditional | Viem chain config (required if no walletClient) |
kmsContractAddress | Address | Yes | KMS contract address (for lookup) |
appId | Address | Yes | App identifier (AppAuth contract address) |
composeHash | string | Yes | Compose hash to register |
privateKey | Hex | Conditional | Caller private key (provide this or walletClient) |
walletClient | WalletClient | Conditional | Custom wallet client (provide this or privateKey) |
rpcUrl | string | No | Custom RPC URL |
publicClient | PublicClient | No | Custom public client |
skipPrerequisiteChecks | boolean | No | Skip balance checks (default: false) |
minBalance | string | No | Minimum ETH balance (default: "0.001") |
timeout | number | No | Transaction timeout in ms |
retryOptions | object | No | Retry configuration |
| Callback | Description |
|---|---|
onTransactionStateChange | Called when transaction state changes |
onTransactionSubmitted | Called when transaction is submitted |
onTransactionConfirmed | Called when transaction is confirmed |
AddComposeHash
| Field | Type | Description |
|---|---|---|
composeHash | string | The registered compose hash |
appId | string | App identifier |
appAuthAddress | string | AppAuth contract address |
transactionHash | string | On-chain transaction hash |
blockNumber | bigint? | Block number |
gasUsed | bigint? | Gas consumed |
safeAddComposeHash
Safe variant that returns aSafeResult<AddComposeHash> instead of throwing on errors.
