translate

package
v0.2.4-0...-f8342f3 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2021 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var IncompleteKey = errors.New("incomplete key")
View Source
var UnknownKey = errors.New("unknown key")

Functions

func KeyToPath

func KeyToPath(k ds.Key) (id peer.ID, p string, err error)

Types

type AddrBookRecord

type AddrBookRecord struct {
	// The multiaddresses. This is a sorted list where element 0 expires the soonest.
	Addrs []*AddrBookRecord_AddrEntry `json:"addrs,omitempty"`
	// The most recently received signed PeerRecord.
	CertifiedRecord *AddrBookRecord_CertifiedRecord `json:"certified_record,omitempty"`
}

type AddrBookRecord_AddrEntry

type AddrBookRecord_AddrEntry struct {
	// Addr in multi-addr format
	Addr string `json:"addr,omitempty"`
	// The point in time when this address expires.
	Expiry int64 `json:"expiry,omitempty"`
	// The original TTL of this address.
	Ttl int64 `json:"ttl,omitempty"`
}

type AddrBookRecord_CertifiedRecord

type AddrBookRecord_CertifiedRecord struct {
	// The Seq counter from the signed PeerRecord envelope
	Seq uint64 `json:"seq,omitempty"`
	// The serialized bytes of the SignedEnvelope containing the PeerRecord. (encoded as hex)
	Raw string `json:"raw,omitempty"`
}

type ENRData

type ENRData struct {
	Raw      string             `json:"raw,omitempty"`
	Other    map[string]string  `json:"other,omitempty"`
	Eth2Data *beacon.Eth2Data   `json:"eth2_data,omitempty"`
	Attnets  *beacon.AttnetBits `json:"attnets,omitempty"`
	Seq      uint64             `json:"seq,omitempty"`
	IP       net.IP             `json:"ip,omitempty"`
	TCP      uint16             `json:"tcp,omitempty"`
	UDP      uint16             `json:"udp,omitempty"`
}

type Entry

type Entry struct {
	Key   string
	Value interface{} // should be either something json-encodeable
}

type Eth2Data

type Eth2Data struct {
	Metadata      *beacon.MetaData `json:"metadata,omitempty"`
	MetadataClaim beacon.SeqNr     `json:"metadata_claim,omitempty"`
	Status        *beacon.Status   `json:"status,omitempty"`
	ENR           *ENRData         `json:"enr,omitempty"`
}

type PartialPeerstoreEntry

type PartialPeerstoreEntry struct {
	Eth2            *Eth2Data       `json:"eth2,omitempty"`
	AddrRecords     *AddrBookRecord `json:"addr_records,omitempty"`
	Protocols       []string        `json:"protocols,omitempty"`
	ProtocolVersion string          `json:"protocol_version,omitempty"`
	UserAgent       string          `json:"user_agent,omitempty"`
	Pubkey          string          `json:"pub,omitempty"` // raw bytes, not the protobuf representation
	NodeID          string          `json:"node_id,omitempty"`
}

func ItemToEntry

func ItemToEntry(k ds.Key, v []byte) (id peer.ID, out PartialPeerstoreEntry, err error)

func (*PartialPeerstoreEntry) Merge

func (*PartialPeerstoreEntry) ToCSV

func (p *PartialPeerstoreEntry) ToCSV(prefixFields ...string) (out [][]string)

Jump to

Keyboard shortcuts

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