truffle README

The project's README from github.com/ConsenSys-archive/truffle. As one markdown file: README.md.

:warning: The Truffle Suite is being sunset. For information on ongoing support, migration options and FAQs, visit the Consensys blog. Thank you for all the support over the years.

npm npm GitHub Discussions Coverage Status gitpoap badge


Truffle is a development environment, testing framework, and asset pipeline for Ethereum, aiming to make life as an Ethereum developer easier. With Truffle you get:

ℹ️ Contributors: Please see the Development section of this README.

Install

$ npm install -g truffle

Note: To avoid any strange permissions errors, we recommend using nvm.

Quick Usage

For a default set of contracts and tests, run the following within an empty project directory:

$ truffle init

From there, you can run truffle compile, truffle migrate, and truffle test to compile your contracts, deploy those contracts to the network, and run their associated unit tests.

Truffle comes bundled with a local development blockchain server that launches automatically when you invoke the commands above. If you'd like to configure a more advanced development environment we recommend you install the blockchain server separately by running npm install -g ganache at the command line.

Documentation

Please see the Official Truffle Documentation for guides, tips, and examples.

Development

We welcome pull requests. To get started, just fork this repo, clone it locally, and run:

# Install
npm install -g yarn
yarn bootstrap

# Test
yarn test

# Adding dependencies to a package
cd packages/<truffle-package>
yarn add <npm-package> [--dev] # Use yarn

If you'd like to update a dependency to the same version across all packages, you might find this utility helpful.

Notes on project branches:

Please make pull requests against develop.

There is a bit more information in the CONTRIBUTING.md file.

License

MIT

truffle (ConsenSys-archive/truffle)

Searching Database…

13.9K ·GitHub
archived
这是做什么的?Truffle 是以太坊的开发环境、测试框架和资源流水线,目的是让以太坊开发者的工作更轻松。它把智能合约的编译、部署和测试整合到一套工作流程里。
它是命令行工具,还是有图形界面的应用?它是命令行工具:你在终端里用 truffle compile、truffle migrate、truffle test 这类命令来编译合约、部署到网络并运行单元测试。
怎么安装,怎么开始第一个项目?先用 npm 全局安装(README 建议先装 nvm,避免权限错误),然后在一个空的项目目录里运行 truffle init,它会生成一套默认的合约和测试文件。
我需要自己跑一个以太坊节点或测试网吗?不需要——Truffle 自带一个本地开发区块链服务器,运行那些命令时会自动启动。想要更高级的配置,可以用 npm install -g ganache 单独安装 ganache 服务器。
仓库上有个停止维护的警告,对新用户来说这意味着什么?Truffle Suite 已经停止开发,这个仓库也已归档。README 指向 ConsenSys 的博客,可以了解后续支持、迁移方案和常见问题,所以在投入时间之前要先权衡一下。
它支持哪些平台?只要能运行 Node.js 的地方都可以——它通过 npm 分发,是支持 Windows、macOS 和 Linux 的跨平台命令行工具。
免费吗?商用项目也能用吗?可以——Truffle 采用 MIT 许可证,可以免费使用、修改和分发。
除了编译和部署合约,Truffle 还能做什么?它可以用 Mocha 和 Chai 运行自动化合约测试,管理多个网络,让你能部署到各种公链和私链;还提供交互式控制台,可以直接和合约对话;开发过程中能即时重新构建资源,还可以在 Truffle 环境里运行外部脚本。
Ganache 是什么?我需要安装它吗?Ganache 是这套工具里负责本地区块链的部分:ganache 是 Truffle 区块链服务器的命令行版本,ganache-ui 则是图形界面版本,可以查看你的交易历史和链上状态。基础使用不需要装它——已经内置了一个服务器,会自动启动。
它能部署到公开测试网或主网,而不只是本地链吗?可以——网络管理功能支持部署到多种公链和私链,而且部署是以脚本化迁移的方式进行的,多步骤部署在不同的环境里都可以重复执行。
Size
180.7 MB
Stars
13.9K
Age
11y
Commits · 90 Days