Skip to content

Learn how to test compile and deploy smartcontract using hardhat

Notifications You must be signed in to change notification settings

bhupendra-chouhan/hardhat-tutorial

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Testing, Compiling and Deploying smartcontract onto the blockchain using Hardhat



Documentations:


Steps to do:

  • Install NodeJS.
  • Initialise a Node project packake.json: npm init -y
  • Install Hardhat as a dev-dependency: npm install --save-dev hardhat
  • Initialise hardhat project: npx hardhat init
  • Install the hardhat-ignition plugin: npm install --save-dev @nomicfoundation/hardhat-ignition
  • Compile the already given smart contract: npx hardhat compile
  • Test the contract: npx hardhat test
  • Install dotenv as dev-dependency: npm install --save-dev dotenv
  • Create and Configure the .env file:
DEPLOYER_PRIVATE_KEY="es2342534ds345ft......"
RPC_URL-"https://rpc.open-campus-codex.gelato.digital"
  • Configure the OpenCampusCodex network inside the hardhat.config.js file:
    require("dotenv").config();
    require("@nomicfoundation/hardhat-toolbox");

    /** @type import('hardhat/config').HardhatUserConfig */
    module.exports = {
        solidity: "0.8.24",
        networks: {
            opencampus: {
            accounts: [process.env.DEPLOYER_PRIVATE_KEY],
            url: process.env.RPC_URL
            }
        }
    };

  • Finally Deploying the smartcontract onto the blockchain: npx hardhat ignition deploy ./ignition/modules/Lock.js --network opencampus

About

Learn how to test compile and deploy smartcontract using hardhat

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published