Launch the service on Google Cloud

This document describes steps required to host the Silent Network node on Google Cloud. Audience of this documents are DevOps, or software engineers, preferably with basic knowledge of Google Cloud and the Shell.

Install gcloud

We will use official Google Cloud CLI for most of the time. Install it from here

Create Project on Google Cloud

Follow official instructions here. You also need to connect billing account.

Enable Compute Engine API to allow start up the VM instances

Go to https://console.cloud.google.com/apis/library/compute.googleapis.com

Then click "Enable"

Enable secret manager api

https://console.cloud.google.com/apis/library/secretmanager.googleapis.com

Setup gcloud

Set the env variables that we will use over the course of this tutorial. The easiest way to do so, is to create a file with following content.

# Your project ID (not project number!)
export WORKLOAD_OPERATOR_PROJECT_ID=

# VM related parameters
export VM_ZONE=
export VM_NAME=operator
export VM_ADDRESS=

# Bucket where user's data shall be stored
export WORKLOAD_OPERATOR_OUTPUT_BUCKET_NAME=
export BUCKET_LOCATION=

# Do not change. Parameters for operator's container registry
export WORKLOAD_AUTHOR_PROJECT_ID=silent-network-426409
export REGISTRY_NAME=silent-network-registry
export CONTAINER_IMAGE=operator-container-image
export WORKLOAD_VERSION=v0.1.5

# Service account attached to the VM
export WORKLOAD_OPERATOR_SERVICE_ACCOUNT_NAME=operator-service-account

The empty variables are going to be set in following sections:

Project

Please fill up WORKLOAD_OPERATOR_PROJECT_ID with the ID of the project you've created. Immediately after set valid project for gloud CLI, so subsequent commands will operate on valid project.

Make sure gcloud is pointing to valid project by calling

VM Zone

Please select a VM_ZONE for the hosted VM in Europe. Go to Available regions and zones , filter location by Europe and machine series by N2D. Select one of available zones and set the VM_ZONE variable.

VM IP address

Set the static IP for the VM instance.

  1. Pick region for the IP address. Needs to be the same as the one selected for the VM. The VM_ZONE variable contains zone, whereas for IP the region is needed. To get region from a zone, simply discard last two characters.

  1. Create static IP in this region:

  1. Get the IP address that was assigned from previous step

  1. Save the IP address in VM_ADDRESS variable

Bucket

Set the WORKLOAD_OPERATOR_OUTPUT_BUCKET_NAME . The name has to be globally unique, the simplest way to do so is to add random suffix:

Select a location of a bucket from here. Choose one from Europe. Set the BUCKET_LOCATION.

Save the configuration

With all variables set, save the file as env.operator.configuration and in the console load the variables by:

Create bucket

Create the bucket by calling:

The read, write permissions to it are going to be set next.

Create Service Account

The Service Account will be attached to the VM, and used to access cloud resources. Create a service account by executing:

Next, set valid permissions for the account

Share the Service account details with us

Provide us output of this command

Our team will grant to that Service Account access the container registry.

Setup the firewall

Enable http and https connection to the VM instance.

Put secrets to Secret Manager

Signing key for MPC protocol

Store the secret key in Google's Secret Manager, the Container will fetch it upon launch.

Launch the VM instance

Create an environment variables file (name it container-env-file) that is going to be passed to the running container.

Set following variables:

  1. KEYSHARE_STORAGE should point to created bucket, with gs:// prefix. For example: gs://workload-output-bucket-xxxxxxxxxx

  2. OPERATOR_ETH_ADDRESS the ETH address derived from public ECDSA key generated during registration to the AVS

Save the file as container-env-file

Start the VM. The container shall be fetched from the private registry, and then executed. The container-env-file is used to set up variables.

Remember to set valid path to thecontainer-env-file option (last line)

Troubleshooting

Check if the VM and the container started up without any problems:

The command should return text response:ok

Error: The zone 'XXX' does not have enough resources available to fulfill the request.

There might be unlikely event upon VM start to face the error ZONE_RESOURCE_POOL_EXHAUSTED_WITH_DETAILS. It means there are insufficient HW resources in the selected VM_ZONE Please choose different zone as described in VM Zone chapter.

There is no way to move the IP, across regions, so if new VM_ZONE is in different region, release old IP by calling:

And then create VM IP address in new region and try again.

Serial console

You can connect to serial port of the VM to read the logs of the Host OS before the container launches. It's helpful in case if container does not starts up.

If everything went well and the container started up, you should be able to see following logs:

To exit the console, hit Enter, and then type: ~.

Logs from the container

If the VM is running, the output from serial console suggests container started up correctly, but there is no response from curl, SSH to the VM:

Find name of running container:

It should be in a form: xxx-operator-xxxx. Get the logs:

Feel free to contact us if you need any assistance, please provide these logs

Share the VM instance information with us

Share following data with our team in order to be able to connect you to the MPC network

  • The IP address from VM_ADDRESS variable,

  • The Operator ETH address

  • The VM_ZONE.

  • Public part of the MPC signing key stored in Secret Manager. Read it from the logs of the running VM instance:

Example output:

Last updated