All Projects → FuelLabs → fuel-core

FuelLabs / fuel-core

Licence: other
Rust full node implementation of the Fuel v2 protocol.

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to fuel-core

openap
Open Aircraft Performance Model and Python Toolkit
Stars: ✭ 68 (-26.88%)
Mutual labels:  fuel
MMM-Fuel
Gas Station price Module for MagicMirror²
Stars: ✭ 47 (-49.46%)
Mutual labels:  fuel
tfrs
Transportation Fuels Reporting System
Stars: ✭ 21 (-77.42%)
Mutual labels:  fuel
Movin
Aplikasi simpel menampilkan film populer dari API TheMovieDB (Kotlin, Android Architecture Component, Fuel)
Stars: ✭ 18 (-80.65%)
Mutual labels:  fuel
ParseRSS
A cup of library to Parse RSS for android. Also available as a ConverterFactory for Retrofit & Fuel
Stars: ✭ 17 (-81.72%)
Mutual labels:  fuel
FuelSDK-Node-Auth
Node authentication library for accessing the Salesforce Marketing Cloud APIs. Used in REST and SOAP client
Stars: ✭ 14 (-84.95%)
Mutual labels:  fuel
sway
🌴 Empowering everyone to build reliable and efficient smart contracts.
Stars: ✭ 132 (+41.94%)
Mutual labels:  fuel
MotoLink
K-line/Serial/CAN interface and fuel mapper for motorcycles.
Stars: ✭ 50 (-46.24%)
Mutual labels:  fuel
Parrot
A simple way to handle remote image in Kotlin.
Stars: ✭ 21 (-77.42%)
Mutual labels:  fuel
sway-lib-std
Sway standard library.
Stars: ✭ 17 (-81.72%)
Mutual labels:  fuel
FuelSDK-Node-REST
Node REST client w/ auth to access the Salesforce Marketing Cloud (formerly ExactTarget) API
Stars: ✭ 29 (-68.82%)
Mutual labels:  fuel

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.

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

Troubleshooting

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, REG_ZERO, 0xca),
ADDI(0x11, REG_ZERO, 0xba),
LOG(0x10, 0x11, REG_ZERO, REG_ZERO),
RET(REG_ONE),
$ cargo run --bin fuel-gql-cli -- 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\"}}"
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].