Skip to content

Instantly share code, notes, and snippets.

@SilentCaesar
SilentCaesar / Getting_Started_with_Fuel_in_NodeJS_partial.js
Created February 27, 2020 16:21
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);
@SilentCaesar
SilentCaesar / Getting_Started_with_Fuel_in_NodeJS.js
Created February 24, 2020 16:24
The NodeJS example code from the recent Fuel tutorial blog post.
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);