File tree Expand file tree Collapse file tree 3 files changed +5
-12
lines changed Expand file tree Collapse file tree 3 files changed +5
-12
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ import EthereumClient from '../lib/client'
7
7
import { Config } from '../lib/config'
8
8
import { Logger } from '../lib/logging'
9
9
import { RPCManager } from '../lib/rpc'
10
+ const os = require ( 'os' )
10
11
const path = require ( 'path' )
11
12
const fs = require ( 'fs-extra' )
12
13
const chains = require ( '@ethereumjs/common/dist/chains' ) . chains
@@ -38,7 +39,7 @@ const args = require('yargs')
38
39
} ,
39
40
datadir : {
40
41
describe : 'Data directory for the blockchain' ,
41
- default : Config . DATADIR_DEFAULT ,
42
+ default : ` ${ os . homedir ( ) } /Library/Ethereum/ethereumjs` ,
42
43
} ,
43
44
transports : {
44
45
describe : 'Network transports' ,
Original file line number Diff line number Diff line change @@ -3,7 +3,6 @@ import VM from '@ethereumjs/vm'
3
3
import { getLogger , Logger } from './logging'
4
4
import { Libp2pServer , RlpxServer } from './net/server'
5
5
import { parseMultiaddrs , parseTransports } from './util'
6
- const os = require ( 'os' )
7
6
8
7
export interface ConfigOptions {
9
8
/**
@@ -130,7 +129,7 @@ export class Config {
130
129
public static readonly CHAIN_DEFAULT = 'mainnet'
131
130
public static readonly SYNCMODE_DEFAULT = 'full'
132
131
public static readonly LIGHTSERV_DEFAULT = false
133
- public static readonly DATADIR_DEFAULT = `${ os . homedir ( ) } /Library/Ethereum/ethereumjs `
132
+ public static readonly DATADIR_DEFAULT = `./datadir `
134
133
public static readonly TRANSPORTS_DEFAULT = [ 'rlpx:port=30303' , 'libp2p' ]
135
134
public static readonly RPC_DEFAULT = false
136
135
public static readonly RPCPORT_DEFAULT = 8545
Original file line number Diff line number Diff line change 1
1
import tape from 'tape-catch'
2
2
import { Config } from '../lib/config'
3
- const os = require ( 'os' )
4
3
5
4
tape ( '[Config]' , ( t ) => {
6
5
t . test ( 'Initialization with default parameters' , ( t ) => {
@@ -17,19 +16,13 @@ tape('[Config]', (t) => {
17
16
18
17
t . test ( 'getChainDataDirectory() default directory' , ( t ) => {
19
18
const config = new Config ( )
20
- t . equal (
21
- config . getChainDataDirectory ( ) ,
22
- `${ os . homedir ( ) } /Library/Ethereum/ethereumjs/mainnet/chain`
23
- )
19
+ t . equal ( config . getChainDataDirectory ( ) , './datadir/mainnet/chain' )
24
20
t . end ( )
25
21
} )
26
22
27
23
t . test ( 'getStateDataDirectory() default directory' , ( t ) => {
28
24
const config = new Config ( )
29
- t . equal (
30
- config . getStateDataDirectory ( ) ,
31
- `${ os . homedir ( ) } /Library/Ethereum/ethereumjs/mainnet/state`
32
- )
25
+ t . equal ( config . getStateDataDirectory ( ) , './datadir/mainnet/state' )
33
26
t . end ( )
34
27
} )
35
28
} )
You can’t perform that action at this time.
0 commit comments