bitswap

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2023 License: MIT Imports: 7 Imported by: 13

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InternetLatencyDelayGenerator

func InternetLatencyDelayGenerator(
	mediumDelay time.Duration,
	largeDelay time.Duration,
	percentMedium float64,
	percentLarge float64,
	std time.Duration,
	rng *rand.Rand) delay.Generator

InternetLatencyDelayGenerator generates three clusters of delays, typical of the type of peers you would encounter on the interenet. Given a base delay time T, the wait time generated will be either: 1. A normalized distribution around the base time 2. A normalized distribution around the base time plus a "medium" delay 3. A normalized distribution around the base time plus a "large" delay The size of the medium & large delays are determined when the generator is constructed, as well as the relative percentages with which delays fall into each of the three different clusters, and the standard deviation for the normalized distribution. This can be used to generate a number of scenarios typical of latency distribution among peers on the internet. Deprecated: use github.com/ipfs/go-libipfs/bitswap/testnet.InternetLatencyDelayGenerator instead

Types

type Network

type Network = libipfs.Network

Network is an interface for generating bitswap network interfaces based on a test network. Deprecated: use github.com/ipfs/go-libipfs/bitswap/testnet.Network instead

func RateLimitedVirtualNetwork

func RateLimitedVirtualNetwork(rs mockrouting.Server, d delay.D, rateLimitGenerator RateLimitGenerator) Network

RateLimitedVirtualNetwork generates a testnet instance where nodes are rate limited in the upload/download speed. Deprecated: use github.com/ipfs/go-libipfs/bitswap/testnet.RateLimitedVirtualNetwork instead

func StreamNet

func StreamNet(ctx context.Context, net mockpeernet.Mocknet, rs mockrouting.Server) (Network, error)

StreamNet is a testnet that uses libp2p's MockNet Deprecated: use github.com/ipfs/go-libipfs/bitswap/testnet.StreamNet instead

func VirtualNetwork

func VirtualNetwork(rs mockrouting.Server, d delay.D) Network

VirtualNetwork generates a new testnet instance - a fake network that is used to simulate sending messages. Deprecated: use github.com/ipfs/go-libipfs/bitswap/testnet.VirtualNetwork instead

type RateLimitGenerator

type RateLimitGenerator = libipfs.RateLimitGenerator

RateLimitGenerator is an interface for generating rate limits across peers Deprecated: use github.com/ipfs/go-libipfs/bitswap/testnet.RateLimitGenerator instead

func FixedRateLimitGenerator

func FixedRateLimitGenerator(rateLimit float64) RateLimitGenerator

FixedRateLimitGenerator returns a rate limit generatoe that always generates the specified rate limit in bytes/sec. Deprecated: use github.com/ipfs/go-libipfs/bitswap/testnet.FixedRateLimitGenerator instead

func VariableRateLimitGenerator

func VariableRateLimitGenerator(rateLimit float64, std float64, rng *rand.Rand) RateLimitGenerator

VariableRateLimitGenerator makes rate limites that following a normal distribution. Deprecated: use github.com/ipfs/go-libipfs/bitswap/testnet.VariableRateLimitGenerator instead

Jump to

Keyboard shortcuts

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