# Starting and stopping the server

## Using Gamma CLI

Start Gamma server by running in terminal

```
gamma-cli start-local
```

When finished with the server, stop it by running in terminal

```
gamma-cli stop-local
```

When you're not sending transactions, the nodes that make up Gamma server will still keep closing empty blocks. It is therefore recommended to stop the server when it's not needed.

### Customizing the Gamma server port

Gamma server is an actual blockchain instance running on your local machine. Clients like Gamma CLI are able to communicate with this instance using HTTP.

By default, Gamma server listens on port **8080**. To start Gamma server on a different port, **8089** for example, run the following in terminal

```
gamma-cli start-local -port 8089
```

## Running Prism

Prism is the Orbs block explorer, you can access the one pointing to the mainnet at: <https://prism.orbs.network>

When running gamma and starting the server, it will also automatically run prism which will be accessible locally by browsing to <http://localhost:3000>

### Customizing the Prism port

Prism will start on port **3000** by default, to start it on a different port, **3003** for example, run the following when starting gamma in the terminal

```
gamma-cli start-local -prismPort 3003
```

This command line flag can of course be chained with other flags.

### Disable Prism

If you do not wish Prism to start with Gamma, use the `no-ui` flag, and run the following when starting Gamma in the terminal

```
gamma-cli start-local -no-ui
```

## In-memory instance

{% hint style="warning" %}
It's important to understand that Gamma server is not storing any persistant state and uses only in-memory storage.
{% endhint %}

Every time you restart a Gamma server, all contracts and state disappear from memory. You will need to deploy the contracts again when the server is started.


---

# 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://docs.orbs.network/v2-contract-sdk/gamma-in-depth/starting-and-stopping-the-server.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.
