sway:为Fuel区块链开发的类Rust语言,赋能现代区块链开发

🌴 Empowering everyone to build reliable and efficient smart contracts.

分支314Tags194
文件最后提交记录最后更新时间
3 年前
1 个月前
1 年前
1 年前
1 个月前
1 个月前
1 个月前
4 个月前
1 个月前
9 个月前
1 个月前
23 天前
1 个月前
23 天前
1 个月前
4 个月前
1 个月前
1 个月前
2 个月前
2 个月前
1 个月前
2 个月前
1 个月前
5 个月前
23 天前
2 年前
10 个月前
3 年前
3 年前
6 个月前
1 个月前
1 个月前
4 年前
11 个月前
1 年前
2 年前
2 个月前
10 个月前
23 天前
3 年前
1 年前

Sway

build crates.io docs twitter discord

Sway 是为 Fuel 区块链开发的语言。它深受 Rust 的启发,旨在为区块链生态系统带来现代化的语言开发体验和性能。

文档

如需用户文档(包括安装发布版本),请参阅 Sway 手册:https://fuellabs.github.io/sway/latest/

如需 Sway 标准库文档,请参阅:https://fuellabs.github.io/sway/master/std/

另可查看 Sway 编程语言的技术参考:https://fuellabs.github.io/sway/master/reference/

从源代码构建

本节内容适用于 Sway 编译器和工具链的开发。如需开发合约和使用 Sway,请参阅上述文档部分。

依赖项

Sway 使用 Rust 构建。首先,请按照 https://www.rust-lang.org/tools/install 上的说明安装 Rust 工具链。然后将 Rust 工具链配置为使用 Rust stable 版本:

rustup default stable

如果尚未操作,请将 Cargo 二进制文件目录添加到你的 PATH 中,方法是将以下行添加到 ~/.profile 并重启 shell 会话。

export PATH="${HOME}/.cargo/bin:${PATH}"

构建 Forc

克隆仓库并构建 Sway 工具链:

git clone git@github.com:FuelLabs/sway.git
cd sway
cargo build

确认 Sway 工具链已成功构建:

cargo run --bin forc -- --help

其他所有脚本/命令

对于其他所有脚本和命令,请使用 https://github.com/casey/just:

> just --list
Available recipes:
    [automation]
    update-contract-ids
    update-fuel-dependencies

    [benchmark]
    benchmark
    benchmark-tests
    collect-gas-usage

    [build]
    build-highlightjs
    build-prism
    generate-sway-lib-std

    [ci]
    ci-check
    install-ci-check

    [test]
    test-forc-fmt-check-panic

为 Sway 做贡献

我们欢迎大家为 Sway 贡献力量!

有关帮助您入门的指南和说明,请参阅 Sway 手册中的 Contributing To Sway 部分。

项目介绍

🌴 Empowering everyone to build reliable and efficient smart contracts.

定制我的领域
30061.46 K5.41 K访问 GitHub