Skip to main content

Overview

Tasks are operations executed on miners. Nonce uses a batch-based task system where multiple tasks can be grouped and executed together.

Task vs Task Batch

ConceptDescription
TaskA single operation on one miner
Task BatchA group of tasks created together, sharing the same task name and base parameters
When you create tasks via the API, you always create a Task Batch. The system automatically creates individual tasks for each target miner.

Task Names

Tasks are categorized by their target and purpose. A task batch creation payload includes:
{
  "task_name": "miner.power_mode.update",
  "miner_ids": ["miner-id-1", "miner-id-2"],
  "params": {
    "mode": "low"
  }
}
FieldTypeRequiredDescription
task_namestringYesThe task type to execute (see tables below)
miner_idsstring[]ConditionalArray of target miner IDs (required for miner-level tasks)
paramsobjectNoTask-specific parameters (see Task Parameters)

Agent-Level Tasks

miner_ids parameter is not required for agent-level tasks.
Operations that run on the agent software itself.
Task NameDescription
agent.scan.createScan the network for miners
agent.self.updateUpdate the agent software

Miner-Level Tasks

Operations that execute on individual miners.
miner_ids parameter is required to specify target miners.
Task NameDescription
miner.system.rebootReboot the miner device
miner.log.getCollect diagnostic logs from the miner
miner.light.updateToggle the miner’s LED indicator light
miner.power_mode.updateChange the mining power mode
miner.pool.updateUpdate mining pool configuration
miner.firmware.updateUpdate miner firmware

Miner Event Tasks

Special tasks that update miner asset metadata.
miner_ids parameter is required to specify target miners.
Task NameDescription
miner.asset.updateUpdate miner asset status (e.g., mark as maintenance)
miner.asset.deleteMark miner asset as deleted

Task Parameters

Each task type requires specific parameters.

miner.system.reboot

Reboot a miner device.
ParameterTypeRequiredDescription
forcebooleanNoForce reboot even if miner is hashing (default: false)

miner.log.get

Collect diagnostic logs from a miner. No additional parameters required.

miner.light.update

Toggle the miner’s LED indicator light.
ParameterTypeRequiredDescription
actionstringYesLight mode: on or off

miner.power_mode.update

Change the mining power mode.
ParameterTypeRequiredDescription
modestringYesMining mode (see Mining Modes below)

miner.pool.update

Update mining pool configuration.
ParameterTypeRequiredDescription
poolsarrayYesArray of pool configurations
pools[].urlstringYesPool URL (e.g., stratum+tcp://pool.example.com:3333)
pools[].userstringYesPool username/worker name

miner.firmware.update

Update miner firmware.
ParameterTypeRequiredDescription
firmware_urlstringYesURL to download the firmware file

agent.scan.create

Scan the network for miners.
ParameterTypeRequiredDescription
ip_rangestringNoIP range to scan (e.g., 192.168.1.0/24)

miner.asset.update

Update miner asset status.
ParameterTypeRequiredDescription
statusstringYesAvailable asset status: online, on_rack, off_rack, transit, maintenance, retired, archived
commentstringNoOptional comment for the asset status update

miner.asset.delete

Mark miner asset as deleted. No required parameters.
ParameterTypeRequiredDescription
commentstringNoOptional comment for the deletion

Task Status

Tasks progress through different statuses during their lifecycle.
StatusDescription
createdTask has been created, waiting to be queued
queuingTask is queued and waiting for agent to pick up
pendingTask is being executed by the agent
succeedTask completed successfully
failedTask execution failed
timed_outTask execution exceeded the timeout limit
cancelledTask was cancelled before completion

Task Lifecycle

Batch Status

Task batches have aggregated statuses based on their individual tasks.
Batch StatusDescription
pendingSome tasks are still running
succeedAll tasks completed successfully
failedAll tasks failed
partial_succeedSome tasks succeeded, some failed

Mining Modes

Mining power modes vary by manufacturer. Not all modes are supported by all devices.

Supported Modes by Manufacturer

ManufacturerSupported Modes
AntMinersleep, low, normal
WhatsMinerlow, normal, high
More manufacturers and modes may be added in future updates.

Mode Descriptions

ModePowerDescription
sleep~5%Standby mode, minimal power consumption (AntMiner only)
low~75%Reduced hashrate, energy efficient
normal~100%Standard operation, balanced performance
high~125%Maximum hashrate, high power consumption (WhatsMiner only)
Attempting to set an unsupported mode for a miner’s manufacturer will result in a validation error.

Example: Creating a Task Batch

curl -X POST "https://api.nonce.app/private-api/v1/{workspace_id}/farms/{farm_id}/tasks/batches" \
  -H "x-api-key: {api_key}" \
  -H "Content-Type: application/json" \
  -d '{
    "task_name": "miner.power_mode.update",
    "miner_ids": ["miner-id-1", "miner-id-2"],
    "params": {
      "mode": "low"
    }
  }'
This creates a task batch that will change the mining mode to low for the specified miners.

Response Format

The API response includes a meta field with task creation summary.
The meta field provides informational hints to help you understand what happened during task creation. It indicates which tasks were actually created and which were skipped, along with the reasons. This is particularly useful for debugging and understanding why certain miners didn’t receive tasks.
{
  "success": true,
  "data": { ... },
  "error": null,
  "meta": {
    "summary": {
      "created_count": 1,
      "skipped_count": 1
    },
    "skipped": [
      {
        "reason": "no_change",
        "message": "Task skipped: miner already in requested mode",
        "miner_ids": ["miner-id-2"]
      }
    ]
  }
}

Meta Summary

FieldTypeDescription
created_countnumberNumber of tasks successfully created
skipped_countnumberNumber of tasks skipped

Skipped Reasons

When some miners are skipped, the skipped array provides details:
FieldTypeDescription
reasonstringSkip reason code (see table below)
messagestringHuman-readable explanation
miner_idsstring[]Array of affected miner IDs
ReasonDescription
no_changeMiner is already in the requested state
unsupported_modeThe requested mode is not supported by the miner’s manufacturer
miner_not_foundMiner ID does not exist or is not accessible