Skip to content

Connecting to Testnet

The Testnet is a public network that allows you to interact with a Fuel Virtual Machine and is used for testing and development purposes.

Latest Testnet

Dev Testnet

https://testnet.fuel.network/v1/graphql

We have some useful resources for the Testnet:

  • Faucet - for funding wallets that have been created.
  • Explorer - for viewing transactions and blocks.
  • GraphQL Playground - for testing GraphQL queries and mutations.

In the example below, we connect a Provider to the latest testnet and create a new wallet from a private key.

Note: New wallets on the Testnet will not have any assets! You can use the Faucet to fund your wallet.

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

const ADDRESS = '0x767caf5b08eba21c561078a4d5be09bbd7f16b9eca22699a61f1edd9e456126f';

const provider = await Provider.create('https://testnet.fuel.network/v1/graphql');
const wallet = Wallet.fromAddress(ADDRESS, provider);

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

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