Fuel client implementation.
If you are interested in contributing to Fuel, see our CONTRIBUTING.md guidelines for coding standards and review process.
There are several system requirements including clang.
brew update
brew install cmake
apt update
apt install -y cmake pkg-config build-essential git clang libclang-dev
pacman -Syu --needed --noconfirm cmake gcc pkgconf git clang
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.
The service can listen to an arbitrary socket, as specified in the help command:
$ ./target/debug/fuel-core --help
fuel-core 0.1.0
USAGE:
fuel-core [OPTIONS]
FLAGS:
-h, --help Prints help information
-V, --version Prints version information
OPTIONS:
--ip <ip> [default: 127.0.0.1]
--port <port> [default: 4000]
--db-path <file path> [default: None]
$ ./target/debug/fuel-core --ip 127.0.0.1 --port 4000
Jul 12 23:28:47.238 INFO fuel_core: Binding GraphQL provider to 127.0.0.1:4000
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
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
# 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
The client functionality is available through a service endpoint that expect GraphQL queries.
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.
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\":{\"byte_price\":0,\"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\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}}"