Documentation ¶
Overview ¶
Package local provides a local, non-networked implementation of the interfaces defined by the net package. It should largely be considered a sample implementation, and is not meant to be used at scale in any way.
Index ¶
Constants ¶
const RetransmissionTick = 50 * time.Millisecond
RetransmissionTick determines the frequency of the retransmissions done by the local broadcast channel implementation.
Variables ¶
var DefaultCurve elliptic.Curve = btcec.S256()
DefaultCurve is the default elliptic curve implementation used in the net/local package. Local network uses the secp256k1 curve and the specific implementation is provided by the btcec package.
Functions ¶
This section is empty.
Types ¶
type Provider ¶
type Provider interface { net.Provider // AddPeer allows the simulation of adding a peer to the client's local // registry of peers. AddPeer(peerID string, publicKey *operator.PublicKey) }
Provider is an extension of net.Provider. This interface exposes additional functions useful for testing.
func Connect ¶
func Connect() Provider
Connect returns a local instance of a net provider that does not go over the network.
func ConnectWithKey ¶
ConnectWithKey returns a local instance of net provider that does not go over the network. The returned instance uses the provided network key to identify network messages.