The configuration is driven by a set of environment variables that can be defined either in your system environment or in a .env file in the project root.
The following environment variables are used to configure the project. Make sure to set them up as described:
- Description: Whether to run locally, against the devnet or testnet.
- Accepted Values:
"local": Runs a local node."devnet": Connects to the Fuel Devnet athttps://devnet.fuel.network."testnet": Connects to the Fuel Testnet athttps://testnet.fuel.network.
- Description:
When
TARGET_CHAINis set to"devnet", this variable must be set to the private key for the wallet used on the Devnet.
- Description:
When
TARGET_CHAINis set to"testnet", this variable must be set to the private key for the wallet used on the Testnet.
- Description: A boolean flag that indicates whether to force contract deployment even if a previous instance exists.
- Accepted Values:
"true"(case insensitive) to force deployment.- Any other value or absence of this variable will default to
false.
- Description: A boolean flag that indicates whether the contract should be deployed as blobs (as a loader) or not.
- Accepted Values:
"true"(case insensitive) to deploy in blobs.- Any other value or absence of this variable will default to
false.
Below is an example of what your .env file might look like when targeting the devnet:
TARGET_CHAIN=devnet
DEV_KEY=your_devnet_private_key_here
FORCE_DEPLOY=true
DEPLOY_IN_BLOBS=falseFor a local setup, you only need to set TARGET_CHAIN to local:
TARGET_CHAIN=local
FORCE_DEPLOY=false
DEPLOY_IN_BLOBS=falseTo run the tests for the project, simply execute:
cargo test -- --test-threads=1