2. How to Use Mina IDE

The process of writing, compiling, deploying and interacting with Mina 01js smart contracts

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.

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.

Click on a contract file to edit the code.

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.

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

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.

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.

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

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.

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.

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, Git and Node.js V20

If you've started a process on a port in the Sandbox and wish to access that port, please refer to ChainIDE - Port Forwarding.

Last updated