第四讲:以太坊智能合约开发框架Hardhat入门

315 阅读1分钟

Hardhat入门

安装
npm install --save-dev hardhat

初始化项目
npx hardhat

编译合约
npx hardhat compile

测试合约
npx hardhat test

部署合约
npx hardhat run scripts/deploy.ts

启动一个本地的以太坊
npx hardhat node

部署合约到本地的以太坊
npx hardhat run scripts/deploy.ts --network localhost

Hardhat官网

https://hardhat.org/

官方教程:
https://hardhat.org/tutorial

中文教程:
https://learnblockchain.cn/docs/hardhat/getting-started/#%E6%A6%82%E8%BF%B0

博客

zhang555.github.io/