Icon HelpCircleForumIcon Link

⌘K

Icon HelpCircleForumIcon Link
Config File

Icon LinkConfig File

Here, you can learn more about all configuration options.

Icon Linkworkspace

Relative directory path to Forc workspace.

	workspace: './sway-programs',
Icon InfoCircle

The property workspace is incompatible with contracts , predicates , and scripts .

Icon Linkcontracts

List of relative directory paths to Sway contracts.

	contracts: ['./sway-programs/contracts'],
Icon InfoCircle

The property contracts is incompatible with workspace .

Icon Linkpredicates

List of relative directory paths to Sway predicates.

	predicates: ['./sway-programs/predicates'],
Icon InfoCircle

The property predicates is incompatible with workspace .

Icon Linkscripts

List of relative directory paths to Sway scripts.

	scripts: ['./sway-programs/scripts'],
Icon InfoCircle

The property scripts is incompatible with workspace .

Icon Linkoutput

Relative directory path to use when generating Typescript definitions.

	output: './src/sway-programs-api',

Icon LinkproviderUrl

The URL to use when deploying contracts.

	// Default: http://127.0.0.1:4000/graphql
	providerUrl: 'http://network:port/graphql',
Icon InfoCircle

When autostartFuelCore property is set to true, the providedUrl is overridden by that of the local short-lived fuel-core node started by the fuels dev command.

Icon LinkprivateKey

Wallet private key, used when deploying contracts.

This property should ideally come from env — process.env.MY_PRIVATE_KEY.

	privateKey: '0xa449b1ffee0e2205fa924c6740cc48b3b473aa28587df6dab12abc245d1f5298',
Icon InfoCircle

When autostartFuelCore property is set to true, the privateKey is overridden with the consensusKey of the local short-lived fuel-core node started by the fuels dev command.

Icon LinkchainConfig

Icon InfoCircle

Relative file path to custom chainConfig.json file to use with fuel-core.

This will take effect only when autoStartFuelCore is true.

	chainConfig: './my/custom/chainConfig.json',

Icon LinkautoStartFuelCore

Icon InfoCircle

When set to true, it will automatically:

  1. Starts a short-lived fuel-core node as part of the fuels dev command
  2. Override property providerUrl with the URL for the recently started fuel-core node
	autoStartFuelCore: true,

If set to false, you must spin up a fuel-core node by yourself and set the URL for it via providerUrl .

Icon LinkfuelCorePort

Icon InfoCircle

Port to use when starting a local fuel-core node.

	// Default: first free port, starting from 4000
	fuelCorePort: 4000,

Icon LinkforcBuildFlags

Icon InfoCircle

Sway programs are compiled in debug mode by default.

Here you can customize all build flags, e.g. to build programs in release mode.

	// Default: []
	forcBuildFlags: ['--release'],

Check also:

Icon LinkdeployConfig

You can supply a ready-to-go deploy configuration object:

	deployConfig: {
gasPrice: 1,
	},

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:
	deployConfig: async (options: ContractDeployOptions) => {
// ability to fetch data remotely
await Promise.resolve(`simulating remote data fetch`);
 
// get contract by name
const { contracts } = options;
 
const contract = contracts.find(({ name }) => {
	const found = name === MY_FIRST_DEPLOYED_CONTRACT_NAME;
	return found;
});
 
if (!contract) {
	throw new Error('Contract not found!');
}
 
return {
	gasPrice: 1,
	storageSlots: [
	{
	  key: '0x..',
	  /**
	   * Here we could initialize a storage slot,
	   * using the relevant contract ID.
	   */
	  value: contract.contractId,
	},
	],
};
	},

Icon LinkonSuccess

Pass a callback function to be called after a successful run.

Parameters:

  • event — The event that triggered this execution
  • config — The loaded config (fuels.config.ts)
	onSuccess: (event: CommandEvent, config: FuelsConfig) => {
console.log('fuels:onSuccess', { event, config });
	},

Icon LinkonFailure

Pass a callback function to be called in case of errors.

Parameters:

  • error — Original error object
  • config — The loaded config (fuels.config.ts)
	onFailure: (error: Error, config: FuelsConfig) => {
console.log('fuels:onFailure', { error, config });
	},

Icon LinkuseBuiltinForc

Opt-in or out from using built-in forc binaries.

When not supplied, will default to using the system binaries.

If system binaries are absent, print a warning and use built-in ones instead.

	// Default: undefined
	useBuiltinForc: false,

Check also:

Icon LinkuseBuiltinFuelCore

Opt-in or out from using built-in fuel-core binaries.

When not supplied, will default to using the system binaries.

If system binaries are absent, print a warning and use built-in ones instead.

	// Default: undefined
	useBuiltinFuelCore: false,

Check also: