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

# Test environments

> A deployment of your app that runs on Bankroll with test cash instead of real money, told apart by one setting and one manifest claim.

An app can run in two environments. **Live** is the app your players use,
paid in BCASH. **Test** is a second deployment of the same code, on the same
Bankroll, paid in **test cash**: a token Bankroll mints without limit that is
worth nothing anywhere. You try a change on test with no real money at risk,
then publish it to live.

## How a Bankroll-built app gets one

An app built with Bankroll has both versions from the start, in one repo.
`git push bankroll main` builds the test version at the app's test address;
`git push bankroll main:live` publishes the tested commit as the live
version. The Bankroll app's builder does the same from a phone: every prompt
builds the test version, and Publish in the test version's menu moves live.
`bankroll wait test` and `bankroll wait live` watch a build; `bankroll
faucet` sends you test cash. Everything below is what Bankroll sets on the
test deployment for you. A self-hosted app sets it itself.

## One setting tells them apart

A test deployment carries one setting:

```bash theme={null}
BANKROLL_ENVIRONMENT=test
```

It is set on a test deployment and nowhere else. A deployment without the
setting is live, as every deployment was before the setting existed, so
nothing changes for an app that never heard of it.

Everything else follows from the setting. On the server, `appEnvironment()`
answers `"test"` or `"live"`, and the money constants follow:

```ts theme={null}
import { appEnvironment, HSUSD_MINT, BCASH_MINT, TEST_CASH_MINT } from '@joinbankroll/sdk/server';

appEnvironment(); // "test" on a test deployment, "live" otherwise
HSUSD_MINT;       // TEST_CASH_MINT on a test deployment, BCASH_MINT otherwise
```

`HSUSD_MINT` is the mint cash settles in **for this deployment**. Charges,
payouts, and `checkCharge` default to it, so the code you wrote for live runs
on test unchanged; only the money differs. Name `BCASH_MINT` or
`TEST_CASH_MINT` only when you mean one of them in particular.

## The manifest says which it is

`manifestRoute` reads the setting and declares it:

```json theme={null}
{ "environment": "test" }
```

A live manifest carries no `environment` claim, so a manifest signed before
the claim existed signs to the same bytes it always did. When the Bankroll
host opens a test deployment, the claim is what makes it charge in test cash,
show test-cash balances, and offer test cash instead of a deposit when a
player runs short.

<Note>
  A test deployment has its own address, its own data, and its own payment
  address. Test cash paid to it stays test cash; nothing moves between the two
  environments.
</Note>

## The mints

| Token | Mint | Decimals |
| - | - | - |
| Bankroll Cash (BCASH) | `4FVaHEubcqws8hKwJSiW8f8CmKGUyMsBxTKUytcGdRvd` | 9 |
| Test cash | `BSHVy5kVBKrrPtD2kasMQKacqzUEMQE2DVGJckNEi2Jf` | 9 |

Both are SPL tokens on Solana mainnet, nine decimals, one token to the dollar.
Test cash has no value and no market; it is minted by Bankroll on request and
spent only inside test deployments.


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