Here, you can learn more about all configuration options.
Relative directory path to Forc workspace.
<<< @/../../demo-fuels/fuels.config.full.ts#workspace{ts:line-numbers}
The property
workspace
is incompatible withcontracts
,predicates
, andscripts
.
List of relative directory paths to Sway contracts.
<<< @/../../demo-fuels/fuels.config.full.ts#contracts{ts:line-numbers}
The property
contracts
is incompatible withworkspace
.
List of relative directory paths to Sway predicates.
<<< @/../../demo-fuels/fuels.config.full.ts#predicates{ts:line-numbers}
The property
predicates
is incompatible withworkspace
.
List of relative directory paths to Sway scripts.
<<< @/../../demo-fuels/fuels.config.full.ts#scripts{ts:line-numbers}
The property
scripts
is incompatible withworkspace
.
Relative directory path to use when generating Typescript definitions.
<<< @/../../demo-fuels/fuels.config.full.ts#output{ts:line-numbers}
The URL to use when deploying contracts.
<<< @/../../demo-fuels/fuels.config.full.ts#providerUrl{ts:line-numbers}
When
autostartFuelCore
property is set totrue
, theprovidedUrl
is overridden by that of the local short-livedfuel-core
node started by thefuels dev
command.
Wallet private key, used when deploying contracts.
This property should ideally come from env — process.env.MY_PRIVATE_KEY
.
<<< @/../../demo-fuels/fuels.config.full.ts#privateKey{ts:line-numbers}
When
autostartFuelCore
property is set totrue
, theprivateKey
is overridden with theconsensusKey
of the local short-livedfuel-core
node started by thefuels dev
command.
- Used by
fuels dev
only.
Relative path to directory containing custom configurations for fuel-core
, such as:
chainConfig.json
metadata.json
stateConfig.json
This will take effect only when autoStartFuelCore
is true
.
<<< @/../../demo-fuels/fuels.config.full.ts#snapshotDir{ts:line-numbers}
- Used by
fuels dev
only.
When set to true
, it will automatically:
- Starts a short-lived
fuel-core
node as part of thefuels dev
command - Override property
providerUrl
with the URL for the recently startedfuel-core
node
<<< @/../../demo-fuels/fuels.config.full.ts#autoStartFuelCore{ts:line-numbers}
If set to false
, you must spin up a fuel-core
node by yourself and set the URL for it via providerUrl
.
- Used by
fuels dev
only.- Ignored when
autoStartFuelCore
is set tofalse
.
Port to use when starting a local fuel-core
node.
<<< @/../../demo-fuels/fuels.config.full.ts#fuelCorePort{ts:line-numbers}
- Used by
fuels build
andfuels deploy
.
Sway programs are compiled in debug
mode by default.
Here you can customize all build flags, e.g. to build programs in release
mode.
<<< @/../../demo-fuels/fuels.config.full.ts#forcBuildFlags{ts:line-numbers}
Check also:
You can supply a ready-to-go deploy configuration object:
<<< @/../../demo-fuels/fuels.config.full.ts#deployConfig-obj{ts:line-numbers}
Or use a function for crafting dynamic deployment flows:
- If you need to fetch and use configs or data from a remote data source
- If you need to use IDs from already deployed contracts — in this case, we can use the
options.contracts
property to get the necessary contract ID. For example:
<<< @/../../demo-fuels/fuels.config.full.ts#deployConfig-fn{ts:line-numbers}
A callback function that is called after a build event has been successful.
Parameters:
config
— The loaded config (fuels.config.ts
)
<<< @/../../demo-fuels/fuels.config.full.ts#onBuild{ts:line-numbers}
A callback function that is called after a deployment event has been successful.
Parameters:
config
— The loaded config (fuels.config.ts
)data
— The data (an array of deployed contracts)
<<< @/../../demo-fuels/fuels.config.full.ts#onDeploy{ts:line-numbers}
A callback function that is called after the fuels dev
command has successfully restarted.
Parameters:
config
— The loaded config (fuels.config.ts
)
<<< @/../../demo-fuels/fuels.config.full.ts#onDev{ts:line-numbers}
A callback function that is called after the fuels node
command has successfully refreshed.
Parameters:
config
— The loaded config (fuels.config.ts
)
<<< @/../../demo-fuels/fuels.config.full.ts#onNode{ts:line-numbers}
Pass a callback function to be called in case of errors.
Parameters:
config
— The loaded config (fuels.config.ts
)error
— Original error object
<<< @/../../demo-fuels/fuels.config.full.ts#onFailure{ts:line-numbers}
Path to the forc
binary.
When not supplied, will default to using the system
binaries (forc
).
<<< @/../../demo-fuels/fuels.config.full.ts#forcPath{ts:line-numbers}
Path to the fuel-core
binary.
When not supplied, will default to using the system
binaries (fuel-core
).
<<< @/../../demo-fuels/fuels.config.full.ts#fuelCorePath{ts:line-numbers}
If you want to load environment variables from a .env
file, you can use the dotenv
package.
First, install it:
::: code-group
pnpm install dotenv
npm install dotenv
bun install dotenv
:::
Then, you can use it in your fuels.config.ts
file:
<<< @/../../create-fuels-counter-guide/fuels.config.ts#fuels-config-file-env{ts:line-numbers}