Do ensure that your npm modules have been added to your path
After installing the above dependencies, we can proceed to install hardhat:
npm install --save-dev hardhat
To create your Hardhat project, run this command while you are in the project's root folder:
npx hardhat
Return (choose the most appropriate option):
? What do you want to do? ...
> Create a basic sample project
Create an advanced sample project
Create an advanced sample project that uses TypeScript
Create an empty hardhat.config.js
Quit
Let’s create the sample project and go through these steps to try out the sample task and compile, test and deploy the sample contract.
The sample project will ask you to install hardhat-waffle and hardhat-ethers, which makes Hardhat compatible with tests built with Waffle. You can learn more about it in this guide.
Hardhat will let you know how, but, in case you missed it, you can install them with npm install --save-dev @nomiclabs/hardhat-waffle ethereum-waffle chai @nomiclabs/hardhat-ethers ethers
hardhat-config
After setting up your truffle project, be it cloning a repository or initializing a new hardhat project
Open hardhat-config.js
Edit hardhat-config.js with Pundi AIFX network credentials
Create a .env file to store your private key of that corresponding wallet address
The files below are just an example, feel free to rename your variables:
if you have not already installed dontenv, please do so by running the following command:
Compile Smart contract file
Deploying on Pundi AIFX Network
Run this command in root of the project directory:
Contract will be deployed on Pundi AIFX network, it will look something like this:
Remember your address would differ, the above is just to provide an idea of structure. Congratulations! You have successfully deployed Greeter Smart Contract. Now you can interact with the Smart Contract.