美文网首页
Truffle初体验之Windows

Truffle初体验之Windows

作者: weiluo12 | 来源:发表于2021-12-16 17:43 被阅读0次

    第一步:安装nodejs

    第二步:安装truffle

        进入cmd

        D:\truffle>npm install -g truffle

    第三步:

        D:\truffle>npm install ganache-cli -g

    启动ganache

        D:\truffle>ganache-cli

    Ganache CLI v6.12.2 (ganache-core: 2.13.2)

    说明:这里如果使用如下命令安装的话,到时候部署会报错【切记不要使用这种过期的安装方式---踩坑了!!!】

        这种错误信息:VM Exception while processing transaction: invalid opcode

        npm -g install ethereumjs-testrpc@6.0.3

        D:\truffle\MetaCoin>TestRPC

        EthereumJS TestRPC v6.0.3 (ganache-core: 2.0.2)

    第四步:

        进入一个新的cmd

            mkdir MetaCoin

            cd MetaCoin

        d:\truffle\MetaCoin>truffle unbox metacoin

    说明:这里可能会报错【Got error: getaddrinfo ENOENT raw.githubusercontent.com.】

        解决方案是:

            1、查看raw.githubusercontent.com的真实IP地址【https://www/ipaddress.com/】

            2、把查询到的ip,配置到C:\Windows\System32\drivers\etc\hosts文件里面

                比如:185.199.108.133 raw.githubusercontent.com

                            185.199.109.133 raw.githubusercontent.com

                            185.199.110.133 raw.githubusercontent.com

                            185.199.111.133 raw.githubusercontent.com

    第五步:

        修改:truffle-config.js文件

    第六步:

        truffle compile

        truffle migrate

        truffle test

    相关文章

      网友评论

          本文标题:Truffle初体验之Windows

          本文链接:https://www.haomeiwen.com/subject/sdmvfrtx.html