# Forking Mainnet

**EVM**

**Foundry for testing**

```solidity
vm.createSelectFork(MAINNET_RPC_URL);

// or

vm.createSelectFork(MAINNET_RPC_URL, blockNumber);
```

**Running a local node**

```bash
anvil --fork-url https://eth.llamarpc.com
```

**Solana**

In Solana you have to download program binaries and accounts you need

```bash
solana program dump -u m metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s tests/fixtures/mpl_token_metadata.so

solana account XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX --output json > tests/fixtures/your_account.json
```

**Anchor.toml for testing**

```rust
[[test.genesis]]
address = "metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s"
program = "tests/fixtures/mpl_token_metadata.so"

[[test.validator.account]]
address = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
filename = "tests/fixtures/your_account.json"
```

**Running a local node**

```bash
solana-test-validator \
  --bpf-program metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s tests/fixtures/your_account.json \
  --account XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX tests/fixtures/your_account.json
```


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://0xkowloon.gitbook.io/anchor-for-evm-developers/forking-mainnet.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
