aboutsummaryrefslogtreecommitdiff
path: root/plugin/params.go
diff options
context:
space:
mode:
authorAaron Buchwald <[email protected]>2020-10-27 14:04:01 -0400
committerAaron Buchwald <[email protected]>2020-10-27 15:52:20 -0400
commit28ccbeb7de18212954310588994058874fb180af (patch)
tree4bca4f77f74b31cc7948832ed45dd6b5a4bc8ef7 /plugin/params.go
parent806d04e9aa4b6e22fc2a484ada6fecb0c9a348e3 (diff)
Parse config to set enabled APIsv0.3.8
Diffstat (limited to 'plugin/params.go')
-rw-r--r--plugin/params.go16
1 files changed, 5 insertions, 11 deletions
diff --git a/plugin/params.go b/plugin/params.go
index 1810295..d780d00 100644
--- a/plugin/params.go
+++ b/plugin/params.go
@@ -5,37 +5,31 @@ import (
"flag"
"os"
- "github.com/ava-labs/avalanchego/utils/wrappers"
"github.com/ava-labs/coreth/plugin/evm"
)
-const (
- name = "coreth"
-)
-
var (
cliConfig evm.CommandLineConfig
- errs wrappers.Errs
)
func init() {
- errs := wrappers.Errs{}
- fs := flag.NewFlagSet(name, flag.ContinueOnError)
+ fs := flag.NewFlagSet("coreth", flag.ContinueOnError)
- config := fs.String("coreth-config", "default", "Pass in CLI Config to set runtime attributes for Coreth")
+ config := fs.String("config", "default", "Pass in CLI Config to set runtime attributes for Coreth")
if err := fs.Parse(os.Args[1:]); err != nil {
- errs.Add(err)
+ cliConfig.ParsingError = err
return
}
if *config == "default" {
cliConfig.EthAPIEnabled = true
+ cliConfig.PersonalAPIEnabled = true
cliConfig.TxPoolAPIEnabled = true
cliConfig.RPCGasCap = 2500000000 // 25000000 x 100
cliConfig.RPCTxFeeCap = 100 // 100 AVAX
} else {
// TODO only overwrite values that were explicitly set
- errs.Add(json.Unmarshal([]byte(*config), &cliConfig))
+ cliConfig.ParsingError = json.Unmarshal([]byte(*config), &cliConfig)
}
}