Dolt

Dolt is a version-controlled SQL database that allows you to branch, merge, and collaborate on your database the same way you do with Git. It’s built for applications that require historical tracking, collaboration, and auditability.

Prerequisites

  1. Akash Network Account: You should have an account on the Akash Network with sufficient AKT tokens to deploy the service.

  2. Akash CLI or Console Access: Set up and configured on your machine.

  3. Docker Knowledge: Familiarity with Docker is helpful.

  4. Dolt Installed: Check the Dolt documentation for instructions on how to install

Step 1: Setting Up Dolt

  1. Initialize the Dolt Database:

Before deploying, you may want to initialize a Dolt repository locally or use an existing one. You can skip this step if you’re deploying a pre-configured database.

dolt init
dolt sql -q "CREATE TABLE example_table (id INT PRIMARY KEY, name VARCHAR(50));"
dolt add .
dolt commit -m "Initialized database with example table"
  1. Push Your Database to a Remote (Optional):

If you want to keep your database remote, you can push it to a DoltHub repository.

dolt remote add origin <your_dolthub_repo_url>
dolt push origin main

Step 2: Creating the Akash Deployment File

You may modiy the following deploy.yaml file as you need:

version: "2.0"
services:
dolt:
image: dolthub/dolt:latest
expose:
- port: 3306
as: 3306
to:
- global: true
env:
- DOLT_ENABLE_VERSIONING=true
- DOLT_PASSWORD=<your_password>
profiles:
compute:
dolt:
resources:
cpu:
units: 0.5
memory:
size: 1024Mi
storage:
size: 5Gi
placement:
any:
attributes:
host: akash
signedBy:
anyOf:
- "akash1365yvmc4s7awdyj3n2sav7xfx76adc6dnmlx63"
pricing:
dolt:
denom: uakt
amount: 2000
deployment:
dolt:
any:
profile: dolt
count: 1

Step 3: Deploying to Akash

You may deploy to Akash either via the CLI or the Console

Deploying via Akash CLI

  1. Initialize Your Akash Deployment:
akash tx deployment create deploy.yaml --from <your_wallet_name>
  1. Check the Deployment Status:
akash query deployment get --owner <your_wallet_address> --dseq <your_deployment_sequence>

Make sure your deployment is active and ready.

  1. Get Access to Your Database:

Once the deployment is live, you’ll receive an endpoint (IP address and port) where the Dolt database is accessible. You can connect using any MySQL client or the Dolt CLI.

Deploying via Akash Console

  1. Log in to the Akash Console:
  • Go to the Akash Console.

  • Connect your wallet and fund it with a minimum of 5 AKT if necessary.

  1. Upload the deploy.yaml File:
  • Navigate to the “Deployments” section.

  • Click on the “Deploy” button.

  • Upload the deploy.yaml file.

  • Follow the prompts to submit and deploy your service.

  1. Monitor Deployment:
  • Use the Console to monitor the status and logs of your deployment.

  • Once the deployment is active, the Dolt database will be accessible at the provided endpoint.

Step 4: Managing Your Dolt Database

  • Connecting to Dolt:

Use the IP address and port from the Akash deployment to connect:

dolt sql-server -H <akash_endpoint_ip> -P 3306 -u dolt -p <your_password>
  • Running SQL Queries:
dolt sql -q "SELECT * FROM example_table;"

References

  1. Akash CLI Deployment Guide

  2. Akash Console Deployment Guide

  3. Dolt Documentation

footer-logo-dark

© Akash Network 2024 The Akash Network Authors Documentation Distributed under CC BY 4.0

Open-source Apache 2.0 Licensed.

GitHub v0.20.0

Privacy