-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.go
166 lines (125 loc) · 4.06 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
// (c) 2019-2020, Ava Labs, Inc. All rights reserved.
// See the file LICENSE for licensing terms.
package node
import (
"crypto/tls"
"time"
"github.com/ava-labs/avalanchego/chains"
"github.com/ava-labs/avalanchego/genesis"
"github.com/ava-labs/avalanchego/ids"
"github.com/ava-labs/avalanchego/nat"
"github.com/ava-labs/avalanchego/network"
"github.com/ava-labs/avalanchego/snow/consensus/avalanche"
"github.com/ava-labs/avalanchego/snow/networking/benchlist"
"github.com/ava-labs/avalanchego/snow/networking/router"
"github.com/ava-labs/avalanchego/utils"
"github.com/ava-labs/avalanchego/utils/dynamicip"
"github.com/ava-labs/avalanchego/utils/logging"
"github.com/ava-labs/avalanchego/utils/profiler"
)
// Config contains all of the configurations of an Avalanche node.
type Config struct {
genesis.Params
// If true, bootstrap the current database version and then end the node.
FetchOnly bool
// Genesis information
GenesisBytes []byte
DjtxAssetID ids.ID
// protocol to use for opening the network interface
Nat nat.Router
// Attempted NAT Traversal did we attempt
AttemptedNATTraversal bool
// ID of the network this node should connect to
NetworkID uint32
// Assertions configuration
EnableAssertions bool
// Crypto configuration
EnableCrypto bool
// Path to database
DBPath string
// Name of the database type to use
DBName string
// Staking configuration
StakingIP utils.DynamicIPDesc
EnableStaking bool
StakingTLSCert tls.Certificate
DisabledStakingWeight uint64
// Health
HealthCheckFreq time.Duration
// Network configuration
NetworkConfig network.Config
PeerListSize uint32
PeerListGossipSize uint32
PeerListGossipFreq time.Duration
CompressionEnabled bool
// Benchlist Configuration
BenchlistConfig benchlist.Config
// Bootstrapping configuration
BootstrapIDs []ids.ShortID
BootstrapIPs []utils.IPDesc
// HTTP configuration
HTTPHost string
HTTPPort uint16
HTTPSEnabled bool
HTTPSKeyFile string
HTTPSCertFile string
APIRequireAuthToken bool
APIAuthPassword string
APIAllowedOrigins []string
// Enable/Disable APIs
AdminAPIEnabled bool
InfoAPIEnabled bool
KeystoreAPIEnabled bool
MetricsAPIEnabled bool
HealthAPIEnabled bool
IndexAPIEnabled bool
// Profiling configurations
ProfilerConfig profiler.Config
// Logging configuration
LoggingConfig logging.Config
// Plugin directory
PluginDir string
// Consensus configuration
ConsensusParams avalanche.Parameters
// IPC configuration
IPCAPIEnabled bool
IPCPath string
IPCDefaultChainIDs []string
// Metrics
MeterVMEnabled bool
// Router that is used to handle incoming consensus messages
ConsensusRouter router.Router
RouterHealthConfig router.HealthConfig
ConsensusShutdownTimeout time.Duration
ConsensusGossipFrequency time.Duration
// Number of peers to gossip to when gossiping accepted frontier
ConsensusGossipAcceptedFrontierSize uint
// Number of peers to gossip each accepted container to
ConsensusGossipOnAcceptSize uint
// Dynamic Update duration for IP or NAT traversal
DynamicUpdateDuration time.Duration
DynamicPublicIPResolver dynamicip.Resolver
// Subnet Whitelist
WhitelistedSubnets ids.Set
IndexAllowIncomplete bool
// Should Bootstrap be retried
RetryBootstrap bool
// Max number of times to retry bootstrap
RetryBootstrapMaxAttempts int
// Timeout when connecting to bootstrapping beacons
BootstrapBeaconConnectionTimeout time.Duration
// Max number of containers in a multiput message sent by this node.
BootstrapMultiputMaxContainersSent int
// This node will only consider the first [MultiputMaxContainersReceived]
// containers in a multiput it receives.
BootstrapMultiputMaxContainersReceived int
// Peer alias configuration
PeerAliasTimeout time.Duration
// ChainConfigs
ChainConfigs map[string]chains.ChainConfig
// Max time to spend fetching a container and its
// ancestors while responding to a GetAncestors message
BootstrapMaxTimeGetAncestors time.Duration
// VM Aliases
VMAliases map[ids.ID][]string
}