routingnode

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2023 License: MIT Imports: 11 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendThisNode

func AppendThisNode()

AppendThisNode - Appends thisNode to the nodeList

func BroadcastThisNode

func BroadcastThisNode() error

BroadcastThisNode - Broadcasts thisNode to the Network

func GenesisNodeList

func GenesisNodeList()

GenesisNodeList - Creates the nodeList

func GetNodeList

func GetNodeList() nodeSlice

GetNodeList - Gets the nodeList

func HandleRequest

func HandleRequest(conn net.Conn)

HandleRequest handles TCP requests

func RequestNodeList

func RequestNodeList(networkIP string, networkTCPPort string) error

RequestNodeList - Requests the nodeList from a Network Node

func StartRoutingNode

func StartRoutingNode(nodeIP string, nodeTCPPort string)

StartRoutingNode - Start the Routing Node (TCP Server)

Types

type NodeStruct

type NodeStruct struct {
	Index          int    `json:"index"`
	Status         string `json:"status"`
	Timestamp      string `json:"timestamp"`
	NodeName       string `json:"nodename"`
	NodeIP         string `json:"nodeip"`
	NodeHTTPPort   string `json:"nodehttpport"`
	NodeTCPPort    string `json:"nodetcpport"`
	NetworkIP      string `json:"networkip"`
	NetworkTCPPort string `json:"networktcpport"`
	TestBlockChain bool   `json:"testblockchain"`
	WalletOnly     bool   `json:"walletonly"`
	ToolVersion    string `json:"toolversion"`
}

NodeStruct is your node info

func AppendNewNode

func AppendNewNode(messageNewNode string) NodeStruct

AppendNewNode - Appends a new Node to the nodeList

func GetNode

func GetNode(id string) NodeStruct

GetNode - Gets a Node (via Index number) from the nodeList

func GetThisNode

func GetThisNode() NodeStruct

GetThisNode - Gets thisNode

func (NodeStruct) LoadThisNode

func (n NodeStruct) LoadThisNode()

LoadThisNode - Loads thisNode

Jump to

Keyboard shortcuts

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