Quickstart
Get started with Dispatch as an agent or worker. Submit your first job or start earning in 5 minutes.
Prerequisites
- Node.js 20+
- pnpm 9+
- Ollama (optional, for LLM inference. Install from ollama.com)
1. Clone and install
git clone https://github.com/pranit-garg/Dispatch.git
cd Dispatch
pnpm install2. Set up environment
Copy the example env file:
cp .env.example .envKey defaults for local development:
# Coordinator (Monad testnet)
COORDINATOR_URL_MONAD=http://localhost:4010
# Worker
COORDINATOR_URL=http://localhost:4010
OLLAMA_BASE_URL=http://localhost:11434
# Demo
DEMO_CHAIN=monad3. Build the monorepo
pnpm buildCompiles all packages and apps with TypeScript project references.
Agent Quickstart
Submit your first compute job to the Dispatch network.
Start the coordinator
Run the Monad testnet coordinator with payment gating disabled:
TESTNET_MODE=true pnpm --filter coordinator-monad startYou should see:
[Coordinator] Listening on port 4010 (eip155:10143)
[Monad Coordinator] x402 payment gating: DISABLED (testnet mode)Start a worker
In a second terminal, start the desktop worker (you need at least one worker running to process jobs):
pnpm --filter worker-desktop startThe worker generates an ed25519 keypair on first run (stored at ./data/worker-key.json), connects via WebSocket, and registers with the coordinator:
[Desktop Worker] Public key: a1b2c3d4e5f6...
[Desktop Worker] Connecting to ws://localhost:4010
[Desktop Worker] Registered as worker_abc123Submit a job
Option A: Using curl
Get a quote, then submit:
# Get price quote
curl http://localhost:4010/v1/quote?job_type=TASK&policy=AUTO
# Submit a TASK job
curl -X POST http://localhost:4010/v1/jobs/commit/cheap \
-H "Content-Type: application/json" \
-d '{
"job_type": "TASK",
"user_id": "quickstart-user",
"privacy_class": "PUBLIC",
"payload": {
"job_type": "TASK",
"task_type": "classify",
"input": "This product is amazing and works perfectly."
}
}'
# Poll for result (replace JOB_ID)
curl http://localhost:4010/v1/jobs/JOB_IDOption B: Using the SDK
import { ComputeRouter } from "@dispatch/compute-router";
import { Policy } from "@dispatch/protocol";
const router = new ComputeRouter({
coordinatorUrls: {
monad: "http://localhost:4010",
solana: "http://localhost:4020",
},
});
const result = await router.runTask({
task_type: "classify",
input: "This product is amazing and works perfectly.",
user_id: "quickstart-user",
chainPreference: "monad",
});
console.log(result.output); // { sentiment: "positive", confidence: 0.5 }
console.log(result.route); // "decentralized:monad"
console.log(result.price); // "$0.001"Verify the receipt
The poll response includes a cryptographic receipt signed by the worker:
{
"receipt": {
"job_id": "abc-123",
"provider_pubkey": "a1b2c3d4...",
"output_hash": "sha256:deadbeef...",
"completed_at": "2026-02-09T12:00:05.000Z",
"payment_ref": null
}
}Using the CLI (coming soon)
# Install the CLI
npm install -g @dispatch/cli
# Set up your config
dispatch init
# Submit an LLM job
dispatch agent run --type llm --prompt "Explain quantum computing" --policy fast
# Check job status
dispatch agent status <job-id>The CLI is under active development. See the SDK examples above for the current recommended approach.
Worker Quickstart
Start earning from your idle hardware by processing Dispatch jobs.
Start the coordinator
If you haven't already started the coordinator (see Agent Quickstart above):
TESTNET_MODE=true pnpm --filter coordinator-monad startStart your worker
In a new terminal, start the desktop worker:
pnpm --filter worker-desktop startThe worker generates an ed25519 keypair on first run, connects via WebSocket, and registers with the coordinator.
Verify it's working
You should see output like this:
[Desktop Worker] Public key: a1b2c3d4e5f6...
[Desktop Worker] Connecting to ws://localhost:4010
[Desktop Worker] Registered as worker_abc123Once registered, the worker will automatically receive and process jobs from the coordinator. Submit a test job (see Agent Quickstart above) to confirm everything works end to end.
Using the CLI (coming soon)
# Install the CLI
npm install -g @dispatch/cli
# Set up as a worker
dispatch init
# Start earning
dispatch worker start --coordinator http://localhost:4010
# Check status
dispatch worker statusThe CLI is under active development. See the pnpm commands above for the current recommended approach.
Next steps
- Architecture deep-dive: understand how all the pieces fit together
- Submit a Job: full guide with all job types and payment options
- Run a Worker: detailed worker setup, trust pairing, and multi-chain config
- Trust Pairing: set up private job routing
- Monad chain config: configure x402 payments on Monad