|
|
@ -47,6 +47,7 @@ import ( |
|
|
|
"github.com/ethereum/go-ethereum/p2p/discover" |
|
|
|
"github.com/ethereum/go-ethereum/p2p/discover" |
|
|
|
"github.com/ethereum/go-ethereum/p2p/nat" |
|
|
|
"github.com/ethereum/go-ethereum/p2p/nat" |
|
|
|
"github.com/ethereum/go-ethereum/params" |
|
|
|
"github.com/ethereum/go-ethereum/params" |
|
|
|
|
|
|
|
"github.com/ethereum/go-ethereum/pow" |
|
|
|
"github.com/ethereum/go-ethereum/rpc" |
|
|
|
"github.com/ethereum/go-ethereum/rpc" |
|
|
|
"github.com/ethereum/go-ethereum/whisper" |
|
|
|
"github.com/ethereum/go-ethereum/whisper" |
|
|
|
) |
|
|
|
) |
|
|
@ -228,6 +229,10 @@ var ( |
|
|
|
Name: metrics.MetricsEnabledFlag, |
|
|
|
Name: metrics.MetricsEnabledFlag, |
|
|
|
Usage: "Enable metrics collection and reporting", |
|
|
|
Usage: "Enable metrics collection and reporting", |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
FakePoWFlag = cli.BoolFlag{ |
|
|
|
|
|
|
|
Name: "fakepow", |
|
|
|
|
|
|
|
Usage: "Disables proof-of-work verification", |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// RPC settings
|
|
|
|
// RPC settings
|
|
|
|
RPCEnabledFlag = cli.BoolFlag{ |
|
|
|
RPCEnabledFlag = cli.BoolFlag{ |
|
|
@ -842,11 +847,13 @@ func MakeChain(ctx *cli.Context) (chain *core.BlockChain, chainDb ethdb.Database |
|
|
|
glog.Fatalln(err) |
|
|
|
glog.Fatalln(err) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
chainConfig := MustMakeChainConfigFromDb(ctx, chainDb) |
|
|
|
chainConfig := MustMakeChainConfigFromDb(ctx, chainDb) |
|
|
|
|
|
|
|
|
|
|
|
var eventMux event.TypeMux |
|
|
|
pow := pow.PoW(core.FakePow{}) |
|
|
|
chain, err = core.NewBlockChain(chainDb, chainConfig, ethash.New(), &eventMux) |
|
|
|
if !ctx.GlobalBool(FakePoWFlag.Name) { |
|
|
|
|
|
|
|
pow = ethash.New() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
chain, err = core.NewBlockChain(chainDb, chainConfig, pow, new(event.TypeMux)) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
Fatalf("Could not start chainmanager: %v", err) |
|
|
|
Fatalf("Could not start chainmanager: %v", err) |
|
|
|
} |
|
|
|
} |
|
|
|