Compare commits
No commits in common. "b50b8e8ced882d7d46b5a3dd3b598e540b705149" and "db4b61bdd9da92eb03e00c38457af103f7a845a9" have entirely different histories.
b50b8e8ced
...
db4b61bdd9
|
@ -4,13 +4,11 @@ import * as bip39 from "@scure/bip39";
|
||||||
import { wordlist } from "@scure/bip39/wordlists/english";
|
import { wordlist } from "@scure/bip39/wordlists/english";
|
||||||
import { errorExit } from "./error.js";
|
import { errorExit } from "./error.js";
|
||||||
|
|
||||||
const BIP44_PATH = "m/44'/1627'/0'/0'/0'";
|
|
||||||
|
|
||||||
export function getSeed() {
|
export function getSeed() {
|
||||||
const seed = config.str("seed");
|
const seed = config.str("seed");
|
||||||
|
|
||||||
let valid = bip39.validateMnemonic(seed, wordlist);
|
let err = bip39.validateMnemonic(seed, wordlist);
|
||||||
if (!valid) {
|
if (err !== null) {
|
||||||
errorExit("LUME_WEB_RELAY_SEED is invalid. Aborting.");
|
errorExit("LUME_WEB_RELAY_SEED is invalid. Aborting.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,7 +16,7 @@ export function getSeed() {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getHDKey(): HDKey {
|
export function getHDKey(): HDKey {
|
||||||
return HDKey.fromMasterSeed(getSeed()).derive(BIP44_PATH);
|
return HDKey.fromMasterSeed(getSeed()).derive("m/44'/1627'/0'/0");
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getKeyPair() {
|
export function getKeyPair() {
|
||||||
|
|
|
@ -2,7 +2,7 @@ import express, { Express } from "express";
|
||||||
import http from "http";
|
import http from "http";
|
||||||
import { AddressInfo } from "net";
|
import { AddressInfo } from "net";
|
||||||
import log from "loglevel";
|
import log from "loglevel";
|
||||||
import { getKeyPair } from "../lib/seed.js";
|
import { getKeyPair } from "./swarm.js";
|
||||||
|
|
||||||
let app: Express;
|
let app: Express;
|
||||||
let router = express.Router();
|
let router = express.Router();
|
||||||
|
|
|
@ -7,7 +7,7 @@ import * as fs from "fs";
|
||||||
import path from "path";
|
import path from "path";
|
||||||
import type { Logger } from "loglevel";
|
import type { Logger } from "loglevel";
|
||||||
|
|
||||||
import { getSeed } from "../lib/seed.js";
|
import { getSeed } from "../lib/util.js";
|
||||||
import pluginRpc from "./plugins/rpc";
|
import pluginRpc from "./plugins/rpc";
|
||||||
import pluginCore from "./plugins/core";
|
import pluginCore from "./plugins/core";
|
||||||
import type Config from "@lumeweb/cfg";
|
import type Config from "@lumeweb/cfg";
|
||||||
|
|
|
@ -8,7 +8,7 @@ import {
|
||||||
import promiseRetry from "promise-retry";
|
import promiseRetry from "promise-retry";
|
||||||
import config from "../config.js";
|
import config from "../config.js";
|
||||||
import log from "loglevel";
|
import log from "loglevel";
|
||||||
import { getSeed } from "../lib/seed.js";
|
import { getSeed } from "../lib/util.js";
|
||||||
import type {
|
import type {
|
||||||
IndependentFileSmall,
|
IndependentFileSmall,
|
||||||
SavedSslData,
|
SavedSslData,
|
||||||
|
|
Loading…
Reference in New Issue