mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-28 15:46:43 +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{
|
||||
Locals: []string{},
|
||||
NoLocals: false,
|
||||
Journal: "",
|
||||
Journal: "transactions.rlp",
|
||||
Rejournal: 1 * time.Hour,
|
||||
PriceLimit: 30000000000,
|
||||
PriceBump: 10,
|
||||
|
|
@ -432,8 +432,8 @@ func DefaultConfig() *Config {
|
|||
Sealer: &SealerConfig{
|
||||
Enabled: false,
|
||||
Etherbase: "",
|
||||
GasCeil: 20000000,
|
||||
GasPrice: big.NewInt(30 * params.GWei),
|
||||
GasCeil: 30_000_000,
|
||||
GasPrice: big.NewInt(1 * params.GWei),
|
||||
ExtraData: "",
|
||||
},
|
||||
Gpo: &GpoConfig{
|
||||
|
|
@ -453,22 +453,22 @@ func DefaultConfig() *Config {
|
|||
Prefix: "",
|
||||
Host: "localhost",
|
||||
API: []string{"eth", "net", "web3", "txpool", "bor"},
|
||||
Cors: []string{"*"},
|
||||
VHost: []string{"*"},
|
||||
Cors: []string{"localhost"},
|
||||
VHost: []string{"localhost"},
|
||||
},
|
||||
Ws: &APIConfig{
|
||||
Enabled: false,
|
||||
Port: 8546,
|
||||
Prefix: "",
|
||||
Host: "localhost",
|
||||
API: []string{"web3", "net"},
|
||||
Cors: []string{"*"},
|
||||
VHost: []string{"*"},
|
||||
API: []string{"net", "web3"},
|
||||
Cors: []string{"localhost"},
|
||||
VHost: []string{"localhost"},
|
||||
},
|
||||
Graphql: &APIConfig{
|
||||
Enabled: false,
|
||||
Cors: []string{"*"},
|
||||
VHost: []string{"*"},
|
||||
Cors: []string{"localhost"},
|
||||
VHost: []string{"localhost"},
|
||||
},
|
||||
},
|
||||
Ethstats: "",
|
||||
|
|
|
|||
|
|
@ -14,10 +14,10 @@ import (
|
|||
func TestConfigLegacy(t *testing.T) {
|
||||
|
||||
readFile := func(path string) {
|
||||
config, err := readLegacyConfig(path)
|
||||
expectedConfig, err := readLegacyConfig(path)
|
||||
assert.NoError(t, err)
|
||||
|
||||
assert.Equal(t, config, &Config{
|
||||
testConfig := &Config{
|
||||
Chain: "mainnet",
|
||||
Identity: Hostname(),
|
||||
RequiredBlocks: map[string]string{
|
||||
|
|
@ -52,7 +52,7 @@ func TestConfigLegacy(t *testing.T) {
|
|||
TxPool: &TxPoolConfig{
|
||||
Locals: []string{},
|
||||
NoLocals: false,
|
||||
Journal: "",
|
||||
Journal: "transactions.rlp",
|
||||
Rejournal: 1 * time.Hour,
|
||||
PriceLimit: 30000000000,
|
||||
PriceBump: 10,
|
||||
|
|
@ -65,8 +65,8 @@ func TestConfigLegacy(t *testing.T) {
|
|||
Sealer: &SealerConfig{
|
||||
Enabled: false,
|
||||
Etherbase: "",
|
||||
GasCeil: 20000000,
|
||||
GasPrice: big.NewInt(30000000000),
|
||||
GasCeil: 30000000,
|
||||
GasPrice: big.NewInt(1 * params.GWei),
|
||||
ExtraData: "",
|
||||
},
|
||||
Gpo: &GpoConfig{
|
||||
|
|
@ -86,22 +86,22 @@ func TestConfigLegacy(t *testing.T) {
|
|||
Prefix: "",
|
||||
Host: "localhost",
|
||||
API: []string{"eth", "net", "web3", "txpool", "bor"},
|
||||
Cors: []string{"*"},
|
||||
VHost: []string{"*"},
|
||||
Cors: []string{"localhost"},
|
||||
VHost: []string{"localhost"},
|
||||
},
|
||||
Ws: &APIConfig{
|
||||
Enabled: false,
|
||||
Port: 8546,
|
||||
Prefix: "",
|
||||
Host: "localhost",
|
||||
API: []string{"web3", "net"},
|
||||
Cors: []string{"*"},
|
||||
VHost: []string{"*"},
|
||||
API: []string{"net", "web3"},
|
||||
Cors: []string{"localhost"},
|
||||
VHost: []string{"localhost"},
|
||||
},
|
||||
Graphql: &APIConfig{
|
||||
Enabled: false,
|
||||
Cors: []string{"*"},
|
||||
VHost: []string{"*"},
|
||||
Cors: []string{"localhost"},
|
||||
VHost: []string{"localhost"},
|
||||
},
|
||||
},
|
||||
Ethstats: "",
|
||||
|
|
@ -149,7 +149,9 @@ func TestConfigLegacy(t *testing.T) {
|
|||
Enabled: false,
|
||||
Period: 0,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
assert.Equal(t, expectedConfig, testConfig)
|
||||
}
|
||||
|
||||
// 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]
|
||||
mine = false
|
||||
gaslimit = 20000000
|
||||
gasprice = "30000000000"
|
||||
gaslimit = 30000000
|
||||
gasprice = "1000000000"
|
||||
|
||||
[gpo]
|
||||
ignoreprice = "4"
|
||||
|
|
|
|||
Loading…
Reference in a new issue