Flare for Rust Devs
This guide is for developers who want to interact with Flare using Rust. In this guide, using Rust, you will learn how to:
- Query a contract on Flare using alloy-rs, an async library for interacting with Ethereum-like chains.
- Compile a Solidity contract using the CLI interface of solc, the Solidity compiler.
- Deploy your compiled contract on Flare.
tip
All examples in this guide are available at developer-hub/examples.
Getting started
Install the Solidity compiler by following the instructions in the Solidity documentation. The main commands are provided here:
- MacOS via Homebrew
- Ubuntu via PPAs
brew tap ethereum/ethereum
brew install solidity
sudo add-apt-repository -y ppa:ethereum/ethereum
sudo apt update
sudo apt install solc
Install the following dependencies:
cargo add alloy eyre tokio --features alloy/full,tokio/rt,tokio/rt-multi-thread,tokio/macros