2. Configuration

Configure hardhat.config.js

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

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"
    }
  }
};

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

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

Then update your config:

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],
    },
  }
};

Last updated