nodes

package
v0.0.0-...-7fcd714 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2021 License: Unlicense Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ENSOroutesDirect

func ENSOroutesDirect(path string, rpcLogin cfg.RPClogin, r *mux.Router) *mux.Router

func GetBitNodes

func GetBitNodes(j *jdb.JDB, bitNodeCoins []string)

// GetBitNodes updates the data about all of the coins in the database

func GetNode

func GetNode(j *jdb.JDB, c, ip string) map[string]interface{}

Types

type BitNode

type BitNode struct {
	IP   string `json:"ip"`
	Port int64  `json:"port"`
	Jrc  *utl.Endpoint
}

func RPCSRC

func RPCSRC(bitNodes BitNodes, username, password string) (b *BitNode)

func (*BitNode) APIGetAddNodeInfo

func (b *BitNode) APIGetAddNodeInfo(ip string) interface{}

func (*BitNode) APIGetBlock

func (b *BitNode) APIGetBlock(blockhash string) (block map[string]interface{})

func (*BitNode) APIGetBlockByHeight

func (b *BitNode) APIGetBlockByHeight(blockheight int) (block interface{})

func (*BitNode) APIGetBlockCount

func (b *BitNode) APIGetBlockCount() (blockcount int)

func (*BitNode) APIGetBlocks

func (b *BitNode) APIGetBlocks(per, page int) (blocks []map[string]interface{})

func (*BitNode) APIGetInfo

func (b *BitNode) APIGetInfo() interface{}

func (*BitNode) APIGetMiningInfo

func (b *BitNode) APIGetMiningInfo() interface{}

func (*BitNode) APIGetNetworkInfo

func (b *BitNode) APIGetNetworkInfo() interface{}

func (*BitNode) APIGetPeerInfo

func (b *BitNode) APIGetPeerInfo() interface{}

func (*BitNode) APIGetRawMemPool

func (b *BitNode) APIGetRawMemPool() interface{}

func (*BitNode) APIGetTx

func (b *BitNode) APIGetTx(txid string) (t interface{})

func (*BitNode) GetBitNodeStatus

func (b *BitNode) GetBitNodeStatus(username, password string) (bitnodeStatus *BitNodeStatus)

GetBitNodeStatus returns the full set of information about a node

func (*BitNode) GetBlockByHeight

func (b *BitNode) GetBlockByHeight(blockheight int) (block map[string]interface{})

func (*BitNode) GetBlockShort

func (b *BitNode) GetBlockShort(blockhash string) map[string]interface{}

func (*BitNode) GetBlockShortByHeight

func (b *BitNode) GetBlockShortByHeight(blockheight int) (block map[string]interface{})

type BitNodeStatus

type BitNodeStatus struct {
	Live           bool        `json:"live"`
	IP             string      `json:"ip"`
	GetInfo        interface{} `json:"getinfo"`
	GetPeerInfo    interface{} `json:"getpeerinfo"`
	GetRawMemPool  interface{} `json:"getrawmempool"`
	GetMiningInfo  interface{} `json:"getmininginfo"`
	GetNetworkInfo interface{} `json:"getnetworkinfo"`
	GeoIP          interface{} `json:"geoip"`
}

NodeStatus stores current data for a node

type BitNoded

type BitNoded struct {
	Coin     string          `json:"coin"`
	BitNodes []BitNodeStatus `json:"bitnodes"`
}

BitNoded data

type BitNodes

type BitNodes []BitNode

BitNodes is array of bitnodes addresses

type GeoResponse

type GeoResponse struct {
	Status      string
	Description string
	Data        struct {
		Geo struct {
			Host          string  `json:"host"`
			IP            string  `json:"ip"`
			RDSN          string  `json:"rdns"`
			ASN           float64 `json:"asn"`
			ISP           string  `json:"isp"`
			CountryName   string  `json:"country_name"`
			CountryCode   string  `json:"country_code"`
			RegionName    string  `json:"region_name"`
			RegionCode    string  `json:"region_code"`
			City          string  `json:"city"`
			PostalCode    string  `json:"postal_code"`
			ContinentName string  `json:"continent_name"`
			ContinentCode string  `json:"continent_code"`
			Latitude      float64 `json:"latitude"`
			Longitude     float64 `json:"longitude"`
			MetroCode     string  `json:"metro_code"`
			Timezone      string  `json:"timezone"`
			Datetime      string  `json:"datetime"`
		}
	}
}

type Node

type Node struct {
	IP            string  `json:"ip"`
	Port          int64   `json:"port"`
	Host          string  `json:"host"`
	Rdns          string  `json:"rdns"`
	ASN           string  `json:"asn"`
	ISP           string  `json:"isp"`
	CountryName   string  `json:"countryname"`
	CountryCode   string  `json:"countrycode"`
	RegionName    string  `json:"regionname"`
	RegionCode    string  `json:"regioncode"`
	City          string  `json:"city"`
	Postcode      string  `json:"postcode"`
	ContinentName string  `json:"continentname"`
	ContinentCode string  `json:"continentcode"`
	Latitude      float64 `json:"latitude"`
	Longitude     float64 `json:"longitude"`
	Zipcode       string  `json:"zipcode"`
	Timezone      string  `json:"timezone"`
	LastSeen      string  `json:"lastseen"`
	Live          bool    `json:"live"`
}

Node stores info retrieved via geoip about a node

func GetGeoIP

func GetGeoIP(ip string) (n Node)

func GetNodes

func GetNodes(n *BitNodeStatus) (nodes []Node)

GetNodes returns the peers connected to a

type Nodes

type Nodes []Node

Jump to

Keyboard shortcuts

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