From c507c9d1c9c572c5f223339c22f21248a5420599 Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Tue, 11 Apr 2017 11:39:28 +0200 Subject: [PATCH] cmd/faucet: fix configuration --- cmd/faucet/faucet.go | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/cmd/faucet/faucet.go b/cmd/faucet/faucet.go index 232f0ff9e6..aa8f4bac16 100644 --- a/cmd/faucet/faucet.go +++ b/cmd/faucet/faucet.go @@ -41,11 +41,13 @@ import ( "github.com/ethereum/go-ethereum/core" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/eth" + "github.com/ethereum/go-ethereum/eth/gasprice" "github.com/ethereum/go-ethereum/ethclient" "github.com/ethereum/go-ethereum/ethstats" "github.com/ethereum/go-ethereum/les" "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/node" + "github.com/ethereum/go-ethereum/p2p" "github.com/ethereum/go-ethereum/p2p/discover" "github.com/ethereum/go-ethereum/p2p/discv5" "github.com/ethereum/go-ethereum/p2p/nat" @@ -175,15 +177,18 @@ type faucet struct { func newFaucet(genesis *core.Genesis, port int, enodes []*discv5.Node, network int, stats string, ks *keystore.KeyStore, index []byte) (*faucet, error) { // Assemble the raw devp2p protocol stack stack, err := node.New(&node.Config{ - Name: "geth", - Version: params.Version, - DataDir: filepath.Join(os.Getenv("HOME"), ".faucet"), - NAT: nat.Any(), - DiscoveryV5: true, - ListenAddr: fmt.Sprintf(":%d", port), - DiscoveryV5Addr: fmt.Sprintf(":%d", port+1), - MaxPeers: 25, - BootstrapNodesV5: enodes, + Name: "geth", + Version: params.Version, + DataDir: filepath.Join(os.Getenv("HOME"), ".faucet"), + P2P: p2p.Config{ + NAT: nat.Any(), + NoDiscovery: true, + DiscoveryV5: true, + ListenAddr: fmt.Sprintf(":%d", port), + DiscoveryV5Addr: fmt.Sprintf(":%d", port+1), + MaxPeers: 25, + BootstrapNodesV5: enodes, + }, }) if err != nil { return nil, err @@ -195,8 +200,7 @@ func newFaucet(genesis *core.Genesis, port int, enodes []*discv5.Node, network i NetworkId: network, Genesis: genesis, GasPrice: big.NewInt(20 * params.Shannon), - GpoBlocks: 10, - GpoPercentile: 50, + GPO: gasprice.Config{Blocks: 10, Percentile: 50}, EthashCacheDir: "ethash", EthashCachesInMem: 2, EthashCachesOnDisk: 3,