# 2. How to Use Mina IDE

## 1. Write a contract

After entering the project, you can click on the "preview" option at the top right corner of the readme.md file in the folder to preview it.

<figure><img src="/files/D6dWHg2FSClyvyplEocl" alt=""><figcaption></figcaption></figure>

In the Explorer panel, you can create new files (or folders), refresh the directory, and download files. You can also directly click on the files that come with the template.

<figure><img src="/files/VILo9HbHRuuvRmk5gMTE" alt=""><figcaption></figcaption></figure>

Click on a contract file to edit the code.

<figure><img src="/files/PxkdQKFftzx2ZZM4UXSS" alt=""><figcaption></figcaption></figure>

## 2. Compile a contract

On the right-hand menu bar, under the Compiler section, select "Module Package Path", and then click on "Compile" to start compiling the contract.

<figure><img src="/files/Ijd6VCZltNSBjK02BEPE" alt=""><figcaption></figcaption></figure>

After successful compilation, a 'build' folder will be generated in the current directory.

<figure><img src="/files/SUq4MNCLkshz8nOKsfvS" alt=""><figcaption></figcaption></figure>

## 3. Deploy a contract

Click on the "Deploy & Interaction" button on the right side, which will take you to the deployment and interaction page. Select "Module Package Path", and then click on "Config" to start zk config.

<figure><img src="/files/ro1ZbspB0G6rHKmhMW5l" alt=""><figcaption></figcaption></figure>

For example (Testnet):

* Deploy alias name: `devnet`

  This tutorial uses `devnet`, but the deploy alias name can be anything and does not have to match the network name.
* Target network kind: `Testnet`
* Mina GraphQL API URL: `https://api.minascan.io/node/devnet/v1/graphql`
* Transaction fee to use when deploying (in MINA): `0.1`
* Use a different account (select to see options): `Create a new fee payer key pair`

For example (Mainnet):

* Deploy alias name: `mainnet`

  This tutorial uses `devnet`, but the deploy alias name can be anything and does not have to match the network name.
* Target network kind: `Mainnet`
* Mina GraphQL API URL: `https://api.minascan.io/node/mainnet/v1/graphql`
* Transaction fee to use when deploying (in MINA): `0.1`
* Use a different account (select to see options): `Create a new fee payer key pair`

After completing the configuration, click on the faucet link in the Sandbox to obtain test tokens.

<figure><img src="/files/q5VcVdTVaBgbDqb1LGRX" alt=""><figcaption></figcaption></figure>

After successfully obtaining the test tokens, click on Deploy and select the appropriate Deploy Alias for deployment.

<figure><img src="/files/HunPMBXnBY2y5tu0RNUX" alt=""><figcaption></figcaption></figure>

Wait for a moment, and the sandbox will display the deployment link. Click on that link to confirm that the deployment transaction has been successfully added to the chain.

<figure><img src="/files/gvniInxOjFSBLGvKT8SE" alt=""><figcaption></figcaption></figure>

## 4. Contract interaction

After a successful contract deployment, you can interact with the contract. Select the corresponding parameters and click on Interact to initiate the interaction.

<figure><img src="/files/epm7fMvCNgDmaev1zRl8" alt=""><figcaption></figcaption></figure>

## 5. Mina Sandbox

If you prefer using the command line for development, you can open the Mina Sandbox, which comes pre-loaded with [zkApp CLI](https://www.npmjs.com/package/zkapp-cli), [Git](https://git-scm.com/) and [Node.js V20](https://nodejs.org/en)。

<figure><img src="/files/bsTlQkpO02KcFpdwfC9z" alt=""><figcaption></figcaption></figure>

If you've started a process on a port in the Sandbox and wish to access that port, please refer to [ChainIDE - Port Forwarding](/chainide-english-1/port-forwarding.md).


---

# 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://chainide.gitbook.io/chainide-english-1/ethereum-ide-1/16.-mina-ide/2.-how-to-use-mina-ide.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.
