Skip to main content

Documentation Index

Fetch the complete documentation index at: https://o1.network/docs/llms.txt

Use this file to discover all available pages before exploring further.

Applications API Reference

Deploy, manage, and monitor applications across your infrastructure with the Applications API. Supports Docker, binary/systemd, Kubernetes (Helm via basic-service), and dual-mode (Docker + binary) deployments with comprehensive lifecycle management.

Endpoints Overview

MethodEndpointDescription
GET/api/applicationsList all applications
POST/api/applications/createCreate new application
PUT/api/applications/editEdit application
GET/api/applications/{applicationName}Get application details
GET/api/applications/{applicationName}/deployment-modesGet deployment modes
POST/api/applications/deployDeploy application
POST/api/applications/deployments/rerunRerun deployment
POST/api/applications/uninstallUninstall application

Application Management

List All Applications

GET /api/applications
Response:
{
  "applications": {
    "Anvil": {
      "name": "Anvil",
      "basic_info": {
        "description": "A fast local Ethereum development node from Foundry",
        "iconUrl": "https://example.com/icons/anvil.png"
      },
      "tags": ["blockchain", "ethereum", "development"],
      "installation": {
        "setup_type": "dual",
        "binary": {
          "url": "https://github.com/foundry-rs/foundry/releases/download/v1.0.0/anvil-linux-amd64",
          "executable": "anvil",
          "versions": ["1.0.0", "1.1.0", "1.2.0"]
        },
        "docker": {
          "image": "ghcr.io/foundry-rs/foundry:latest",
          "versions": ["latest", "1.0.0", "1.1.0"]
        }
      },
      "configuration": {
        "config_files": [
          {
            "filename": "config.yaml",
            "content": "server:\n  port: {port}\n  host: {host}",
            "destinationPath": "/etc/anvil/config.yaml"
          }
        ],
        "environment_variables": [
          {
            "key": "ANVIL_IP_ADDR",
            "value": "{anvil_host}"
          }
        ]
      }
    }
  }
}

Create Application

POST /api/applications/create
Request Body (JSON):
{
  "name": "Anvil",
  "basic_info": {
    "description": "A fast local Ethereum development node from Foundry"
  },
  "installation": {
    "setup_type": "dual",
    "binary": {
      "url": "https://github.com/foundry-rs/foundry/releases/download/v1.0.0/anvil-linux-amd64",
      "executable": "anvil"
    },
    "docker": {
      "image": "ghcr.io/foundry-rs/foundry:latest"
    }
  }
}
Response:
{
  "success": true,
  "message": "Application created successfully"
}

Get Application Details

GET /api/applications/{applicationName}
Parameters:
  • applicationName (path): Name of the application
Response:
{
  "success": true,
  "application": {
    "name": "Anvil",
    "basic_info": {
      "description": "A fast local Ethereum development node from Foundry"
    },
    "installation": {
      "setup_type": "dual",
      "binary": {
        "url": "https://github.com/foundry-rs/foundry/releases/download/v1.0.0/anvil-linux-amd64",
        "executable": "anvil",
        "versions": ["1.0.0", "1.1.0", "1.2.0"]
      },
      "docker": {
        "image": "ghcr.io/foundry-rs/foundry:latest",
        "versions": ["latest", "1.0.0", "1.1.0"]
      }
    }
  }
}

Deployment Management

Get Deployment Modes

GET /api/applications/{applicationName}/deployment-modes
Response:
{
  "isDualMode": true,
  "availableModes": ["docker", "binary"],
  "defaultMode": "binary",
  "versions": {
    "docker": ["latest", "1.0.0", "1.1.0"],
    "binary": ["1.0.0", "1.1.0", "1.2.0"],
    "kubernetes": []
  }
}
For Kubernetes-only applications (setup_type: kubernetes), availableModes is ["kubernetes"] and the backend generates Helm values for the basic-service role (setup_mode: k8s). Example Kubernetes installation block:
{
  "installation": {
    "setup_type": "kubernetes",
    "kubernetes": {
      "image": "nginx:1.25",
      "versions": ["1.25.0"],
      "helm_namespace": "default",
      "cluster_name": "my-eks-cluster"
    }
  }
}
Ensure the target node has kubectl access (KUBECONFIG / KUBE_CONTEXT as required by basic-service).

Deploy Application

POST /api/applications/deploy
Request Body (JSON):
{
  "applicationName": "Anvil",
  "nodeName": "test-anvil-01",
  "version": "1.0.0",
  "deploymentMode": "binary",
  "variables": {
    "anvil_port": 8545,
    "accounts": 10
  },
  "deploymentId": "deploy-20240115-103000"
}
Response:
{
  "success": true,
  "deploymentId": "deploy-20240115-103000",
  "message": "Deployment started"
}

Rerun Deployment

POST /api/applications/deployments/rerun
Request Body (JSON):
{
  "deploymentId": "deploy-20240115-103000",
  "newDeploymentId": "deploy-20240116-140000",
  "applicationName": "Anvil",
  "nodeName": "test-anvil-01"
}
Response:
{
  "success": true,
  "message": "Deployment rerun started",
  "deploymentId": "deploy-20240116-140000",
  "node": "test-anvil-01",
  "playbookPath": "/playbooks/anvil/deploy.yml",
  "originalDeploymentId": "deploy-20240115-103000"
}

Uninstall Application

POST /api/applications/uninstall
Request Body (JSON):
{
  "applicationName": "Anvil",
  "nodeName": "test-anvil-01",
  "deploymentMode": "binary"
}
Response:
{
  "success": true,
  "message": "Application uninstalled successfully"
}

Deployment History & Monitoring

Get Deployment History

GET /api/applications/{applicationName}/deployments
Response:
[
  {
    "deployment_id": "deploy-20240115-103000",
    "applicationName": "Anvil",
    "nodeName": "test-anvil-01",
    "version": "1.0.0",
    "deploymentMode": "binary",
    "status": "completed",
    "startTime": "2024-01-15T10:30:00Z",
    "endTime": "2024-01-15T10:35:00Z",
    "variables": {
      "anvil_port": 8545,
      "accounts": 10
    },
    "logs": [
      {
        "timestamp": "2024-01-15T10:30:00Z",
        "type": "info",
        "message": "Starting deployment"
      },
      {
        "timestamp": "2024-01-15T10:35:00Z",
        "type": "status",
        "message": "Deployment completed successfully"
      }
    ]
  }
]

Advanced Features

Fetch Versions (Auto-detection)

POST /api/applications/fetch-versions
Request Body (JSON):
{
  "url": "https://api.github.com/repos/foundry-rs/foundry/releases",
  "key": "[].tag_name"
}
Response:
{
  "versions": ["v1.0.0", "v1.1.0", "v1.2.0"]
}

Update Deployment Mode

PATCH /api/applications/{applicationName}/nodes/{nodeName}/deployment-mode
Request Body (JSON):
{
  "deploymentMode": "binary"
}
Response:
{
  "success": true,
  "message": "Deployment mode updated from docker to binary",
  "data": {
    "applicationName": "Anvil",
    "nodeName": "test-anvil-01",
    "oldMode": "docker",
    "newMode": "binary"
  }
}

Error Responses

Common error responses for Applications API:
{
  "success": false,
  "error": "Application not found",
  "details": {
    "applicationName": "non-existent-app"
  }
}
{
  "success": false,
  "error": "Deployment failed",
  "details": {
    "deploymentId": "deploy-20240115-103000",
    "nodeName": "test-anvil-01",
    "output": "SSH connection failed"
  }
}

Best Practices

Deployment Strategies

  • Use dual-mode applications when possible for flexibility
  • Test deployments in staging before production
  • Implement proper rollback procedures
  • Monitor deployment health and performance

Configuration Management

  • Use environment-specific variables
  • Implement proper secret management
  • Version control configuration files
  • Test configuration changes in isolation

Monitoring & Observability

  • Set up comprehensive logging
  • Implement health checks and monitoring
  • Monitor resource usage and performance
  • Set up alerting for critical issues
For detailed schema definitions, refer to the OpenAPI specification published alongside the backend service.