Skip to main content


The Go version of the SDK takes shape as a powerful command-line interface (CLI) and library at the same time. Whether you are building an application that launches workflows, or you are implementing a bot, the DeepSquare Go SDK provides you with the tools and flexibility needed to develop software using the DeepSquare Grid.

Getting started

As a CLI

The CLI can be downloaded in the Releases tab in the Git repository. See The Command Line Interface - Getting Started.

CLI mode

Run dps --help to get the usage of the CLI.

For example, to submit jobs:

  1. Run dps init to initialize a workflow file.

  2. Edit the job.<...>.yaml:

    # yaml-language-server: $schema=/tmp/.job.schema.json
    ## See:

    ## Allow DeepSquare logging
    enableLogging: true

    ## Allocate resources
    tasks: 1
    cpusPerTask: 1
    memPerCpu: 1024
    gpus: 0

    ## The job content
    ## The steps of the jobs which are run sequentially.
    - name: 'hello-world'
    image: ubuntu:latest
    command: echo "hello world"
  3. Submit the job with:

    ./bin/dps submit --watch --exit-on-job-exit --credits 100 --job-name test job.<...>.yaml
    # --credits value Allocated a number of credits. Unit is 1e18. Is a float and is not precise. (default: 0)
    # --exit-on-job-exit, -e Exit the job after the job has finished and throw on error. (default: false)
    # --job-name value The job name.
    # --watch, -w Watch logs after submitting the job (default: false)

Interactive mode

Simply run dps to start the Terminal User Interface (TUI) and interactively send jobs.


As a library

Fetch the library by running:

go get

And use it:

import (

func main() {
pk, _ := crypto.GenerateKey() // Use a random account.

client, _ := deepsquare.NewClient(ctx, &deepsquare.ClientConfig{
MetaschedulerAddress: common.HexToAddress("0x48af46ee836514551886bbC3b5920Eba81126F62"),
UserPrivateKey: pk,

// Set job name
var jobName [32]byte
jobNameS := "test"
copy(jobName[:], jobNameS)

// Set allowance
lockedAmount, _ := new(big.Int).SetString("100000000000000000000", 10)
curr, err := client.GetAllowance(ctx)
if err != nil {
err = client.SetAllowance(ctx, curr.Add(curr, lockedAmount))
if err != nil {

// Submit job
_, _ = client.SubmitJob(
Resources: &sbatch.JobResources{
Tasks: 1,
CPUsPerTask: 1,
MemPerCPU: 100,
GPUs: 0,
Steps: []*sbatch.Step{
Run: &sbatch.StepRun{
Command: "echo test",

// ...

See references for more examples.


The source code of the CLI is accessible on the Git repository

Examples of usage as an SDK are available in the _examples directory.

Official API documentation is available on the website.


Everyone is welcome to contribute code via pull requests, to file issues on GitHub, to help triage, reproduce, or fix bugs that people have filed, to add to our documentation, or to help out in any other way.