cluster

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2022 License: Apache-2.0 Imports: 17 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeENR

func DecodeENR(enrStr string) (*enr.Record, error)

func EncodeENR

func EncodeENR(record *enr.Record) (string, error)

func PeerIDFromENR

func PeerIDFromENR(record *enr.Record) (peer.ID, error)

PeerIDFromENR derives the libp2p peer ID from the secp256k1 public key encoded in the ENR.

Types

type KnownClusters

type KnownClusters struct {
	// contains filtered or unexported fields
}

KnownClusters is a registry of known clusters.

func LoadKnownClusters

func LoadKnownClusters() (KnownClusters, error)

LoadKnownClusters loads cluster specs.

func LoadKnownClustersFromDir

func LoadKnownClustersFromDir(dir string) (KnownClusters, error)

LoadKnownClustersFromDir discovers clusters from the given directory.

func (KnownClusters) Clusters

func (k KnownClusters) Clusters() map[string]*Manifest

Clusters returns a list of known clusters.

func (KnownClusters) GetCluster

func (k KnownClusters) GetCluster(pubkey kyber.Point) *Manifest

GetCluster returns the cluster for the given BLS public key.

Returns nil if no matching cluster was found.

type Manifest

type Manifest struct {
	TSS     crypto.TBLSScheme     `json:"tss"`     // Threshold signature scheme params
	Members []crypto.BLSPubkeyHex `json:"members"` // DV consensus BLS pubkeys
	ENRs    []string              `json:"enrs"`    // Charon peer ENRs
}

Manifest captures the public cryptographic and networking info required to connect to a DV cluster.

func LoadManifest

func LoadManifest(filePath string) (*Manifest, error)

LoadManifest reads the manifest file from the given file path.

func (*Manifest) ParsedENRs

func (m *Manifest) ParsedENRs() ([]enr.Record, error)

ParsedENRs returns the decoded list of ENRs in a manifest.

func (*Manifest) PeerIDs

func (m *Manifest) PeerIDs() ([]peer.ID, error)

PeerIDs maps ENRs to libp2p peer IDs.

TODO This can be computed at deserialization-time.

func (*Manifest) Pubkey

func (m *Manifest) Pubkey() kyber.Point

Pubkey returns the BLS public key of the distributed validator.

Jump to

Keyboard shortcuts

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