info

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Crawler
	DefaultIP        string = "0.0.0.0"
	DefaultTcpPort   int    = 9020
	DefaultUdpPort   int    = 9020
	DefaultUserAgent string = "bsc_crawler"
	DefaultLogLevel  string = "info"

	// Bootnodes
	DefaultEth2BootNodesFile string = "./bootstrap_nodes/bootnodes_mainnet.json"
	DefaultIpfsBootNodesFile string = "./bootstrap_nodes/ipfs-bootnodes.json"

	// Config Files
	DefaultEth2ConfigFile string = "./config-files/eth2-config.json"
	DefaultIpfsConfigFile string = "./config-files/ipfs-config.json"

	// ETH2
	DefaultEth2Network string = "mainnet"

	// IPFS
	DefaultIpfsNetwork string = "ipfs"
	Ipfsprotocols             = []string{
		"/ipfs/kad/1.0.0",
		"/ipfs/kad/2.0.0",
	}
	Filecoinprotocols = []string{
		"/fil/kad/testnetnet/kad/1.0.0",
	}

	// Metrics
	DefaultOutputPath string = "./peerstore"

	// Control
	MinPort           int      = 0
	MaxPort           int      = 65000
	PossibleLogLevels []string = []string{"trace", "debug", "info", "warn", "error"}
)

Functions

This section is empty.

Types

type Eth2InfoData added in v1.1.0

type Eth2InfoData struct {
	IP            net.IP
	TcpPort       int
	UdpPort       int
	UserAgent     string
	TopicArray    []string
	Network       string
	ForkDigest    string
	DbEndpoint    string
	Eth2endpoint  string
	LogLevel      string
	PrivateKey    *crypto.Secp256k1PrivateKey
	BootNodesFile string
	OutputPath    string
}

func Eth2infoFromConfig added in v1.1.0

func Eth2infoFromConfig(inputConfig config.ConfigData) Eth2InfoData

importFromConfig: This method will import all data from the given ConfigData object. As soon as we read the log level from the config object we create the logger object. @param inputConfig object to import data from. @param stdOpts base logging options.

func InitEth2 added in v1.1.0

func InitEth2(c *cli.Context) (Eth2InfoData, error)

func (Eth2InfoData) GetPrivKeyString added in v1.1.0

func (i Eth2InfoData) GetPrivKeyString() string

func (Eth2InfoData) GetUdpPortString added in v1.1.0

func (i Eth2InfoData) GetUdpPortString() string

func (*Eth2InfoData) SetForkDigest added in v1.1.0

func (i *Eth2InfoData) SetForkDigest(inputString string) bool

func (*Eth2InfoData) SetPrivKeyFromString added in v1.1.0

func (i *Eth2InfoData) SetPrivKeyFromString(input_key string) error

func (*Eth2InfoData) SetTcpPort added in v1.1.0

func (i *Eth2InfoData) SetTcpPort(input_port int)

func (*Eth2InfoData) SetTopicArray added in v1.1.0

func (i *Eth2InfoData) SetTopicArray(inputList []string) bool

SetTopicArray: This method loops over the given array and validate that topics exist before setting the array. We need at least one valid. @return boolean in case any topic in the list was applied (true) or none was applied (false).

func (*Eth2InfoData) SetTopicArrayFromString added in v1.1.0

func (i *Eth2InfoData) SetTopicArrayFromString(input_list string) bool

func (*Eth2InfoData) SetUdpPort added in v1.1.0

func (i *Eth2InfoData) SetUdpPort(input_port int)

type IpfsInfoData added in v1.1.0

type IpfsInfoData struct {
	IP        net.IP
	TcpPort   int
	UdpPort   int
	UserAgent string
	Network   string

	TopicArray    []string
	DbEndpoint    string
	LogLevel      string
	PrivateKey    *crypto.Secp256k1PrivateKey
	BootNodesFile string
	OutputPath    string
}

func IPFSinfoFromConfig added in v1.1.0

func IPFSinfoFromConfig(inputConfig config.ConfigData) IpfsInfoData

importFromConfig: This method will import all data from the given ConfigData object. As soon as we read the log level from the config object we create the logger object. @param inputConfig object to import data from. @param stdOpts base logging options.

func InitIpfs added in v1.1.0

func InitIpfs(c *cli.Context) (IpfsInfoData, error)

func (IpfsInfoData) GetPrivKeyString added in v1.1.0

func (i IpfsInfoData) GetPrivKeyString() string

func (IpfsInfoData) GetUdpPortString added in v1.1.0

func (i IpfsInfoData) GetUdpPortString() string

func (*IpfsInfoData) SetPrivKeyFromString added in v1.1.0

func (i *IpfsInfoData) SetPrivKeyFromString(input_key string) error

func (*IpfsInfoData) SetTcpPort added in v1.1.0

func (i *IpfsInfoData) SetTcpPort(input_port int)

func (*IpfsInfoData) SetTopicArray added in v1.1.0

func (i *IpfsInfoData) SetTopicArray(inputList []string) bool

SetTopicArray: This method loops over the given array and validate that topics exist before setting the array. We need at least one valid. @return boolean in case any topic in the list was applied (true) or none was applied (false).

func (*IpfsInfoData) SetTopicArrayFromString added in v1.1.0

func (i *IpfsInfoData) SetTopicArrayFromString(input_list string) bool

func (*IpfsInfoData) SetUdpPort added in v1.1.0

func (i *IpfsInfoData) SetUdpPort(input_port int)

Jump to

Keyboard shortcuts

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