dot

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 27, 2020 License: LGPL-3.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExportConfig

func ExportConfig(cfg *Config, fp string) *os.File

ExportConfig exports a dot configuration to a toml configuration file

func InitNode

func InitNode(cfg *Config) error

InitNode initializes a new dot node from the provided dot node configuration and JSON formatted genesis file.

func LoadConfig

func LoadConfig(cfg *Config, fp string) error

LoadConfig loads the values from the toml configuration file into the provided configuration

func NetworkServiceEnabled

func NetworkServiceEnabled(cfg *Config) bool

NetworkServiceEnabled returns true if the network service is enabled

func NewTestGenesis

func NewTestGenesis(t *testing.T) *genesis.Genesis

NewTestGenesis returns a test genesis instance using "gssmr" raw data

func NewTestGenesisAndRuntime

func NewTestGenesisAndRuntime(t *testing.T) string

NewTestGenesisAndRuntime create a new test runtime and a new test genesis file with the test runtime stored in raw data and returns the genesis file nolint

func NewTestGenesisFile

func NewTestGenesisFile(t *testing.T, cfg *Config) *os.File

NewTestGenesisFile returns a test genesis file using "gssmr" raw data

func NodeInitialized

func NodeInitialized(basepath string, expected bool) bool

NodeInitialized returns true if, within the configured data directory for the node, the state database has been created and the genesis data has been loaded

func RPCServiceEnabled

func RPCServiceEnabled(cfg *Config) bool

RPCServiceEnabled returns true if the rpc service is enabled

Types

type AccountConfig

type AccountConfig struct {
	Key    string `toml:"key"`
	Unlock string `toml:"unlock"`
}

AccountConfig is to marshal/unmarshal account config vars

type Config

type Config struct {
	Global  GlobalConfig     `toml:"global"`
	Init    InitConfig       `toml:"init"`
	Account AccountConfig    `toml:"account"`
	Core    CoreConfig       `toml:"core"`
	Network NetworkConfig    `toml:"network"`
	RPC     RPCConfig        `toml:"rpc"`
	System  types.SystemInfo `toml:"-"`
}

Config is a collection of configurations throughout the system

func GssmrConfig

func GssmrConfig() *Config

GssmrConfig returns a new test configuration using the provided basepath

func KsmccConfig

func KsmccConfig() *Config

KsmccConfig returns a "ksmcc" node configuration

func NewTestConfig

func NewTestConfig(t *testing.T) *Config

NewTestConfig returns a new test configuration using the provided basepath

func NewTestConfigWithFile

func NewTestConfigWithFile(t *testing.T) (*Config, *os.File)

NewTestConfigWithFile returns a new test configuration and a temporary configuration file

func (*Config) String

func (c *Config) String() string

String will return the json representation for a Config

type CoreConfig

type CoreConfig struct {
	Authority bool `toml:"authority"`
	Roles     byte `toml:"roles"`
}

CoreConfig is to marshal/unmarshal toml core config vars

type GlobalConfig

type GlobalConfig struct {
	Name     string `toml:"name"`
	ID       string `toml:"id"`
	BasePath string `toml:"basepath"`
}

GlobalConfig is to marshal/unmarshal toml global config vars

type InitConfig

type InitConfig struct {
	Genesis string `toml:"genesis"`
}

InitConfig is the configuration for the node initialization

type NetworkConfig

type NetworkConfig struct {
	Port        uint32   `toml:"port"`
	Bootnodes   []string `toml:"bootnodes"`
	ProtocolID  string   `toml:"protocol"`
	NoBootstrap bool     `toml:"nobootstrap"`
	NoMDNS      bool     `toml:"nomdns"`
}

NetworkConfig is to marshal/unmarshal toml network config vars

type Node

type Node struct {
	Name     string
	Services *services.ServiceRegistry // registry of all node services
	// contains filtered or unexported fields
}

Node is a container for all the components of a node.

func NewNode

func NewNode(cfg *Config, ks *keystore.Keystore) (*Node, error)

NewNode creates a new dot node from a dot node configuration

func (*Node) Start

func (n *Node) Start() error

Start starts all dot node services

func (*Node) Stop

func (n *Node) Stop()

Stop stops all dot node services

type RPCConfig

type RPCConfig struct {
	Enabled   bool     `toml:"enabled"`
	Port      uint32   `toml:"port"`
	Host      string   `toml:"host"`
	Modules   []string `toml:"modules"`
	WSPort    uint32   `toml:"ws-port"`
	WSEnabled bool     `toml:"ws-enabled"`
}

RPCConfig is to marshal/unmarshal toml RPC config vars

Directories

Path Synopsis
rpc

Jump to

Keyboard shortcuts

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