phala 1.1.0-beta.1 → 1.1.0-beta.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +126 -42
- package/dist/api/index.d.ts +441 -2384
- package/dist/api/index.js +45 -1
- package/dist/index.js +387 -86
- package/package.json +27 -30
- package/dist/_esm-2SSTGT5A.js +0 -10
- package/dist/_esm-2SSTGT5A.js.map +0 -1
- package/dist/api/index.js.map +0 -1
- package/dist/ccip-V5MAMPAX.js +0 -2
- package/dist/ccip-V5MAMPAX.js.map +0 -1
- package/dist/chunk-KC2EQH4K.js +0 -2
- package/dist/chunk-KC2EQH4K.js.map +0 -1
- package/dist/chunk-WITLSA6W.js +0 -42
- package/dist/chunk-WITLSA6W.js.map +0 -1
- package/dist/chunk-ZUJB7PGQ.js +0 -58
- package/dist/chunk-ZUJB7PGQ.js.map +0 -1
- package/dist/index.js.map +0 -1
package/README.md
CHANGED
|
@@ -63,7 +63,7 @@ ___
|
|
|
63
63
|
|
|
64
64
|
To deploy applications to Phala Cloud, you'll need an API key:
|
|
65
65
|
|
|
66
|
-
- Visit [Phala Cloud](https://cloud.phala.network/login) to log into your Phala Cloud account. If you do not have an account, registe [here](https://cloud.phala.network/register?invite=beta)
|
|
66
|
+
- Visit [Phala Cloud](https://cloud.phala.network/login) to log into your Phala Cloud account. If you do not have an account, registe [here](https://cloud.phala.network/register?invite=beta).
|
|
67
67
|
- After logging in, navigate to the "API Keys" section in your profile
|
|
68
68
|
- Create a new API key with an appropriate name (e.g., "CLI Access")
|
|
69
69
|
- Copy the generated API key - you'll need it for authentication
|
|
@@ -100,14 +100,14 @@ ___
|
|
|
100
100
|
# ⟳ Encrypting environment variables... ✓
|
|
101
101
|
# ⟳ Creating CVM... ✓
|
|
102
102
|
# ✓ CVM created successfully
|
|
103
|
-
# ℹ CVM ID:
|
|
103
|
+
# ℹ CVM ID: 2755
|
|
104
104
|
# ℹ Name: webshell
|
|
105
105
|
# ℹ Status: creating
|
|
106
106
|
# ℹ App ID: e15c1a29a9dfb522da528464a8d5ce40ac28039f
|
|
107
|
-
# ℹ
|
|
107
|
+
# ℹ App URL: <https://cloud.phala.network/dashboard/cvms/app_e15c1a29a9dfb522da528464a8d5ce40ac28039f>
|
|
108
108
|
# ℹ
|
|
109
109
|
# ℹ Your CVM is being created. You can check its status with:
|
|
110
|
-
# ℹ phala cvms status
|
|
110
|
+
# ℹ phala cvms status e15c1a29a9dfb522da528464a8d5ce40ac28039f
|
|
111
111
|
```
|
|
112
112
|
|
|
113
113
|
Now interact with your application in Phala Cloud by going to the url on port 7681 (Example of what a url at port 7681 would look like https://e15c1a29a9dfb522da528464a8d5ce40ac28039f-7681.dstack-prod5.phala.network)
|
|
@@ -165,37 +165,6 @@ phala cvms create --name my-tee-app --compose ./docker-compose.yml --env-file ./
|
|
|
165
165
|
# Access your app via the provided URL
|
|
166
166
|
```
|
|
167
167
|
|
|
168
|
-
### 3️⃣ Simplified Workflow: One-Step On-Chain KMS CVM Creation
|
|
169
|
-
|
|
170
|
-
Deploy new applications with the `deploy` command:
|
|
171
|
-
|
|
172
|
-
```bash
|
|
173
|
-
# Basic deployment with interactive prompts
|
|
174
|
-
phala deploy
|
|
175
|
-
|
|
176
|
-
# Deployment with private key from environment, assume user want to deploy the default AppAuth contract we provide
|
|
177
|
-
export PRIVATE_KEY=your_private_key_here
|
|
178
|
-
phala deploy --kms-id 0x1234...
|
|
179
|
-
|
|
180
|
-
# Deployment with custom-app-id, assume user already deployed the AppAuth contract onchain
|
|
181
|
-
phala deploy \
|
|
182
|
-
--kms-id 0xabc123 \
|
|
183
|
-
--custom-app-id 0x5678... \
|
|
184
|
-
--pre-launch-script ./pre-launch.sh
|
|
185
|
-
```
|
|
186
|
-
|
|
187
|
-
### 4️⃣ Upgrade Existing Applications
|
|
188
|
-
|
|
189
|
-
Upgrade your deployed applications with new configurations:
|
|
190
|
-
|
|
191
|
-
```bash
|
|
192
|
-
# Basic upgrade with new compose file
|
|
193
|
-
phala cvms upgrade <app-id> --compose docker-compose.prod.yml
|
|
194
|
-
|
|
195
|
-
# Upgrade with new compose file and environment variables and private key
|
|
196
|
-
phala cvms upgrade <app-id> --compose docker-compose.prod.yml --env-file .env.prod --private-key $PRIVATE_KEY
|
|
197
|
-
```
|
|
198
|
-
|
|
199
168
|
## 💼 Real-World Use Cases for Confidential Computing
|
|
200
169
|
|
|
201
170
|
### 🏦 Financial Services
|
|
@@ -274,18 +243,21 @@ phala auth logout
|
|
|
274
243
|
#### Status
|
|
275
244
|
|
|
276
245
|
```bash
|
|
277
|
-
phala
|
|
246
|
+
phala status [options]
|
|
278
247
|
```
|
|
279
248
|
|
|
280
|
-
Check your authentication status with Phala Cloud. Displays user information
|
|
249
|
+
Check your authentication status with Phala Cloud. Displays user information including API endpoint, username, and current workspace.
|
|
250
|
+
|
|
251
|
+
> **Note**: `phala auth status` is still available for backward compatibility, but it's recommended to use `phala status` instead.
|
|
281
252
|
|
|
282
253
|
**Options:**
|
|
283
254
|
- `-j, --json`: Output in JSON format
|
|
255
|
+
- `-d, --debug`: Enable debug output
|
|
284
256
|
|
|
285
257
|
**Example:**
|
|
286
258
|
```bash
|
|
287
|
-
phala
|
|
288
|
-
phala
|
|
259
|
+
phala status
|
|
260
|
+
phala status --json
|
|
289
261
|
```
|
|
290
262
|
|
|
291
263
|
### Docker Management Commands
|
|
@@ -370,7 +342,15 @@ phala docker generate --image my-tee-app --tag v1.0.0 --env-file ./.env
|
|
|
370
342
|
|
|
371
343
|
### TEE Simulator Commands
|
|
372
344
|
|
|
373
|
-
Commands for managing the local TEE simulator for development and testing.
|
|
345
|
+
Commands for managing the local TEE simulator for development and testing. When run without subcommands, shows the current status of the simulator.
|
|
346
|
+
|
|
347
|
+
#### Check Status
|
|
348
|
+
|
|
349
|
+
```bash
|
|
350
|
+
phala simulator
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
Shows the current status of the TEE simulator, including the process ID and endpoint information if running.
|
|
374
354
|
|
|
375
355
|
#### Start Simulator
|
|
376
356
|
|
|
@@ -382,11 +362,17 @@ Start the TEE simulator locally for development and testing.
|
|
|
382
362
|
|
|
383
363
|
**Options:**
|
|
384
364
|
|
|
385
|
-
- `-
|
|
365
|
+
- `-p, --port <port>`: Port to bind the simulator to (default: 8000)
|
|
366
|
+
- `-v, --verbose`: Enable verbose output
|
|
367
|
+
|
|
368
|
+
**Examples:**
|
|
386
369
|
|
|
387
|
-
**Example:**
|
|
388
370
|
```bash
|
|
371
|
+
# Start with default options
|
|
389
372
|
phala simulator start
|
|
373
|
+
|
|
374
|
+
# Start with verbose output
|
|
375
|
+
phala simulator start --verbose
|
|
390
376
|
```
|
|
391
377
|
|
|
392
378
|
#### Stop Simulator
|
|
@@ -398,10 +384,22 @@ phala simulator stop
|
|
|
398
384
|
Stop the running TEE simulator.
|
|
399
385
|
|
|
400
386
|
**Example:**
|
|
387
|
+
|
|
401
388
|
```bash
|
|
402
389
|
phala simulator stop
|
|
403
390
|
```
|
|
404
391
|
|
|
392
|
+
#### Environment Variables
|
|
393
|
+
|
|
394
|
+
When the simulator is running, you'll need to set these environment variables to use it:
|
|
395
|
+
|
|
396
|
+
```bash
|
|
397
|
+
export DSTACK_SIMULATOR_ENDPOINT=/path/to/dstack.sock
|
|
398
|
+
export TAPPD_SIMULATOR_ENDPOINT=/path/to/tappd.sock
|
|
399
|
+
```
|
|
400
|
+
|
|
401
|
+
These variables will be automatically displayed when you run `phala simulator` while the simulator is running.
|
|
402
|
+
|
|
405
403
|
### Cloud Virtual Machine (CVM) Commands
|
|
406
404
|
|
|
407
405
|
Commands for managing Cloud Virtual Machines (CVMs) on Phala Cloud.
|
|
@@ -448,6 +446,92 @@ Get detailed information about a specific CVM.
|
|
|
448
446
|
phala cvms get app_123456
|
|
449
447
|
```
|
|
450
448
|
|
|
449
|
+
#### Deploy (Simplified)
|
|
450
|
+
|
|
451
|
+
```bash
|
|
452
|
+
phala deploy [options]
|
|
453
|
+
```
|
|
454
|
+
|
|
455
|
+
Create a new CVM with automatic resource matching. This is the recommended command for most users as it simplifies deployment by automatically selecting optimal resources based on availability.
|
|
456
|
+
|
|
457
|
+
**Key Features:**
|
|
458
|
+
- **Auto Resource Matching**: Backend automatically finds the best available node based on your requirements
|
|
459
|
+
- **All Parameters Optional**: Specify only what you need; the system handles the rest
|
|
460
|
+
- **Structured Error Messages**: Clear error codes (ERR-xxxx) with actionable suggestions
|
|
461
|
+
- **On-chain KMS Support**: Built-in support for decentralized key management
|
|
462
|
+
|
|
463
|
+
**Options:**
|
|
464
|
+
- `-n, --name <name>`: Name of the CVM (auto-generated from folder name if not provided)
|
|
465
|
+
- `-c, --compose <compose>`: Path to Docker Compose file (default: docker-compose.yml)
|
|
466
|
+
- `-t, --instance-type <type>`: Instance type (e.g., tdx.small, tdx.medium, tdx.large) - **optional**, auto-selected if not specified
|
|
467
|
+
- `-r, --region <region>`: Preferred region (e.g., us-west, eu-central) - **optional**, auto-selected if not specified
|
|
468
|
+
- `--vcpu <vcpu>`: Number of vCPUs - **optional**, auto-matched if not specified
|
|
469
|
+
- `--memory <memory>`: Memory with unit (e.g., 2G, 1024MB) - **optional**, auto-matched if not specified
|
|
470
|
+
- `--disk-size <diskSize>`: Disk size with unit (e.g., 50G, 100GB) - **optional**, auto-matched if not specified
|
|
471
|
+
- `--image <image>`: OS image version - **optional**, auto-selected if not specified
|
|
472
|
+
- `--node-id <nodeId>`: Specific node ID - **optional**, auto-selected if not specified
|
|
473
|
+
- `-e, --env-file <envFile>`: Path to environment variables file
|
|
474
|
+
- `-i, --interactive`: Enable interactive mode for required parameters
|
|
475
|
+
- `--kms-id <kmsId>`: KMS ID for on-chain key management
|
|
476
|
+
- `--private-key <key>`: Private key for on-chain KMS deployment
|
|
477
|
+
- `--rpc-url <url>`: RPC URL for blockchain interaction
|
|
478
|
+
- `--uuid <uuid>`: UUID of existing CVM to upgrade
|
|
479
|
+
- `--wait`: Wait for deployment/update to complete before returning
|
|
480
|
+
- `-j, --json`: Output in JSON format
|
|
481
|
+
- `-d, --debug`: Enable debug logging
|
|
482
|
+
|
|
483
|
+
**Examples:**
|
|
484
|
+
|
|
485
|
+
```bash
|
|
486
|
+
# Simplest - auto-select everything
|
|
487
|
+
phala deploy
|
|
488
|
+
|
|
489
|
+
# Specify instance type and region
|
|
490
|
+
phala deploy --instance-type tdx.medium --region us-west
|
|
491
|
+
|
|
492
|
+
# Manual resource specification
|
|
493
|
+
phala deploy --vcpu 4 --memory 8G --disk-size 100G
|
|
494
|
+
|
|
495
|
+
# With on-chain KMS
|
|
496
|
+
phala deploy --kms-id ethereum --private-key <key> --rpc-url <url>
|
|
497
|
+
|
|
498
|
+
# Deploy to specific node (advanced)
|
|
499
|
+
phala deploy --node-id 6
|
|
500
|
+
|
|
501
|
+
# Interactive mode for guided setup
|
|
502
|
+
phala deploy --interactive
|
|
503
|
+
```
|
|
504
|
+
|
|
505
|
+
**Error Handling:**
|
|
506
|
+
|
|
507
|
+
The deploy command provides structured error messages with unique error codes for easy troubleshooting:
|
|
508
|
+
|
|
509
|
+
```
|
|
510
|
+
Error [ERR-1003]: The selected node does not have enough CPU capacity
|
|
511
|
+
|
|
512
|
+
Details:
|
|
513
|
+
- Need 4 CPUs, but only 2 are available
|
|
514
|
+
- node_id: 6
|
|
515
|
+
|
|
516
|
+
Suggestions:
|
|
517
|
+
- Choose a smaller instance type
|
|
518
|
+
- Reduce the number of CPUs requested
|
|
519
|
+
- Remove the --node-id flag to search all available nodes
|
|
520
|
+
|
|
521
|
+
Need help? Contact support: https://cloud.phala.network/contact
|
|
522
|
+
Reference error code: ERR-1003
|
|
523
|
+
```
|
|
524
|
+
|
|
525
|
+
Common error codes:
|
|
526
|
+
- `ERR-1001`: Instance type not found
|
|
527
|
+
- `ERR-1002`: No available resources match requirements
|
|
528
|
+
- `ERR-1003`: Insufficient CPU capacity
|
|
529
|
+
- `ERR-1004`: Insufficient memory
|
|
530
|
+
- `ERR-2003`: OS image not available
|
|
531
|
+
- `ERR-2005`: Node not accessible
|
|
532
|
+
|
|
533
|
+
For a complete list of error codes, refer to the error code documentation.
|
|
534
|
+
|
|
451
535
|
#### Create CVM
|
|
452
536
|
|
|
453
537
|
```bash
|