Documentation ¶
Index ¶
- Constants
- func Bootstrap(ctx context.Context, host host.Host, router routing.Routing) error
- func DecodeKey(encoded string) (crypto.PrivKey, error)
- func Discovery(ctx context.Context, h host.Host) error
- func EncodeKey(priv crypto.PrivKey) (string, error)
- func GenerateKey() (crypto.PrivKey, error)
- func NewHost(ctx context.Context, priv crypto.PrivKey, listenAddr []string) (host.Host, routing.Routing, error)
- type Peer
Constants ¶
View Source
const ( // DiscoveryInterval is the time between mdns queries. DiscoveryInterval = time.Duration(15) * time.Second // DiscoveryConnectTimeout is the time to wait for a connection to be made. DiscoveryConnectTimeout = time.Second * 30 // DiscoveryServiceTag is used to identify a group of nodes. DiscoveryServiceTag = discovery.ServiceTag )
View Source
const ( // LowWater is the minimum amount of connections to keep. LowWater = 100 // HighWater is the maximum amount of connections to keep. HighWater = 400 // GracePeriod is how long wait to consider a connection active. GracePeriod = time.Minute )
View Source
const ( // ReprovideInterval is the time between reprovides. ReprovideInterval = 12 * time.Hour // QueueName is the name for the provider queue. QueueName = "repro" )
View Source
const DefaultKeyType = crypto.Ed25519
DefaultKeyType is the default private key type.
Variables ¶
This section is empty.
Functions ¶
func GenerateKey ¶
GenerateKey returns a new private key.
Types ¶
type Peer ¶
type Peer struct { // Blocks is the ipfs blockstore. Blocks blockstore.Blockstore // DAG implements ipld DAGService. DAG ipld.DAGService // Host is the libp2p host. Host host.Host // Router is the libp2p router. Router routing.Routing }
Peer implements p2p services.
Click to show internal directories.
Click to hide internal directories.