Skip to content

Commit dfca23a

Browse files
committed
feat: change env name and add default value
1 parent 1ae8533 commit dfca23a

File tree

6 files changed

+11
-8
lines changed

6 files changed

+11
-8
lines changed

contracts/predicate/scripts/run-predicate.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@ import { BaseAssetId, Predicate, Provider, Wallet, bn, hexlify } from 'fuels';
22
import { promises as fs } from 'node:fs';
33
import { resolve } from 'node:path';
44

5-
const { FUEL_PROVIDER_BETA5, PRIVATE_KEY } = process.env;
5+
const { FUEL_PROVIDER, PRIVATE_KEY } = process.env;
66
const BIN_PATH = resolve(__dirname, '../out/debug/predicate-app.bin');
77
const AMOUNT = 300_000;
88

9-
if (!FUEL_PROVIDER_BETA5 || !PRIVATE_KEY) {
9+
if (!FUEL_PROVIDER || !PRIVATE_KEY) {
1010
throw new Error('Missing some config on your .env file');
1111
}
1212

1313
async function main() {
1414
const binHex = hexlify(await fs.readFile(BIN_PATH));
15-
const provider = await Provider.create(FUEL_PROVIDER_BETA5!);
15+
const provider = await Provider.create(FUEL_PROVIDER!);
1616
const wallet = Wallet.fromPrivateKey(PRIVATE_KEY!, provider);
1717
const { minGasPrice: gasPrice } = wallet.provider.getGasConfig();
1818
const walletAddress = wallet.address.toB256();

packages/app-explorer/.env.example

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
FUEL_PROVIDER_BETA5=https://beta-5.fuel.network/graphql
1+
FUEL_PROVIDER=https://beta-5.fuel.network/graphql

packages/app-explorer/.env.production

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
FUEL_PROVIDER_BETA5=https://beta-5.fuel.network/graphql
1+
FUEL_PROVIDER=https://beta-5.fuel.network/graphql

packages/app-explorer/src/app/api/graphql/route.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { ContextDomain } from '@fuel-explorer/graphql/src/domains/Context';
33
import { createYoga } from 'graphql-yoga';
44
import { requireEnv } from '~/systems/utils/requireEnv';
55

6-
const { FUEL_PROVIDER_BETA5: url } = requireEnv(['FUEL_PROVIDER_BETA5']);
6+
const { FUEL_PROVIDER: url } = requireEnv(['FUEL_PROVIDER']);
77

88
const executor = createExecutor(async ({ body }) => {
99
return fetch(url, {

packages/graphql/tsup.config.mjs

+4-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@ export default defineConfig((options) => ({
2929
SERVER_PORT: port,
3030
CODE_GEN: true,
3131
WATCH: Boolean(options.watch),
32-
FUEL_PROVIDER: process.env.FUEL_PROVIDER,
32+
// TODO: remove the requirement of fetching the fuel provider
33+
// at build time.
34+
FUEL_PROVIDER:
35+
process.env.FUEL_PROVIDER || 'https://beta-5.fuel.network/graphql',
3336
},
3437
});
3538
// Wait process to close until restarting

turbo.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"$schema": "https://turbo.build/schema.json",
3-
"globalEnv": ["NODE_ENV", "IS_PREVIEW", "FUEL_PROVIDER_BETA5"],
3+
"globalEnv": ["NODE_ENV", "IS_PREVIEW", "FUEL_PROVIDER"],
44
"pipeline": {
55
"ts:check": {
66
"dependsOn": ["^build"],

0 commit comments

Comments
 (0)