File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed
Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change 11import * as db from "@dappnode/db" ;
22import { eventBus } from "@dappnode/eventbus" ;
3- import initializeDb from "./initializeDb.js" ;
3+ import { initializeDb } from "./initializeDb.js" ;
44import {
55 checkDockerNetwork ,
66 copyHostScripts ,
@@ -35,6 +35,11 @@ import { DappNodeRegistry } from "@dappnode/toolkit";
3535
3636const controller = new AbortController ( ) ;
3737
38+ // Initialize DB must be the first step so the db has the required values
39+ initializeDb ( )
40+ . then ( ( ) => logs . info ( "Initialized Database" ) )
41+ . catch ( e => logs . error ( "Error inititializing Database" , e ) ) ;
42+
3843const ethUrl = await getEthUrl ( ) . catch ( e => {
3944 logs . error (
4045 `Error getting ethUrl, using default ${ params . ETH_MAINNET_RPC_URL_REMOTE } ` ,
@@ -86,11 +91,6 @@ if (params.TEST) startTestApi();
8691// Execute migrations
8792executeMigrations ( ) . catch ( e => logs . error ( "Error on executeMigrations" , e ) ) ;
8893
89- // Initialize DB
90- initializeDb ( )
91- . then ( ( ) => logs . info ( "Initialized Database" ) )
92- . catch ( e => logs . error ( "Error inititializing Database" , e ) ) ;
93-
9494// Start daemons
9595startDaemons ( dappnodeInstaller , controller . signal ) ;
9696
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ function returnNullIfError(
4242 * - Get network status variables
4343 * - Trigger a dyndns loop
4444 */
45- export default async function initializeDb ( ) : Promise < void > {
45+ export async function initializeDb ( ) : Promise < void > {
4646 /**
4747 * ipfsClientTarget
4848 */
You can’t perform that action at this time.
0 commit comments