Created
February 27, 2020 16:21
-
-
Save SilentCaesar/549dcfc59ad839b29ee717d8651a14a1 to your computer and use it in GitHub Desktop.
Setup, faucet and transfer using Fuel with NodeJS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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