fuels-rs README

The project's README from github.com/FuelLabs/fuels-rs. As one markdown file: README.md.

fuels-rs

build crates.io docs discord

Rust SDK for Fuel. It can be used for a variety of things, including but not limited to:

Documentation

See the fuels-rs book

Features

FAQ

What dependencies do I need?

How can I run the SDK tests?

First, build the test projects using forc:

forc build --release --path e2e

Then you can run the SDK tests with:

cargo test

You can also run specific tests. The following example will run all integration tests in types.rs whose names contain in_vector and show their outputs:

cargo test --test types in_vector -- --show-output

How to run WASM tests?

You need to have wasm32 as a target, if you don't already:

 rustup target add wasm32-unknown-unknown

You also need wasm-pack, if you don't already:

cargo install wasm-pack

Navigate to packages/wasm-tests and run wasm-pack test.

What to do if my tests are failing on master

Before doing anything else, try all these commands:

cargo clean
rm Cargo.lock
forc build --release --path e2e
cargo test

Why is the prefix fuels and not fuel?

In order to make the SDK for Fuel feel familiar with those coming from the ethers.js ecosystem, this project opted for an s at the end. The fuels-* family of SDKs is inspired by The Ethers Project.

How can I run the docs locally?

Install mdbook by running:

cargo install mdbook

Next, navigate to the docs folder and run the command below to start a local server and open a new tab in your browser.

mdbook serve --open

You can build the book by running:

mdbook build

fuels-rs (FuelLabs/fuels-rs)

Searching Database…

这是什么?fuels-rs 是 Fuel 网络官方的 Rust SDK,用于编译、部署和测试 Sway 智能合约,启动本地 Fuel 节点,构造并签署交易,并为合约调用生成类型安全的 Rust 绑定。
这是我要添加到 Rust 项目里的库,还是一个独立应用?它是一个 Rust crate(库),你可以在 Cargo.toml 中将其作为依赖引入;它还附带一个小型命令行工具,用于运行本地测试钱包等常见操作。
我该怎么在自己的电脑上让 fuels-rs 跑起来?在你的 Rust 项目中把 fuels 添加为 crate 依赖即可;如果要构建并运行它自带的测试套件,需要先用 forc 编译测试用的 Sway 项目,然后再运行 Rust 测试运行器。
除了 Rust 工具链,我还需要别的东西吗?需要。你需要最新的稳定版 Rust 工具链,以及来自 Fuel 生态的 forc 和 fuel-core 二进制文件。
这个 SDK 还缺哪些部分?除本地测试钱包之外的钱包集成,以及事件查询与监听,目前被列为尚未实现的功能。
为什么 crate 叫 'fuels' 而不是 'fuel'?为了让来自 ethers.js 生态的开发者感觉熟悉,该项目沿用了 Ethers Project 系列 SDK 所使用的 'fuels-' 命名规范。
我能运行这个 SDK 的 WASM 测试吗?可以。添加 wasm32 目标,安装 wasm-pack,然后在 packages/wasm-tests 目录下运行 'wasm-pack test'。
这个 SDK 开箱即用支持本地 Fuel 测试钱包吗?支持。本地测试钱包是该 SDK 内置的功能,且已完成支持。
我能用这个 SDK 在本地启动一个 Fuel 网络吗?可以。启动本地 Fuel 节点是核心支持功能,与在节点上部署和调用合约并列。
Creator
FuelLabs
Size
19.7 MB
Stars
43K
Age
4y
Commits · 90 Days