*Extract keypair logic to a helper function
This commit is contained in:
parent
668e427b8c
commit
36da04bdfe
|
@ -19,15 +19,19 @@ let node: {
|
||||||
};
|
};
|
||||||
let server: any;
|
let server: any;
|
||||||
|
|
||||||
async function start() {
|
export function getKeyPair() {
|
||||||
const seed = config.str("seed");
|
const seed = config.str("seed");
|
||||||
|
|
||||||
let err = validSeedPhrase(seed);
|
let err = validSeedPhrase(seed);
|
||||||
if (err !== null) {
|
if (err !== null) {
|
||||||
errorExit("RELAY_SEED is invalid. Aborting.");
|
errorExit("LUME_WEB_RELAY_SEED is invalid. Aborting.");
|
||||||
}
|
}
|
||||||
|
|
||||||
const keyPair = deriveMyskyRootKeypair(seedPhraseToSeed(seed)[0]);
|
return deriveMyskyRootKeypair(seedPhraseToSeed(seed)[0]);
|
||||||
|
}
|
||||||
|
|
||||||
|
async function start() {
|
||||||
|
const keyPair = getKeyPair();
|
||||||
|
|
||||||
node = new DHT({ keyPair });
|
node = new DHT({ keyPair });
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue