DevelopersBlueprint RunnerBuilding a Blueprint Runner

Building a Blueprint Runner

This guide shows the minimal wiring for a production-style runner: jobs + router + producer + consumer.

Prerequisites

Before you start building your Blueprint Runner, ensure you have:

  1. Rust installed
  2. Tangle CLI installed
  3. A basic understanding of Blueprints
  4. A Blueprint created with the CLI (Step 1 below)

Runner Structure

A Blueprint Runner consists of:

  1. Jobs: async functions that do work and return outputs
  2. Router: routes job calls (jobIndex) to job handlers
  3. Producer: turns event sources into JobCalls (e.g., EVM logs)
  4. Consumer: turns job results into side effects (e.g., submit results on-chain)
  5. Background services (optional): long-running support tasks

Step-by-Step Guide

Step 1: Setting Up the Project Structure

If you haven’t already created a Blueprint project, you can use the Tangle CLI (if you haven’t installed it yet, see here):

cargo tangle blueprint create --name <BLUEPRINT_NAME>

Depending on the template, you’ll get either a single crate or a small workspace split into:

  • Library Package: Contains your job definitions and core logic
  • Binary Package: Contains your runner wiring (producer + consumer + router)

Step 2: Define Jobs

Jobs live in your library crate and typically use extractors like TangleEvmArg<T> to ABI-decode inputs:

Step 3: Build the Router

The router is the “job table” for your blueprint:

Step 4: Wire Producer + Consumer

In the binary crate, you load the environment, create the Tangle producer/consumer (TangleEvmProducer/TangleEvmConsumer), and start the runner:

Step 5 (Optional): Add Background Services

Background services run alongside job processing (health checks, caches, watchers, etc.):

Next Steps