mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-10 14:03:46 +00:00
internal/cli/server: update default cli values Co-authored-by: SHIVAM SHARMA <shivam691999@gmail.com>
This commit is contained in:
parent
54719fb180
commit
7bb7bacd50
3 changed files with 27 additions and 25 deletions
|
|
@ -419,7 +419,7 @@ func DefaultConfig() *Config {
|
||||||
TxPool: &TxPoolConfig{
|
TxPool: &TxPoolConfig{
|
||||||
Locals: []string{},
|
Locals: []string{},
|
||||||
NoLocals: false,
|
NoLocals: false,
|
||||||
Journal: "",
|
Journal: "transactions.rlp",
|
||||||
Rejournal: 1 * time.Hour,
|
Rejournal: 1 * time.Hour,
|
||||||
PriceLimit: 30000000000,
|
PriceLimit: 30000000000,
|
||||||
PriceBump: 10,
|
PriceBump: 10,
|
||||||
|
|
@ -432,8 +432,8 @@ func DefaultConfig() *Config {
|
||||||
Sealer: &SealerConfig{
|
Sealer: &SealerConfig{
|
||||||
Enabled: false,
|
Enabled: false,
|
||||||
Etherbase: "",
|
Etherbase: "",
|
||||||
GasCeil: 20000000,
|
GasCeil: 30_000_000,
|
||||||
GasPrice: big.NewInt(30 * params.GWei),
|
GasPrice: big.NewInt(1 * params.GWei),
|
||||||
ExtraData: "",
|
ExtraData: "",
|
||||||
},
|
},
|
||||||
Gpo: &GpoConfig{
|
Gpo: &GpoConfig{
|
||||||
|
|
@ -453,22 +453,22 @@ func DefaultConfig() *Config {
|
||||||
Prefix: "",
|
Prefix: "",
|
||||||
Host: "localhost",
|
Host: "localhost",
|
||||||
API: []string{"eth", "net", "web3", "txpool", "bor"},
|
API: []string{"eth", "net", "web3", "txpool", "bor"},
|
||||||
Cors: []string{"*"},
|
Cors: []string{"localhost"},
|
||||||
VHost: []string{"*"},
|
VHost: []string{"localhost"},
|
||||||
},
|
},
|
||||||
Ws: &APIConfig{
|
Ws: &APIConfig{
|
||||||
Enabled: false,
|
Enabled: false,
|
||||||
Port: 8546,
|
Port: 8546,
|
||||||
Prefix: "",
|
Prefix: "",
|
||||||
Host: "localhost",
|
Host: "localhost",
|
||||||
API: []string{"web3", "net"},
|
API: []string{"net", "web3"},
|
||||||
Cors: []string{"*"},
|
Cors: []string{"localhost"},
|
||||||
VHost: []string{"*"},
|
VHost: []string{"localhost"},
|
||||||
},
|
},
|
||||||
Graphql: &APIConfig{
|
Graphql: &APIConfig{
|
||||||
Enabled: false,
|
Enabled: false,
|
||||||
Cors: []string{"*"},
|
Cors: []string{"localhost"},
|
||||||
VHost: []string{"*"},
|
VHost: []string{"localhost"},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Ethstats: "",
|
Ethstats: "",
|
||||||
|
|
|
||||||
|
|
@ -14,10 +14,10 @@ import (
|
||||||
func TestConfigLegacy(t *testing.T) {
|
func TestConfigLegacy(t *testing.T) {
|
||||||
|
|
||||||
readFile := func(path string) {
|
readFile := func(path string) {
|
||||||
config, err := readLegacyConfig(path)
|
expectedConfig, err := readLegacyConfig(path)
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
|
|
||||||
assert.Equal(t, config, &Config{
|
testConfig := &Config{
|
||||||
Chain: "mainnet",
|
Chain: "mainnet",
|
||||||
Identity: Hostname(),
|
Identity: Hostname(),
|
||||||
RequiredBlocks: map[string]string{
|
RequiredBlocks: map[string]string{
|
||||||
|
|
@ -52,7 +52,7 @@ func TestConfigLegacy(t *testing.T) {
|
||||||
TxPool: &TxPoolConfig{
|
TxPool: &TxPoolConfig{
|
||||||
Locals: []string{},
|
Locals: []string{},
|
||||||
NoLocals: false,
|
NoLocals: false,
|
||||||
Journal: "",
|
Journal: "transactions.rlp",
|
||||||
Rejournal: 1 * time.Hour,
|
Rejournal: 1 * time.Hour,
|
||||||
PriceLimit: 30000000000,
|
PriceLimit: 30000000000,
|
||||||
PriceBump: 10,
|
PriceBump: 10,
|
||||||
|
|
@ -65,8 +65,8 @@ func TestConfigLegacy(t *testing.T) {
|
||||||
Sealer: &SealerConfig{
|
Sealer: &SealerConfig{
|
||||||
Enabled: false,
|
Enabled: false,
|
||||||
Etherbase: "",
|
Etherbase: "",
|
||||||
GasCeil: 20000000,
|
GasCeil: 30000000,
|
||||||
GasPrice: big.NewInt(30000000000),
|
GasPrice: big.NewInt(1 * params.GWei),
|
||||||
ExtraData: "",
|
ExtraData: "",
|
||||||
},
|
},
|
||||||
Gpo: &GpoConfig{
|
Gpo: &GpoConfig{
|
||||||
|
|
@ -86,22 +86,22 @@ func TestConfigLegacy(t *testing.T) {
|
||||||
Prefix: "",
|
Prefix: "",
|
||||||
Host: "localhost",
|
Host: "localhost",
|
||||||
API: []string{"eth", "net", "web3", "txpool", "bor"},
|
API: []string{"eth", "net", "web3", "txpool", "bor"},
|
||||||
Cors: []string{"*"},
|
Cors: []string{"localhost"},
|
||||||
VHost: []string{"*"},
|
VHost: []string{"localhost"},
|
||||||
},
|
},
|
||||||
Ws: &APIConfig{
|
Ws: &APIConfig{
|
||||||
Enabled: false,
|
Enabled: false,
|
||||||
Port: 8546,
|
Port: 8546,
|
||||||
Prefix: "",
|
Prefix: "",
|
||||||
Host: "localhost",
|
Host: "localhost",
|
||||||
API: []string{"web3", "net"},
|
API: []string{"net", "web3"},
|
||||||
Cors: []string{"*"},
|
Cors: []string{"localhost"},
|
||||||
VHost: []string{"*"},
|
VHost: []string{"localhost"},
|
||||||
},
|
},
|
||||||
Graphql: &APIConfig{
|
Graphql: &APIConfig{
|
||||||
Enabled: false,
|
Enabled: false,
|
||||||
Cors: []string{"*"},
|
Cors: []string{"localhost"},
|
||||||
VHost: []string{"*"},
|
VHost: []string{"localhost"},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Ethstats: "",
|
Ethstats: "",
|
||||||
|
|
@ -149,7 +149,9 @@ func TestConfigLegacy(t *testing.T) {
|
||||||
Enabled: false,
|
Enabled: false,
|
||||||
Period: 0,
|
Period: 0,
|
||||||
},
|
},
|
||||||
})
|
}
|
||||||
|
|
||||||
|
assert.Equal(t, expectedConfig, testConfig)
|
||||||
}
|
}
|
||||||
|
|
||||||
// read file in hcl format
|
// read file in hcl format
|
||||||
|
|
|
||||||
4
internal/cli/server/testdata/test.toml
vendored
4
internal/cli/server/testdata/test.toml
vendored
|
|
@ -12,8 +12,8 @@ lifetime = "1s"
|
||||||
|
|
||||||
[miner]
|
[miner]
|
||||||
mine = false
|
mine = false
|
||||||
gaslimit = 20000000
|
gaslimit = 30000000
|
||||||
gasprice = "30000000000"
|
gasprice = "1000000000"
|
||||||
|
|
||||||
[gpo]
|
[gpo]
|
||||||
ignoreprice = "4"
|
ignoreprice = "4"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue