Run the supported Worker fleet with mock devices
Boot multiple backend Workers as supervised PM2 or Docker processes, each connected to mock hardware
This page directs you to the correct location for the prerequisites, run command, smoke test, and troubleshooting.
Overview
Use this example when you want to run a demo for multiple configured Workers across device families - a miner, a mining pool, and a
powermeter - each supervised as its own separate process. Each talks to mock hardware that speaks the real wire protocol. The site
Gateway plugin surfaces all device data through a single /site HTTP API.
This example runs the local topology under PM2 supervision. Use this when:
- You want to explore a multi-Worker site and its telemetry in one running system
- You need supervisor-managed restarts and logs, and want to restart or scale one service without restarting the others
- You are testing PM2 orchestration before deploying to hardware, or want a production-like layout for Gateway and Workers
- You want real driver code running its full connect, collect, and command paths (only the endpoints are localhost mocks instead of hardware)
- You want the site Gateway plugin as a starting point for your own
/siteAPI
You have a choice of deployment topologies from single-process to distributed microservices.
This example's config/site.deploy.json sets discovery to "local" by default (Kernel and Workers share
one machine, discovery via shared directory). Setting it to "dht" moves discovery onto Hyperswarm so Workers can run on separate
hosts, but the example's own README doesn't walk through that mode end-to-end. For a worked cross-host walkthrough today, see
examples/full-site's cli.js --discovery dht.
Run the example
Follow the Starter site example:
- Start with the prerequisites
- Use PM2 for local process supervision on one host
- Verify the fleet is up
Next steps
- Understand the trade-offs between deployment topologies
- Run a single-process site for the simpler single-process topology
- Register a single miner before building a site config — Run a miner Worker
- Extend the Gateway HTTP API with custom plugins
- Browse the functions that wire together the Kernel, device Workers, and the Gateway HTTP
- Build your own Worker from scratch