Dapp开发petshop——truffle官方例程

truffle-pet-shop

pet-shop是truffle的官方例程。

之前参考https://learnblockchain.cn/2018/01/12/first-dapp/的中文教程,但是里面有一些错误,修改起来麻烦。

后面直接参加官方例程https://trufflesuite.com/tutorial/index.html,虽然是英文,但写的很好,一步一步来。就是现在的repositotyhttps://github.com/driftalong2/petshop。

使用之前,需要

1.安装Ganache,启动

2.在浏览器里安装MetaMask,导入Ganache的密钥

下载之后:

npm install
truffle compile
truffle  migrate
truffle test

最后,运行

 npm run dev

浏览器会自动弹开,进入这个页面。
Dapp开发petshop——truffle官方例程_第1张图片

记录一下使用过程可能会出现的错误:

  1. npm install没有权限,或者安装完之后找不到安装的包
    https://blog.csdn.net/weixin_46794385/article/details/119847646

  2. Truffle Unbox failed问题解决方法
    https://blog.csdn.net/weixin_45591812/article/details/116800865

  3. 合约版本错误
    https://blog.csdn.net/sinyusin/article/details/88558519

你可能感兴趣的:(Dapp开发petshop——truffle官方例程)