server

package
v0.0.0-...-acf744c Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2018 License: GPL-3.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitBlocksMaker

func InitBlocksMaker(s *NodeServer) (c *blocksMaker)

func InitQueryFilter

func InitQueryFilter(proxyAddr, dbAddr string, node *nodemanager.Node, logger *utils.LoggerMan, bmo *blocksMaker) (q *queryFilter, err error)

func StartChangesChecker

func StartChangesChecker(s *NodeServer) (c *changesChecker)

Types

type NodeDaemon

type NodeDaemon struct {
	Port        int
	LocalPort   int
	Host        string
	ConfigDir   string
	Server      *NodeServer
	Logger      *utils.LoggerMan
	Node        *nodemanager.Node
	DBProxyAddr string
	DBAddr      string
}

func (*NodeDaemon) DaemonizeServer

func (n *NodeDaemon) DaemonizeServer() error

Makes a daemon process. It starts node server and waits for interrupt signal when to exit.

func (*NodeDaemon) GetRunningProcessInfo

func (n *NodeDaemon) GetRunningProcessInfo() (int, string)

Returns port and auth string of currently running process

func (*NodeDaemon) GetServerState

func (n *NodeDaemon) GetServerState() (bool, int, int, error)

* Returns state of a server. Detects if it is running

func (*NodeDaemon) Init

func (n *NodeDaemon) Init() error

func (*NodeDaemon) StartServer

func (n *NodeDaemon) StartServer() error

func (*NodeDaemon) StartServerInteractive

func (n *NodeDaemon) StartServerInteractive() error

func (*NodeDaemon) StopServer

func (n *NodeDaemon) StopServer() error

type NodeServer

type NodeServer struct {
	ConfigDir string
	Node      *nodemanager.Node

	NodeAddress netlib.NodeAddr // Port can be different from NodePort. NodeAddress is address exposed outside
	NodePort    int             // This is the port where a server will listen

	Transit nodeTransit

	Logger *utils.LoggerMan
	// Channels to manipulate roitunes
	StopMainChan        chan struct{}
	StopMainConfirmChan chan struct{}

	DBProxyAddr string
	DBAddr      string
	QueryFilter *queryFilter

	NodeAuthStr string
	// contains filtered or unexported fields
}

func (*NodeServer) GetClient

func (s *NodeServer) GetClient() *nodeclient.NodeClient

func (*NodeServer) StartServer

func (s *NodeServer) StartServer(serverStartResult chan string) error

func (*NodeServer) TryToMakeNewBlock

func (s *NodeServer) TryToMakeNewBlock(tx []byte)

* Sends signal to routine where we make blocks. This makes the routine to check transactions in unapproved cache * And try to make a block if there are enough transactions

type NodeServerRequest

type NodeServerRequest struct {
	Node              *nodemanager.Node
	S                 *NodeServer
	Request           []byte
	RequestIP         string
	Logger            *utils.LoggerMan
	HasResponse       bool
	Response          []byte
	NodeAuthStrIsGood bool
	SessID            string
}

func (*NodeServerRequest) Init

func (s *NodeServerRequest) Init()

Jump to

Keyboard shortcuts

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