Skip to content

Connecting to a Local Node

Firstly, you will need a local node running on your machine. We recommend one of the following methods:

In the following example, we create a provider to connect to the local node and sign a message.

ts
import { Provider, Wallet } from 'fuels';

import { LOCAL_NETWORK_URL } from '../env';

const ADDRESS = '0x767caf5b08eba21c561078a4d5be09bbd7f16b9eca22699a61f1edd9e456126f';

const provider = await Provider.create(LOCAL_NETWORK_URL);
const wallet = Wallet.fromAddress(ADDRESS, provider);

const { balances } = await wallet.getBalances();

console.log('Balances', balances);
See code in context