*If we don't have a seed, create one by saving to the config folder as account.json
This commit is contained in:
parent
8d19edb8e0
commit
49739eaac8
10
src/index.ts
10
src/index.ts
|
@ -6,9 +6,19 @@ import config from "./config.js";
|
||||||
import { loadPlugins } from "./modules/plugin.js";
|
import { loadPlugins } from "./modules/plugin.js";
|
||||||
import { start as startDns } from "./modules/dns.js";
|
import { start as startDns } from "./modules/dns.js";
|
||||||
import { start as startSSl } from "./modules/ssl.js";
|
import { start as startSSl } from "./modules/ssl.js";
|
||||||
|
import { generateSeedPhraseDeterministic } from "libskynet";
|
||||||
|
import * as crypto from "crypto";
|
||||||
|
|
||||||
log.setDefaultLevel(config.str("log-level"));
|
log.setDefaultLevel(config.str("log-level"));
|
||||||
|
|
||||||
|
if (!config.str("seed")) {
|
||||||
|
config.saveConfigJson("account.json", {
|
||||||
|
seed: generateSeedPhraseDeterministic(
|
||||||
|
crypto.randomBytes(100).toString("hex")
|
||||||
|
),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
async function boot() {
|
async function boot() {
|
||||||
await loadPlugins();
|
await loadPlugins();
|
||||||
await startApp();
|
await startApp();
|
||||||
|
|
Loading…
Reference in New Issue