chain

package
v2.0.6-testnet Latest Latest
Warning

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

Go to latest
Published: May 10, 2024 License: Apache-2.0, MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Info

type Info struct {
	PublicKey   kyber.Point   `json:"public_key"`
	ID          string        `json:"id"`
	Period      time.Duration `json:"period"`
	Scheme      string        `json:"scheme"`
	GenesisTime int64         `json:"genesis_time"`
	GenesisSeed []byte        `json:"group_hash"`
}

Info represents the public information that is necessary for a client to verify any beacon present in a randomness chain.

func InfoFromJSON

func InfoFromJSON(buff io.Reader) (*Info, error)

InfoFromJSON returns a Info from JSON description in the given reader

func InfoFromProto

func InfoFromProto(p *drand.ChainInfoPacket) (*Info, error)

InfoFromProto returns a Info from the protocol description

func NewChainInfo

func NewChainInfo(g *key.Group) *Info

NewChainInfo makes a chain Info from a group.

func (*Info) Equal

func (c *Info) Equal(c2 *Info) bool

Equal indicates if two Chain Info objects are equivalent

func (*Info) GetSchemeName

func (c *Info) GetSchemeName() string

GetSchemeName returns the scheme name used

func (*Info) Hash

func (c *Info) Hash() []byte

Hash returns the canonical hash representing the chain information. A hash is consistent throughout the entirety of a chain, regardless of the network composition, the actual nodes, generating the randomness.

func (*Info) HashString

func (c *Info) HashString() string

HashString returns the value of Hash in string format

func (*Info) ToJSON

func (c *Info) ToJSON(w io.Writer, metadata *drand.Metadata) error

ToJSON provides a json serialization of an info packet

func (*Info) ToProto

func (c *Info) ToProto(metadata *drand.Metadata) *drand.ChainInfoPacket

ToProto returns the protobuf description of the chain info

Jump to

Keyboard shortcuts

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