> ## Documentation Index
> Fetch the complete documentation index at: /llms.txt
> Use this file to discover all available pages before exploring further.

# Deploy a local testnet

> Deploy the full Livepeer protocol stack locally using Hardhat and connect go-livepeer nodes to your own contracts for development and testing.

Running a local Livepeer stack lets you develop against real protocol contracts without spending ETH or affecting mainnet state. The protocol repo ships a Hardhat deploy script that deploys every contract automatically, seeds the faucet with test LPT, and writes a deployments JSON you can point go-livepeer at.

> [!TIP]
>
> This guide covers local Hardhat deployment only. For Arbitrum Sepolia testnet deployment the same deploy script applies — swap the Hardhat network target for `arbitrumSepolia` and provide a funded Sepolia wallet.

## Prerequisites

You need the following installed before starting:

* **Node.js** v18 or later and **yarn**
* **Go** 1.21 or later (for building go-livepeer)
* **git**
* An Ethereum wallet with a private key (for Hardhat, the default accounts are pre-funded — no setup needed)

## Deploy the protocol contracts

**1. Clone the protocol repo**

```bash theme={null}
git clone https://github.com/livepeer/protocol.git
cd protocol
git checkout delta
```

**2. Install dependencies**

```bash theme={null}
yarn install
```

**3. Compile the contracts**

```bash theme={null}
yarn compile
```

This compiles all Solidity contracts in `contracts/` using the compiler version specified in `hardhat.config.ts`. Output goes to `artifacts/`.

**4. Start a local Hardhat node**

Open a separate terminal and leave this running for the duration of your development session.

```bash theme={null}
yarn hardhat node
```

Hardhat starts a local JSON-RPC node at `http://127.0.0.1:8545` with chain ID `31337`. It pre-funds 20 accounts with 10,000 ETH each and prints their private keys to stdout.

**5. Deploy all contracts**

In your original terminal, run the deploy script against the local node:

```bash theme={null}
yarn hardhat deploy --network gethDev
```

The `gethDev` network config (from `deploy/migrations.config.ts`) sets short round lengths and unlock periods suitable for local testing:

| Parameter | Value |
| - | - |
| `roundLength` | 50 blocks |
| `unbondingPeriod` | 7 rounds |
| `unlockPeriod` | 50 blocks |
| `faucet.requestAmount` | 10 LPT |
| `faucet.requestWait` | 1 hour |

On completion, contract addresses are written to `deployments/gethDev/`. The deployer account is set as Controller owner and Governor owner. The faucet is seeded with `6,343,700 LPT` (`genesis.crowdSupply`) and the deployer receives `500,000 LPT` (`genesis.companySupply`).

**6. Note the Controller address**

Every contract address is resolvable from the Controller. Find it in the deployment output:

```bash theme={null}
cat deployments/gethDev/Controller.json | grep '"address"'
```

You will need this address to configure go-livepeer in the next section.

## What gets deployed

The deploy script (`deploy/deploy_contracts.ts`) deploys and registers the following contracts automatically. All proxy contracts are registered in the Controller.

| Contract | Notes |
| - | - |
| Controller | Central registry. Owner set to Governor after deployment. |
| Minter | Inflation schedule. Granted MINTER\_ROLE on LivepeerToken. |
| LivepeerToken | ERC-20. Deployed fresh for non-Arbitrum networks. |
| LivepeerTokenFaucet | Test LPT distribution. Seeded with `crowdSupply`. |
| TicketBroker | Proxy + target. Also registered as `JobsManager` for legacy Minter compatibility. |
| BondingManager | Proxy + target. Linked with SortedDoublyLL library. |
| BondingVotes | Proxy + target. Checkpoint store for governance voting power. |
| RoundsManager | Deployed as `AdjustableRoundsManager` on non-live networks, allowing round length to be changed programmatically in tests. |
| ServiceRegistry | Proxy + target. |
| MerkleSnapshot | Registered in Controller. |
| Governor | Ownership transferred to deployer account (or governance multisig on mainnet). |
| Treasury | OpenZeppelin TimelockController. |
| LivepeerGovernor | Proxy + target. Initialised with voting parameters from `migrations.config.ts`. |

> [!NOTE]
>
> `LivepeerTokenFaucet` is the only contract that is skipped on production networks (`mainnet`, `arbitrumMainnet`). The deploy script gates it with `if (!isProdNetwork(hre.network.name))`.

## Connect go-livepeer to your local contracts

With contracts deployed, you can run go-livepeer nodes against your local stack.

**1. Build go-livepeer**

```bash theme={null}
git clone https://github.com/livepeer/go-livepeer.git
cd go-livepeer
make
```

The binary is built to `./livepeer`.

**2. Get the Controller address**

From your protocol repo:

```bash theme={null}
cat deployments/gethDev/Controller.json | grep '"address"'
# "address": "0x5FbDB2315678afecb367f032d93F642f64180aa3"
```

**3. Start an orchestrator node**

Replace `<CONTROLLER_ADDRESS>` with the address from the previous step and `<KEYSTORE_PATH>` with a path to an Ethereum keystore file (you can export one of the Hardhat accounts).

```bash theme={null}
./livepeer \
  -network offchain \
  -ethUrl http://127.0.0.1:8545 \
  -ethController <CONTROLLER_ADDRESS> \
  -ethKeystorePath <KEYSTORE_PATH> \
  -ethPassword "" \
  -orchestrator \
  -transcoder \
  -serviceAddr 127.0.0.1:8935 \
  -pricePerUnit 0 \
  -initializeRound
```

The key flags for local contract targeting:

| Flag | Purpose |
| - | - |
| `-network offchain` | Disables built-in network configs so `-ethController` is used directly |
| `-ethUrl` | JSON-RPC endpoint of your local Hardhat node |
| `-ethController` | Address of the Controller contract from your deployment |
| `-initializeRound` | Automatically initialises a new round when needed; essential for local testing |

**4. Start a gateway node**

In a separate terminal, using a different keystore account:

```bash theme={null}
./livepeer \
  -network offchain \
  -ethUrl http://127.0.0.1:8545 \
  -ethController <CONTROLLER_ADDRESS> \
  -ethKeystorePath <GATEWAY_KEYSTORE_PATH> \
  -ethPassword "" \
  -gateway \
  -orchAddr 127.0.0.1:8935 \
  -maxPricePerUnit 0
```

Using `-orchAddr` directly bypasses the ServiceRegistry lookup and connects the gateway to your local orchestrator immediately.

**5. Request test LPT from the faucet**

The faucet address is in `deployments/gethDev/LivepeerTokenFaucet.json`. Call `request()` directly using cast or the go-livepeer CLI:

```bash theme={null}
cast send <FAUCET_ADDRESS> "request()" \
  --rpc-url http://127.0.0.1:8545 \
  --private-key <PRIVATE_KEY>
```

Each call transfers 10 LPT to the caller. The rate limit is 1 hour between requests, but whitelisted addresses bypass it entirely. Add your test addresses to the whitelist by calling `addToWhitelist(address)` from the deployer account.

**6. Bond LPT and activate an orchestrator**

With test LPT in your orchestrator wallet, bond and register:

```bash theme={null}
# Approve BondingManager to spend LPT
cast send <LPT_ADDRESS> \
  "approve(address,uint256)" <BONDING_MANAGER_ADDRESS> 1000000000000000000000 \
  --rpc-url http://127.0.0.1:8545 \
  --private-key <PRIVATE_KEY>

# Bond 1000 LPT to yourself (self-delegation = orchestrator registration)
cast send <BONDING_MANAGER_ADDRESS> \
  "bond(uint256,address)" 1000000000000000000000 <YOUR_ADDRESS> \
  --rpc-url http://127.0.0.1:8545 \
  --private-key <PRIVATE_KEY>
```

After the next round initialises (triggered automatically by `-initializeRound` on your orchestrator node), your orchestrator enters the active set and can call `reward()`.

## Deploying to Arbitrum Sepolia

The same deploy script targets Arbitrum Sepolia with a different network name. You need a funded Sepolia wallet (Sepolia ETH from a faucet) and an Arbitrum Sepolia RPC URL.

```bash theme={null}
# Set your deployer private key
export PRIVATE_KEY=0x...

# Deploy to Arbitrum Sepolia
yarn hardhat deploy --network arbitrumSepolia
```

Add an `arbitrumSepolia` entry to `hardhat.config.ts` pointing at your RPC URL, then use the `defaultConfig` from `migrations.config.ts` as your parameter baseline. The faucet deploys and is seeded the same as local — `crowdSupply` worth of test LPT.

> [!WARNING]
>
> `arbitrumSepolia` is not a named network in `migrations.config.ts` as of the current delta branch. It falls through to `defaultConfig`, which has sensible testnet defaults. Confirm `roundLength: 5760` is acceptable for your testing cadence before deploying.

## Related pages

> [card] [Blockchain Contracts](/v2/about/protocol/blockchain-contracts.md)
>
> Full technical reference for every protocol contract: purpose, key functions, and source code.

> [card] [Contract Addresses](/v2/about/resources/reference/livepeer-contract-addresses.md)
>
> Current and historical mainnet contract addresses across Arbitrum One and Ethereum Mainnet.

> [card] [Protocol repo on GitHub](https://github.com/livepeer/protocol/tree/delta)
>
> Source code, deploy scripts, and migration configs for the Livepeer protocol.

> [card] [go-livepeer on GitHub](https://github.com/livepeer/go-livepeer)
>
> Node implementation. Build from source or use pre-built binaries.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.