Icon HelpCircleForumIcon Link

⌘K

Icon HelpCircleForumIcon Link
Connecting to Testnet

Icon LinkConnecting 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.

Icon InfoCircle

[!NOTE] Latest Testnet Dev Testnet

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

We have some useful resources for the Testnet:


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

Icon InfoCircle

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

// #import { Provider, Wallet, FUEL_TESTNET_NETWORK_URL };
 
// Create a provider, with the Latest Testnet URL.
const provider = await Provider.create(FUEL_TESTNET_NETWORK_URL);
 
// Create our wallet (with a private key).
const PRIVATE_KEY = 'a1447cd75accc6b71a976fd3401a1f6ce318d27ba660b0315ee6ac347bf39568';
const wallet = Wallet.fromPrivateKey(PRIVATE_KEY, provider);
 
// Perform a balance check.
const balances = await wallet.getBalances();
// [{ assetId: '0x..', amount: bn(..) }, ..]