config

package
v0.0.0-...-58a2b35 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Path_config         = "config.json"                                //配置文件名称
	Core_keystore       = "keystore.key"                               //密钥文件
	Path_configDir      = "conf"                                       //配置文件存放目录
	KeystoreFileAbsPath = filepath.Join(Path_configDir, Core_keystore) //密钥文件存放地址

	AddrPre               = ""                                       //收款地址前缀
	AreaName              = sha256.Sum256([]byte("icom_chain_test")) //名称不同节点无法连接
	Init                  = false                                    //是否创世节点
	Init_LocalIP          = ""                                       //rpc 服务ip
	Init_LocalPort uint16 = 19981                                    // rpc 服务端口

	WebAddr                = "0.0.0.0"
	WebPort         uint16 = 2080
	Web_path_static        = "./static"
	Web_path_views         = "./view"
	RpcServer              = false
	RPCUser                = "test"
	RPCPassword            = "testp"

	NetType_release = "release" //正式网络
	NetType         = "test"    //网络类型:正式网络release/测试网络test

	MachineId = "" // 客户端机器Id
)

Functions

func ParseConfig

func ParseConfig()

func SetLibp2pareaConfig

func SetLibp2pareaConfig() string

func Step

func Step()

TODO 解析本地配置文件,根据不同的模块需求自定义配置

Types

type Config

type Config struct {
	// Netid       uint32 `json:"netid"`       //
	IP          string `json:"ip"`          //ip地址
	Port        uint16 `json:"port"`        //监听端口
	WebAddr     string `json:"WebAddr"`     //
	WebPort     uint16 `json:"WebPort"`     //
	WebStatic   string `json:"WebStatic"`   //
	WebViews    string `json:"WebViews"`    //
	RpcServer   bool   `json:"RpcServer"`   //
	RpcUser     string `json:"RpcUser"`     //
	RpcPassword string `json:"RpcPassword"` //
	NetType     string `json:"NetType"`     //正式网络release/测试网络test
	AddrPre     string `json:"AddrPre"`     //收款地址前缀
	MachineID   string `json:"MachineId"`   //设备机器码
}

Jump to

Keyboard shortcuts

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