Subspace Farmerless Dev Node
Developer utility binary that boots a local Subspace consensus node (mocked farmerless setup) and, optionally, an EVM domain node for integration testing and manual experimentation. It wraps helpers from subspace-test-service and domain-test-service so that devs can exercise cross-domain flows without spinning up a full farmer.
Prerequisites
- Cloned Subspace Repository
- Rust toolchain with
cargo - Workspace dependencies built once (
cargo build -p subspace-farmerless-dev-node)
Usage
From the workspace root:
cargo run -p subspace-farmerless-dev-node -- [FLAGS/OPTIONS]Common Flags
--finalize-depth <K>: Enforce finalization depth; omit to disable.--domain: Start the EVM domain node alongside consensus.--base-path <PATH>: Persist data instead of using a temp dir.--rpc-host <IP>/--rpc-port <PORT>: Consensus RPC interface (defaults127.0.0.1:9944).--domain-rpc-host <IP>/--domain-rpc-port <PORT>: Domain RPC interface (defaults127.0.0.1:9945).--block-interval-ms <MS>: Slot and block production cadence (default6000; use0to disable auto-production).
To inspect the full CLI help, run:
cargo run -p subspace-farmerless-dev-node -- --helpTypical Scenarios
Quick Smoke Test
Produces consensus blocks every 6s using temp storage:
cargo run -p subspace-farmerless-dev-nodeRun with Domain Node
Start both consensus and EVM domain nodes:
cargo run -p subspace-farmerless-dev-node -- --domainFast Integration Testing
Faster block production for quick testing:
cargo run -p subspace-farmerless-dev-node -- --block-interval-ms 500 --domainManual Block Production
Disable auto-production and trigger blocks manually via RPC:
cargo run -p subspace-farmerless-dev-node -- --block-interval-ms 0 --domainManual Block Production RPCs
When --block-interval-ms 0 is set, the node exposes JSON-RPC endpoints for manual block production:
dev_produceBlock
Produce a single consensus block.
Parameters:
wait_for_bundle(optional, boolean): Iftrue, wait for domain bundle submission before producing the block. Defaults tofalse.
Example:
curl -H "Content-Type: application/json" \
--data '{"jsonrpc":"2.0","id":1,"method":"dev_produceBlock","params":[true]}' \
http://127.0.0.1:9944dev_produceBlocks
Produce multiple consensus blocks.
Parameters:
count(required, number): Number of blocks to produce.wait_for_bundle(optional, boolean): Iftrue, wait for domain bundle submission before each block. Defaults tofalse.
Examples:
# Produce 5 blocks without waiting for bundles
curl -H "Content-Type: application/json" \
--data '{"jsonrpc":"2.0","id":1,"method":"dev_produceBlocks","params":[5]}' \
http://127.0.0.1:9944
# Produce 5 blocks, waiting for bundles
curl -H "Content-Type: application/json" \
--data '{"jsonrpc":"2.0","id":1,"method":"dev_produceBlocks","params":[5,true]}' \
http://127.0.0.1:9944Note: When
wait_for_bundleistrue, the domain node must be running (--domainflag) or the RPC call will timeout waiting for bundle submission.
Docker Setup
For easy setup using Docker, you can use the provided farmerless-dev-node.yml file. This setup automatically builds and runs the farmerless dev node with the EVM domain enabled.
Prerequisites
- Docker and Docker Compose installed
Quick Start with Docker
-
Ensure you’re in the workspace root directory (where
farmerless-dev-node.ymlis located). -
Start the farmerless dev node:
docker-compose upThis will:
- Build the
subspace-farmerless-dev-nodebinary - Start the node with the
--domainflag enabled - Expose ports:
9944: Consensus RPC9945: Domain RPC8545: EVM RPC
- Access the RPC endpoints:
- Consensus RPC:
http://localhost:9944 - Domain RPC:
http://localhost:9945 - EVM RPC:
http://localhost:8545
- Consensus RPC:
Customizing Docker Setup
You can modify the docker-compose.yml file to customize the setup:
- Change block interval: Modify the command to include
--block-interval-ms <MS> - Persist data: Add
--base-path /workspace/datato the command - Change ports: Update the port mappings in the
portssection
Example: Fast Block Production
To run with faster block production (500ms intervals), modify the command in docker-compose.yml:
command: >
bash -c "
cargo build -p subspace-farmerless-dev-node --release &&
cargo run -p subspace-farmerless-dev-node --release -- --domain --block-interval-ms 500 --rpc-host 0.0.0.0 --domain-rpc-host 0.0.0.0
"Stopping the Container
To stop the farmerless dev node:
docker-compose downTo stop and remove volumes (clearing cached build artifacts):
docker-compose down -v