This file contains hidden or 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); | |
This file contains hidden or 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); | |