> For the complete documentation index, see [llms.txt](https://docs.minervachain.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.minervachain.org/build/local-devnet.md). Agents can also search and read this documentation through its [MCP server](https://docs.minervachain.org/~gitbook/mcp).

# Run a local devnet

The network repository starts a single-node Minerva devnet (chain id 77137) with the same rules as the mainnet: native-only transactions, the precompiles, system contracts and emission from block 0. A devnet account is prefunded so you can start sending at once.

## Requirements

Node.js 20+, pnpm 10+, Go 1.22+, Foundry.

```sh
git clone https://github.com/MinervaQuantum/minerva-network network
cd network
pnpm install
pnpm coregeth:build          # builds build/bin/minerva-geth from the CoreGeth fork
```

Stock go-ethereum is not a substitute: it refuses Ethash sealing on new private networks and has no ML-DSA precompile.

## Start

```sh
pnpm devnet:start
pnpm devnet:health
```

| Service       | Command                                                                      | Address                      |
| ------------- | ---------------------------------------------------------------------------- | ---------------------------- |
| Node RPC      | started by `devnet:start`                                                    | `http://127.0.0.1:8545`      |
| RPC gateway   | `pnpm rpc:start`                                                             | `http://127.0.0.1:18545/rpc` |
| Faucet        | `pnpm faucet:start`                                                          | `http://127.0.0.1:18546`     |
| PQ relayer    | `pnpm pq-relayer:start`                                                      | `http://127.0.0.1:18548`     |
| Indexer       | `pnpm indexer:start`                                                         | `http://127.0.0.1:18549`     |
| Explorer      | `pnpm explorer:start` (set `NEXT_PUBLIC_INDEXER_URL=http://127.0.0.1:18549`) | `http://127.0.0.1:3050`      |
| Explorer-lite | `pnpm explorer-lite:start`                                                   | `http://127.0.0.1:18547`     |

Deploy the contracts the smokes use (system contracts are already in the genesis):

```sh
pnpm contracts:deploy:devnet
```

## Smoke tests

Each command is a live proof against the running devnet:

```sh
pnpm devnet:pq-smoke                 # fund, deploy and execute from a Minerva account
pnpm devnet:pq-native-raw-smoke      # submit a raw MinervaPQTxV1 with no relayer
pnpm devnet:pq-rotation-smoke        # rotate a key; the old key is rejected by consensus
pnpm devnet:pq-device-key-smoke      # enrol a device key, hit and miss its scope, revoke it
pnpm devnet:migration-smoke          # migration reserve claims and the base-fee split
pnpm devnet:multinode-smoke          # two nodes peer, sync and mine a PQ transaction
pnpm devnet:acceptance               # the whole chain, including wallet flows
```

## Point a wallet at it

Minerva Wallet development builds include the devnet as a selectable network (chain 77137). The extension's options page also accepts a custom RPC URL, and the SDK accepts `createMinervaClient({ rpcUrl: "http://127.0.0.1:8545", chainId: 77137 })`-style overrides through `@minervaquantum/chain-config`'s custom chain registration.

## Stop and reset

```sh
pnpm devnet:stop
pnpm devnet:reset     # wipes the data directory
```

The full guide, including the proof-pack export, is `docs/devnet/run-devnet.md` in the network repository.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.minervachain.org/build/local-devnet.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
