Skip to content

Latest commit

 

History

History
59 lines (41 loc) · 1.03 KB

README.md

File metadata and controls

59 lines (41 loc) · 1.03 KB

A simple counter example on fuel.

sway contract, indexer, rust sdk contract call, and react app

Pre-requisites

  • Get the fuel toolchain here
  • Clone and build the indexer
git clone https://github.com/FuelLabs/fuel-indexer.git
cargo build --release
  • Copy the indexer binary into project bin folder
cp target/release/fuel-indexer <project-root>/counter-indexer/bin/

Execution

  • Run a local fuel node
fuel-core run --db-type in-memory 
  • Build and test the contract
forc build -p counter
cargo test
  • Run the contract calls
cd counter-rust && cargo run
  • Build and start indexing
cd counter-indexer

# build target will auto set
cargo build --release

# snip the erands
./wasm_clip.sh

# run the indexer
./bin/fuel-indexer --manifest manifest.yaml

# to run with custom config
./bin/fuel-indexer --manifest manifest.yaml --config config.yaml