node

package
v0.0.0-...-9098a98 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2019 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

Package node provides the central tool to manage the node.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Role of the node.
	Role string
	// Network ID hash in base58 encoded format.
	NetworkID string
	// Listen address of the server.
	NetworkAddr string
	// Addresses of initial peers.
	Peers []string
	// Maximum number of peers to connect.
	MaxPeers int
	// Node ID (public key derived from seed).
	NodeID string
	// Seed of this node.
	Seed string
	// Path of the log file.
	LogFile string
	// Database backend.
	DBBackend string
	// Database file path.
	DBPath string
	// Initial quorum.
	Quorum *ultpb.Quorum
	// Interval for consensus proposition.
	ProposeInterval int
}

func NewConfig

func NewConfig(v *viper.Viper) (*Config, error)

type Node

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

Node is the central controller for Ultiledger network.

func NewNode

func NewNode(conf *Config) *Node

NewNode creates a Node which controls all the sub components.

func (*Node) Start

func (n *Node) Start(newnode bool)

Start triggers sub goroutines to do the sub tasks.

func (*Node) Stop

func (n *Node) Stop()

Close node by signaling all the goroutines to stop.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳