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, LOCAL_NETWORK_URL } from 'fuels';

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 });
See code in context