> For the complete documentation index, see [llms.txt](https://luntra.gitbook.io/luntra-infrastructure/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://luntra.gitbook.io/luntra-infrastructure/smart-contract-deployment-guide-on-hardhat/2.-configuration.md).

# 2. Configuration

### Configure hardhat.config.js

Replace the contents of your `hardhat.config.js` file with:

```javascript
require("@nomicfoundation/hardhat-toolbox");

/** @type import('hardhat/config').HardhatUserConfig */
module.exports = {
  solidity: "0.8.28",
  networks: {
    luntraChain: {
      url: "https://rpc.luntrainfrastructure.com/http",
      chainId: 3470144,
      accounts: ["YOUR_PRIVATE_KEY_HERE"], // Replace with your actual private key
    },
    hardhat: {
      // Local development network
    },
    localhost: {
      url: "http://127.0.0.1:8545"
    }
  },
  etherscan: {
    // Add block explorer API key if available for Luntra
    apiKey: {
      luntraChain: "YOUR_API_KEY"
    }
  }
};

```

### Environment Variables (Recommended)

For security, create a `.env` file in your project root:

```shell
LUNTRA_PRIVATE_KEY=your_private_key_here
LUNTRA_RPC_URL=https://rpc.luntrainfrastructure.com/http
```

#### Then update your config:

```javascript
require("dotenv").config();

module.exports = {
  solidity: "0.8.28",
  networks: {
    luntraChain: {
      url: process.env.LUNTRA_RPC_URL,
      chainId: 3470144,
      accounts: [process.env.LUNTRA_PRIVATE_KEY],
    },
  }
};

```
