Merge pull request #214 from maticnetwork/ferran/feature-config-file

Feature to add a config file to Bor
This commit is contained in:
Ferran Borreguero 2021-10-25 13:58:57 +02:00 committed by GitHub
commit 7bb48844a4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 420 additions and 138 deletions

View file

@ -36,7 +36,7 @@ type Command struct {
// final configuration // final configuration
config *Config config *Config
configFile string configFile []string
// bor node // bor node
node *node.Node node *node.Node
@ -65,8 +65,8 @@ func (c *Command) Run(args []string) int {
// read config file // read config file
config := DefaultConfig() config := DefaultConfig()
if c.configFile != "" { for _, configFile := range c.configFile {
cfg, err := readConfigFile(c.configFile) cfg, err := readConfigFile(configFile)
if err != nil { if err != nil {
c.UI.Error(err.Error()) c.UI.Error(err.Error())
return 1 return 1
@ -130,8 +130,8 @@ func (c *Command) Run(args []string) int {
} }
// register ethash service // register ethash service
if config.EthStats != "" { if config.Ethstats != "" {
if err := ethstats.New(stack, backend.APIBackend, backend.Engine(), config.EthStats); err != nil { if err := ethstats.New(stack, backend.APIBackend, backend.Engine(), config.Ethstats); err != nil {
c.UI.Error(err.Error()) c.UI.Error(err.Error())
return 1 return 1
} }
@ -165,7 +165,7 @@ func (c *Command) Run(args []string) int {
} }
} }
if err := c.setupMetrics(config.Metrics); err != nil { if err := c.setupTelemetry(config.Telemetry); err != nil {
c.UI.Error(err.Error()) c.UI.Error(err.Error())
return 1 return 1
} }
@ -221,7 +221,7 @@ func (c *Command) unlockAccounts(borKeystore *keystore.KeyStore) error {
return nil return nil
} }
func (c *Command) setupMetrics(config *MetricsConfig) error { func (c *Command) setupTelemetry(config *TelemetryConfig) error {
metrics.Enabled = config.Enabled metrics.Enabled = config.Enabled
metrics.EnabledExpensive = config.Expensive metrics.EnabledExpensive = config.Expensive

View file

@ -25,6 +25,7 @@ import (
"github.com/ethereum/go-ethereum/p2p/enode" "github.com/ethereum/go-ethereum/p2p/enode"
"github.com/ethereum/go-ethereum/p2p/nat" "github.com/ethereum/go-ethereum/p2p/nat"
"github.com/ethereum/go-ethereum/params" "github.com/ethereum/go-ethereum/params"
"github.com/hashicorp/hcl/v2/hclsimple"
"github.com/imdario/mergo" "github.com/imdario/mergo"
"github.com/mitchellh/go-homedir" "github.com/mitchellh/go-homedir"
gopsutil "github.com/shirou/gopsutil/mem" gopsutil "github.com/shirou/gopsutil/mem"
@ -33,147 +34,319 @@ import (
type Config struct { type Config struct {
chain *chains.Chain chain *chains.Chain
Chain string // Chain is the chain to sync with
Debug bool Chain string `hcl:"chain,optional"`
Whitelist map[string]string
LogLevel string // Whitelist is a list of required (block number, hash) pairs to accept
DataDir string Whitelist map[string]string `hcl:"whitelist,optional"`
P2P *P2PConfig
SyncMode string // LogLevel is the level of the logs to put out
GcMode string LogLevel string `hcl:"log-level,optional"`
Snapshot bool
EthStats string // DataDir is the directory to store the state in
Heimdall *HeimdallConfig DataDir string `hcl:"data-dir,optional"`
TxPool *TxPoolConfig
Sealer *SealerConfig // SyncMode selects the sync protocol
JsonRPC *JsonRPCConfig SyncMode string `hcl:"sync-mode,optional"`
Gpo *GpoConfig
Ethstats string // GcMode selects the garbage collection mode for the trie
Metrics *MetricsConfig GcMode string `hcl:"gc-mode,optional"`
Cache *CacheConfig
Accounts *AccountsConfig // XXX
Snapshot bool `hcl:"snapshot,optional"`
// Ethstats is the address of the ethstats server to send telemetry
Ethstats string `hcl:"ethstats,optional"`
// P2P has the p2p network related settings
P2P *P2PConfig `hcl:"p2p,block"`
// Heimdall has the heimdall connection related settings
Heimdall *HeimdallConfig `hcl:"heimdall,block"`
// TxPool has the transaction pool related settings
TxPool *TxPoolConfig `hcl:"txpool,block"`
// Sealer has the validator related settings
Sealer *SealerConfig `hcl:"sealer,block"`
// JsonRPC has the json-rpc related settings
JsonRPC *JsonRPCConfig `hcl:"jsonrpc,block"`
// Gpo has the gas price oracle related settings
Gpo *GpoConfig `hcl:"gpo,block"`
// Telemetry has the telemetry related settings
Telemetry *TelemetryConfig `hcl:"telemetry,block"`
// Cache has the cache related settings
Cache *CacheConfig `hcl:"cache,block"`
// Account has the validator account related settings
Accounts *AccountsConfig `hcl:"accounts,block"`
} }
type P2PConfig struct { type P2PConfig struct {
MaxPeers uint64 // MaxPeers sets the maximum number of connected peers
MaxPendPeers uint64 MaxPeers uint64 `hcl:"max-peers,optional"`
Bind string
Port uint64 // MaxPendPeers sets the maximum number of pending connected peers
NoDiscover bool MaxPendPeers uint64 `hcl:"max-pend-peers,optional"`
NAT string
Discovery *P2PDiscovery // Bind is the bind address
Bind string `hcl:"bind,optional"`
// Port is the port number
Port uint64 `hcl:"port,optional"`
// NoDiscover is used to disable discovery
NoDiscover bool `hcl:"no-discover,optional"`
// NAT it used to set NAT options
NAT string `hcl:"nat,optional"`
// Discovery has the p2p discovery related settings
Discovery *P2PDiscovery `hcl:"discovery,block"`
} }
type P2PDiscovery struct { type P2PDiscovery struct {
V5Enabled bool // V5Enabled is used to enable disc v5 discovery mode
Bootnodes []string V5Enabled bool `hcl:"v5-enabled,optional"`
BootnodesV4 []string
BootnodesV5 []string // Bootnodes is the list of initial bootnodes
StaticNodes []string Bootnodes []string `hcl:"bootnodes,optional"`
TrustedNodes []string
DNS []string // BootnodesV4 is the list of initial v4 bootnodes
BootnodesV4 []string `hcl:"bootnodesv4,optional"`
// BootnodesV5 is the list of initial v5 bootnodes
BootnodesV5 []string `hcl:"bootnodesv5,optional"`
// StaticNodes is the list of static nodes
StaticNodes []string `hcl:"static-nodes,optional"`
// TrustedNodes is the list of trusted nodes
TrustedNodes []string `hcl:"trusted-nodes,optional"`
// DNS is the list of enrtree:// URLs which will be queried for nodes to connect to
DNS []string `hcl:"dns,optional"`
} }
type HeimdallConfig struct { type HeimdallConfig struct {
URL string // URL is the url of the heimdall server
Without bool URL string `hcl:"url,optional"`
// Without is used to disable remote heimdall during testing
Without bool `hcl:"without,optional"`
} }
type TxPoolConfig struct { type TxPoolConfig struct {
Locals []string // Locals are the addresses that should be treated by default as local
NoLocals bool Locals []string `hcl:"locals,optional"`
Journal string
// NoLocals enables whether local transaction handling should be disabled
NoLocals bool `hcl:"no-locals,optional"`
// Journal is the path to store local transactions to survive node restarts
Journal string `hcl:"journal,optional"`
// Rejournal is the time interval to regenerate the local transaction journal
Rejournal time.Duration Rejournal time.Duration
PriceLimit uint64 RejournalRaw string `hcl:"rejournal,optional"`
PriceBump uint64
AccountSlots uint64 // PriceLimit is the minimum gas price to enforce for acceptance into the pool
GlobalSlots uint64 PriceLimit uint64 `hcl:"price-limit,optional"`
AccountQueue uint64
GlobalQueue uint64 // PriceBump is the minimum price bump percentage to replace an already existing transaction (nonce)
LifeTime time.Duration PriceBump uint64 `hcl:"price-bump,optional"`
// AccountSlots is the number of executable transaction slots guaranteed per account
AccountSlots uint64 `hcl:"account-slots,optional"`
// GlobalSlots is the maximum number of executable transaction slots for all accounts
GlobalSlots uint64 `hcl:"global-slots,optional"`
// AccountQueue is the maximum number of non-executable transaction slots permitted per account
AccountQueue uint64 `hcl:"account-queue,optional"`
// GlobalQueueis the maximum number of non-executable transaction slots for all accounts
GlobalQueue uint64 `hcl:"global-queue,optional"`
// Lifetime is the maximum amount of time non-executable transaction are queued
LifeTime time.Duration
LifeTimeRaw string `hcl:"lifetime,optional"`
} }
type SealerConfig struct { type SealerConfig struct {
Enabled bool // Enabled is used to enable validator mode
Etherbase string Enabled bool `hcl:"enabled,optional"`
ExtraData string
GasCeil uint64 // Etherbase is the address of the validator
GasPrice *big.Int Etherbase string `hcl:"etherbase,optional"`
// ExtraData is the block extra data set by the miner
ExtraData string `hcl:"extra-data,optional"`
// GasCeil is the target gas ceiling for mined blocks.
GasCeil uint64 `hcl:"gas-ceil,optional"`
// GasPrice is the minimum gas price for mining a transaction
GasPrice *big.Int `hcl:"gas-price,optional"`
} }
type JsonRPCConfig struct { type JsonRPCConfig struct {
IPCDisable bool // IPCDisable enables whether ipc is enabled or not
IPCPath string IPCDisable bool `hcl:"ipc-disable,optional"`
Modules []string // IPCPath is the path of the ipc endpoint
VHost []string IPCPath string `hcl:"ipc-path,optional"`
Cors []string
GasCap uint64 // Modules is the list of enabled api modules
TxFeeCap float64 Modules []string `hcl:"modules,optional"`
Http *APIConfig // VHost is the list of valid virtual hosts
Ws *APIConfig VHost []string `hcl:"vhost,optional"`
Graphql *APIConfig
// Cors is the list of Cors endpoints
Cors []string `hcl:"cors,optional"`
// GasCap is the global gas cap for eth-call variants.
GasCap uint64 `hcl:"gas-cap,optional"`
// TxFeeCap is the global transaction fee cap for send-transaction variants
TxFeeCap float64 `hcl:"tx-fee-cap,optional"`
// Http has the json-rpc http related settings
Http *APIConfig `hcl:"http,block"`
// Http has the json-rpc websocket related settings
Ws *APIConfig `hcl:"ws,block"`
// Http has the json-rpc graphql related settings
Graphql *APIConfig `hcl:"graphql,block"`
} }
type APIConfig struct { type APIConfig struct {
Enabled bool // Enabled selects whether the api is enabled
Port uint64 Enabled bool `hcl:"enabled,optional"`
Prefix string
Host string // Port is the port number for this api
Port uint64 `hcl:"port,optional"`
// Prefix is the http prefix to expose this api
Prefix string `hcl:"prefix,optional"`
// Host is the address to bind the api
Host string `hcl:"host,optional"`
} }
type GpoConfig struct { type GpoConfig struct {
Blocks uint64 // Blocks is the number of blocks to track to compute the price oracle
Percentile uint64 Blocks uint64 `hcl:"blocks,optional"`
MaxPrice *big.Int
IgnorePrice *big.Int // Percentile sets the weights to new blocks
Percentile uint64 `hcl:"percentile,optional"`
// MaxPrice is an upper bound gas price
MaxPrice *big.Int `hcl:"max-price,optional"`
// IgnorePrice is a lower bound gas price
IgnorePrice *big.Int `hcl:"ignore-price,optional"`
} }
type MetricsConfig struct { type TelemetryConfig struct {
Enabled bool // Enabled enables metrics
Expensive bool Enabled bool `hcl:"enabled,optional"`
InfluxDB *InfluxDBConfig
// Expensive enables expensive metrics
Expensive bool `hcl:"expensive,optional"`
// InfluxDB has the influxdb related settings
InfluxDB *InfluxDBConfig `hcl:"influx,block"`
} }
type InfluxDBConfig struct { type InfluxDBConfig struct {
V1Enabled bool // V1Enabled enables influx v1 mode
Endpoint string V1Enabled bool `hcl:"v1-enabled,optional"`
Database string
Username string // Endpoint is the url endpoint of the influxdb service
Password string Endpoint string `hcl:"endpoint,optional"`
Tags map[string]string
V2Enabled bool // Database is the name of the database in Influxdb to store the metrics.
Token string Database string `hcl:"database,optional"`
Bucket string
Organization string // Enabled is the username to authorize access to Influxdb
Username string `hcl:"username,optional"`
// Password is the password to authorize access to Influxdb
Password string `hcl:"password,optional"`
// Tags are tags attaches to all generated metrics
Tags map[string]string `hcl:"tags,optional"`
// Enabled enables influx v2 mode
V2Enabled bool `hcl:"v2-enabled,optional"`
// Token is the token to authorize access to Influxdb V2.
Token string `hcl:"token,optional"`
// Bucket is the bucket to store metrics in Influxdb V2.
Bucket string `hcl:"bucket,optional"`
// Organization is the name of the organization for Influxdb V2.
Organization string `hcl:"organization,optional"`
} }
type CacheConfig struct { type CacheConfig struct {
Cache uint64 // Cache is the amount of cache of the node
PercGc uint64 Cache uint64 `hcl:"cache,optional"`
PercSnapshot uint64
PercDatabase uint64 // PercGc is percentage of cache used for garbage collection
PercTrie uint64 PercGc uint64 `hcl:"perc-gc,optional"`
Journal string
Rejournal time.Duration // PercSnapshot is percentage of cache used for snapshots
NoPrefetch bool PercSnapshot uint64 `hcl:"perc-snapshot,optional"`
Preimages bool
TxLookupLimit uint64 // PercDatabase is percentage of cache used for the database
PercDatabase uint64 `hcl:"perc-database,optional"`
// PercTrie is percentage of cache used for the trie
PercTrie uint64 `hcl:"perc-trie,optional"`
// Journal is the disk journal directory for trie cache to survive node restarts
Journal string `hcl:"journal,optional"`
// Rejournal is the time interval to regenerate the journal for clean cache
Rejournal time.Duration
RejournalRaw string `hcl:"rejournal,optional"`
// NoPrefetch is used to disable prefetch of tries
NoPrefetch bool `hcl:"no-prefetch,optional"`
// Preimages is used to enable the track of hash preimages
Preimages bool `hcl:"preimages,optional"`
// TxLookupLimit sets the maximum number of blocks from head whose tx indices are reserved.
TxLookupLimit uint64 `hcl:"tx-lookup-limit,optional"`
} }
type AccountsConfig struct { type AccountsConfig struct {
Unlock []string // Unlock is the list of addresses to unlock in the node
PasswordFile string Unlock []string `hcl:"unlock,optional"`
AllowInsecureUnlock bool
UseLightweightKDF bool // PasswordFile is the file where the account passwords are stored
PasswordFile string `hcl:"password-file,optional"`
// AllowInsecureUnlock allows user to unlock accounts in unsafe http environment.
AllowInsecureUnlock bool `hcl:"allow-insecure-unlock,optional"`
// UseLightweightKDF enables a faster but less secure encryption of accounts
UseLightweightKDF bool `hcl:"use-lightweight-kdf,optional"`
} }
func DefaultConfig() *Config { func DefaultConfig() *Config {
return &Config{ return &Config{
Chain: "mainnet", Chain: "mainnet",
Debug: false,
Whitelist: map[string]string{}, Whitelist: map[string]string{},
LogLevel: "INFO", LogLevel: "INFO",
DataDir: defaultDataDir(), DataDir: defaultDataDir(),
@ -201,7 +374,6 @@ func DefaultConfig() *Config {
SyncMode: "fast", SyncMode: "fast",
GcMode: "full", GcMode: "full",
Snapshot: true, Snapshot: true,
EthStats: "",
TxPool: &TxPoolConfig{ TxPool: &TxPoolConfig{
Locals: []string{}, Locals: []string{},
NoLocals: false, NoLocals: false,
@ -253,7 +425,7 @@ func DefaultConfig() *Config {
}, },
}, },
Ethstats: "", Ethstats: "",
Metrics: &MetricsConfig{ Telemetry: &TelemetryConfig{
Enabled: false, Enabled: false,
Expensive: false, Expensive: false,
InfluxDB: &InfluxDBConfig{ InfluxDB: &InfluxDBConfig{
@ -290,19 +462,52 @@ func DefaultConfig() *Config {
} }
} }
func (c *Config) fillTimeDurations() error {
tds := []struct {
path string
td *time.Duration
str *string
}{
{"txpool.lifetime", &c.TxPool.LifeTime, &c.TxPool.LifeTimeRaw},
{"txpool.rejournal", &c.TxPool.Rejournal, &c.TxPool.RejournalRaw},
{"cache.rejournal", &c.Cache.Rejournal, &c.Cache.RejournalRaw},
}
for _, x := range tds {
if x.td != nil && x.str != nil && *x.str != "" {
d, err := time.ParseDuration(*x.str)
if err != nil {
return fmt.Errorf("%s can't parse time duration %s", x.path, *x.str)
}
*x.str = ""
*x.td = d
}
}
return nil
}
func readConfigFile(path string) (*Config, error) { func readConfigFile(path string) (*Config, error) {
data, err := ioutil.ReadFile(path) ext := filepath.Ext(path)
if err != nil { if ext == ".toml" {
// read file and apply the legacy config
data, err := ioutil.ReadFile(path)
if err != nil {
return nil, err
}
return readLegacyConfig(data)
}
config := &Config{
TxPool: &TxPoolConfig{},
Cache: &CacheConfig{},
}
if err := hclsimple.DecodeFile(path, nil, config); err != nil {
return nil, fmt.Errorf("failed to decode config file '%s': %v", path, err)
}
if err := config.fillTimeDurations(); err != nil {
return nil, err return nil, err
} }
// TODO: Use hcl as config format return config, nil
ext := filepath.Ext(path)
switch ext {
case ".toml":
return readLegacyConfig(data)
default:
return nil, fmt.Errorf("file path extension '%s' not found", ext)
}
} }
func (c *Config) loadChain() error { func (c *Config) loadChain() error {
@ -337,6 +542,14 @@ func (c *Config) buildEth() (*ethconfig.Config, error) {
n.HeimdallURL = c.Heimdall.URL n.HeimdallURL = c.Heimdall.URL
n.WithoutHeimdall = c.Heimdall.Without n.WithoutHeimdall = c.Heimdall.Without
// gas price oracle
{
n.GPO.Blocks = int(c.Gpo.Blocks)
n.GPO.Percentile = int(c.Gpo.Percentile)
n.GPO.MaxPrice = c.Gpo.MaxPrice
n.GPO.IgnorePrice = c.Gpo.IgnorePrice
}
// txpool options // txpool options
{ {
n.TxPool.NoLocals = c.TxPool.NoLocals n.TxPool.NoLocals = c.TxPool.NoLocals

View file

@ -21,8 +21,8 @@ func TestConfigDefault(t *testing.T) {
func TestConfigMerge(t *testing.T) { func TestConfigMerge(t *testing.T) {
c0 := &Config{ c0 := &Config{
Chain: "0", Chain: "0",
Debug: true, Snapshot: true,
Whitelist: map[string]string{ Whitelist: map[string]string{
"a": "b", "a": "b",
}, },
@ -52,8 +52,8 @@ func TestConfigMerge(t *testing.T) {
}, },
} }
expected := &Config{ expected := &Config{
Chain: "1", Chain: "1",
Debug: true, Snapshot: true,
Whitelist: map[string]string{ Whitelist: map[string]string{
"a": "b", "a": "b",
"b": "c", "b": "c",
@ -75,6 +75,32 @@ func TestConfigMerge(t *testing.T) {
assert.Equal(t, c0, expected) assert.Equal(t, c0, expected)
} }
func TestConfigLoadFile(t *testing.T) {
readFile := func(path string) {
config, err := readConfigFile(path)
assert.NoError(t, err)
assert.Equal(t, config, &Config{
DataDir: "./data",
P2P: &P2PConfig{
MaxPeers: 30,
},
TxPool: &TxPoolConfig{
LifeTime: time.Duration(1 * time.Second),
},
Cache: &CacheConfig{},
})
}
// read file in hcl format
t.Run("hcl", func(t *testing.T) {
readFile("./testdata/simple.hcl")
})
// read file in json format
t.Run("json", func(t *testing.T) {
readFile("./testdata/simple.json")
})
}
var dummyEnodeAddr = "enode://0cb82b395094ee4a2915e9714894627de9ed8498fb881cec6db7c65e8b9a5bd7f2f25cc84e71e89d0947e51c76e85d0847de848c7782b13c0255247a6758178c@44.232.55.71:30303" var dummyEnodeAddr = "enode://0cb82b395094ee4a2915e9714894627de9ed8498fb881cec6db7c65e8b9a5bd7f2f25cc84e71e89d0947e51c76e85d0847de848c7782b13c0255247a6758178c@44.232.55.71:30303"
func TestConfigBootnodesDefault(t *testing.T) { func TestConfigBootnodesDefault(t *testing.T) {

View file

@ -9,11 +9,6 @@ func (c *Command) Flags() *flagset.Flagset {
f := flagset.NewFlagSet("server") f := flagset.NewFlagSet("server")
f.BoolFlag(&flagset.BoolFlag{
Name: "debug",
Usage: "Path of the file to apply",
Value: &c.cliConfig.Debug,
})
f.StringFlag(&flagset.StringFlag{ f.StringFlag(&flagset.StringFlag{
Name: "chain", Name: "chain",
Usage: "Name of the chain to sync", Usage: "Name of the chain to sync",
@ -29,7 +24,7 @@ func (c *Command) Flags() *flagset.Flagset {
Usage: "Path of the data directory to store information", Usage: "Path of the data directory to store information",
Value: &c.cliConfig.DataDir, Value: &c.cliConfig.DataDir,
}) })
f.StringFlag(&flagset.StringFlag{ f.SliceStringFlag(&flagset.SliceStringFlag{
Name: "config", Name: "config",
Usage: "File for the config file", Usage: "File for the config file",
Value: &c.configFile, Value: &c.configFile,
@ -364,63 +359,63 @@ func (c *Command) Flags() *flagset.Flagset {
f.BoolFlag(&flagset.BoolFlag{ f.BoolFlag(&flagset.BoolFlag{
Name: "metrics", Name: "metrics",
Usage: "Enable metrics collection and reporting", Usage: "Enable metrics collection and reporting",
Value: &c.cliConfig.Metrics.Enabled, Value: &c.cliConfig.Telemetry.Enabled,
}) })
f.BoolFlag(&flagset.BoolFlag{ f.BoolFlag(&flagset.BoolFlag{
Name: "metrics.expensive", Name: "metrics.expensive",
Usage: "Enable expensive metrics collection and reporting", Usage: "Enable expensive metrics collection and reporting",
Value: &c.cliConfig.Metrics.Expensive, Value: &c.cliConfig.Telemetry.Expensive,
}) })
f.BoolFlag(&flagset.BoolFlag{ f.BoolFlag(&flagset.BoolFlag{
Name: "metrics.influxdb", Name: "metrics.influxdb",
Usage: "Enable metrics export/push to an external InfluxDB database (v1)", Usage: "Enable metrics export/push to an external InfluxDB database (v1)",
Value: &c.cliConfig.Metrics.InfluxDB.V1Enabled, Value: &c.cliConfig.Telemetry.InfluxDB.V1Enabled,
}) })
f.StringFlag(&flagset.StringFlag{ f.StringFlag(&flagset.StringFlag{
Name: "metrics.influxdb.endpoint", Name: "metrics.influxdb.endpoint",
Usage: "InfluxDB API endpoint to report metrics to", Usage: "InfluxDB API endpoint to report metrics to",
Value: &c.cliConfig.Metrics.InfluxDB.Endpoint, Value: &c.cliConfig.Telemetry.InfluxDB.Endpoint,
}) })
f.StringFlag(&flagset.StringFlag{ f.StringFlag(&flagset.StringFlag{
Name: "metrics.influxdb.database", Name: "metrics.influxdb.database",
Usage: "InfluxDB database name to push reported metrics to", Usage: "InfluxDB database name to push reported metrics to",
Value: &c.cliConfig.Metrics.InfluxDB.Database, Value: &c.cliConfig.Telemetry.InfluxDB.Database,
}) })
f.StringFlag(&flagset.StringFlag{ f.StringFlag(&flagset.StringFlag{
Name: "metrics.influxdb.username", Name: "metrics.influxdb.username",
Usage: "Username to authorize access to the database", Usage: "Username to authorize access to the database",
Value: &c.cliConfig.Metrics.InfluxDB.Username, Value: &c.cliConfig.Telemetry.InfluxDB.Username,
}) })
f.StringFlag(&flagset.StringFlag{ f.StringFlag(&flagset.StringFlag{
Name: "metrics.influxdb.password", Name: "metrics.influxdb.password",
Usage: "Password to authorize access to the database", Usage: "Password to authorize access to the database",
Value: &c.cliConfig.Metrics.InfluxDB.Password, Value: &c.cliConfig.Telemetry.InfluxDB.Password,
}) })
f.MapStringFlag(&flagset.MapStringFlag{ f.MapStringFlag(&flagset.MapStringFlag{
Name: "metrics.influxdb.tags", Name: "metrics.influxdb.tags",
Usage: "Comma-separated InfluxDB tags (key/values) attached to all measurements", Usage: "Comma-separated InfluxDB tags (key/values) attached to all measurements",
Value: &c.cliConfig.Metrics.InfluxDB.Tags, Value: &c.cliConfig.Telemetry.InfluxDB.Tags,
}) })
// influx db v2 // influx db v2
f.BoolFlag(&flagset.BoolFlag{ f.BoolFlag(&flagset.BoolFlag{
Name: "metrics.influxdbv2", Name: "metrics.influxdbv2",
Usage: "Enable metrics export/push to an external InfluxDB v2 database", Usage: "Enable metrics export/push to an external InfluxDB v2 database",
Value: &c.cliConfig.Metrics.InfluxDB.V2Enabled, Value: &c.cliConfig.Telemetry.InfluxDB.V2Enabled,
}) })
f.StringFlag(&flagset.StringFlag{ f.StringFlag(&flagset.StringFlag{
Name: "metrics.influxdb.token", Name: "metrics.influxdb.token",
Usage: "Token to authorize access to the database (v2 only)", Usage: "Token to authorize access to the database (v2 only)",
Value: &c.cliConfig.Metrics.InfluxDB.Token, Value: &c.cliConfig.Telemetry.InfluxDB.Token,
}) })
f.StringFlag(&flagset.StringFlag{ f.StringFlag(&flagset.StringFlag{
Name: "metrics.influxdb.bucket", Name: "metrics.influxdb.bucket",
Usage: "InfluxDB bucket name to push reported metrics to (v2 only)", Usage: "InfluxDB bucket name to push reported metrics to (v2 only)",
Value: &c.cliConfig.Metrics.InfluxDB.Bucket, Value: &c.cliConfig.Telemetry.InfluxDB.Bucket,
}) })
f.StringFlag(&flagset.StringFlag{ f.StringFlag(&flagset.StringFlag{
Name: "metrics.influxdb.organization", Name: "metrics.influxdb.organization",
Usage: "InfluxDB organization name (v2 only)", Usage: "InfluxDB organization name (v2 only)",
Value: &c.cliConfig.Metrics.InfluxDB.Organization, Value: &c.cliConfig.Telemetry.InfluxDB.Organization,
}) })
// account // account

9
command/server/testdata/simple.hcl vendored Normal file
View file

@ -0,0 +1,9 @@
data-dir = "./data"
p2p {
max-peers = 30
}
txpool {
lifetime = "1s"
}

9
command/server/testdata/simple.json vendored Normal file
View file

@ -0,0 +1,9 @@
{
"data-dir": "./data",
"p2p": {
"max-peers": 30
},
"txpool": {
"lifetime": "1s"
}
}

1
go.mod
View file

@ -36,6 +36,7 @@ require (
github.com/gorilla/websocket v1.4.2 github.com/gorilla/websocket v1.4.2
github.com/graph-gophers/graphql-go v0.0.0-20201113091052-beb923fada29 github.com/graph-gophers/graphql-go v0.0.0-20201113091052-beb923fada29
github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d
github.com/hashicorp/hcl/v2 v2.10.1
github.com/holiman/bloomfilter/v2 v2.0.3 github.com/holiman/bloomfilter/v2 v2.0.3
github.com/holiman/uint256 v1.2.0 github.com/holiman/uint256 v1.2.0
github.com/huin/goupnp v1.0.2 github.com/huin/goupnp v1.0.2

29
go.sum
View file

@ -53,6 +53,8 @@ github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6/go.mod h1:3eOhrU
github.com/VictoriaMetrics/fastcache v1.6.0 h1:C/3Oi3EiBCqufydp1neRZkqcwmEiuRT9c3fqvvgKm5o= github.com/VictoriaMetrics/fastcache v1.6.0 h1:C/3Oi3EiBCqufydp1neRZkqcwmEiuRT9c3fqvvgKm5o=
github.com/VictoriaMetrics/fastcache v1.6.0/go.mod h1:0qHz5QP0GMX4pfmMA/zt5RgfNuXJrTP0zS7DqpHGGTw= github.com/VictoriaMetrics/fastcache v1.6.0/go.mod h1:0qHz5QP0GMX4pfmMA/zt5RgfNuXJrTP0zS7DqpHGGTw=
github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII=
github.com/agext/levenshtein v1.2.1 h1:QmvMAjj2aEICytGiWzmxoE0x2KZvE0fvmqMOfy2tjT8=
github.com/agext/levenshtein v1.2.1/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558=
github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw=
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
@ -60,6 +62,11 @@ github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156 h1:eMwmnE/GDgah
github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM=
github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8=
github.com/apache/arrow/go/arrow v0.0.0-20191024131854-af6fa24be0db/go.mod h1:VTxUBvSJ3s3eHAg65PNgrsn5BtqCRPdmyXh6rAfdxN0= github.com/apache/arrow/go/arrow v0.0.0-20191024131854-af6fa24be0db/go.mod h1:VTxUBvSJ3s3eHAg65PNgrsn5BtqCRPdmyXh6rAfdxN0=
github.com/apparentlymart/go-dump v0.0.0-20180507223929-23540a00eaa3/go.mod h1:oL81AME2rN47vu18xqj1S1jPIPuN7afo62yKTNn3XMM=
github.com/apparentlymart/go-textseg v1.0.0 h1:rRmlIsPEEhUTIKQb7T++Nz/A5Q6C9IuX2wFoYVvnCs0=
github.com/apparentlymart/go-textseg v1.0.0/go.mod h1:z96Txxhf3xSFMPmb5X/1W05FF/Nj9VFpLOpjS5yuumk=
github.com/apparentlymart/go-textseg/v13 v13.0.0 h1:Y+KvPE1NYz0xl601PVImeQfFyEy6iT90AvPUL1NNfNw=
github.com/apparentlymart/go-textseg/v13 v13.0.0/go.mod h1:ZK2fH7c4NqDTLtiYLvIkEghdlcqw7yxLeM89kiTRPUo=
github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310 h1:BUAU3CGlLvorLI26FmByPp2eC2qla6E1Tw+scpcg/to= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310 h1:BUAU3CGlLvorLI26FmByPp2eC2qla6E1Tw+scpcg/to=
github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=
github.com/aws/aws-sdk-go-v2 v1.2.0 h1:BS+UYpbsElC82gB+2E2jiCBg36i8HlubTB/dO/moQ9c= github.com/aws/aws-sdk-go-v2 v1.2.0 h1:BS+UYpbsElC82gB+2E2jiCBg36i8HlubTB/dO/moQ9c=
@ -171,6 +178,8 @@ github.com/go-sourcemap/sourcemap v2.1.2+incompatible/go.mod h1:F8jJfvm2KbVjc5Nq
github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w=
github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk= github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk=
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68=
github.com/go-test/deep v1.0.3/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA=
github.com/gofrs/uuid v3.3.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gofrs/uuid v3.3.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM=
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o=
@ -182,9 +191,11 @@ github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4er
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y=
github.com/golang/protobuf v1.1.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=
github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
@ -234,6 +245,8 @@ github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d h1:dg1dEPuWpEqDnvIw251EVy4zlP8gWbsGj4BsUKCRpYs= github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d h1:dg1dEPuWpEqDnvIw251EVy4zlP8gWbsGj4BsUKCRpYs=
github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4=
github.com/hashicorp/hcl/v2 v2.10.1 h1:h4Xx4fsrRE26ohAk/1iGF/JBqRQbyUqu5Lvj60U54ys=
github.com/hashicorp/hcl/v2 v2.10.1/go.mod h1:FwWsfWEjyV/CMj8s/gqAuiviY72rJ1/oayI9WftqcKg=
github.com/holiman/bloomfilter/v2 v2.0.3 h1:73e0e/V0tCydx14a0SCYS/EWCxgwLZ18CZcZKVu0fao= github.com/holiman/bloomfilter/v2 v2.0.3 h1:73e0e/V0tCydx14a0SCYS/EWCxgwLZ18CZcZKVu0fao=
github.com/holiman/bloomfilter/v2 v2.0.3/go.mod h1:zpoh+gs7qcpqrHr3dB55AMiJwo0iURXE7ZOP9L9hSkA= github.com/holiman/bloomfilter/v2 v2.0.3/go.mod h1:zpoh+gs7qcpqrHr3dB55AMiJwo0iURXE7ZOP9L9hSkA=
github.com/holiman/uint256 v1.2.0 h1:gpSYcPLWGv4sG43I2mVLiDZCNDh/EpGjSk8tmtxitHM= github.com/holiman/uint256 v1.2.0 h1:gpSYcPLWGv4sG43I2mVLiDZCNDh/EpGjSk8tmtxitHM=
@ -296,6 +309,7 @@ github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORN
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k=
github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=
github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
github.com/labstack/echo/v4 v4.2.1/go.mod h1:AA49e0DZ8kk5jTOOCKNuPR6oTnBS0dYiM4FW1e6jwpg= github.com/labstack/echo/v4 v4.2.1/go.mod h1:AA49e0DZ8kk5jTOOCKNuPR6oTnBS0dYiM4FW1e6jwpg=
@ -332,6 +346,8 @@ github.com/mitchellh/copystructure v1.0.0 h1:Laisrj+bAB6b/yJwB5Bt3ITZhGJdqmxquMK
github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw=
github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7 h1:DpOJ2HYzCv8LZP15IdmG+YdwD2luVPHITV96TkirNBM=
github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo=
github.com/mitchellh/reflectwalk v1.0.0 h1:9D+8oIskB4VJBN5SFlmc27fSlIBZaov1Wpk/IfikLNY= github.com/mitchellh/reflectwalk v1.0.0 h1:9D+8oIskB4VJBN5SFlmc27fSlIBZaov1Wpk/IfikLNY=
github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
@ -398,6 +414,7 @@ github.com/ryanuber/columnize v2.1.2+incompatible h1:C89EOx/XBWwIXl8wm8OPJBd7kPF
github.com/ryanuber/columnize v2.1.2+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/ryanuber/columnize v2.1.2+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
github.com/segmentio/kafka-go v0.1.0/go.mod h1:X6itGqS9L4jDletMsxZ7Dz+JFWxM6JHfPOCvTvk+EJo= github.com/segmentio/kafka-go v0.1.0/go.mod h1:X6itGqS9L4jDletMsxZ7Dz+JFWxM6JHfPOCvTvk+EJo=
github.com/segmentio/kafka-go v0.2.0/go.mod h1:X6itGqS9L4jDletMsxZ7Dz+JFWxM6JHfPOCvTvk+EJo= github.com/segmentio/kafka-go v0.2.0/go.mod h1:X6itGqS9L4jDletMsxZ7Dz+JFWxM6JHfPOCvTvk+EJo=
github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ=
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible h1:Bn1aCHHRnjv4Bl16T8rcaFjYSrGrIZvpiGO6P3Q4GpU= github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible h1:Bn1aCHHRnjv4Bl16T8rcaFjYSrGrIZvpiGO6P3Q4GpU=
github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA=
@ -408,6 +425,7 @@ github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9
github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
github.com/spf13/pflag v1.0.2/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/status-im/keycard-go v0.0.0-20190316090335-8537d3370df4 h1:Gb2Tyox57NRNuZ2d3rmvB3pcmbu7O1RS3m8WRx7ilrg= github.com/status-im/keycard-go v0.0.0-20190316090335-8537d3370df4 h1:Gb2Tyox57NRNuZ2d3rmvB3pcmbu7O1RS3m8WRx7ilrg=
github.com/status-im/keycard-go v0.0.0-20190316090335-8537d3370df4/go.mod h1:RZLeN1LMWmRsyYjvAu+I6Dm9QmlDaIIt+Y+4Kd7Tp+Q= github.com/status-im/keycard-go v0.0.0-20190316090335-8537d3370df4/go.mod h1:RZLeN1LMWmRsyYjvAu+I6Dm9QmlDaIIt+Y+4Kd7Tp+Q=
@ -435,11 +453,18 @@ github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/X
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8=
github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ=
github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk=
github.com/vmihailenco/msgpack/v4 v4.3.12/go.mod h1:gborTTJjAo/GWTqqRjrLCn9pgNN+NXzzngzBKDPIqw4=
github.com/vmihailenco/tagparser v0.1.1/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI=
github.com/willf/bitset v1.1.3/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4= github.com/willf/bitset v1.1.3/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4=
github.com/xlab/treeprint v0.0.0-20180616005107-d6fb6747feb6/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg= github.com/xlab/treeprint v0.0.0-20180616005107-d6fb6747feb6/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg=
github.com/xsleonard/go-merkle v1.1.0 h1:fHe1fuhJjGH22ZzVTAH0jqHLhTGhOq3wQjJN+8P0jQg= github.com/xsleonard/go-merkle v1.1.0 h1:fHe1fuhJjGH22ZzVTAH0jqHLhTGhOq3wQjJN+8P0jQg=
github.com/xsleonard/go-merkle v1.1.0/go.mod h1:cW4z+UZ/4f2n9IJgIiyDCdYguchoDyDAPmpuOWGxdGg= github.com/xsleonard/go-merkle v1.1.0/go.mod h1:cW4z+UZ/4f2n9IJgIiyDCdYguchoDyDAPmpuOWGxdGg=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/zclconf/go-cty v1.2.0/go.mod h1:hOPWgoHbaTUnI5k4D2ld+GRpFJSCe6bCM7m1q/N4PQ8=
github.com/zclconf/go-cty v1.8.0 h1:s4AvqaeQzJIu3ndv4gVIhplVD0krU+bgrcLSVUnaWuA=
github.com/zclconf/go-cty v1.8.0/go.mod h1:vVKLxnk3puL4qRAv72AO+W99LUD4da90g3uUAzyuvAk=
github.com/zclconf/go-cty-debug v0.0.0-20191215020915-b22d67c1ba0b/go.mod h1:ZRKQfBXbGkpdV6QMzT3rU1kSTAnfu1dO8dPKjYprgj8=
go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
@ -449,6 +474,7 @@ go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q=
golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190909091759-094676da4a83/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190909091759-094676da4a83/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
@ -487,6 +513,7 @@ golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzB
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180811021610-c39426892332/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@ -501,6 +528,7 @@ golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLL
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
@ -535,6 +563,7 @@ golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5h
golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190502175342-a43fa875dd82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=