This repository was archived by the owner on Dec 10, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change 1
1
#!/usr/bin/env node
2
2
3
- const Common = require ( 'ethereumjs- common' ) . default
4
- const chains = require ( 'ethereumjs- common/dist/chains' ) . chains
3
+ const Common = require ( '@ ethereumjs/ common' ) . default
4
+ const chains = require ( '@ ethereumjs/ common/dist/chains' ) . chains
5
5
const { getLogger } = require ( '../lib/logging' )
6
6
const { parseParams, parseTransports } = require ( '../lib/util' )
7
7
const { fromName : serverFromName } = require ( '../lib/net/server' )
@@ -123,11 +123,17 @@ async function run() {
123
123
}
124
124
}
125
125
const networkDirName = args . network === 'mainnet' ? '' : `${ args . network } /`
126
+
127
+ // TODO: see todo below wrt resolving chain param parsing
128
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
126
129
const chainParams = args . params ? await parseParams ( args . params ) : args . network
130
+
127
131
// Initialize Common with an explicit 'chainstart' HF set until
128
132
// hardfork awareness is implemented within the library
129
133
// Also a fix for https://github.com/ethereumjs/ethereumjs-vm/issues/757
130
- const common = new Common ( chainParams , 'chainstart' )
134
+
135
+ // TODO: map chainParams (and lib/util.parseParams) to new Common format
136
+ const common = new Common ( { chain : args . network , hardfork : 'chainstart' } )
131
137
const servers = parseTransports ( args . transports ) . map ( ( t : any ) => {
132
138
const Server = serverFromName ( t . name )
133
139
if ( t . name === 'rlpx' ) {
Original file line number Diff line number Diff line change 1
- import Common from 'ethereumjs- common'
1
+ import Common from '@ ethereumjs/ common'
2
2
const level = require ( 'level' )
3
3
4
4
// Blockchain
@@ -45,7 +45,7 @@ import { getLogger } from './logging'
45
45
export function createNode ( args : any ) {
46
46
const logger = getLogger ( { loglevel : args . loglevel } )
47
47
const options = {
48
- common : new Common ( args . network || 'mainnet' ) ,
48
+ common : new Common ( { chain : args . network || 'mainnet' } ) ,
49
49
servers : [ new exports . Libp2pServer ( { multiaddrs : [ ] , ...args } ) ] ,
50
50
syncmode : args . syncmode || 'fast' ,
51
51
db : level ( args . db || 'ethereumjs' ) ,
You can’t perform that action at this time.
0 commit comments