node

package
v0.0.0-...-2af0010 Latest Latest
Warning

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

Go to latest
Published: May 18, 2025 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromJSON

func FromJSON(data string, v interface{}) error

Helper function to convert JSON string to struct

func Init

func Init()

func MakeItString

func MakeItString(str string) string

func ToJSON

func ToJSON(data interface{}) string

Types

type IPInfo

type IPInfo struct {
	IPv4Addresses []string
	IPv6Addresses []string
}

func GetIPInfo

func GetIPInfo() IPInfo

type IpGeoAddress

type IpGeoAddress struct {
	IpInfoIP       string
	IpInfoCity     string
	IpInfoCountry  string
	IpInfoLocation string
	IpInfoOrg      string
	IpInfoPostal   string
	IpInfoTimezone string
}

func GetIpData

func GetIpData() IpGeoAddress

type NodeStatus

type NodeStatus struct {
	PeerId           string  `json:"peerId" gorm:"primaryKey"`
	Name             string  `json:"name"`
	HttpPort         string  `json:"httpPort"`
	Host             string  `json:"host"` //domain
	PeerAddress      string  `json:"peerAddress"`
	Region           string  `json:"region"`
	Status           string  `json:"status"` // offline 1, online 2, maintainance 3,block 4
	DownloadSpeed    float64 `json:"downloadSpeed"`
	UploadSpeed      float64 `json:"uploadSpeed"`
	RegistrationTime int64   `json:"registrationTime"` //StartTimeStamp
	LastPing         int64   `json:"lastPing"`
	Chain            string  `json:"chainName"`
	WalletAddress    string  `json:"walletAddress"`
	Version          string  `json:"version"`
	CodeHash         string  `json:"codeHash"`
	SystemInfo       string  `json:"systemInfo" gorm:"type:jsonb"`
	IpInfo           string  `json:"ipinfo" gorm:"type:jsonb"`
	IpGeoData        string  `json:"ipGeoData" gorm:"type:jsonb"`
	NodeAccess       string  `json:"nodeAccess"`
	NodeConfig       string  `json:"nodeConfig"`
}

func CreateNodeStatus

func CreateNodeStatus(address string, id string, startTimeStamp int64, name string) *NodeStatus

type OSInfo

type OSInfo struct {
	Name         string // Name of the operating system
	Hostname     string // Hostname of the system
	Architecture string // Architecture of the system
	NumCPU       int    // Number of CPUs
}

func GetOSInfo

func GetOSInfo() OSInfo

Jump to

Keyboard shortcuts

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