Fuel手册-更新中 (The Fuel Book)-updating
  • 0.Fuel手册 (The Fuel Book)
  • 1. 开发者快速上手 (Developer Quickstart)
    • 1.1构建智能合约 (Building A Smart Contract)
    • 1.2 构建前端 (Building a Frontend)
  • 2.准备开始 (Getting Started)
    • 2.1为什么是Fuel (Why Fuel)
    • 2.2Fuel是什么? (What is Fuel?)
      • 2.2.1 Fuel工具链 (The Fuel Toolchain)
    • 2.3 模块化运动 (Modular Movement)
      • 2.3.1 单片架构 (Monolithic Architecture)
      • 2.3.4 什么是模块化执行层 (What is a Modular Execution Layer)
    • 2.4 Fuel设置 (Fuel Configurations)
      • 2.4.1 作为汇总的Fuel (Fuel as a roll-up)
      • 2.4.2 作为L1的Fuel (Fuel as an L1)
      • 2.4.3 作为状态通道的Fuel (Fuel as a state channel)
      • 2.4.4 作为侧链的Fuel (Fuel as a sidechain)
  • 3. 技术 (Technology)
    • 3.1 并行交易执行(Parallel Transaction Execution)
    • 3.2欺诈证明 (Fraud Proofs)
  • 4. Fuel虚拟机 (The FuelVM)
    • 4.1合约和调用模型(Contract and Call Model)
    • 4.2内存模式 (Memory Mode)
    • 4.3多重原生资产(Multiple Native Assets)
    • 4.4FuelVM和EVM, 轻松搞明白(FuelVM vs. EVM, Explained)
  • 5.Sway语言 (Sway Language)
    • 5.1 Sway设计哲学 (Sway Design Philosophy)
    • 5.2 Sway的安全性 (Sway Safety)
  • 6.开发者看这里(For Developers)
    • 6.1Sway程序示例 (Sway Application Examples)
    • 6.2 网络 (Networks)
      • 6.2.1 `beta-3`测试网 (The `beta-3` testnet)
      • 6.2.2 `beta-2`测试网 (The `beta-2` testnet)
      • 6.2.3 `beta-1` 测试网 (beta-1 testnet)
    • 6.3 运行一个本地Fuel节点 (Running a local Fuel node)
    • 6.4 Sway语言 (Sway Language) 🌴
    • 6.5 Typescript SDK
    • 6.6 Rust SDK
    • 6.7 Fuel索引器 (Fuel Indexer)
    • 6.8 水龙头和区块浏览器 (Faucet and Block Explorer)
    • 6.9 Fuelup
    • 6.10 Fuel GraphQL API
  • 7. Fuel术语 (Fuel Glossary)
Powered by GitBook
On this page

1. 开发者快速上手 (Developer Quickstart)

This guide will walk developers through writing a smart contract in Sway, a simple test, deploying to Fuel, and building a frontend.

本手册将指导开发人员在 Sway 中编写智能合约、进行简单测试、部署到 Fuel 以及构建前端。

Before we begin, it may be helpful to understand the terminology that will be used throughout the docs and how they relate to each other:

在我们开始之前,提前了解在整个文档中使用的术语和它们之间的相互关系,会有所帮助:

  • Fuel: the Fuel blockchain. Fuel:Fuel 区块链。

  • FuelVM: the virtual machine powering Fuel. FuelVM:为 Fuel 提供支持的虚拟机。

  • Sway: the domain-specific language crafted for the FuelVM; it is inspired by Rust. Sway:为 FuelVM 打造的特定领域语言;它的灵感来自 Rust。

  • Forc: the build system and package manager for Sway, similar to Cargo for Rust. Forc:Sway 的构建系统和包管理器,类似于 Rust 的 Cargo。

了解 Sway 程序类型 (Understand Sway Program Types)

There are four types of Sway programs: 有四种类型的 Sway 程序:

  • 合约 contract

  • 谓词 predicate

  • 脚本 script

  • 库 library

The main features of a smart contract that differentiate it from scripts or predicates are that it is callable and stateful.

智能合约区别于脚本或谓词的主要特征是它是可调用的和有状态的。

A script is runnable bytecode on the chain which can call contracts to perform some task. It does not represent ownership of any resources and it cannot be called by a contract.

脚本是链上可运行的字节码,可以调用合约来执行某些任务。它不代表任何资源的所有权,也不能被合约调用。

A few pieces of info that will be helpful before moving on:

在继续之前,还有一些有用的信息:

  • This guide was created using VSCode as the code editor. 本手册是使用 VSCode 作为代码编辑器创建的。

  • Download the Sway language extension in VSCode to get syntax highlighting, keyboard shortcuts, and more. 在 VSCode 中下载 Sway 语言扩展,可以获得语法高亮显示、键盘快捷键等。

  • Download the rust-analyzer extension in VSCode to get syntax highlighting, code completion, and more. 下载 VSCode 中的 rust-analyzer 可以获得语法高亮、代码完成等功能。

Previous0.Fuel手册 (The Fuel Book)Next1.1构建智能合约 (Building A Smart Contract)

Last updated 2 years ago

See for more information.

有关详细信息,请参阅有关的章节。

the chapter on program types
程序类型