gf_eth_core

package
Version: v0.0.0-...-68b4e11 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2021 License: GPL-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Error__get_defs

func Error__get_defs() map[string]gf_core.Error_def

-------------------------------------------------

func Eth_favorites__tx_add

func Eth_favorites__tx_add(p_tx_id_hex_str string,
	p_ctx context.Context,
	p_runtime *GF_runtime) *gf_core.GF_error

-------------------------------------------------

func Eth_miners__db__get_info

func Eth_miners__db__get_info(p_miner_address_str string,
	p_metrics *GF_metrics,
	p_ctx context.Context,
	p_runtime *GF_runtime) (map[string]*GF_eth__miner__int, *gf_core.GF_error)

-------------------------------------------------

func Eth_peers__db__write

func Eth_peers__db__write(p_peer_new_lifecycle *GF_eth_peer__new_lifecycle,
	p_ctx context.Context,
	p_metrics *GF_metrics,
	p_runtime *GF_runtime) *gf_core.GF_error

------------------------------------------------- DB_WRITE

func Eth_peers__init_continuous_metrics

func Eth_peers__init_continuous_metrics(p_metrics *GF_metrics,
	p_runtime *GF_runtime)

func Eth_rpc__call

func Eth_rpc__call(p_input_json_str string,
	p_eth_node_host_str string,
	p_runtime_sys *gf_core.Runtime_sys) (map[string]interface{}, *gf_core.GF_error)

-------------------------------------------------

func Eth_rpc__init

func Eth_rpc__init(p_host_str string,
	p_geth_port_int int,
	p_runtime_sys *gf_core.Runtime_sys) (*ethclient.Client, *gf_core.GF_error)

------------------------------------------------- INIT

func Metrics__init_server

func Metrics__init_server(p_port_int int)

------------------------------------------------- INIT_SERVER

func Worker__discovery__init

func Worker__discovery__init(p_runtime *GF_runtime) (func(context.Context, *GF_runtime) []string, chan *gf_core.GF_error)

-------------------------------------------------

Types

type Error_def

type Error_def struct {
	Descr_str string
}

-------------------------------------------------

type GF_config

type GF_config struct {

	// PORTS
	Port_str         string `mapstructure:"port"`
	Port_metrics_str string `mapstructure:"port_metrics"`

	// MONGODB - this is the dedicated mongodb DB
	Mongodb_host_str    string `mapstructure:"mongodb_host"`
	Mongodb_db_name_str string `mapstructure:"mongodb_db_name"`

	// AWS_SQS
	AWS_SQS_queue_str string `mapstructure:"aws_sqs_queue"`

	// WORKERS_AWS_DISCOVERY - if AWS API's should be used for workers discovery,
	//                         or if the hardcoded workers_host config is used.
	Workers_aws_discovery_bool bool `mapstructure:"workers_aws_discovery"`

	// WORKERS_HOSTS - list of "," separated hosts, that are used by gf_eth_monitor__masters
	//                 to reach a worker_inspector service running on each worker.
	Workers_hosts_str string `mapstructure:"workers_hosts"`

	// SENTRY_ENDPOINT
	Sentry_endpoint_str string `mapstructure:"sentry_endpoint"`

	// EVENTS - flag to turn on/off event consumption and processing from queues.
	//          mostly used for debugging and testing.
	Events_consume_bool bool `mapstructure:"events_consume"`

	// PY_PLUGINS
	Py_plugins_dir_path_str string `mapstructure:"py_plugins_dir_path"`
}

-------------------------------------------------------------

type GF_eth__miner__int

type GF_eth__miner__int struct {
	Name_str        string `bson:"name_str" json:"name_str"`
	Address_hex_str string `bson:"addr_str" json:"address_hex_str"`
}

-------------------------------------------------

type GF_eth_peer__db_aggregate__name_group

type GF_eth_peer__db_aggregate__name_group struct {
	Name_str             string   `bson:"_id"                  json:"name_str"`
	Peers_remote_ips_lst []string `bson:"peers_remote_ips_lst" json:"peers_remote_ips_lst"`
	Count_int            int      `bson:"count_int"            json:"count_int"`
}

func Eth_peers__db__get_pipeline

func Eth_peers__db__get_pipeline(p_metrics *GF_metrics,
	p_runtime *GF_runtime) ([]*GF_eth_peer__db_aggregate__name_group, *gf_core.GF_error)

------------------------------------------------- GET_PIPELINE

type GF_eth_peer__db_aggregate__name_group_counts

type GF_eth_peer__db_aggregate__name_group_counts struct {
	Name_str  string `bson:"_id"       json:"name_str"`
	Count_int int    `bson:"count_int" json:"count_int"`
}

func Eth_peers__db__get_count

func Eth_peers__db__get_count(p_metrics *GF_metrics,
	p_runtime *GF_runtime) ([]*GF_eth_peer__db_aggregate__name_group_counts, *gf_core.GF_error)

-------------------------------------------------

type GF_eth_peer__new_lifecycle

type GF_eth_peer__new_lifecycle struct {
	T_str              string  `bson:"t"` // "peer_new_lifecycle"
	V_str              string  `bson:"v"` // version - "v0",...
	Peer_name_str      string  `bson:"peer_name_str"`
	Peer_enode_id_str  string  `bson:"peer_enode_id_str"`
	Peer_remote_ip_str string  `bson:"peer_remote_ip_str"`
	Node_public_ip_str string  `bson:"node_public_ip_str"`
	Event_time_unix_f  float64 `bson:"event_time_unix_f"`
}

------------------------------------------------- GF_ETH_PEER__NEW_LIFECYCLE

type GF_metrics

type GF_metrics struct {

	// SQS
	SQS__msgs_num__counter prometheus.Counter

	// PEERS
	Peers__http_req_num__get_peers__counter prometheus.Counter
	Peers__unique_names_num__gauge          prometheus.Gauge

	// BLOCK
	Block__db_count__gauge prometheus.Gauge

	// TX
	Tx__db_count__gauge prometheus.Gauge

	// TX_TRACE
	Tx_trace__worker_inspector_durration__gauge prometheus.Gauge
	Tx_trace__py_plugin__plot_durration__gauge  prometheus.Gauge
	Tx_trace__db_count__gauge                   prometheus.Gauge

	// DB
	DB__writes_num__new_peer_lifecycle__counter prometheus.Counter

	// ERRORS
	Errs_num__counter prometheus.Counter
}

-------------------------------------------------

func Metrics__init

func Metrics__init(p_port_int int) (*GF_metrics, *gf_core.GF_error)

------------------------------------------------- INIT

type GF_py_plugins

type GF_py_plugins struct {
	Base_dir_path_str string
}

-------------------------------------------------

type GF_runtime

type GF_runtime struct {
	Config      *GF_config
	Py_plugins  *GF_py_plugins
	Runtime_sys *gf_core.Runtime_sys
}

-------------------------------------------------------------

func Runtime__get

func Runtime__get(p_config *GF_config,
	p_runtime_sys *gf_core.Runtime_sys) (*GF_runtime, error)

-------------------------------------------------

Jump to

Keyboard shortcuts

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