mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 15:16:43 +00:00
cmd/faucet: fix configuration
This commit is contained in:
parent
03cf680f04
commit
c507c9d1c9
1 changed files with 15 additions and 11 deletions
|
|
@ -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"
|
||||||
|
|
@ -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) {
|
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
|
// Assemble the raw devp2p protocol stack
|
||||||
stack, err := node.New(&node.Config{
|
stack, err := node.New(&node.Config{
|
||||||
Name: "geth",
|
Name: "geth",
|
||||||
Version: params.Version,
|
Version: params.Version,
|
||||||
DataDir: filepath.Join(os.Getenv("HOME"), ".faucet"),
|
DataDir: filepath.Join(os.Getenv("HOME"), ".faucet"),
|
||||||
NAT: nat.Any(),
|
P2P: p2p.Config{
|
||||||
DiscoveryV5: true,
|
NAT: nat.Any(),
|
||||||
ListenAddr: fmt.Sprintf(":%d", port),
|
NoDiscovery: true,
|
||||||
DiscoveryV5Addr: fmt.Sprintf(":%d", port+1),
|
DiscoveryV5: true,
|
||||||
MaxPeers: 25,
|
ListenAddr: fmt.Sprintf(":%d", port),
|
||||||
BootstrapNodesV5: enodes,
|
DiscoveryV5Addr: fmt.Sprintf(":%d", port+1),
|
||||||
|
MaxPeers: 25,
|
||||||
|
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,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue