bootstrap

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

README

bootstrap

codecov

bootstrap provides helpers for bootstrapping libp2p hosts. It supports bootstrapping off the default libp2p bootstrap peers from ipfs/go-ipfs-config combined with the Temporal production IPFS nodes. Additionally it supports a DynamicBootstrap method to be used in-combination with a persistent peerstore to enable a "decentralized boostrapping" method that isn't reliant on pre-existing hosts.

The Bootstrap and DefaultBootstrapPeers are modified versions of those contained in hsanjuan/ipfs-lite.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TemporalPeerAddresses = []string{
	"/ip4/172.218.49.115/tcp/4002/ipfs/QmPvnFXWAz1eSghXD6JKpHxaGjbVo4VhBXY2wdBxKPbne5",
	"/ip4/172.218.49.115/tcp/4003/ipfs/QmXow5Vu8YXqvabkptQ7HddvNPpbLhXzmmU53yPCM54EQa",
	"/ip4/35.203.44.77/tcp/4001/ipfs/QmUMtzoRfQ6FttA7RygL8jJf7TZJBbdbZqKTmHfU6QC5Jm",
}

TemporalPeerAddresses are the multiaddrs for Temporal's production nodes.

Functions

func Bootstrap

func Bootstrap(ctx context.Context, logger *zap.Logger, dt routing.Routing, hst host.Host, peers []libcore.PeerAddrInfo) error

Bootstrap is used to connect our libp2p host to the specified set of peers

func DefaultBootstrapPeers

func DefaultBootstrapPeers() ([]libcore.PeerAddrInfo, error)

DefaultBootstrapPeers returns the default lsit of bootstrap peers used by go-ipfs, updated with the Temporal bootstrap nodes

func DynamicBootstrap

func DynamicBootstrap(ctx context.Context, logger *zap.Logger, dt routing.Routing, hst host.Host) error

DynamicBootstrap is used to bootstrapa a host off a dynamic list of bootstrap peers. This must be used in combination with a host using a datastore backed peerstore so that we have a persistent set of peers to boot from, otherwise we just do a default bootstrap The final list of bootstrap peers is at most 10 randomly selected from the peerstore, combined with the deafult libp2p bootstrap peers

Types

This section is empty.

Jump to

Keyboard shortcuts

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