Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save SilentCaesar/549dcfc59ad839b29ee717d8651a14a1 to your computer and use it in GitHub Desktop.
Save SilentCaesar/549dcfc59ad839b29ee717d8651a14a1 to your computer and use it in GitHub Desktop.
Setup, faucet and transfer using Fuel with NodeJS
const { Wallet, utils, dbs } = require("fuel-core");
(async () => {
// DB and Key Setup
const db = new dbs.Level(); // persisting db
const privateKey = (await db.get('key')) || utils.randomBytes(32);
await db.put('key', privateKey);
const signer = new utils.SigningKey(privateKey);
console.log('My Fuel address is :', signer.address);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment