Skip to content

Commit

Permalink
chore: revert more autostart fuel-core changes
Browse files Browse the repository at this point in the history
  • Loading branch information
danielbate committed Oct 7, 2024
1 parent fa6845b commit 1464fae
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
9 changes: 1 addition & 8 deletions packages/fuels/src/cli/commands/deploy/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@ import { savePredicateFiles } from './savePredicateFiles';
import { saveScriptFiles } from './saveScriptFiles';

export async function deploy(config: FuelsConfig) {
let cleanup: (() => void) | undefined;
if (config.autoStartFuelCore) {
const res = await autoStartFuelCore(config);
cleanup = res?.killChildProcess;
}
/**
* Deploy contract and save their IDs to JSON file.
*/
Expand All @@ -35,11 +30,9 @@ export async function deploy(config: FuelsConfig) {
const predicates = await deployPredicates(config);
savePredicateFiles(predicates, config);

cleanup?.();

/**
* After deploying scripts/predicates, we need to
* re-generate factory classes with the loader code
* re-generate factory classe with the loader coee
*/
await generateTypes(config);

Expand Down
8 changes: 5 additions & 3 deletions packages/fuels/src/cli/commands/dev/autoStartFuelCore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,15 @@ export const autoStartFuelCore = async (config: FuelsConfig) => {

const port = config.fuelCorePort ?? (await getPortPromise({ port: 4000 }));

const { cleanup, snapshotDir, url } = await launchNode({
const providerUrl = `http://${accessIp}:${port}/v1/graphql`;

const { cleanup, snapshotDir } = await launchNode({
args: [
['--snapshot', config.snapshotDir],
['--db-type', 'in-memory'],
].flat() as string[],
ip: bindIp,
port: `${port}`,
port: port.toString(),
loggingEnabled: loggingConfig.isLoggingEnabled,
basePath: config.basePath,
fuelCorePath: config.fuelCorePath,
Expand All @@ -41,7 +43,7 @@ export const autoStartFuelCore = async (config: FuelsConfig) => {
bindIp,
accessIp,
port,
providerUrl: url,
providerUrl,
snapshotDir,
killChildProcess: cleanup,
};
Expand Down

0 comments on commit 1464fae

Please sign in to comment.