The core protocol of WoopChain
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
woop/cmd/harmony/default.go

158 lines
3.2 KiB

package main
import nodeconfig "github.com/harmony-one/harmony/internal/configs/node"
const tomlConfigVersion = "1.0.2"
const (
defNetworkType = nodeconfig.Mainnet
)
var defaultConfig = harmonyConfig{
Version: tomlConfigVersion,
General: generalConfig{
NodeType: "validator",
NoStaking: false,
ShardID: -1,
IsArchival: false,
IsOffline: false,
DataDir: "./",
},
Network: getDefaultNetworkConfig(defNetworkType),
P2P: p2pConfig{
Port: nodeconfig.DefaultP2PPort,
IP: nodeconfig.DefaultPublicListenIP,
KeyFile: "./.hmykey",
},
HTTP: httpConfig{
Node API Refactor - pt3 (Stage 3.1 of Node API Overhaul) (#3297) * [rosetta] Add server with example block & network services * Update go.mod for rosetta SDK Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [internal/configs] Add RosettaServer to node config Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [cmd] Add rosetta port flag Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [node] Add rosetta server start & rename api.go Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [rosetta] Change server start to use nodeconfig of rosetta Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [cmd] Cleanup debugging prints Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [rosetta] Fix stdout print & document placeholders Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [rosetta] Fix lint & make StartSevers more consistent Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [cmd] Disable rosetta by default Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [test] Make explorer deploy rosetta server Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [rosetta] Use direct http server for start * Make go.mod changes minimal Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [rosetta] Fix fmt Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [rosetta] Fix fmt of go.mod Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [rosetta] Use port 9700 instead of 10000 Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [cmd] Bump config version Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [cmd] Add v1.0.0 config backwards compatibility test * Included update message if old config is loaded Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [test] Do not broadcast invalid tx on localnet Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [cmd] Correct for invalid port when loading old config Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [cmd] Make rosetta variable names consistent Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
4 years ago
Enabled: true,
RosettaEnabled: false,
IP: "127.0.0.1",
Port: nodeconfig.DefaultRPCPort,
RosettaPort: nodeconfig.DefaultRosettaPort,
},
WS: wsConfig{
Enabled: true,
IP: "127.0.0.1",
Port: nodeconfig.DefaultWSPort,
},
BLSKeys: blsConfig{
KeyDir: "./.hmy/blskeys",
KeyFiles: []string{},
MaxKeys: 10,
PassEnabled: true,
PassSrcType: blsPassTypeAuto,
PassFile: "",
SavePassphrase: false,
KMSEnabled: false,
KMSConfigSrcType: kmsConfigTypeShared,
KMSConfigFile: "",
},
TxPool: txPoolConfig{
BlacklistFile: "./.hmy/blacklist.txt",
},
Pprof: pprofConfig{
Enabled: false,
ListenAddr: "127.0.0.1:6060",
},
Log: logConfig{
Folder: "./latest",
FileName: "harmony.log",
RotateSize: 100,
Verbosity: 3,
},
}
var defaultSysConfig = sysConfig{
NtpServer: "1.pool.ntp.org",
}
var defaultDevnetConfig = devnetConfig{
NumShards: 2,
ShardSize: 10,
HmyNodeSize: 10,
}
var defaultRevertConfig = revertConfig{
RevertBeacon: false,
RevertBefore: 0,
RevertTo: 0,
}
var defaultLogContext = logContext{
IP: "127.0.0.1",
Port: 9000,
}
var defaultConsensusConfig = consensusConfig{
MinPeers: 6,
}
const (
defaultBroadcastInvalidTx = true
)
func getDefaultHmyConfigCopy(nt nodeconfig.NetworkType) harmonyConfig {
config := defaultConfig
config.Network = getDefaultNetworkConfig(nt)
if nt == nodeconfig.Devnet {
devnet := getDefaultDevnetConfigCopy()
config.Devnet = &devnet
}
return config
}
func getDefaultSysConfigCopy() sysConfig {
config := defaultSysConfig
return config
}
func getDefaultDevnetConfigCopy() devnetConfig {
config := defaultDevnetConfig
return config
}
func getDefaultRevertConfigCopy() revertConfig {
config := defaultRevertConfig
return config
}
func getDefaultLogContextCopy() logContext {
config := defaultLogContext
return config
}
func getDefaultConsensusConfigCopy() consensusConfig {
config := defaultConsensusConfig
return config
}
const (
nodeTypeValidator = "validator"
nodeTypeExplorer = "explorer"
)
const (
blsPassTypeAuto = "auto"
blsPassTypeFile = "file"
blsPassTypePrompt = "prompt"
kmsConfigTypeShared = "shared"
kmsConfigTypePrompt = "prompt"
kmsConfigTypeFile = "file"
legacyBLSPassTypeDefault = "default"
legacyBLSPassTypeStdin = "stdin"
legacyBLSPassTypeDynamic = "no-prompt"
legacyBLSPassTypePrompt = "prompt"
legacyBLSPassTypeStatic = "file"
legacyBLSPassTypeNone = "none"
legacyBLSKmsTypeDefault = "default"
legacyBLSKmsTypePrompt = "prompt"
legacyBLSKmsTypeFile = "file"
legacyBLSKmsTypeNone = "none"
)