Dev Environment
In this guide, we will walk you through the process of setting up a development environment for Sodot MPC Vertex.
Its purpose is to allow you to run the Vertex locally, with minimal resources and effort, so you can start integrate with it using your code without the need to deploy it to a cloud provider.
Requirements
Before starting the setup process, make sure you have the following installed:
- Docker - Install Docker
You will also need to obtain the following credentials:
- Sodot Docker registry user and token - allows you to access the Vertex image. The credentials can be obtained by following the Obtaining Credentials guide.
Setup Process
The setup process is made of the following steps:
- Login to Sodot Docker registry using the provided token
- Pull the latest Vertex Docker image
- Create a Docker Volume so the Vertex can persist its data (only needed if you want to persist the vertex DB between runs)
- Run the Vertex Docker container
1. Login to Sodot Docker registry
To login to the Sodot Docker registry, you will need to use the provided user and token. To do this, run the following command:
docker login -u <ARTIFACTORY_USER> -p <ARTIFACTORY_TOKEN> repo.sodot.dev
2. Pulling the latest Vertex Docker image
To pull the latest Vertex Docker image, run the following command:
docker pull repo.sodot.dev/sodot-docker-oci/vertex:latest
3. Creating a Docker Volume
To create a Docker Volume, run the following command:
docker volume create vertex-db
4. Running the Vertex Docker container
To run the Vertex Docker container, you will first need to create a vertex.env file with the following content:
RUST_LOG=info
VERTEX_LISTEN_ADDR=0.0.0.0:80
# token to access admin API
VERTEX_ADMIN_TOKEN=VERY_SECRET_TOKEN
# listen on HTTP
VERTEX_HTTP=true
# non-production relay server you can use for testing
VERTEX_RELAY_ADDRESS=us1.sodot.dev
# us1.sodot.dev does not validate API keys
VERTEX_RELAY_API_KEY=aaaa
VERTEX_SQLITE=sqlite:///app/vertex.db?mode=rwc
# 32 bytes hex encoded key to encrypt/decrypt DB keys
# This method is not recommended for production use
VERTEX_BASIC_ENCRYPTION_KEY=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
Then, run the following command:
docker run -d -p 80:80 -v vertex-db:/app/db.sqlite --env-file vertex.env repo.sodot.dev/sodot-docker-oci/vertex:latest
You can now access the Vertex at http://localhost:80.
Optional: disable TLS for Relay communication
Usually, the Vertex communicates with the Relay over TLS and requires a valid TLS certificate to be provided by the relay server it communicates with. For development purposes, you can run the Vertex with a non-TLS Relay server, which is highly unrecommended for production use.
To do this, add the following lines to the vertex.env file:
DANGEROUS_CONTACT_RELAY_NO_TLS=true
and change the VERTEX_RELAY_ADDRESS to your desired relay address. If a schema is provided, make sure to use http instead of https.
Next Steps
Now that you have a running Vertex instance, you can start integrating with it using the Vertex API Reference.
Production Deployment
For production deployment, you can follow the deployment guide of the supported cloud providers: