First we will log into the Phala Cloud with your account. If you have not signed up for an account and you are in the terminal, follow the steps in Sign Up for an Account via CLI below. Otherwise, skip to #generate-a-phala-cloud-api-key.
Log into your dashboard and select the logo in the top left corner.
Click your username and select “API Tokens”.
Click Create Token and then copy your newly generated API Key.
With your API Key in hand, authenticate your CLI:
Copy
Ask AI
npx phala auth login
When prompted, paste your API Key. The CLI will confirm successful authentication.
Copy
Ask AI
phala auth login✔ Enter your API key: … ************************************************✓ Welcome hashwarlock! API key validated and saved successfullyℹ Open in Web UI at https://cloud.phala.network/dashboard/
Congratulations! You’ve now set up the Phala Cloud CLI and authenticated your account. You’re ready to start deploying and managing confidential applications on Phala Cloud.Remember, you can always check your authentication status with:
Copy
Ask AI
npx phala auth status
Copy
Ask AI
⟳ Checking authentication status... ✓✓ Authenticated as hashwarlock╭────────────┬────────────────────────────────────────╮├────────────┼────────────────────────────────────────┤│ Username │ hashwarlock │├────────────┼────────────────────────────────────────┤│ Email │ hashwarlock@usergroup.phala.network │├────────────┼────────────────────────────────────────┤│ Role │ admin │├────────────┼────────────────────────────────────────┤│ Team │ hashwarlock's projects (enterprise) │├────────────┼────────────────────────────────────────┤│ Credits │ $400 │╰────────────┴────────────────────────────────────────╯
If you need to log out or switch accounts:
Copy
Ask AI
npx phala auth logout# ✓ API key removed successfully.
Now that we are authenticated to our Phala Cloud account with our API Key, let’s deploy our first CVMThe process is easy as we have setup a demo command for you to try this out quickly.
Copy
Ask AI
phala demo
You’ll have a list of demos to test, and we will try the Jupyter Notebook demo. This part of the guide is very simple. Run the command, sit back and watch the magic unfold.
Copy
Ask AI
phala demo⟳ Verifying your credentials... ✓✓ Logged in as hashwarlock✔ Select a template to deploy: Jupyter Notebook✓ Selected template: Jupyter Notebook✔ Enter a name for your CVM: Jupyter-Notebookℹ Preparing to deploy your CVM...⟳ Preparing CVM configuration... ✓⟳ Creating your demo CVM... ✓✓ Demo CVM created successfully! 🎉╭─────────────────────┬───────────────────────────────────────────────────────────────────────────────────────────────────╮├─────────────────────┼───────────────────────────────────────────────────────────────────────────────────────────────────┤│ CVM ID │ 3751 │├─────────────────────┼───────────────────────────────────────────────────────────────────────────────────────────────────┤│ Name │ Jupyter-Notebook │├─────────────────────┼───────────────────────────────────────────────────────────────────────────────────────────────────┤│ Status │ creating │├─────────────────────┼───────────────────────────────────────────────────────────────────────────────────────────────────┤│ App ID │ app_ecc21474f89b47a8e33ecd4e53a0ed744fff4eb2 │├─────────────────────┼───────────────────────────────────────────────────────────────────────────────────────────────────┤│ App URL │ https://cloud.phala.network/dashboard/cvms/app_ecc21474f89b47a8e33ecd4e53a0ed744fff4eb2 │├─────────────────────┼───────────────────────────────────────────────────────────────────────────────────────────────────┤│ Template │ Jupyter Notebook │├─────────────────────┼───────────────────────────────────────────────────────────────────────────────────────────────────┤│ Resources │ 2 vCPUs, 2GB RAM, 20GB Storage │├─────────────────────┼───────────────────────────────────────────────────────────────────────────────────────────────────┤│ Jupyter Token │ e4d13458163d6b8314a9d976a55600ad │├─────────────────────┼───────────────────────────────────────────────────────────────────────────────────────────────────┤│ Access Instructions │ Access your Jupyter notebook using the token above. Go to 'Network' tab to see the public URL. │╰─────────────────────┴───────────────────────────────────────────────────────────────────────────────────────────────────╯✓ Your demo is being created. You can check its status with:phala cvms get app_ecc21474f89b47a8e33ecd4e53a0ed744fff4eb2
Congratulations! Your Jupyter Notebook is deployed! Let’s checkout the deployment and use the Jupyter Token to access our notebook. Go to the “Network” Tab:
Open in New Tab and enter the Jupyter Token generated for your Jupyter Notebook.
This is a great start, but let’s try something more specific like generating:
Ethereum Account
Solana Keypair
First, run pip install "dstack-sdk[all]" to get the right dependencies.
Let’s write some code to get an ETH and SOL account.
This is great! We have now shown we can interact with the TEE special functions for deriving keys through the key management service and generate remote attestations. We will have another blogpost to dive deeper into this information later, but to get a head start check out Key Management Service Docs and the Attestation Guide for Dstack.