Documentation ¶
Index ¶
- func ConstructHost(priv crypto.PrivKey, listenAddr string, bootstrap []ma.Multiaddr, ...) (host.Host, *pubsub.PubSub, error)
- func LoadOrCreatePrivKey(identityPath string, log dlog.Logger) (crypto.PrivKey, error)
- func ParseMultiaddrSlice(peers []string) ([]ma.Multiaddr, error)
- func PubSubTopic(h string) string
- type GossipRelayConfig
- type GossipRelayNode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConstructHost ¶
func ConstructHost(priv crypto.PrivKey, listenAddr string, bootstrap []ma.Multiaddr, log dlog.Logger) (host.Host, *pubsub.PubSub, error)
ConstructHost build a libp2p host configured for relaying drand randomness over pubsub.
func LoadOrCreatePrivKey ¶
LoadOrCreatePrivKey loads a base64 encoded libp2p private key from a file or creates one if it does not exist.
func ParseMultiaddrSlice ¶
ParseMultiaddrSlice parses a list of addresses into multiaddrs
func PubSubTopic ¶
PubSubTopic generates a drand pubsub topic from a chain hash.
Types ¶
type GossipRelayConfig ¶
type GossipRelayConfig struct { // ChainHash is a hash that uniquely identifies the drand chain. ChainHash string PeerWith []string Addr string DataDir string IdentityPath string CertPath string Insecure bool Client drand.Client }
GossipRelayConfig configures a gossip-relay relay node.
type GossipRelayNode ¶
type GossipRelayNode struct {
// contains filtered or unexported fields
}
GossipRelayNode is a gossip-relay relay runtime.
func NewGossipRelayNode ¶
func NewGossipRelayNode(l log.Logger, cfg *GossipRelayConfig) (*GossipRelayNode, error)
NewGossipRelayNode starts a new gossip-relay relay node.
func (*GossipRelayNode) Multiaddrs ¶
func (g *GossipRelayNode) Multiaddrs() []ma.Multiaddr
Multiaddrs returns the gossipsub multiaddresses of this relay node.
func (*GossipRelayNode) Shutdown ¶
func (g *GossipRelayNode) Shutdown()
Shutdown stops the relay node.
Click to show internal directories.
Click to hide internal directories.