Getting started with Hardhat | Ethereum development environment for professionals by Nomic FoundationGetting started with Hardhathttps://hardhat.org/hardhat-runner/docs/getting-started#quick-start安装环境
npm install --save-dev hardhat
创建项目
npx hardhat
编译项目
npx hardhat compile
单元测试
npx hardhat test
发表项目
npx hardhat run scripts/deploy.ts
运行本地节点,打开另外一个terminal执行以下命令
npx hardhat node
连接本地节点
npx hardhat run scripts/deploy.ts --network localhost
遇到Cannot find module '@nomicfoundation/hardhat-toolbox'问题
执行npm install --save-dev @nomicfoundation/hardhat-toolbox
alchemy - Cannot find module '@nomicfoundation/hardhat-toolbox' - Stack Overflow
改为执行 npx hardhat run .\scripts\deploy.js --network localhost
更多
Hardhat快速上手_hardhat默认账户_正如此时的博客-CSDN博客