cardanocfg

package
v0.0.0-...-197aa00 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2021 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const AlonzoGenesis = "alonzo-genesis.json"
View Source
const ByronGenesis = "byron-genesis.json"
View Source
const ConfigJSON = "config.json"
View Source
const Mainnet = "mainnet"
View Source
const ShelleyGenesis = "shelley-genesis.json"
View Source
const Testnet = "testnet"
View Source
const TopologyJSON = "topology.json"
View Source
const URI = "https://hydra.iohk.io/job/Cardano/cardano-node/cardano-deployment/latest-finished/download/1"

Variables

This section is empty.

Functions

This section is empty.

Types

type Downloader

type Downloader struct {
	Wg             *sync.WaitGroup
	ConfigJSON     string
	TopologyJSON   string
	ShelleyGenesis string
	AlonzoGenesis  string
	ByronGenesis   string
	// contains filtered or unexported fields
}

func New

func New(n *config.Node, c *config.C) (*Downloader, error)

func (*Downloader) ConfigureBlocks

func (d *Downloader) ConfigureBlocks(jsonB []byte) ([]byte, error)

func (*Downloader) DownloadAndSetTopologyFile

func (d *Downloader) DownloadAndSetTopologyFile() error

func (*Downloader) DownloadAndSetTopologyFileProducer

func (d *Downloader) DownloadAndSetTopologyFileProducer() (top Topology, err error)

func (*Downloader) DownloadAndSetTopologyFileRelay

func (d *Downloader) DownloadAndSetTopologyFileRelay() (top Topology, err error)

func (*Downloader) DownloadConfigFiles

func (d *Downloader) DownloadConfigFiles() (configJSON, topology, shelley, byron, alonzo string)

func (*Downloader) DownloadFile

func (d *Downloader) DownloadFile(filePath, url string) error

DownloadFile will download a url to a local file. It's efficient because it will write as it downloads and not load the whole file into memory.

func (*Downloader) DownloadTopologyJSON

func (d *Downloader) DownloadTopologyJSON(aNet string) (Topology, error)

func (*Downloader) GetConfigFile

func (d *Downloader) GetConfigFile(aType string)

func (*Downloader) GetConfigJSON

func (d *Downloader) GetConfigJSON(aType string) (filePath string, err error)

func (*Downloader) GetFilePath

func (d *Downloader) GetFilePath(aType string, isTmp bool) (filePath string, err error)

func (*Downloader) GetTestNetRelays

func (d *Downloader) GetTestNetRelays() (tp Topology, newProduces []Node, err error)

func (*Downloader) GetURL

func (d *Downloader) GetURL(aType string) (url string, err error)

func (*Downloader) MainNetRelays

func (d *Downloader) MainNetRelays() (Topology, error)

func (*Downloader) MainnetDownloadNodes

func (d *Downloader) MainnetDownloadNodes() ([]Node, error)

func (*Downloader) RelaysChan

func (d *Downloader) RelaysChan() chan Node

func (*Downloader) RelaysDone

func (d *Downloader) RelaysDone() chan interface{}

func (*Downloader) SetEKGVIEWContents

func (d *Downloader) SetEKGVIEWContents(jsonB []byte) ([]byte, error)

func (*Downloader) SetMapSubtraceContents

func (d *Downloader) SetMapSubtraceContents(jsonB []byte) ([]byte, error)

func (*Downloader) SetPrometheus

func (d *Downloader) SetPrometheus(newJSON []byte) ([]byte, error)

func (*Downloader) SetTraceForwardTo

func (d *Downloader) SetTraceForwardTo(newJSON []byte) ([]byte, error)

func (*Downloader) SetTraceMempool

func (d *Downloader) SetTraceMempool(newJSON []byte) ([]byte, error)

func (*Downloader) SetTraces

func (d *Downloader) SetTraces(newJSON []byte) ([]byte, error)

func (*Downloader) SetValency

func (d *Downloader) SetValency(relays NodeList) (NodeList, error)

func (*Downloader) TestLatency

func (d *Downloader) TestLatency(newProduces NodeList) (finalProducers NodeList, err error)

func (*Downloader) TestLatencyWithPing

func (d *Downloader) TestLatencyWithPing(newProduces NodeList) (allLostPackets, finalProducers NodeList, err error)

func (*Downloader) TestNetRelays

func (d *Downloader) TestNetRelays() (tp Topology, err error)

type Node

type Node struct {
	Atype           string `json:"type"`
	Addr            string `json:"addr"`
	Port            uint   `json:"port"`
	Valency         uint   `json:"valency"`
	Debug           string `json:"debug"`
	Latency         time.Duration
	LatencyAcc      time.Duration
	LatencyAccCount uint64
}

type NodeList

type NodeList []Node

func (NodeList) Len

func (ms NodeList) Len() int

Len is part of sort.Interface.

func (NodeList) Less

func (ms NodeList) Less(i, j int) bool

Less is part of sort.Interface. It is implemented by looping along the less functions until it finds a comparison that discriminates between the two items (one is less than the other). Note that it can call the less functions twice per call. We could change the functions to return -1, 0, 1 and reduce the number of calls for greater efficiency: an exercise for the reader.

func (NodeList) Swap

func (ms NodeList) Swap(i, j int)

Swap is part of sort.Interface.

type Topology

type Topology struct {
	Producers []Node `json:"Producers"`
}

Jump to

Keyboard shortcuts

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