Install Truffle Suite

Prerequist

gcc-c++, glibc-2.18

yum -y install gcc-c++

wget http://ftp.gnu.org/gnu/glibc/glibc-2.18.tar.gz
tar -xvf glibc-2.18.tar.gz
cd glibc-2.18
mkdir build && cd build && ../configure --prefix=/usr && make -j4 && make install

Notes

  • truffle是以太坊智能合约的开发工具,可以编译、单元测试、发布;也支持polygon链。
  • ganache-cli是以太坊模拟系统, 通过命令行启动模拟以太坊系统. ganache已被集成到truffle中,无需额外安装。
    ganache-cli是ethereum-testrpc的替代,所以不用安装testrpc。
  • Truffle Suite - ganache 是通过UI启动模拟以太坊系统

Install Truffle

# 查看版本 https://github.com/trufflesuite/truffle/releases
npm install -g truffle@5.5.31

# 在global目录中找到truffle
npm get prefix

# ls -l <global_path>/bin
ls -l `npm get prefix`/bin/

# 执行脚本
`npm get prefix`/lib/node_modules/truffle/build/cli.bundled.js

truffle --version

# 测试ganache 模拟以太坊, 一下两个命令运行哪个都可以
/matt/data/npm/global_modules/lib/node_modules/truffle/node_modules/.bin/ganache
/matt/data/npm/global_modules/lib/node_modules/truffle/node_modules/.bin/ganache-cli

image

图形界面

https://www.trufflesuite.com/ganache

image

posted @ 2022-10-15 17:35  608088  阅读(27)  评论(0编辑  收藏  举报