> For the complete documentation index, see [llms.txt](https://docs.orbs.network/v2-contract-sdk/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.orbs.network/v2-contract-sdk/gamma-in-depth/working-with-multiple-environments.md).

# Working with multiple environments

## Motivation

In a standard workflow, the first steps of development will be facing a locally running Gamma server. This server runs multiple nodes in-memory on your local machine.

In later stages of the development process, the contract should also be tested on a test net. Since the test net is external, the HTTP endpoints used will have to change.

To make this process easier, Gamma CLI supports multiple environments with an optional config file.

## Gamma config JSON

To configure multiple environments create a file named `orbs-gamma-config.json` in the local directory, with the following format

{% code title="orbs-gamma-config.json" %}

```javascript
{
  "Environments": {
    "local": {
      "VirtualChain": 42,
      "Endpoints": ["localhost"]
    },
    "testnet1": {
      "VirtualChain": 90043,
      "Endpoints": ["http://192.168.1.1", "http://192.168.2.2:8080"]
    },
    "testnet2": {
      "VirtualChain": 3007,
      "Endpoints": ["http://10.1.1.122", "https://node-example.com", "http://another.io:8081"]
    }
  }
}
```

{% endcode %}

{% hint style="info" %}
If a config file does not exist, the default environment is `"local"` with virtual chain `42` and the endpoint `"localhost"`
{% endhint %}

## Choosing environment in Gamma CLI

You can choose the active environment by passing the `-env` command line argument to every command.&#x20;

For example, to work with environment **testnet2**

```
gamma-cli send-tx transfer.json -signer user1 -env testnet2
```


---

# 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 dynamically by asking a question.

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

```
GET https://docs.orbs.network/v2-contract-sdk/gamma-in-depth/working-with-multiple-environments.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
