Skip to main content
This page tells you what you need to get from cloning the repository to running a worker on your machine. BlockX is a Go workspace; the python/ directory holds the Python executor and SDK. See Architecture overview for the overall architecture and Repository layout and code layering for the directory layering.

Prerequisites

Every external service has a stand-in for local development, so you don’t need to set up etcd, BlockDB, Meta, or a chain node first:

Quick start

1

Clone and download Go dependencies

If private module downloads fail, first confirm that git can reach github.com/Chaintable/*; CI solves this with GOPRIVATE=github.com/Chaintable/* and token injection.
2

Install Python dependencies

This creates the venv in python/.venv/. pythonBin() in internal/testutil/paths.go looks for /tmp/blockx-venv/bin/python and then python/.venv/bin/python, falling back to python3 only when neither exists. When the venv is missing, all process E2E tests are skipped rather than failed.
3

Build and run unit tests

The first build of cmd/worker links the DuckDB static library and is much slower than the other packages; later builds hit the build cache. go test ./... also runs the process / contract / system E2E tests (they don’t check -short), which need the venv from the previous step; e2e/perf is skipped by TestMain by default. To run only pure unit tests, use go test ./internal/... ./api/....
4

Run the Python unit tests

5

Start a worker on your machine

The following set of variables comes from StartWorkerAt in internal/testutil/worker.go; it is the minimal set the process E2E tests use to start a real worker:
You’re up when the log shows worker listening and executor started. What each item means:
  • ETCD_ENDPOINTS=none: don’t register with etcd, so no Coordinator is involved; clients call RequestTaskSlot / SubmitTask on the worker directly.
  • ICEBERG_NAMESPACE: WorkerFullConfig.Validate requires it to be non-empty (internal/worker/app/config.go).
  • BLOCKDB_BATCH_WRITE_ADDR: the block profile in cmd/worker registers the BundleWrite plugin, and validateProfileRuntimeConfig requires this address to be non-empty; locally, any unreachable port will do.
  • STUB_BLOCKDB_DELAY_MS=0: once any BLOCKDB_*_ADDR is set, the worker treats BlockDB as real; this variable switches the read path back to the devstub.
To submit a task and verify the whole path, follow examples/local_test_service/README.md to start local_proxy.py and then run submit.py. You can also run a single process E2E test to see a real call:
The worker must be started with the set of variables above. Without ICEBERG_NAMESPACE or BLOCKDB_BATCH_WRITE_ADDR, the process exits during config validation.

Makefile targets

Environment variables and config files

The worker’s load order lives in internal/worker/app/app.go: DefaultWorkerFullConfig() → the profile’s TuneDefaults → the JSON file pointed to by WORKER_CONFIG (LoadWorkerFullConfigFrom) → environment variable overrides. JSON field names match the json tags of WorkerFullConfig; see docs/deploy.md §9.3 in the blockx repository for an example. The coordinator reads only environment variables and has no config file (LoadCoordinatorRuntimeConfigFromEnv in internal/coordinator/app/config.go). The variables you’ll run into most often in local development: For the full table (dozens of entries covering AIMD, gRPC keepalive, the Iceberg cache, and more), see docs/deploy.md §9 in the blockx repository; deploy/env/worker.env.example is a sample env file for EC2 deployment that contains many keys read only by the host scripts, so it isn’t suitable for running locally as-is.

Code generation

Regenerate the Go bindings after changing .proto files:
The Makefile adds $(go env GOBIN) (or $(go env GOPATH)/bin) to PATH, so installing the plugins in the default location is enough. Proto source locations: api/grpc/*/ and internal/sdk/{blockdb,meta,localtestservice}/proto/. Commit the generated output together with the change.

Common issues

RequirePythonModules in internal/testutil/python.go tries an import with the detected interpreter and calls t.Skip on failure. The process E2E tests in cmd/worker require all seven modules greenlet, blockx_sdk, blockx_executor, blockdb, blockx, leafage, chaintable to be importable (cmd/worker/worker_process_helpers_test.go); the last four come from the private git dependencies in pyproject.toml. Run uv sync --project python first and confirm that python/.venv/bin/python exists.
This is a symptom of CGO_ENABLED=0. worker and bundle_worker must have CGO enabled, and the machine needs a C compiler. A slow first link is normal.
Read the error string: for icebergNamespace must not be empty, add ICEBERG_NAMESPACE; for plugin BlockBundleWriteResultHandler requires blockdb.batchWriteAddr, add BLOCKDB_BATCH_WRITE_ADDR; for usage-related errors, add BLOCKX_USAGE_DISABLED=true.
Check that ETCD_ENDPOINTS points to the same etcd and that WORKER_ADDR is an address the Coordinator can reach; with container network isolation it must be set explicitly (docs/deploy.md §7). For single-machine local debugging, you can bypass the Coordinator with ETCD_ENDPOINTS=none.
Confirm that the interpreter PYTHON_BIN points to can import blockx_executor (PYTHONPATH must include python/). The default python3 is usually the system interpreter and lacks dependencies such as greenlet.
These are private modules. Configure git credentials (for example git config --global url."git@github.com:".insteadOf "https://github.com/") and set GOPRIVATE=github.com/Chaintable/*. The Python-side blockx-py and friends are also private git dependencies and need credentials too.
  • Testing: commands, durations, and prerequisites for each test layer.
  • Contributing: commit and PR conventions.
  • Repository layout and code layering: what goes in cmd/, internal/, api/, and python/.
  • Deployment overview: image build and the EC2 runtime shape.
  • docs/deploy.md in the blockx repository: full environment variable table, Docker startup examples, and common issues.
  • AGENTS.md in the blockx repository: the authoritative checklist for build, test, and collaboration conventions.