Skip to content
This repository has been archived by the owner on Oct 24, 2023. It is now read-only.

Obscuro Testnet

Gavin Thomas edited this page Jun 7, 2022 · 5 revisions

Introducing Obscuro Testnet

The Obscuro Testnet is the number 1 destination for application developers, builders and node operators who want to migrate their Ethereum smart contracts to a privacy preserving layer 2. With Obscuro Testnet you can familiarise yourselves with deploying apps, running an Obscuro node or simply understand more about how Obscuro works.

The Testnet release schedule has been intentionally designed to make new features available as soon as possible. This means you can expect frequent updates which will be communicated here. The trade-off is that in the early days Testnet will have some sharp edges and unexpected surprises. More specifically, whilst Testnet is in its infancy:

  • Obscuro Testnet will crash from time to time
  • When Obscuro Testnet crashes expect to lose everything
  • Obscuro Testnet code has not been audited (mainnet code will be audited prior to launch) so expect to see code which is yet to be optimised

All Obscuro code is intentionally under an open source licence. If you see something you think could be improved or reworked feel free to submit a PR in the go-obscuro repo.

As you would expect from a Testnet, OBX tokens issued on Obscuro Testnet have no value and gas fees will be zero.

To indicate your interest in Testnet prior to it being available please complete the form on the Obscuro website.

Deploying Your Smart Contract to Obscuro Testnet

PLACEHOLDER

Joining Obscuro Testnet

Follow the steps below to create a new Obscuro node using Docker and join the Obscuro Testnet.

Obscuro makes use of Intel's Software Guard Extension (SGX) capability to achieve full computational privacy (see the Obscuro Whitepaper for full details). As a result there are some hardware compatibility requirements and the Intel SGX driver and SGX Platform Software (PSW) has to be installed.

An attestation process initiated when the node wants to join the Obscuro testnet verifies the node is running a genuine SGX enclave and that it is patched and not vulnerable to any known exploits. The steps below include a means of checking the outcome of the attestation process to avoid a failure at the point of joining the Testnet.

Prerequisites

Either,

Or,

  • Azure Confidential Computing virtual machine. By default these use Intel SGX capable processors.

Joining Testnet as an Aggregator Node

Install SGX

  1. Update the system and install required components:

    sudo apt update
    sudo apt upgrade
    sudo apt-get install make gcc wget
    
  2. Download SGX driver:

    wget "<the URL recorded as part of prerequisites above>"

  3. Set protections to allow for the .bin file execution:

    chmod +x sgx_linux_x64_driver_<driver version taken from driver download URL>.bin

  4. Install the driver:

    sudo ./sgx_linux_x64_driver_<driver version taken from driver download URL>.bin

  5. Create or update remount-dev-exec.service to remove /dev as exec and at system startup:

    sudo nano /etc/systemd/system/remount-dev-exec.service

    Paste in the following and press Ctrl+O to write the contents and Ctrl+X to exit nano

         [Unit]
         Description=Remount /dev as exec to allow AESM service to boot and load enclaves into SGX
    
         [Service]
         Type=oneshot
         ExecStart=/bin/mount -o remount,exec /dev
         RemainAfterExit=true
    
         [Install]
         WantedBy=multi-user.target
    
    sudo systemctl enable remount-dev-exec
    sudo systemctl start remount-dev-exec
    
  6. Configure the system to run an Intel SGX application:

    echo 'deb [arch=amd64] https://download.01.org/intelsgx/sgx_repo/ubuntu bionic main' | sudo tee /etc/apt/sources.list.d/intel-sgx.list
    wget -qO - https://download.01.org/intelsgx/sgx_repo/ubuntu/intel-sgx-deb.key | sudo apt-key add
    sudo apt update
    sudo apt-get install libsgx-epid libsgx-quote-ex libsgx-dcap-ql libsgx-enclave-common libsgx-urts sgx-aesm-service libsgx-uae-service autoconf libtool libprotobuf-dev
    

Verify Your SGX Installation

PLACEHOLDER

Install Docker

Before you install Docker Engine for the first time you need to set up the Docker repository.

Set up the repository

  1. Update the apt package index and install packages to allow apt to use a repository over HTTPS:

    sudo apt-get update
    sudo apt-get install ca-certificates curl gnupg lsb-release
    
  2. Add Docker’s official GPG key:

    sudo mkdir -p /etc/apt/keyrings
    curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
    
  3. Use the following command to set up the repository:

    echo \
    "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
    $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
    

Install Docker Engine

  1. Update the apt package index, and install the latest version of Docker Engine, containered, and Docker Compose, or go to the next step to install a specific version:

    sudo apt-get update
    sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin
    
  2. To install a specific version of Docker Engine, list the available versions in the repo, then select and install:

    a. List the versions available in your repo:

    apt-cache madison docker-ce

    b. Install a specific version using the version string from the second column, for example, 5:20.10.16~3-0~ubuntu-jammy.

    sudo apt-get install docker-ce=<VERSION_STRING> docker-ce-cli=<VERSION_STRING> containerd.io docker-compose-plugin

  3. Verify that Docker Engine is installed correctly by running the hello-world image.

    sudo docker run hello-world

This command downloads a test image and runs it in a container. When the container runs, it prints a message and exits.

Docker Engine is installed and running. The docker group is created but no users are added to it. You need to use sudo to run Docker commands.

Start Edgeless Database

  1. Run EdgelessDB on an SGX-capable system:

    docker run --name my-edb -p3306:3306 -p8080:8080 --privileged -v /dev/sgx:/dev/sgx -t ghcr.io/edgelesssys/edgelessdb-sgx-1gb

Start Enclave

  1. Create a Dockerfile so the Docker image can be created:

    sudo nano enclave.Dockerfile

    Paste in the following and press Ctrl+O to write the contents and Ctrl+X to exit nano

    FROM ghcr.io/edgelesssys/ego-dev:latest
    
    RUN git clone https://github.com/obscuronet/go-obscuro
    RUN cd go-obscuro/go/obscuronode/enclave/main && ego-go build && ego sign main
    
    ENV OE_SIMULATION=1
    ENTRYPOINT ["ego", "run", "go-obscuro/go/obscuronode/enclave/main/main"]
    EXPOSE 11000
    
  2. Create a Docker image for the enclave service to run in SGX:

    sudo docker build -t obscuro_enclave -f enclave.Dockerfile .

  3. Run the Docker image as a container where XXX is the port on which to expose the enclave service's RPC endpoints on the local machine, and YYY is the public IP address of your node:

    sudo docker run -e OE_SIMULATION=0 --privileged -v /dev/sgx:/dev/sgx -p XXX:11000/tcp obscuro_enclave --hostID YYY --address :11000 --willAttest=true

Start Host

PLACEHOLDER

Join Your Node to Obscuro Testnet

PLACEHOLDER

Uninstall

Uninstall the Docker Engine, CLI, Containerd, and Docker Compose packages:

 sudo apt-get purge docker-ce docker-ce-cli containerd.io docker-compose-plugin

Images, containers, volumes, or customized configuration files on your host are not automatically removed. To delete all images, containers, and volumes:

 sudo rm -rf /var/lib/docker
 sudo rm -rf /var/lib/containerd

You must delete any edited configuration files manually.

Uninstall SGX

  1. Run the uninstall shell script:

    sudo /opt/intel/sgxdriver/uninstall.sh

  2. Uninstall the rest of the dependencies:

    sudo apt purge -y libsgx-enclave-common libsgx-enclave-common-dev libsgx-urts sgx-aesm-service libsgx-uae-service libsgx-launch libsgx-aesm-launch-plugin libsgx-ae-le

Joining Testnet as a Validator Node

PLACEHOLDER