Documentation ¶
Index ¶
- Variables
- func DefaultDataDir() string
- type Config
- func (c *Config) DataDirPathAbs() error
- func (c *Config) GetPrivateKey() ed25519.PrivateKey
- func (c *Config) HTTPEndpoint() string
- func (c *Config) IPCEndpoint() string
- func (c *Config) RunLogDir() string
- func (c *Config) RunLogFile() (string, error)
- func (c *Config) SetPrivateKey(privateKey string)
- func (c *Config) WSEndpoint() string
- type Node
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrDataDirUsed = errors.New("dataDir already used by another process") ErrNodeStopped = errors.New("node not started") ErrNodeRunning = errors.New("node already running") ErrServiceUnknown = errors.New("unknown service") ErrWalletConfigNil = errors.New("wallet config is nil") ErrViteConfigNil = errors.New("vite config is nil") ErrP2PConfigNil = errors.New("p2p config is nil") )
View Source
var DefaultNodeConfig = Config{ Identity: "nodeServer", IPCPath: "gvite.ipc", DataDir: DefaultDataDir(), KeyStoreDir: DefaultDataDir(), HttpPort: common.DefaultHTTPPort, WSPort: common.DefaultWSPort, PrivateKey: "", MaxPeers: 0, MaxPassivePeersRatio: 0, MaxPendingPeers: 0, BootNodes: nil, Port: 0, NetID: 0, LogLevel: "info", }
Functions ¶
func DefaultDataDir ¶
func DefaultDataDir() string
DefaultDataDir is the default data directory to use for the databases and other persistence requirements.
Types ¶
type Config ¶
type Config struct { DataDir string `json:"DataDir"` KeyStoreDir string `json:"KeyStoreDir"` // template:["broker1,broker2,...|topic",""] KafkaProducers []string `json:"KafkaProducers"` // p2p NetSelect string Identity string `json:"Identity"` PrivateKey string `json:"PrivateKey"` MaxPeers uint `json:"MaxPeers"` MaxPassivePeersRatio uint `json:"MaxPassivePeersRatio"` MaxPendingPeers uint `json:"MaxPendingPeers"` BootNodes []string `json:"BootNodes"` Port uint `json:"Port"` NetID uint `json:"NetID"` //producer CoinBase string `json:"CoinBase"` MinerEnabled bool `json:"Miner"` MinerInterval int `json:"MinerInterval"` //rpc RPCEnabled bool `json:"RPCEnabled"` IPCEnabled bool `json:"IPCEnabled"` WSEnabled bool `json:"WSEnabled"` IPCPath string `json:"IPCPath"` HttpHost string `json:"HttpHost"` HttpPort int `json:"HttpPort"` HttpVirtualHosts []string `json:"HttpVirtualHosts"` WSHost string `json:"WSHost"` WSPort int `json:"WSPort"` //Log level LogLevel string `json:"LogLevel"` //VM VMTestEnabled bool `json:"VMTestEnabled"` //Net TODO: cmd after ? Single bool `json:"Single"` FilePort int `json:"FilePort"` Topology []string `json:"Topology"` TopologyTopic string `json:"TopologyTopic"` TopologyReportInterval int `json:"TopologyReportInterval"` }
func (*Config) DataDirPathAbs ¶
resolve the dataDir so future changes to the current working directory don't affect the node
func (*Config) GetPrivateKey ¶
func (c *Config) GetPrivateKey() ed25519.PrivateKey
func (*Config) HTTPEndpoint ¶
func (*Config) IPCEndpoint ¶
func (*Config) RunLogFile ¶
func (*Config) SetPrivateKey ¶
func (*Config) WSEndpoint ¶
Click to show internal directories.
Click to hide internal directories.