aboutsummaryrefslogtreecommitdiff
path: root/plugin/params.go
diff options
context:
space:
mode:
authorAaron Buchwald <[email protected]>2020-10-20 11:57:31 -0400
committerAaron Buchwald <[email protected]>2020-10-20 11:57:31 -0400
commit6da65c2173e6da457423d67e958ce153c5598a17 (patch)
treea4e89b92bdebee9f7a2522a0bf0cf1ada394c9c5 /plugin/params.go
parenta02b51064dcb5e4fe062237635d2b986591630f0 (diff)
Add CLI config to coreth plugin
Diffstat (limited to 'plugin/params.go')
-rw-r--r--plugin/params.go30
1 files changed, 30 insertions, 0 deletions
diff --git a/plugin/params.go b/plugin/params.go
new file mode 100644
index 0000000..403424c
--- /dev/null
+++ b/plugin/params.go
@@ -0,0 +1,30 @@
+package main
+
+import (
+ "encoding/json"
+ "flag"
+
+ "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)
+
+ config := fs.String("coreth-config", "default", "Pass in CLI Config to set runtime attributes for Coreth")
+ if *config == "default" {
+ cliConfig.EthAPIEnabled = true
+ } else {
+ errs.Add(json.Unmarshal([]byte(*config), &cliConfig))
+ }
+}