aboutsummaryrefslogtreecommitdiff
path: root/plugin/params.go
blob: 403424ca873ed447d4ea20ebe15b9fdbbb6bf222 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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))
	}
}