@0xcert/truffle 中文文档教程

发布于 6年前 浏览 30 项目主页 更新于 3年前

[npm]() [npm]() Join the chat at https://gitter.im/consensys/truffle


Truffle 是以太坊的开发环境、测试框架和资产管道,旨在让生活成为以太坊开发人员更容易。 使用 Truffle,您将获得:

  • Built-in smart contract compilation, linking, deployment and binary management.
  • Automated contract testing with Mocha and Chai.
  • Configurable build pipeline with support for custom build processes.
  • Scriptable deployment & migrations framework.
  • Network management for deploying to many public & private networks.
  • Interactive console for direct contract communication.
  • Instant rebuilding of assets during development.
  • External script runner that executes scripts within a Truffle environment.

Install

$ npm install -g truffle

Quick Usage

对于一组默认的契约和测试,在一个空的项目目录中运行以下命令:

$ truffle init

从那里,您可以运行 truffle compiletruffle migratetruffle test 编译您的合约,将这些合约部署到网络,并运行它们相关的单元测试。

Truffle 与本地开发区块链服务器捆绑在一起,当您调用上述命令时,该服务器会自动启动。 如果您想配置更高级的开发环境,我们建议您通过运行 npm 单独安装区块链服务器在命令行安装 -g ganache-cli

  • ganache-cli: a command-line version of Truffle's blockchain server.
  • ganache: A GUI for the server that displays your transaction history and chain state.

Documentation

请参阅官方 Truffle 文档以获取指南、提示和示例。

Contributing

该软件包是 Truffle 命令行工具的分发包。 请参阅 truffle-core 贡献主要核心代码。

License

麻省理工学院

[npm]() [npm]() Join the chat at https://gitter.im/consensys/truffle


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:

  • Built-in smart contract compilation, linking, deployment and binary management.
  • Automated contract testing with Mocha and Chai.
  • Configurable build pipeline with support for custom build processes.
  • Scriptable deployment & migrations framework.
  • Network management for deploying to many public & private networks.
  • Interactive console for direct contract communication.
  • Instant rebuilding of assets during development.
  • External script runner that executes scripts within a Truffle environment.

Install

$ npm install -g truffle

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-cli at the command line.

  • ganache-cli: a command-line version of Truffle's blockchain server.
  • ganache: A GUI for the server that displays your transaction history and chain state.

Documentation

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

Contributing

This package is a distribution package of the Truffle command line tool. Please see truffle-core to contribute to the main core code.

License

MIT

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文