config

package
v1.0.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 26, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultRPCEndPoint  = "0.0.0.0:8888"
	DefaultHTTPEndPoint = "0.0.0.0:8080"
)
View Source
const (
	DEFAULT_NODE_PORT                       = uint(20338)
	DEFAULT_CONSENSUS_PORT                  = uint(20339)
	DEFAULT_MAX_CONN_IN_BOUND               = uint(23)
	DEFAULT_MAX_CONN_OUT_BOUND              = uint(23)
	DEFAULT_MAX_CONN_IN_BOUND_FOR_SINGLE_IP = uint(23)
)
View Source
const (
	DefaultMinDiskSpaceInGB = 200
)

Variables

View Source
var DefaultNodeConfig = node.Config{
	ChainId:          common.ChainNameMainNet,
	DataDir:          DefaultDataDir(),
	LogLevel:         mylog.DebugLevel,
	MinDiskSpaceInGB: DefaultMinDiskSpaceInGB,
	P2P: service_configs.P2PConfig{
		Genesis:                   MainNetConfig,
		EnableConsensus:           true,
		ReservedCfg:               &service_configs.P2PRsvConfig{},
		ReservedPeersOnly:         false,
		NodePort:                  DEFAULT_NODE_PORT,
		NodeConsensusPort:         DEFAULT_CONSENSUS_PORT,
		DualPortSupport:           true,
		IsTLS:                     false,
		CertPath:                  "",
		KeyPath:                   "",
		CAPath:                    "",
		MaxConnInBound:            DEFAULT_MAX_CONN_IN_BOUND,
		MaxConnOutBound:           DEFAULT_MAX_CONN_OUT_BOUND,
		MaxConnInBoundForSingleIP: DEFAULT_MAX_CONN_IN_BOUND_FOR_SINGLE_IP,
	},

	GRPC: service_configs.GRPCConfig{
		RPCName:    "rpc",
		RPCListen:  DefaultRPCEndPoint,
		HTTPListen: DefaultHTTPEndPoint,
		HTTPCors:   []string{"*"},
		HTTPLimit:  100,
	},
	Consensus: service_configs.ConsensusConfig{
		Type:              "SABFT",
		BootStrap:         true,
		LocalBpName:       constants.COSInitMiner,
		LocalBpPrivateKey: constants.InitminerPrivKey,
	},
	HealthCheck: service_configs.HCheck{
		Port: "9090",
	},

	Database: &service_configs.DatabaseConfig{
		Driver:   "mysql",
		User:     "contentos",
		Password: "123456",
		Db:       "contentosdb",
	},
}

DefaultConfig contains reasonable default settings.

View Source
var DevNetConfig = &service_configs.GenesisConfig{
	SeedList: []string{
		fmt.Sprintf("127.0.0.1:%d", DEFAULT_NODE_PORT)},
}
View Source
var MainNetConfig = &service_configs.GenesisConfig{
	SeedList: []string{
		fmt.Sprintf("127.0.0.1:%d", DEFAULT_NODE_PORT)},
}
View Source
var TestNetConfig = &service_configs.GenesisConfig{
	SeedList: []string{
		fmt.Sprintf("127.0.0.1:%d", DEFAULT_NODE_PORT)},
}

Functions

func DefaultDataDir

func DefaultDataDir() string

func MakeName added in v1.0.2

func MakeName(name, version string) string

func WriteNodeConfigFile

func WriteNodeConfigFile(configDirPath string, configName string, config node.Config, mode os.FileMode) error

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL