6.5 KiB
DeTEE CLI
For obvious reasons, the CLI is the first end-user app developed as part of our product.
Installation
The DeTEE CLI is available as a container. First make sure you [install docker] https://docs.docker.com/desktop/).
Once docker is installed, use the following command to run the CLI:
docker run -it --name detee-cli --entrypoint /usr/bin/fish $IMAGE_NAME
Currently, the
IMAGE_NAME
is not public. For a private demo, please contact us.
DeTEE CLI features completion for bash, zsh and fish and you are heavily encouraged to use completion. You can also enable extra logs by adding the environment variable LOG_LEVEL=INFO
or LOG_LEVEL=DEBUG
Configure accounts
Inside the container, configure the accounts for your session:
ssh-keygen
# Hit enter a few times.
detee-cli account ssh-pubkey-path /root/.ssh/id_ed25519.pub
detee-cli account brain-url http://164.92.249.180:31337
Also, list get your public key:
detee-cli account
~ $ detee-cli account
Config path: /home/ghe0/.detee/cli/cli-config.yaml
The brain URL is: http://detee-build-1:31337
SSH Key Path: /home/ghe0/.ssh/id_ed25519.pub
DeTEE wallet key: x52w7jARC5erhWWK65VZmjdGXzBK6ZDgfv1A283d8XK
Account Balance: 980.16022 DeTEE Tokens available, 0 Tokens locked
SNP admin secret key path: /home/ghe0/.detee/cli/secret_detee_wallet_key
And give it to us on Discord so that we can give you your airdrop (assuming you have access).
Deploy a VM
To see options f#or deploying a VM, just write detee-cli vm deploy --
and hit TAB. Autocompletion will show available options:
~ $ detee-cli vm deploy --
--country (deploy to a specific Country)
--disk (disk size in GB)
--distro (GNU/Linux distribution)
--from-yaml (allows extended config through yaml)
--help (Print help (see more with '--help'))
--hostname (hostname of you VM and OS)
--hours (for how many hours should the VM run)
--memory (memory in MB)
--price (price per unit per minute; check docs)
--public-ip (get a public IPv4 address for this VM)
--vcpus (the number of vCPUs)
Deploying a VM looks like this:
~ $ detee-cli vm deploy --distro ubuntu --vcpus 4 --memory 4096 --disk 20 --hours 4
No hostname specified! Using random VM name: luminous-soap
Node price: 0.00002/unit/minute. Total Units for hardware requested: 216. Locking 1.0368 tokens (offering the VM for 4 hours).
Injecting disk encryption key into VM. This will take a minute. Do not interrupt.
VM CREATED! To ssh, run the following command:
ssh -p 44367 root@173.234.17.2
In the background, the CLI will perform an attestation of the SNP server and also download the public SSH keys of the servers during the attestation. SSH will just work.
Now you can list VMs to get information:
~ $ detee-cli vm list
╭────────┬──────────────────────────────────────┬───────────────┬───────┬──────────┬──────┬────────┬───────────╮
│ City │ UUID │ hostname │ Cores │ Mem (MB) │ Disk │ DTE/h │ time left │
├────────┼──────────────────────────────────────┼───────────────┼───────┼──────────┼──────┼────────┼───────────┤
│ London │ d51de633-640f-4b19-b372-b4197b321c8d │ luminous-soap │ 4 │ 4096 │ 20 │ 0.2592 │ 3h 59m │
╰────────┴──────────────────────────────────────┴───────────────┴───────┴──────────┴──────┴────────┴───────────╯
In case you forgot SSH details for your VM, just use the SSH wrapper:
~ $ detee-cli vm ssh d51de633-640f-4b19-b372-b4197b321c8d
Welcome to Ubuntu 24.04 LTS (GNU/Linux 6.12.10-arch1-1 x86_64)
root@luminous-soap:~#
Update or delete VM
The update command will allow you to modify the hardware specification and also the number of hours that you want your VM to run. If both hardware and time are modified, the hardware modification is executed first and the tokens are recalculated after that.
~ $ detee-cli vm update --vcpus 2 --memory 2000 --hours 10 d51de633-640f-4b19-b372-b4197b321c8d
The node accepted the hardware modifications for the VM.
Injecting disk encryption key into VM. This will take a minute. Do not interrupt.
The VM will run for another 10 hours.
~ $ detee-cli vm list
╭────────┬──────────────────────────────────────┬───────────────┬───────┬──────────┬──────┬────────┬───────────╮
│ City │ UUID │ hostname │ Cores │ Mem (MB) │ Disk │ DTE/h │ time left │
├────────┼──────────────────────────────────────┼───────────────┼───────┼──────────┼──────┼────────┼───────────┤
│ London │ d51de633-640f-4b19-b372-b4197b321c8d │ luminous-soap │ 2 │ 2000 │ 20 │ 0.1344 │ 10h 0m │
╰────────┴──────────────────────────────────────┴───────────────┴───────┴──────────┴──────┴────────┴───────────╯
~ $
Please note that changing the number of CPUs or the kernel will rotate the hot decryption key of the server. This is why after these updates the CLI will use the backup key to start the VM.
Deletion works as expected:
~ $ detee-cli vm delete d51de633-640f-4b19-b372-b4197b321c8d
VM deleted.
~ $