# hardhat 框架本地搭建 **Published by:** [ZhangSL](https://paragraph.com/@zhangsl/) **Published on:** 2022-05-24 **URL:** https://paragraph.com/@zhangsl/hardhat ## Content 环境搭建nodejswallet (metamask)IDE (vscode)部署//创建空的文件夹,执行 npm init //安装本地hardhat npm install --save-dev hardhat //创建项目 npx hardhat //创建测试虚拟账户 npx hardhat accounts //编译合约 npx hardhat compile //执行合约 npx hardhat run scripts/sample-script.js //启动本地网络 npx hardhat node //TODO Started HTTP and WebSocket JSON-RPC server at http://127.0.0.1:8545/ //链接到本地网络,后者链接到测试网络 npx hardhat run scripts/sample-script.js --network localhost npx hardhat run scripts/sample-script.js --network Ropsten ## Publication Information - [ZhangSL](https://paragraph.com/@zhangsl/): Publication homepage - [All Posts](https://paragraph.com/@zhangsl/): More posts from this publication - [RSS Feed](https://api.paragraph.com/blogs/rss/@zhangsl): Subscribe to updates - [Twitter](https://twitter.com/Z_SLong): Follow on Twitter