Truffle 入门

准备环境

Install truffle

启动

mkdir hello
cd hello

# truffle compile  编译合约
# truffle console  进入命令行交互模式,合成合约需要在这个交互模式下
# truffle migrate  在命令行交互模式中,合成合约

truffle init
truffle compile

MetaMask 集成 truffle

  1. 启动Truffle图形界面
  2. 启动MetaMask 添加网络
  3. Click on your user picture from metamask, and then select import account from drop down in metamask. And then input the secret key (select one of the 10 accounts from image below) from you gnache gui server.

image

Remix 集成 truffle

Environment 选择 External Http Provider, 并配置

image

账户和代币都显示在Account中,和Truffle Ganache界面显示的账号地址一致

image

posted @ 2022-10-15 20:30  608088  阅读(41)  评论(0编辑  收藏  举报