
SDK for working with Switchboard's SGX and serverless functions.
Documentation: docs.switchboard.xyz
Warning
This repo is in active development! Expect breaking changes as the SGX SDK is developed.
pnpm install
pnpm build
cargo build
Note
This repo includes dependencies that require an SGX compatible machine to compile.
The following links provide some background on Switchboard's implimentation of on-chain attestation:
- What is Switchboard V3?: Switchboard docs on Switchboard V3.
- What are Secure Enclaves?: Switchboard docs on Trusted Execution Environments (TEE).
- Intel SGX SDK Overview: Some background on some Intel nomenclature used throughout this repository.
You will need a host machine with SGX in order to develop Switchboard functions.
We will be using Azure, in the future more cloud providers will be supported.
./scripts/create_azure_vm.sh \
-n my-sgx-vm
This will take a few minutes to provision the machine and install the dependencies.
Now attach to the VM and mount the project directory
./scripts/attach_azure_vm.sh.sh \
-n my-sgx-vm
You can attach your VS Code workspace to our virtual machine in Azure. Check out their guide for more infor VS Code - Remote Development using SSH.
- Install the Remote - SSH extension in VS Code
- Click the green arrows in the bottom left corner to pull up the remote development options
- Select Connect Host
- You should see your Azure VM name populated in the lists of hosts. If not you may need to add your host to
~/.ssh/known_hosts
or manually inputazureuser@YOUR_VM_IP_HERE
- Done! VS Code should now start a new workspace on the remote VM.
Optionally, you can open your VS Code User settings.json and add the following lines to install a set of extensions on your remote host when you connect:
{
"[rust]": {
"editor.defaultFormatter": "statiolake.vscode-rustfmt"
},
"remote.SSH.defaultExtensions": [
// Better TOML
"bungcip.better-toml",
// Rust Bundle
"1yib.rust-bundle",
// vscode-rustfmt
"statiolake.vscode-rustfmt",
// JS/TS Bundle
"ms-vscode.vscode-typescript-next",
// ESLint
"dbaeumer.vscode-eslint",
// Prettier
"esbenp.prettier-vscode",
// EditorConfig for VS Code
"editorconfig.editorconfig",
// Sync-Rsync (Sync between local and remote workstation)
"vscode-ext.sync-rsync"
]
}
- File a GitHub Issue
- Ask a question in Discord #dev-support