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…

What is this?fuels-rs is the official Rust SDK for the Fuel Network, used to compile, deploy and test Sway smart contracts, launch a local Fuel node, craft and sign transactions, and generate type-safe Rust bindings for contract calls.
Is this a library I add to a Rust project, or a standalone app?It is a Rust crate/library you depend on in Cargo.toml; it also ships a small CLI for common operations like running local test wallets.
How do I get fuels-rs working on my machine?Add fuels as a crate dependency in your Rust project; to build and run its own test suite you first compile the test Sway projects with forc and then run the Rust test runner.
Do I need anything besides the Rust toolchain?Yes — you need the latest stable Rust toolchain plus the forc and fuel-core binaries from the Fuel ecosystem.
What parts of the SDK are still missing?Wallet integration (beyond local test wallets) and events querying/monitoring are listed as not yet implemented.
Why is the crate named 'fuels' instead of 'fuel'?To feel familiar to developers coming from the ethers.js ecosystem, the project follows the 'fuels-' naming convention used by the Ethers Project family of SDKs.
Can I run the SDK's WASM tests?Yes — add the wasm32 target, install wasm-pack, and run 'wasm-pack test' from the packages/wasm-tests directory.
Does it support local Fuel test wallets out of the box?Yes, local test wallets are a built-in, checked-off feature of the SDK.
Can I launch a Fuel network locally with this SDK?Yes, launching local Fuel nodes is a core supported feature alongside deploying and interacting with contracts on them.
Creator
FuelLabs
Size
19.7 MB
Stars
43K
Age
4y
Commits · 90 Days