cmd/faucet: fix configuration

This commit is contained in:
Felix Lange 2017-04-11 11:39:28 +02:00
parent 03cf680f04
commit c507c9d1c9

View file

@ -41,11 +41,13 @@ import (
"github.com/ethereum/go-ethereum/core" "github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/eth" "github.com/ethereum/go-ethereum/eth"
"github.com/ethereum/go-ethereum/eth/gasprice"
"github.com/ethereum/go-ethereum/ethclient" "github.com/ethereum/go-ethereum/ethclient"
"github.com/ethereum/go-ethereum/ethstats" "github.com/ethereum/go-ethereum/ethstats"
"github.com/ethereum/go-ethereum/les" "github.com/ethereum/go-ethereum/les"
"github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/node" "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/discover"
"github.com/ethereum/go-ethereum/p2p/discv5" "github.com/ethereum/go-ethereum/p2p/discv5"
"github.com/ethereum/go-ethereum/p2p/nat" "github.com/ethereum/go-ethereum/p2p/nat"
@ -178,12 +180,15 @@ func newFaucet(genesis *core.Genesis, port int, enodes []*discv5.Node, network i
Name: "geth", Name: "geth",
Version: params.Version, Version: params.Version,
DataDir: filepath.Join(os.Getenv("HOME"), ".faucet"), DataDir: filepath.Join(os.Getenv("HOME"), ".faucet"),
P2P: p2p.Config{
NAT: nat.Any(), NAT: nat.Any(),
NoDiscovery: true,
DiscoveryV5: true, DiscoveryV5: true,
ListenAddr: fmt.Sprintf(":%d", port), ListenAddr: fmt.Sprintf(":%d", port),
DiscoveryV5Addr: fmt.Sprintf(":%d", port+1), DiscoveryV5Addr: fmt.Sprintf(":%d", port+1),
MaxPeers: 25, MaxPeers: 25,
BootstrapNodesV5: enodes, BootstrapNodesV5: enodes,
},
}) })
if err != nil { if err != nil {
return nil, err return nil, err
@ -195,8 +200,7 @@ func newFaucet(genesis *core.Genesis, port int, enodes []*discv5.Node, network i
NetworkId: network, NetworkId: network,
Genesis: genesis, Genesis: genesis,
GasPrice: big.NewInt(20 * params.Shannon), GasPrice: big.NewInt(20 * params.Shannon),
GpoBlocks: 10, GPO: gasprice.Config{Blocks: 10, Percentile: 50},
GpoPercentile: 50,
EthashCacheDir: "ethash", EthashCacheDir: "ethash",
EthashCachesInMem: 2, EthashCachesInMem: 2,
EthashCachesOnDisk: 3, EthashCachesOnDisk: 3,