• Stars
    star
    58,200
  • Rank 176 (Top 0.01 %)
  • Language
    Rust
  • License
    Other
  • Created over 4 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Rust full node implementation of the Fuel v2 protocol.

Fuel Client

build crates.io docs discord

Fuel client implementation.

Contributing

If you are interested in contributing to Fuel, see our CONTRIBUTING.md guidelines for coding standards and review process.

Before pushing any changes or creating pull request please run source ci_checks.sh.

Building

System Requirements

There are several system requirements including clang.

MacOS
brew update
brew install cmake
brew install protobuf
Debian
apt update
apt install -y cmake pkg-config build-essential git clang libclang-dev protobuf-compiler
Arch
pacman -Syu --needed --noconfirm cmake gcc pkgconf git clang protobuf-compiler

Building

We recommend using xtask to build fuel-core:

cargo xtask build

This will run cargo build as well as any other custom build processes we have such as re-generating a GraphQL schema for the client.

Running

The service can be launched by executing fuel-core run. The list of options for running can be accessed via the help option:

$ ./target/debug/fuel-core run --help

USAGE:
    fuel-core run [OPTIONS]

OPTIONS:
        --chain <CHAIN_CONFIG>
            Specify either an alias to a built-in configuration or filepath to a JSON file [default:
            local_testnet]
        ...

For many development puposes it is useful to have a state that won't persist and the db-type option can be set to in-memory as in the following example.

Example

$ ./target/debug/fuel-core run --db-type in-memory
Jul 12 23:28:47.238  INFO fuel_core: Binding GraphQL provider to 127.0.0.1:4000

To disable block production on your local node, set --poa-instant=false

Example

$ ./target/debug/fuel-core run --poa-instant=false
2023-01-23T02:25:18.787401Z  INFO fuel_core::cli::run: 173: Block production disabled.

Troubleshooting

Publishing

We use publish-crates action for automatic publishing of all crates.

If you have problems with publishing, you can troubleshoot it locally with act.

act release -s GITHUB_TOKEN=<YOUR_GITHUB_TOKEN> -j publish-crates-check --container-architecture linux/amd64 --reuse

It requires GitHubToken to do request to the GitHub. You can create it with this instruction.

Outdated database

If you encounter an error such as

thread 'main' panicked at 'unable to open database: DatabaseError(Error { message: "Invalid argument: Column families not opened: column-11, column-10, column-9, column-8, column-7, column-6, column-5, column-4, column-3, column-2, column-1, column-0" })', fuel-core/src/main.rs:23:66

Clear your local database using: rm -rf ~/.fuel/db

File descriptor limits

On some macOS versions the default file descriptor limit is quite low, which can lead to IO errors with messages like Too many open files or even fatal runtime error: Rust cannot catch foreign exceptions when RocksDB encounters these issues. Use the following command to increase the open file limit. Note that this only affects the current shell session, so consider adding it to ~/.zshrc.

ulimit -n 10240

Log level

The service relies on the environment variable RUST_LOG. For more information, check the EnvFilter examples crate.

Human logging can be disabled with the environment variable HUMAN_LOGGING=false

Docker & Kubernetes

# Create Docker Image
docker build -t fuel-core . -f deployment/Dockerfile

# Delete Docker Image
docker image rm fuel-core

# Create Kubernetes Volume, Deployment & Service
kubectl create -f deployment/fuel-core.yml

# Delete Kubernetes Volume, Deployment & Service
kubectl delete -f deployment/fuel-core.yml

GraphQL service

The client functionality is available through a service endpoint that expect GraphQL queries.

Transaction executor

The transaction executor currently performs instant block production. Changes are persisted to RocksDB by default.

  • Service endpoint: /graphql
  • Schema (available after building): fuel-client/assets/schema.sdl

The service expects a mutation defined as submit that receives a Transaction in hex encoded binary format, as specified here.

cURL example

This example will execute a script that represents the following sequence of ASM:

ADDI(0x10, RegId::ZERO, 0xca),
ADDI(0x11, RegId::ZERO, 0xba),
LOG(0x10, 0x11, RegId::ZERO, RegId::ZERO),
RET(RegId::ONE),
$ cargo run --bin fuel-core-client -- transaction submit \
"{\"Script\":{\"gas_price\":0,\"gas_limit\":1000000,\"maturity\":0,\"script\":[80,64,0,202,80,68,0,186,51,65,16,0,36,4,0,0],\"script_data\":[],\"inputs\":[],\"outputs\":[],\"witnesses\":[],\"receipts_root\":\"0x6114142d12e0f58cfb8c72c270cd0535944fb1ba763dce83c17e882c482224a2\"}}"

More Repositories

1

sway

🌴 Empowering everyone to build reliable and efficient smart contracts.
Rust
62,819
star
2

fuels-ts

Fuel Network Typescript SDK
TypeScript
44,282
star
3

fuels-rs

Fuel Network Rust SDK
Rust
44,281
star
4

fuel-specs

📝 Specifications for the Fuel protocol and the FuelVM, a blazingly fast blockchain VM.
1,779
star
5

sway-applications

Swaypplications
Rust
1,580
star
6

sway-farm

Farm 🍅 on the Fuel network.
TypeScript
1,411
star
7

swayswap

SwaySwap is a blazingly fast DEX built on the fastest modular execution layer: Fuel.
TypeScript
1,098
star
8

fuels-wallet

💳 The official Fuel wallet.
TypeScript
918
star
9

fuel-vm

Fuel v2 interpreter in Rust
Rust
351
star
10

fuelup

⛽ The Fuel toolchain installer
Rust
277
star
11

awesome-fuel

A maintained and comprehensive list of awesome Fuel resources!
239
star
12

yulp

➕ A low-level, highly efficient extension to Yul, an intermediate language for the Ethereum Virtual Machine.
Nearley
173
star
13

fuel-bridge

The canonical Fuel bridge mono repo.
TypeScript
173
star
14

sway-standards

SRC Standards set for the Sway language
Sway
159
star
15

sway-libs

Miscellaneous Sway libraries.
Sway
143
star
16

fuel-indexer

🗃 The Fuel indexer is a standalone service that can be used to index various components of the Fuel blockchain.
Rust
140
star
17

docs-hub

The documentation hub for Fuel
TypeScript
113
star
18

forc-wallet

A forc plugin for managing Fuel wallets.
Rust
98
star
19

fuel.nix

A Nix flake for the Fuel Labs ecosystem.
Nix
97
star
20

fuel-v1-contracts

⚡ The Fuel optimistic rollup in Yul+ for the Ethereum Virtual Machine
JavaScript
87
star
21

fuel-ui

Fuel design system
TypeScript
85
star
22

fuel-explorer

TypeScript
85
star
23

fuel-js

⚡ All Fuel javascript utilities and implementations.
JavaScript
82
star
24

fuel-connectors

TypeScript
78
star
25

faucet

The official Fuel faucet
Rust
70
star
26

sway-playground

🌴▶️ Sway in the browser
TypeScript
65
star
27

fuel-merkle-sol

A Solidity implementation of binary, sum, and sparse Merkle trees
Solidity
56
star
28

fuel-block-committer

A standalone service that commits Fuel block data to L1 / DA
Rust
52
star
29

sway-vscode-plugin

Sway Visual Studio Code plugin
TypeScript
48
star
30

fuels-npm-packs

TypeScript
47
star
31

fuel-subgraph

Rust
45
star
32

bridge-message-predicates

Predicate for relaying messages from Ethereum to a Fuel contract
Rust
44
star
33

fuel-docs

📃 Top-level documentation for Fuel
JavaScript
43
star
34

fuels-portal

The user facing portal and Fuel landing page
TypeScript
43
star
35

quickstart

TypeScript
29
star
36

fuel-bft

Tendermint consensus in Rust
Rust
26
star
37

sway-nightly-binaries

Fuel v2 full node and Sway toolchain nightly binaries
26
star
38

authn-sign

✍️ authn-sign - A simplified browser interface for WebAuthn focused on secp256r1 (P-256).
JavaScript
25
star
39

intro-to-sway

Learn how to build a marketplace contract with Sway
TypeScript
24
star
40

sway-lib-std

Sway standard library.
Rust
24
star
41

sway-rfcs

RFCs for changes to Sway
Sway
23
star
42

fuel-crypto

Fuel cryptographic primitives.
Rust
22
star
43

sway-performance-data

Sway performance data
19
star
44

fuel-burner-wallet

🔥 An experimental version of Burner Wallet using the Fuel open-beta.
HTML
19
star
45

sway.vim

Vim syntax file for Sway.
Vim Script
18
star
46

chain-configuration

18
star
47

sway-by-example-lib

Library for compiled sway programs
17
star
48

block-explorer-v2

Block explorer frontend for Fuel.
TypeScript
17
star
49

sway-lib-core

Sway standard library core primitives.
Rust
15
star
50

infrastructure

Shared infrastructure templates for Fuel services
HCL
15
star
51

EVM-Wallet-Connector

TypeScript
14
star
52

bridge-fungible-token

Fuel contract for managing and issuing bridged versions of ERC-20 tokens
Rust
14
star
53

fuel-tx

Fuel v2 transaction processing module in Rust.
Rust
14
star
54

sway-vs-solidity

1:1 code examples comparing Sway to Solidity
Solidity
13
star
55

github-actions

Reusable Actions workflows
TypeScript
12
star
56

tree-sitter-sway

C
12
star
57

docs

📝 Documentation for the Fuel v1 tools and services.
CSS
11
star
58

fuel-graphql-docs

Documentation for the Fuel GraphQL API
TypeScript
11
star
59

action-fuel-toolchain

🛠️ GitHub Action for `fuelup` commands
TypeScript
10
star
60

fuel-burner-plugin

🔥⚙️ Wallet plugin which connects Fuel network to the Burner architecture.
TypeScript
10
star
61

reddit-cash

🌕 A Fuel-powered Reddit community tokens build on a Burner Wallet
TypeScript
9
star
62

smt-test-generation

Generate specification compliant test data used for data-driven sparse Merkle tree testing
Go
9
star
63

rfcs

RFCs for changes to Fuel, and standards
Shell
8
star
64

fuel-contributors

An exhaustive list of all Fuel Contributors
8
star
65

fuel-debugger

Debugger for Fuel v2
Rust
8
star
66

fuel-asm

Fuel assembly and opcodes module
Rust
8
star
67

sway-by-example

Examples of Sway programs
Solidity
8
star
68

fuel-design-tokens

Design tokens that we are using across Figma and Fuel
JavaScript
8
star
69

fuel-types

Common types for Fuel v2
Rust
8
star
70

fuel-dev-env

Full stack Fuel development environment
Shell
7
star
71

fuel-wasm-examples

WASM examples for Fuel
Rust
7
star
72

migrations-and-disclosures

Biweekly consolidated breaking change log across the Fuel stack
JavaScript
7
star
73

developer-quickstart

scratch space for code behind developer quickstart section in book
TypeScript
7
star
74

hacker-starter-kit

A resource for developers preparing to build on Fuel.
7
star
75

fuel-merkle

Fuel Merkle trees in Rust.
Rust
7
star
76

fuel-v2-contracts

The Fuel Solidity smart contract architecture.
TypeScript
6
star
77

fuel-storage

Storage traits for Fuel storage-backed data structures.
Rust
6
star
78

fuel-abi-types

Rust
6
star
79

demo-block-explorer

A bare-bones block explorer that demos the Fuel GraphQL API
TypeScript
6
star
80

typedoc-just-the-docs-theme

TypeScript
6
star
81

releasy

Release Automation Tooling
Rust
6
star
82

Pyth-integration

Sway
6
star
83

cargo-toml-lint

A linter for Cargo.toml files
Rust
6
star
84

docs-portal

Fuel's Documentation Portal
TypeScript
6
star
85

audits

5
star
86

sway-by-example-archive

Let's explore how to design, write and test a contract
Rust
5
star
87

Solana-Wallet-Connector

TypeScript
5
star
88

fuel-low-level

Rust
4
star
89

data-systems

Fuel data systems related projects
Rust
4
star
90

devcontainer-features

Features for Github Dev Containers for the Fuel ecosystem
Shell
4
star
91

sway-performance-dashboard

Sway performance dashboard
JavaScript
4
star
92

action-forc

📦 GitHub Action for Sway `forc` command
4
star
93

sway-test-rs

A cargo-generate template for Rust + Sway integration testing.
Rust
4
star
94

sway-workshops

A set of example apps for workshops.
4
star
95

forc-explorer

Forc block explorer plugin
Rust
3
star
96

.github

3
star
97

ETHDubai-2022-Workshop

Rust
3
star
98

sway-std

A mirror repo of sway lang's standard library
Sway
3
star
99

bridge-message-executor

Service for executing predicate based messages on Fuel
Rust
3
star
100

bridge-integration-tests

Integration tests for the Fuel Messaging Bridge
TypeScript
3
star