Skip to main content

bee-factory

bee-factory is the recommended way to run a local Swarm development environment. It spins up 5 Bee nodes connected to a local Anvil blockchain — all wired together in a single command, with no real xBZZ required.

info

The bee dev command is no longer available. Please use bee-factory for local development instead.

Requirements

  • Node.js ≥ 18
  • Docker

Installation

npm install -g @ethersphere/bee-factory

Usage

bee-factory start               # Start the stack (uses bundled snapshot for fast boot)
bee-factory start --fresh # Redeploy contracts from scratch, save new snapshot
bee-factory start --tag v2.7.1 # Build Bee from a specific git ref (default: master)

bee-factory stop # Stop and remove all containers

The --fresh flag redeploys all contracts and saves a new snapshot; subsequent normal starts load from it instantly.

Endpoints

Once running, the nodes are accessible at these addresses:

NodeAPIP2P
Queenhttp://localhost:1633http://localhost:1634
Worker 1http://localhost:11633http://localhost:11634
Worker 2http://localhost:21633http://localhost:21634
Worker 3http://localhost:31633http://localhost:31634
Worker 4http://localhost:41633http://localhost:41634

Anvil RPC: http://localhost:8545 (chain ID 1337)

Deployed contracts

The following contracts are deployed automatically on startup, with addresses printed to the console:

ContractRole
BzzTokenERC-20 BZZ token
PostageStampPostage stamp management
PriceOraclePostage pricing
StakeRegistryNode staking
RedistributionStake redistribution
SimpleSwapFactorySwap contract factory
SwapPriceOracleSwap pricing oracle

Notes

  • Each node is funded with 1 ETH and 100 BZZ.
  • Node password: bee-factory
  • Uses Foundry test keys — never use in production.