# Configuration Hardhat

### Configure Hardhat <a href="#configure-hardhat" id="configure-hardhat"></a>

[Hardhat](https://hardhat.org/) is a development environment to compile, deploy, test, and debug your Ethereum software. It helps developers manage the entire development cycle of their smart contracts. Hardhat is a popular choice for developers who want to build, test, and deploy smart contracts on the Ethereum network.

This guide will walk you through configuring Hardhat to work with IBVM. You will learn how to set up Hardhat to deploy smart contracts on **IBVM Testnet.**

#### Hardhat Installation <a href="#hardhat-installation" id="hardhat-installation"></a>

Before you begin, make sure you have Node.js installed on your machine. If you haven't installed Node.js yet, you can download it from the [official website](https://nodejs.org/).

To install Hardhat, run the following command in your terminal:

```javascript
npm install --save-dev hardhat
```

This command will install Hardhat as a development dependency in your project.

#### Create a Hardhat Project <a href="#create-a-hardhat-project" id="create-a-hardhat-project"></a>

To create a new Hardhat project, run the following command in your terminal:

```javascript
npx hardhat init
```

Select the default options when prompted. This command will create a new Hardhat project in your current directory.

#### Configure Hardhat for IBVM <a href="#configure-hardhat-for-citrea" id="configure-hardhat-for-citrea"></a>

To configure Hardhat for IBVM, you need to update the `hardhat.config.js` file in your project directory. Open the `hardhat.config.js` file in your code editor and add the following configuration:

```javascript
"REST_OF_YOUR_CONFIG_GOES_HERE",
module.exports = {
    "REST_OF_YOUR_CONFIG_GOES_HERE",
    networks: {
        ibvm: {
            url: "https://rpc-testnet.ibvm.io",
            chainId: 2107,
            accounts: ["YOUR_PRIVATE_KEY"],
        },
    },
    "REST_OF_YOUR_CONFIG_GOES_HERE",
};
```

Replace `YOUR_PRIVATE_KEY` with your private key. Make sure to keep your private key secure and never share it with anyone. You can obtain a private key from your IBVM Testnet wallet (e.g., Metamask).

#### Implement Your Smart Contract and Deploy <a href="#implement-your-smart-contract-and-deploy" id="implement-your-smart-contract-and-deploy"></a>

For the rest of the development process, you can follow the official Hardhat documentation to compile, deploy, test, and debug your smart contracts. You can find more information on the [Hardhat website](https://hardhat.org/).

Once you have implemented your smart contract, you can deploy it to IBVM Testnet using the following command:

```javascript
npx hardhat run --network ibvm scripts/deploy.js
```

This command will deploy your smart contract to the IBVM Testnet network. You can interact with your smart contract using the IBVM Testnet explorer or other tools.

### Congratulations! <a href="#congratulations" id="congratulations"></a>

You have successfully configured Hardhat to work with IBVM. You can now start building and deploying smart contracts on IBVM Testnet.


---

# 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://ibvm.gitbook.io/ibvm-doc/development-guide/configuration-hardhat.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.
