config

package
v0.0.0-...-cf6e08f Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2018 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Exists

func Exists() bool

Exists checks if configuration file exists on disk.

Types

type Config

type Config struct {
	Ip          string `json:"ip"`
	Port        int    `json:"port"`
	ChainPath   string `json:"chain_path"`
	WalletsPath string `json:"wallets_path"`
}

Represents node configuration

func Default

func Default() (Config, error)

Default returns default node configuration.

func LoadConfig

func LoadConfig() (Config, error)

Load loads config from file.

func (Config) Save

func (cfg Config) Save() error

Save marshals config and saves it to a file.

func (Config) SetChainPath

func (cfg Config) SetChainPath(path string) Config

SetChainPath sets a path to block chain database.

func (Config) SetIp

func (cfg Config) SetIp(ip string) Config

SetIp sets node's ip.

func (Config) SetPort

func (cfg Config) SetPort(port int) Config

SetPort sets node's port.

func (Config) SetWalletsPath

func (cfg Config) SetWalletsPath(path string) Config

SetWalletsPath sets a path to wallets location.

Jump to

Keyboard shortcuts

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