node

package
v0.0.0-...-be0919c Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2018 License: GPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Node

type Node struct {
	// contains filtered or unexported fields
}

Node represent entrypoint for Mysterium node with top level components

func NewNode

func NewNode(
	options Options,
	identityManager identity.Manager,
	signerFactory identity.SignerFactory,
	identityRegistry identity_registry.IdentityRegistry,
	identityRegistration identity_registry.RegistrationDataProvider,
	mysteriumClient server.Client,
	ipResolver ip.Resolver,
	locationResolver location.Resolver,
) *Node

NewNode function creates new Mysterium node by given options

func (*Node) Kill

func (node *Node) Kill() error

Kill stops Mysterium node

func (*Node) Start

func (node *Node) Start() error

Start starts Mysterium node (Tequilapi service, fetches location)

func (*Node) Wait

func (node *Node) Wait() error

Wait blocks until Mysterium node is stopped

type Options

type Options struct {
	Directories OptionsDirectory

	TequilapiAddress string
	TequilapiPort    int

	Openvpn  openvpn_core.NodeOptions
	Location OptionsLocation
	OptionsNetwork
}

Options describes options which are required to start Node

type OptionsDirectory

type OptionsDirectory struct {
	// Data directory stores persistent data like keystore, cli history, etc.
	Data string
	// Data directory stores identity keys
	Keystore string
	// Config directory stores all data needed for runtime (db scripts etc.)
	Config string
	// Runtime directory for various temp file - usually current working dir
	Runtime string
}

OptionsDirectory describes data structure holding directories as parameters

func (*OptionsDirectory) Check

func (options *OptionsDirectory) Check() error

Check checks that configured dirs exist (which should contain info) and runtime dirs are created (if not exist)

type OptionsLocation

type OptionsLocation struct {
	IpifyUrl string
	Database string
	Country  string
}

OptionsLocation describes possible parameters of location detection configuration

type OptionsNetwork

type OptionsNetwork struct {
	Testnet  bool
	Localnet bool

	DiscoveryAPIAddress string
	BrokerAddress       string

	EtherClientRPC       string
	EtherPaymentsAddress string
}

OptionsNetwork describes possible parameters of network configuration

Jump to

Keyboard shortcuts

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