Skip to content

🔒 SDK for Switchboard's secure enclave computing

Notifications You must be signed in to change notification settings

switchboard-xyz/sgx-sdk

Repository files navigation

Switchboard SGX SDK

SDK for working with Switchboard's SGX and serverless functions.

Discord Twitter

Documentation: docs.switchboard.xyz

Warning
This repo is in active development! Expect breaking changes as the SGX SDK is developed.

Setup

pnpm install
pnpm build
cargo build

Note
This repo includes dependencies that require an SGX compatible machine to compile.

Documentation

The following links provide some background on Switchboard's implimentation of on-chain attestation:

Create SGX Virtual Machine

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.

Use SGX Virtual Machine

Now attach to the VM and mount the project directory

./scripts/attach_azure_vm.sh.sh \
  -n my-sgx-vm

Using VS Code Remote SSH Extension

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 input azureuser@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"
  ]
}

Troubleshooting

  1. File a GitHub Issue
  2. Ask a question in Discord #dev-support

About

🔒 SDK for Switchboard's secure enclave computing

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •