### detee-cli VM Deployment Output Source: https://docs.detee.ltd/tutorials/website-hosting Example output from the `detee-cli vm deploy` command, indicating the node price, resource allocation, disk encryption process, and the SSH command to access the newly deployed VM. This output confirms successful VM provisioning. ```shell Node price: 0.00002/unit/minute. Total Units for hardware requested: 26. Locking 0.0312 C (offering the VM for 1 hours). Injecting disk encryption key into VM. This will take a minute. Do not interrupt. To SSH into dude (UUID: 160d0b1f-693b-47ee-8ae0-2116f7fada0b), run the following command: ssh -i /root/.ssh/id_ed25519 -p 22 root@149.22.95.3 ``` -------------------------------- ### Download DeTEE SGX Daemon Install Script Source: https://docs.detee.ltd/provider-nodes/intel Downloads the installation script for the DeTEE SGX Daemon. This script guides the user through the daemon setup process. ```bash wget https://registry.detee.ltd/sgx/daemon/install_daemon.sh ``` -------------------------------- ### Deploy VM with detee-cli Source: https://docs.detee.ltd/tutorials/website-hosting Command to deploy a virtual machine for website hosting on DeTEE. It specifies location, resources (vCPUs, memory, disk), hostname, operating system, public IP, and duration. Ensure you have a DeTEE account and the `detee-cli` installed. ```shell detee-cli vm deploy --location France \ --vcpus 2 --memory 4000 --disk 5 \ --hostname website \ --distro ubuntu \ --public-ip \ --hours 800 ``` -------------------------------- ### Install and Start DeTEE SGX Daemon Source: https://docs.detee.ltd/docs/provider-nodes/intel This bash script automates the setup of the DeTEE SGX Daemon. It checks for SGX support and Docker, downloads the daemon binary, systemd service file, and configuration template, then starts the service. ```bash #!/bin/bash set -e if ! lscpu | grep -qi "sgx"; then echo "SGX is not enabled. Please enable it in the BIOS." exit 1 fi if ! command -v docker &> /dev/null; then echo "Error: Docker is not installed." echo "Please install Docker by following the instructions at https://docs.docker.com/get-docker/" exit 1 fi echo "Creating folders..." mkdir -p /usr/local/bin/detee/ mkdir -p /etc/detee/app_daemon/ echo "Downloading detee-sgx-daemon, systemd unit file and config..." wget -q --show-progress -O /usr/local/bin/detee-sgx-daemon https://registry.detee.ltd/sgx/daemon/detee-sgx-daemon wget -q --show-progress -O /etc/systemd/system/detee-sgx-daemon.service https://registry.detee.ltd/sgx/daemon/detee-sgx-daemon.service wget -q --show-progress -O /etc/detee/app_daemon/sample_config.yaml https://registry.detee.ltd/sgx/daemon/sample_config.yaml chmod +x /usr/local/bin/detee-sgx-daemon wget -O /etc/detee/root_ca.pem https://registry.detee.ltd/root_ca.pem echo "Take a look at /etc/detee/app_daemon/sample_config.yaml" echo "Modify config based on your setup and save it to /etc/detee/app_daemon/config.yaml" echo "Press enter when done (this will attempt to start the daemon)" read my_var echo "Starting detee-sgx-daemon..." systemctl daemon-reload systemctl start detee-sgx-daemon.service ``` -------------------------------- ### Download DeTEE SNP Daemon Installer Source: https://docs.detee.ltd/docs/provider-nodes/amd Command to download the installation script for the DeTEE SNP Daemon from the DeTEE registry. This script will then guide the user through the daemon setup. ```shell wget https://registry.detee.ltd/daemon/install_daemon.sh ``` -------------------------------- ### Download DeTEE SGX Daemon Installer Source: https://docs.detee.ltd/docs/provider-nodes/intel Downloads the installation script for the DeTEE SGX Daemon using wget. This script facilitates the setup process for the daemon, which is essential for node operation. ```bash wget https://registry.detee.ltd/sgx/daemon/install_daemon.sh ``` -------------------------------- ### DeTEE SNP Daemon Installation Script Source: https://docs.detee.ltd/docs/provider-nodes/amd A comprehensive bash script to automate the installation of the DeTEE SNP Daemon. It creates necessary directories, installs QEMU dependencies, downloads the daemon binary, systemd unit file, and a sample configuration, then starts the daemon service. ```bash #!/bin/bash set -e echo "Creating folders..." mkdir -p /var/lib/detee/boot/ mkdir -p /etc/detee/daemon/vms/ mkdir -p /usr/local/bin/detee/ mkdir -p /opt/detee_vms/ echo "Installing qemu-system-x86..." # Ensure pacman is available or adjust for other package managers (e.g., apt, dnf) # This example assumes an Arch Linux based system due to 'pacman' if command -v pacman &> /dev/null then pacman -S qemu-system-x86 qemu-img --noconfirm else echo "pacman not found. Please install qemu-system-x86 and qemu-img manually." exit 1 fi echo "Downloading detee-snp-daemon, systemd unit file and config..." wget -O /etc/detee/daemon/sample_config.yaml https://registry.detee.ltd/daemon/config.yaml wget -O /usr/local/bin/detee-snp-daemon https://registry.detee.ltd/daemon/detee-snp-daemon chmod +x /usr/local/bin/detee-snp-daemon wget -O /usr/local/bin/detee/start_qemu_vm.sh https://registry.detee.ltd/daemon/start_qemu_vm.sh chmod +x /usr/local/bin/detee/start_qemu_vm.sh wget -O /etc/systemd/system/detee-snp-daemon.service https://registry.detee.ltd/daemon/detee-snp-daemon.service echo "Take a look at /etc/detee/daemon/sample_config.yaml" echo "Modify config based on your setup and save it to /etc/detee/daemon/config.yaml" echo "Press enter when done (this will attempt to start the daemon)" read my_var echo "Starting detee-snp-daemon..." systemctl daemon-reload systemctl start detee-snp-daemon.service ``` -------------------------------- ### DeTEE SGX Daemon Installation Script Source: https://docs.detee.ltd/provider-nodes/intel This bash script automates the installation of the DeTEE SGX Daemon. It checks for SGX support and Docker, downloads necessary files (daemon, service unit, config sample, CA certificate), sets execute permissions, and starts the daemon service. ```bash #!/bin/bash set -e if ! lscpu | grep -qi "sgx"; then echo "SGX is not enabled. Please enable it in the BIOS." exit 1 fi if ! command -v docker &> /dev/null; then echo "Error: Docker is not installed." echo "Please install Docker by following the instructions at https://docs.docker.com/get-docker/" exit 1 fi echo "Creating folders..." mkdir -p /usr/local/bin/detee/ mkdir -p /etc/detee/app_daemon/ echo "Downloading detee-sgx-daemon, systemd unit file and config..." wget -q --show-progress -O /usr/local/bin/detee-sgx-daemon https://registry.detee.ltd/sgx/daemon/detee-sgx-daemon wget -q --show-progress -O /etc/systemd/system/detee-sgx-daemon.service https://registry.detee.ltd/sgx/daemon/detee-sgx-daemon.service wget -q --show-progress -O /etc/detee/app_daemon/sample_config.yaml https://registry.detee.ltd/sgx/daemon/sample_config.yaml chmod +x /usr/local/bin/detee-sgx-daemon wget -O /etc/detee/root_ca.pem https://registry.detee.ltd/root_ca.pem echo "Take a look at /etc/detee/app_daemon/sample_config.yaml" echo "Modify config based on your setup and save it to /etc/detee/app_daemon/config.yaml" echo "Press enter when done (this will attempt to start the daemon)" read my_var echo "Starting detee-sgx-daemon..." systemctl daemon-reload systemctl start detee-sgx-daemon.service ``` -------------------------------- ### Run DeTEE Hacker Challenge Node (DTHC) Source: https://docs.detee.ltd/hackers/quickstart This command starts the DeTEE Hacker Challenge Node (DTHC) as a Docker container. It maps necessary devices for SGX functionality, mounts a volume for challenge data, exposes ports, and sets initial nodes for cluster joining. Ensure you have Docker installed and SGX drivers configured. ```bash docker run --device /dev/sgx/enclave --device /dev/sgx/provision \ -v /tmp/dthc:/challenge/main -p 80:31372 -p 31373:31373 -d \ --env INIT_NODES="212.95.45.139 46.165.199.12 184.107.183.210" \ --name dthc detee/hacker-challenge:latest ``` -------------------------------- ### DeTEE SNP Daemon Installation Script Source: https://docs.detee.ltd/provider-nodes/amd A comprehensive bash script to set up the DeTEE SNP Daemon on an AMD-based server. It creates necessary directories, installs QEMU, downloads the daemon binary, systemd service file, and a sample configuration, then starts the daemon. ```bash #!/bin/bash set -e echo "Creating folders..." mkdir -p /var/lib/detee/boot/ mkdir -p /etc/detee/daemon/vms/ mkdir -p /usr/local/bin/detee/ mkdir -p /opt/detee_vms/ echo "Installing qemu-system-x86..." pacman -S qemu-system-x86 qemu-img --noconfirm echo "Downloading detee-snp-daemon, systemd unit file and config..." wget -O /etc/detee/daemon/sample_config.yaml https://registry.detee.ltd/daemon/config.yaml wget -O /usr/local/bin/detee-snp-daemon https://registry.detee.ltd/daemon/detee-snp-daemon chmod +x /usr/local/bin/detee-snp-daemon wget -O /usr/local/bin/detee/start_qemu_vm.sh https://registry.detee.ltd/daemon/start_qemu_vm.sh chmod +x /usr/local/bin/detee/start_qemu_vm.sh wget -O /etc/systemd/system/detee-snp-daemon.service https://registry.detee.ltd/daemon/detee-snp-daemon.service echo "Take a look at /etc/detee/daemon/sample_config.yaml" echo "Modify config based on your setup and save it to /etc/detee/daemon/config.yaml" echo "Press enter when done (this will attempt to start the daemon)" read my_var echo "Starting detee-snp-daemon..." systemctl daemon-reload systemctl start detee-snp-daemon.service ``` -------------------------------- ### Example Monthly Price Calculation Source: https://docs.detee.ltd/docs/getting-started/pricing This example demonstrates the calculation of the monthly price for a mini VM at a node price of 20k nanoC per unit. It uses the previously defined unit calculation and converts it to a monthly cost. ```text ((1 * 10) + (1256 / 200) + (10 / 10) + 10) * 20000 * 60 * 24 * 30 / 1_000_000_000 = 23.56992 ``` -------------------------------- ### Fedora VM Setup and OS Template Creation Source: https://docs.detee.ltd/docs/getting-started/advanced This shell script demonstrates setting up a Fedora virtual machine, installing necessary packages like `fsarchiver`, and creating a compressed OS template (`.fsa`) from the VM's root filesystem. It involves package upgrades, installations, and cleanup operations. ```shell dnf upgrade -y dnf install fsarchiver -y dnf install -y --use-host-config --installroot=/mnt --releasever:41 @core dnf remove -y --use-host-config --installroot=/mnt zram-generator-defaults rm -rf /mnt/var/cache/libdnf5/* fsarchiver savedir /tmp/os_template.fsa /mnt ``` -------------------------------- ### Setup Fedora VM with DNF Source: https://docs.detee.ltd/getting-started/advanced This snippet demonstrates the steps to prepare a Fedora virtual machine. It includes upgrading packages, installing fsarchiver, setting up a minimal core system in a specified root directory, and cleaning up package cache. The final step archives the prepared system using fsarchiver. ```shell dnf upgrade -y dnf install fsarchiver -y dnf install -y --use-host-config --installroot=/mnt --releasever:41 @core dnf remove -y --use-host-config --installroot=/mnt zram-generator-defaults rm -rf /mnt/var/cache/libdnf5/* fsarchiver savedir /tmp/os_template.fsa /mnt ``` -------------------------------- ### Actix Web Server Example (Rust) Source: https://docs.detee.ltd/getting-started/cli A simple Actix web server written in Rust that responds with 'Hello from DeTEE!' to GET requests on the root path. This serves as an example application to be compiled for Intel SGX. ```rust use actix_web::{web, App, HttpResponse, HttpServer, Responder}; async fn hello() -> impl Responder { HttpResponse::Ok().body("Hello from DeTEE!") } #[actix_web::main] async fn main() -> std::io::Result<()> { HttpServer::new(|| App::new().route("/", web::get().to(hello))) .bind("0.0.0.0:8080")? .run() .await } ``` -------------------------------- ### Simple SGX Check and Symlink Setup Source: https://docs.detee.ltd/hackers/prerequisites Verify SGX enablement using `cpuid` and create device symlinks for SGX in `/dev/sgx` for simple installations. ```shell # Check if sgx is enabled cpuid | grep -i sgx # Add symlinks for the sgx devices sudo mkdir -p /dev/sgx sudo ln -sf ../sgx_enclave /dev/sgx/enclave sudo ln -sf ../sgx_provision /dev/sgx/provision ``` -------------------------------- ### Simple SGX Device Symlink Setup Source: https://docs.detee.ltd/docs/hackers/prerequisites Commands to verify SGX processor support and create necessary device symlinks for SGX on Linux systems. This is part of the simple installation process for the Hacker Challenge. ```bash # Check if sgx is enabled cpuid | grep -i sgx # Add symlinks for the sgx devices sudo mkdir -p /dev/sgx sudo ln -sf ../sgx_enclave /dev/sgx/enclave sudo ln -sf ../sgx_provision /dev/sgx/provision ``` -------------------------------- ### Install SGX SDK Source: https://docs.detee.ltd/hackers/prerequisites Installs the Intel SGX SDK by running the downloaded binary. It's recommended to place the SDK under the /opt/intel directory for consistent access. ```shell # Put SGX SDK under /opt/intel # Assumes the SDK binary is downloaded and present sudo ./sgx_linux_x64_sdk_2.24.100.3.bin ``` -------------------------------- ### Install DeTEE CLI using Docker Source: https://docs.detee.ltd/getting-started/cli Instructions for installing and running the DeTEE CLI as a Docker container. It requires Docker to be installed and demonstrates how to mount volumes for persistent storage of configuration and SSH keys. ```shell docker run --pull always -dt --name detee-cli \ --volume ~/.detee/container_volume/cli:/root/.detee/cli:rw \ --volume ~/.detee/container_volume/.ssh:/root/.ssh:rw \ --entrypoint /usr/bin/fish detee/detee-cli:latest docker exec -it detee-cli fish ``` ```shell docker run --pull always --restart always --name detee-cli -dt \ --volume detee-cli-volume:/root/.detee/cli:rw \ --volume detee-ssh-volume:/root/.ssh:rw \ --entrypoint /usr/bin/fish detee/detee-cli:latest docker exec -it detee-cli fish ``` -------------------------------- ### DeTEE SNP Daemon Configuration Example (YAML) Source: https://docs.detee.ltd/docs/provider-nodes/amd This YAML configuration file is used to set up the DeTEE SNP Daemon. It specifies network interfaces, including IP ranges and drivers (MACVTAP), defines resource offers for virtual machines with CPU, memory, storage, and pricing, and configures public port ranges. It requires the detee-cli for wallet setup. ```yaml # Get the CLI from https://hub.docker.com/r/detee/detee-cli # And use `detee-cli account` to find your operator wallet owner_wallet: "x52w7jARC5erhWWK65VZmjdGXzBK6ZDgfv1A283d8XK" network: "testnet" # If you don't have seconday IPs, just comment out this section # If you have secondary IPs, add them here. They will get assigned in order to VMS network_interfaces: - driver: "MACVTAP" device: "eno8303" ipv4_ranges: - first_ip: "173.234.136.154" last_ip: "173.234.136.155" netmask: "27" gateway: "173.234.136.158" - first_ip: "173.234.137.17" last_ip: "173.234.137.17" netmask: "27" gateway: "173.234.137.30" ipv6_ranges: - first_ip: "2a0d:3003:b666:a00c:0002:0000:0000:0011" last_ip: "2a0d:3003:b666:a00c:0002:0000:0000:fffc" netmask: "64" gateway: "2a0d:3003:b666:a00c::1" # In this section you can configure the offers that you want to prepare for # pontential customers. Only one offer is required in order to operate, however # you can feel free to optimize based on the requests you are getting from # community members. offers: - storage_path: "/opt/detee_vms/" # Offering 20 vCPUs means this offer has 20 slots. max_vcpu_reservation: 20 # VMs will always deploy based on the ratios defined here. # For this case, each slot offers 1024 MiB of memory. max_mem_reservation_mib: 20480 max_storage_mib: 819200 # This is a multiplier that influences the cost of your service. price: 5000 # the storage path must be unique for each offer - storage_path: "/opt/detee_vms2/" max_storage_mib: 855040 max_vcpu_reservation: 12 max_mem_reservation_mib: 12288 price: 5000 # Make sure ports in this range are free, since they will get randomly assigned public_port_range: start: 30000 end: 50000 max_ports_per_vm: 5 ``` -------------------------------- ### k3s Worker Node Installation Output Source: https://docs.detee.ltd/kubernetes/k3s Example output from the k3s worker node installation script, showing download, verification, and service startup messages. ```text [INFO] Finding release for channel stable [INFO] Using v1.32.3+k3s1 as release [INFO] Downloading hash https://github.com/k3s-io/k3s/releases/download/v1.32.3+k3s1/sha256sum-amd64.txt [INFO] Downloading binary https://github.com/k3s-io/k3s/releases/download/v1.32.3+k3s1/k3s [INFO] Verifying binary download [INFO] Installing k3s to /usr/local/bin/k3s main: line 597: [: : integer expression expected [INFO] Skipping installation of SELinux RPM [INFO] Creating /usr/local/bin/kubectl symlink to k3s [INFO] Creating /usr/local/bin/crictl symlink to k3s [INFO] Creating /usr/local/bin/ctr symlink to k3s [INFO] Creating killall script /usr/local/bin/k3s-killall.sh [INFO] Creating uninstall script /usr/local/bin/k3s-agent-uninstall.sh [INFO] env: Creating environment file /etc/systemd/system/k3s-agent.service.env [INFO] systemd: Creating service file /etc/systemd/system/k3s-agent.service [INFO] systemd: Enabling k3s-agent unit Created symlink '/etc/systemd/system/multi-user.target.wants/k3s-agent.service' -> '/etc/systemd/system/k3s-agent.service'. [INFO] systemd: Starting k3s-agent ``` -------------------------------- ### Deploy VM with detee-cli Source: https://docs.detee.ltd/website-hosting Command to deploy a virtual machine for website hosting on DeTEE. It specifies hardware resources, location, and duration. The output shows pricing, encryption status, and SSH connection details. ```bash detee-cli vm deploy --location France \ --vcpus 2 --memory 4000 --disk 5 \ --hostname website \ --distro ubuntu \ --public-ip \ --hours 800 ``` ```bash Node price: 0.00002/unit/minute. Total Units for hardware requested: 26. Locking 0.0312 C (offering the VM for 1 hours). Injecting disk encryption key into VM. This will take a minute. Do not interrupt. To SSH into dude (UUID: 160d0b1f-693b-47ee-8ae0-2116f7fada0b), run the following command: ssh -i /root/.ssh/id_ed25519 -p 22 root@149.22.95.3 ``` -------------------------------- ### Detee CLI VM Deployment Example Source: https://docs.detee.ltd/getting-started/cli Demonstrates the command to deploy a virtual machine with specified resources and duration. It highlights the output, including node pricing, credit locking, and SSH connection details. ```bash ~ $ detee-cli vm deploy --vcpus 2 --memory 5000 --hours 3 --distro ubuntu --location US No hostname specified! Using random VM name: noble-scissors Node price: 0.00002/unit/minute. Total Units for hardware requested: 47.Locking 0.1692 C (offering the VM for 3 hours). Injecting disk encryption key into VM. This will take a minute. Do not interrupt. To SSH into noble-scissors (UUID: 35cdae77-6c42-478b-9f81-a4270b1580ac), run the following command: ssh -i /root/.ssh/id_ed25519 -p 48132 root@149.36.48.99 ``` -------------------------------- ### Install Node.js Source: https://docs.detee.ltd/hackers/prerequisites Installs Node.js version 20.10 using NodeSource setup script. This involves downloading the setup script, executing it with root privileges, and then installing the Node.js package. ```shell curl -fsSL https://deb.nodesource.com/setup_20.10 -o nodesource_setup.sh sudo -E bash nodesource_setup.sh sudo apt install nodejs ``` -------------------------------- ### Setup SGX Device Symlinks Source: https://docs.detee.ltd/docs/provider-nodes/intel Creates necessary symbolic links for SGX devices in the /dev/sgx directory. These commands are crucial for SGX functionality and must be executed with root privileges. ```bash # These command must run as root mkdir -p /dev/sgx ln -sf ../sgx_enclave /dev/sgx/enclave ln -sf ../sgx_provision /dev/sgx/provision ``` -------------------------------- ### Setup SGX Device Symlinks Source: https://docs.detee.ltd/provider-nodes/intel Creates necessary symbolic links for SGX devices in the /dev/sgx directory. These commands are required for the Hacker Challenge and must be executed with root privileges. ```bash # These command must run as root mkdir -p /dev/sgx ln -sf ../sgx_enclave /dev/sgx/enclave ln -sf ../sgx_provision /dev/sgx/provision ``` -------------------------------- ### Advanced SGX Installation and Setup Source: https://docs.detee.ltd/docs/hackers/prerequisites A comprehensive set of terminal commands for advanced installation of Intel SGX components on Ubuntu 22.04 (Jammy). This includes adding repositories, installing drivers, SDKs, and necessary libraries for ECDSA attestation. ```bash # Add debian repository with SGX echo 'deb [arch=amd64] https://download.01.org/intel-sgx/sgx_repo/ubuntu/ jammy main' | sudo tee /etc/apt/sources.list.d/intel-sgx.list wget -qO - https://download.01.org/intel-sgx/sgx_repo/ubuntu/intel-sgx-deb.key | sudo apt-key add - sudo apt update # Choose release https://download.01.org/intel-sgx/Releases/ # Note: Specific versions might change, ensure compatibility with your system. # Example for SGX driver v1.41 wget https://download.01.org/intel-sgx/sgx-linux/2.24/distro/ubuntu22.04-server/sgx_linux_x64_driver_1.41.bin # Example for SGX driver v2.11 (for platform software) wget https://download.01.org/intel-sgx/sgx-linux/2.24/distro/ubuntu22.04-server/sgx_linux_x64_driver_2.11.b6f5b4a.bin # Example for SGX SDK v2.24 wget https://download.01.org/intel-sgx/sgx-linux/2.24/distro/ubuntu22.04-server/sgx_linux_x64_sdk_2.24.100.3.bin chmod 777 sgx_linux_x64* # ECDSA attestation support sudo apt install build-essential ocaml automake autoconf libtool wget python-is-python3 libssl-dev # SGX DCAP Driver, kernels v5.11 have it built-in, but manual install might be needed sudo ./sgx_linux_x64_driver_1.41.bin # SGX DCAP (Data Center Attestation Primitives) sudo apt install python3 cracklib-runtime sudo apt install libsgx-dcap-ql libsgx-dcap-ql-dev sudo apt install libsgx-dcap-default-qpl libsgx-dcap-default-qpl-dev sudo apt install libsgx-dcap-quote-verify libsgx-dcap-quote-verify-dev # SGX PSW (Platform Software), get launch, epid, and agnostic attestation sudo apt install libssl-dev libcurl4-openssl-dev libprotobuf-dev sudo ./sgx_linux_x64_driver_2.11.b6f5b4a.bin ``` -------------------------------- ### Mini VM Monthly Price Calculation Example Source: https://docs.detee.ltd/getting-started/pricing This example demonstrates the calculation of a mini VM's monthly cost in C. It applies the unit calculation, a node price of 20k nanoC/unit/min, and converts it to a monthly cost, showing the detailed steps. ```formula ((1 * 10) + (1256 / 200) + (10 / 10) + 10) * 20000 * 60 * 24 * 30 / 1_000_000_000 = 23.56992 ``` -------------------------------- ### Install k3s Worker Node Source: https://docs.detee.ltd/kubernetes/k3s Installs k3s as a worker node by joining it to the master cluster. Requires the master's IP address and node token, and uses curl to download and execute the k3s installation script. ```shell ~# detee-cli vm ssh d811af7e-83a0-40fe-b83f-a4fec2cc7608 Running SSH command: ssh -i /root/.ssh/id_ed25519 -p 22 root@173.234.137.17 [root@k3s-node-1 ~]# curl -sfL https://get.k3s.io | K3S_URL=https://173.234.136.155:6443 K3S_TOKEN=K10cc4e73cdf765636f89e34ec84c7698972bf52499fdd162acd60a084ed70ceca6::server:89e69f56769aca094fc5bc804efcc7e1 sh - ``` -------------------------------- ### k3s Worker Node Installation Output Source: https://docs.detee.ltd/tutorials/kubernetes/k3s Example output from the k3s worker node installation process, showing the download, verification, and service startup messages. ```shell [INFO] Finding release for channel stable [INFO] Using v1.32.3+k3s1 as release [INFO] Downloading hash https://github.com/k3s-io/k3s/releases/download/v1.32.3+k3s1/sha256sum-amd64.txt [INFO] Downloading binary https://github.com/k3s-io/k3s/releases/download/v1.32.3+k3s1/k3s [INFO] Verifying binary download [INFO] Installing k3s to /usr/local/bin/k3s main: line 597: [: : integer expression expected [INFO] Skipping installation of SELinux RPM [INFO] Creating /usr/local/bin/kubectl symlink to k3s [INFO] Creating /usr/local/bin/crictl symlink to k3s [INFO] Creating /usr/local/bin/ctr symlink to k3s [INFO] Creating killall script /usr/local/bin/k3s-killall.sh [INFO] Creating uninstall script /usr/local/bin/k3s-agent-uninstall.sh [INFO] env: Creating environment file /etc/systemd/system/k3s-agent.service.env [INFO] systemd: Creating service file /etc/systemd/system/k3s-agent.service [INFO] systemd: Enabling k3s-agent unit Created symlink '/etc/systemd/system/multi-user.target.wants/k3s-agent.service' → '/etc/systemd/system/k3s-agent.service'. [INFO] systemd: Starting k3s-agent ``` -------------------------------- ### Install k3s Master Node Source: https://docs.detee.ltd/kubernetes/k3s Commands to update system packages and install k3s on the master node. Requires root privileges and uses pacman for package management. ```shell pacman -Syu --noconfirm pacman -S curl --noconfirm curl -sfL https://get.k3s.io | sh - ``` -------------------------------- ### Deploy VM with Specific Configuration Source: https://docs.detee.ltd/docs/getting-started/cli Example of deploying a VM with specified vCPUs, memory, hours, distribution, and location. The command output includes pricing, credit locking, and SSH connection details. ```shell ~ $ detee-cli vm deploy --vcpus 2 --memory 5000 --hours 3 --distro ubuntu --location US No hostname specified! Using random VM name: noble-scissors Node price: 0.00002/unit/minute. Total Units for hardware requested: 47.Locking 0.1692 C (offering the VM for 3 hours). Injecting disk encryption key into VM. This will take a minute. Do not interrupt. To SSH into noble-scissors (UUID: 35cdae77-6c42-478b-9f81-a4270b1580ac), run the following command: ssh -i /root/.ssh/id_ed25519 -p 48132 root@149.36.48.99 ``` -------------------------------- ### DeTEE SGX Daemon Configuration Sample Source: https://docs.detee.ltd/provider-nodes/intel This YAML file provides a sample configuration for the DeTEE SGX Daemon. It allows users to define resource allocations such as cores, memory, disk, and network ports, as well as operational parameters like the operator wallet and network environment. ```yaml # Get the CLI from https://hub.docker.com/r/detee/detee-cli # And use `detee-cli account` to find your operator wallet operator_wallet: "7V3rEuh6j8VuwMVB5PyGqWKLmjJ4fYSv6WtrTL51NZTB" network: "testnet" # overwrite IP address for apps # host_ip_address: 212.95.45.139 max_cores_per_app: 4 max_memory_mb_per_app: 4000 max_vcpu_reservation: 16 max_mem_reservation_mb: 16000 max_disk_reservation_mb: 200000 max_ports_per_app: 9 # This is the multiplier we recommend during the testnet phase price: 20000 # delete enclave archive after launching (for debuging) delete_archive: true public_port_range: start: 30000 end: 50000 ``` -------------------------------- ### Advanced SGX SDK and DCAP Driver Installation Source: https://docs.detee.ltd/hackers/prerequisites Install the Intel SGX SDK and DCAP drivers on Ubuntu 22.04 (Jammy) for advanced trusted execution environment setups. This includes adding repositories, installing build tools, SGX drivers, and platform software. ```shell # Add debian repository with SGX echo 'deb [arch=amd64] https://download.01.org/intel-sgx/sgx_repo/ubuntu/ jammy main' | sudo tee /etc/apt/sources.list.d/intel-sgx.list wget -qO - https://download.01.org/intel-sgx/sgx_repo/ubuntu/intel-sgx-deb.key | sudo apt-key add - sudo apt update # Choose release https://download.01.org/intel-sgx/Releases/ wget https://download.01.org/intel-sgx/sgx-linux/2.24/distro/ubuntu22.04-server/sgx_linux_x64_driver_1.41.bin wget https://download.01.org/intel-sgx/sgx-linux/2.24/distro/ubuntu22.04-server/sgx_linux_x64_driver_2.11.b6f5b4a.bin wget https://download.01.org/intel-sgx/sgx-linux/2.24/distro/ubuntu22.04-server/sgx_linux_x64_sdk_2.24.100.3.bin chmod 777 sgx_linux_x64* # ECDSA attestation support sudo apt install build-essential ocaml automake autoconf libtool wget python-is-python3 libssl-dev # SGX DCAP Driver, kernels v5.11 have it built-in sudo ./sgx_linux_x64_driver_1.41.bin # SGX DCAP sudo apt install python3 cracklib-runtime sudo apt install libsgx-dcap-ql libsgx-dcap-ql-dev sudo apt install libsgx-dcap-default-qpl libsgx-dcap-default-qpl-dev sudo apt install libsgx-dcap-quote-verify libsgx-dcap-quote-verify-dev # SGX PSW (platform software), get launch, epid, and agnostic attestation sudo apt install libssl-dev libcurl4-openssl-dev libprotobuf-dev sudo ./sgx_linux_x64_driver_2.11.b6f5b4a.bin ``` -------------------------------- ### Run DeTEE Hacker Challenge Node (DTHC) Source: https://docs.detee.ltd/docs/hackers/quickstart This command initiates the DeTEE Hacker Challenge Node (DTHC) as a Docker container. It configures necessary SGX device access, mounts a local directory for persistent data, exposes network ports for communication, and sets initial nodes for cluster discovery. Ensure Docker and SGX drivers are properly installed on your system. ```docker docker run --device /dev/sgx/enclave --device /dev/sgx/provision \ -v /tmp/dthc:/challenge/main -p 80:31372 -p 31373:31373 -d \ --env INIT_NODES="212.95.45.139 46.165.199.12 184.107.183.210" \ --name dthc detee/hacker-challenge:latest ``` -------------------------------- ### DeTEE SGX Daemon Configuration Example Source: https://docs.detee.ltd/docs/provider-nodes/intel A sample YAML configuration file for the DeTEE SGX Daemon. It allows customization of resources like CPU, memory, disk, and network ports, as well as operator wallet and network settings. ```yaml # Get the CLI from https://hub.docker.com/r/detee/detee-cli # And use `detee-cli account` to find your operator wallet operator_wallet: "7V3rEuh6j8VuwMVB5PyGqWKLmjJ4fYSv6WtrTL51NZTB" network: "testnet" # overwrite IP address for apps # host_ip_address: 212.95.45.139 max_cores_per_app: 4 max_memory_mb_per_app: 4000 max_vcpu_reservation: 16 max_mem_reservation_mb: 16000 max_disk_reservation_mb: 200000 max_ports_per_app: 9 # This is the multiplier we recommend during the testnet phase price: 20000 # delete enclave archive after launching (for debuging) delete_archive: true public_port_range: start: 30000 end: 50000 ``` -------------------------------- ### Install DeTEE CLI (Windows) Source: https://docs.detee.ltd/docs/getting-started/cli Installs and runs the DeTEE CLI Docker image on Windows using named volumes for persistent storage of configuration and SSH keys. It sets the entrypoint to 'fish' for interactive use and then executes a command to enter the container. ```bash docker run --pull always --restart always --name detee-cli -dt \ --volume detee-cli-volume:/root/.detee/cli:rw \ --volume detee-ssh-volume:/root/.ssh:rw \ --entrypoint /usr/bin/fish detee/detee-cli:latest docker exec -it detee-cli fish ``` -------------------------------- ### Detee CLI VM Deploy Options Source: https://docs.detee.ltd/docs/getting-started/cli Displays available options for deploying a virtual machine using the detee-cli. This command helps users discover parameters like location, disk size, distribution, and resource allocation. ```APIDOC detee-cli vm deploy -- This command initiates the deployment of a virtual machine. Autocompletion provides a list of available flags and their descriptions. Parameters: --location string (deploy to a specific location) --disk int (disk size in GB) --distro string (GNU/Linux distribution) --from-yaml string (allows extended config through yaml) --help (Print help (see more with '--help')) --hostname string (hostname of your VM and OS) --hours int (for how many hours should the VM run) --memory int (memory in MB) --price float (price per unit per minute; check docs) --public-ip (get a public IPv4 address for this VM) --vcpus int (the number of vCPUs) Notes: - The VM will expire and autodelete after the specified --hours (default is 1 hour). - Unspent credits are refunded upon early deletion. ```