forked from ava-labs/avalanchego
-
Notifications
You must be signed in to change notification settings - Fork 4
/
config.go
52 lines (45 loc) · 1.72 KB
/
config.go
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved.
// See the file LICENSE for licensing terms.
package local
import (
"time"
"github.com/MetalBlockchain/metalgo/config"
"github.com/MetalBlockchain/metalgo/tests/fixture/testnet"
)
const (
// Constants defining the names of shell variables whose value can
// configure local network orchestration.
MetalGoPathEnvName = "METALGO_PATH"
NetworkDirEnvName = "TESTNETCTL_NETWORK_DIR"
RootDirEnvName = "TESTNETCTL_ROOT_DIR"
DefaultNetworkStartTimeout = 2 * time.Minute
DefaultNodeInitTimeout = 10 * time.Second
DefaultNodeStopTimeout = 5 * time.Second
DefaultNodeTickerInterval = 50 * time.Millisecond
)
// A set of flags appropriate for local testing.
func LocalFlags() testnet.FlagsMap {
// Supply only non-default configuration to ensure that default values will be used.
return testnet.FlagsMap{
config.NetworkPeerListGossipFreqKey: "250ms",
config.NetworkMaxReconnectDelayKey: "1s",
config.PublicIPKey: "127.0.0.1",
config.HTTPHostKey: "127.0.0.1",
config.StakingHostKey: "127.0.0.1",
config.HealthCheckFreqKey: "2s",
config.AdminAPIEnabledKey: true,
config.IpcAPIEnabledKey: true,
config.IndexEnabledKey: true,
config.LogDisplayLevelKey: "INFO",
config.LogLevelKey: "DEBUG",
}
}
// C-Chain config for local testing.
func LocalCChainConfig() testnet.FlagsMap {
// Supply only non-default configuration to ensure that default
// values will be used. Available C-Chain configuration options are
// defined in the `github.com/MetalBlockchain/coreth/evm` package.
return testnet.FlagsMap{
"log-level": "debug",
}
}