---
title: "Get Test ADA and Set Up Preprod or Preview"
description: "Get free test ada from the Cardano faucet, pick preprod or preview, and configure Mesh providers, keys and network ids for a Cardano testnet."
url: https://meshjs.dev/guides/testnet-setup
markdown: https://meshjs.dev/guides/testnet-setup.md
lastModified: 2026-12-03
---

# Get Test ADA and Set Up Preprod or Preview

Get free test ada from the Cardano faucet, pick preprod or preview, and configure Mesh providers, keys and network ids for a Cardano testnet.

To get test ada, open the official [Cardano testnet faucet](https://docs.cardano.org/cardano-testnets/tools/faucet), choose preprod or preview, and paste a testnet address (`addr_test1...`) from your wallet. Then point Mesh at the same network: `network: "preprod"` (or `"preview"`) in `TxBuilder`, a provider key for that network, and network id `0` in your wallet.

## Which testnet should I use: preprod or preview?

Cardano has two public test networks. Both use test ada with no real-world value and testnet addresses that start with `addr_test1`.

|                                 | Preprod                                                                                          | Preview                                                           |
| ------------------------------- | ------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------- |
| Purpose                         | The most mature test network, resembling mainnet; for testing a dApp before deploying to mainnet | Testing release candidates of upcoming node and protocol releases |
| Mesh `network` name             | `"preprod"`                                                                                      | `"preview"`                                                       |
| Network id (addresses, wallets) | `0`                                                                                              | `0`                                                               |
| Network magic                   | `1`                                                                                              | `2`                                                               |

The descriptions follow the [Cardano testnet environments](https://docs.cardano.org/cardano-testnets/environments) page. Mainnet uses network id `1` and magic `764824073`; the magic values come from `networkConfig` in `@meshsdk/common`. Most Mesh examples use preprod; if unsure, start there.

## How do I get test ada from the faucet?

1. Switch your wallet to the testnet you chose, in the wallet's network settings, and copy a receiving address that starts with `addr_test1`. Check your wallet's documentation for which testnets it supports.
2. Open the [Cardano testnet faucet](https://docs.cardano.org/cardano-testnets/tools/faucet).
3. Select the network and the action to receive test ada, paste your address, and submit. If you have been issued a faucet API key, enter it as well.
4. Wait for the transaction to confirm, then check the balance in your wallet.

When you have finished testing, the faucet asks you to return unused test ada to it.

For a server-side wallet, get its address from your code and paste that address into the faucet. See [Headless wallet](https://meshjs.dev/apis/wallets/meshwallet) for creating a wallet from a mnemonic, and [Mint an NFT collection](https://meshjs.dev/guides/nft-collection) for a full example that generates a wallet and funds it from the faucet.

## How do I configure Mesh for a testnet?

Use the same network everywhere: in the builder, the provider and the wallet. A mismatch makes `TxBuilder` throw `NETWORK_MISMATCH` (see [Providers and networks](https://meshjs.dev/apis/txbuilder/networks)).

```tsx
import { BlockfrostProvider, TxBuilder } from "@meshsdk/core";

// A Blockfrost project ID for preprod starts with "preprod"
const provider = new BlockfrostProvider("<YOUR_PREPROD_PROJECT_ID>");
const builder = new TxBuilder({ network: "preprod", provider });
```

Create your wallet with network id `0` and the same provider. Wallet setup is covered in [Wallets](https://meshjs.dev/apis/wallets): [browser wallets](https://meshjs.dev/apis/wallets/browserwallet) follow the network the user selected in the extension, and [headless wallets](https://meshjs.dev/apis/wallets/meshwallet) take a `networkId`.

## How do I get a provider key for each network?

Each hosted provider issues keys or endpoints per network. Use a testnet key with a testnet builder.

| Provider                                              | How the network is chosen                                                                                                                                                               | Example                                                                 |
| ----------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------- |
| [Blockfrost](https://meshjs.dev/providers/blockfrost) | By the project ID: create a separate project per network in the Blockfrost dashboard. The ID starts with `preprod`, `preview` or `mainnet`, and Mesh reads the network from that prefix | `new BlockfrostProvider("<YOUR_PREPROD_PROJECT_ID>")`                   |
| [Koios](https://meshjs.dev/providers/koios)           | By the first argument: `"preprod"`, `"preview"` or `"api"` (mainnet). The API key is optional                                                                                           | `new KoiosProvider("preprod", "<YOUR_API_KEY>")`                        |
| [Maestro](https://meshjs.dev/providers/maestro)       | By the `network` option: `"Preprod"`, `"Preview"` or `"Mainnet"`, with a key for that network                                                                                           | `new MaestroProvider({ network: "Preprod", apiKey: "<YOUR_API_KEY>" })` |
| [UTxO RPC](https://meshjs.dev/providers/utxorpc)      | By the endpoint URL of the server you connect to                                                                                                                                        | See the provider page                                                   |

Keep keys out of source control: read them from environment variables, as in [Mint an NFT collection](https://meshjs.dev/guides/nft-collection).

## Can I test without a public testnet?

Yes. [Yaci DevKit](https://meshjs.dev/yaci) runs a local Cardano devnet in Docker that you can create, fund and reset in seconds, with no faucet and no rate limits. Mesh also hosts a Yaci devnet you can reach with `new YaciProvider()`. See [Getting started with Yaci](https://meshjs.dev/yaci/getting-started) and [Yaci transactions](https://meshjs.dev/yaci/transactions); on a devnet, give `TxBuilder` a `customNetwork(...)` instead of `"preprod"`.

For unit tests with no network at all, use `TxEmulator` from `@meshsdk/tx-emulator` ([Testing](https://meshjs.dev/apis/txbuilder/testing)) or the [Offline fetcher](https://meshjs.dev/providers/offline-fetcher).

## Troubleshooting

### The faucet transaction never arrives

Check that your wallet is on the same network you selected in the faucet, and that you pasted an `addr_test1` address.

### `NETWORK_MISMATCH` when building

The builder's `network`, the provider and the wallet disagree. A preprod Blockfrost key with `network: "preview"` is a common cause.

### 403 or "Project not found" from Blockfrost

The project ID belongs to another network. Create a project for the network you use.

## Related

- [Build your first dApp with Next.js](https://meshjs.dev/guides/nextjs)
- [Providers](https://meshjs.dev/providers)
- [Cardano developer glossary](https://meshjs.dev/resources/glossary)
- [Production deployment](https://meshjs.dev/guides/production-deployment)
