File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -294,7 +294,7 @@ export class Config {
294294 if ( option !== undefined ) return option
295295 return this . chainCommon . chainName ( ) === 'mainnet'
296296 }
297-
297+
298298 getNetworkDir ( ) : string {
299299 const networkDirName = this . common . chainName ( )
300300 const dataDir = `${ this . datadir } /${ networkDirName } `
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import { randomBytes } from 'crypto'
22import { RLPx as Devp2pRLPx , Peer as Devp2pRLPxPeer , DPT as Devp2pDPT } from '@ethereumjs/devp2p'
33import { RlpxPeer } from '../peer/rlpxpeer'
44import { Server , ServerOptions } from './server'
5- import fs from 'fs'
5+ const fs = require ( 'fs-extra' )
66
77export interface RlpxServerOptions extends ServerOptions {
88 /* Local port to listen on (default: 30303) */
@@ -73,6 +73,7 @@ export class RlpxServer extends Server {
7373 } else {
7474 const key = randomBytes ( 32 )
7575 this . key = key
76+ fs . ensureDirSync ( dataDir )
7677 fs . writeFileSync ( fileName , key . toString ( 'binary' ) , {
7778 encoding : 'binary' ,
7879 } )
You can’t perform that action at this time.
0 commit comments