Icon HelpCircleForumIcon Link

⌘K

Icon HelpCircleForumIcon Link
Connecting to a Local Node

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

// #import { Provider, Wallet };
 
// Create a provider.
const LOCAL_FUEL_NETWORK = `http://127.0.0.1:4000/v1/graphql`;
const provider = await Provider.create(LOCAL_FUEL_NETWORK);
 
// Create our wallet (with a private key).
const PRIVATE_KEY = 'a1447cd75accc6b71a976fd3401a1f6ce318d27ba660b0315ee6ac347bf39568';
const wallet = Wallet.fromPrivateKey(PRIVATE_KEY, provider);