Icon HelpCircleForumIcon Link

⌘K

Icon HelpCircleForumIcon Link
Connecting to the Network

Icon LinkConnecting to the Network

After installing the fuels package, it's easy to connect to the Network:

import { Provider } from 'fuels';
 
const NETWORK_URL = 'https://mainnet.fuel.network/v1/graphql';
 
const provider = new Provider(NETWORK_URL);
 
const baseAssetId = await provider.getBaseAssetId();
const chainId = await provider.getChainId();
const gasConfig = await provider.getGasConfig();
 
console.log('chainId', chainId);
console.log('baseAssetId', baseAssetId);
console.log('gasConfig', gasConfig);

Icon LinkRPC URLs

These are our official RPC URLs:

NetworkURL
Mainnethttps://testnet.fuel.network/v1/graphql
Testnethttps://mainnet.fuel.network/v1/graphql
LocalhostRunning a local Fuel node

Icon LinkResources

Access all our apps directly: