Sometimes You Need A Hard Hat for Blockchain Testing
In our labs, we tell the students to use command-line tools wherever possible, and where the terminal or command line should become the natural place to run things.
And so, in cybersecurity, we often avoid those pesky Graphical User Interfaces (GUI) and find a way to drop to a Command Line Interface (CLI). With Ethereum testing, we can use Remix and Ganache, but these take a bit of control away from the user, and are difficult to script with. Here we see Remix being used to test a function in a smart contract [here]:
But there’s another way … the Hardhat way:
With Hardhat, we use command-line tools to create the compilation, testing and deployment of our code. This makes the whole process easier to script and automate. After installing Hardhat, we can check the accounts that it has created for us:
% npx hardhat accounts
0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266
0x70997970C51812dc3A010C7d01b50e0d17dc79C8…