Dapp开发petshop——truffle官方例程
时间:2022-02-22 作者:junny-du
truffle-pet-shop
pet-shop是truffle的官方例程。
之前参考https://域名/2018/01/12/first-dapp/的中文教程,但是里面有一些错误,修改起来麻烦。
后面直接参加官方例程https://域名/tutorial/域名,虽然是英文,但写的很好,一步一步来。就是现在的repositotyhttps://域名/driftalong2/petshop。
使用之前,需要
1.安装Ganache,启动
2.在浏览器里安装MetaMask,导入Ganache的密钥
下载之后:
npm install
truffle compile
truffle migrate
truffle test
最后,运行
npm run dev
浏览器会自动弹开,进入这个页面。
记录一下使用过程可能会出现的错误:
-
npm install没有权限,或者安装完之后找不到安装的包
https://域名/weixin_46794385/article/details/119847646 -
Truffle Unbox failed问题解决方法
https://域名/weixin_45591812/article/details/116800865 -
合约版本错误
https://域名/sinyusin/article/details/88558519