Documentation
¶
Index ¶
- Constants
- type Config
- type Network
- func (n *Network) Close() error
- func (n *Network) EnsurePeer(peerID string, addrs []string) error
- func (n *Network) ID() string
- func (n *Network) ListenAddrs() []string
- func (n *Network) RegisterHandler(handler networking.MessageHandler) error
- func (n *Network) Send(ctx context.Context, peerID string, data []byte) error
Constants ¶
View Source
const MaxFrameSize = 1 * 1024 * 1024 // 1 MiB
MaxFrameSize bounds a single length-prefixed frame on TSS streams. The cap rejects oversize length prefixes before allocation so a peer cannot trigger large attacker-chosen heap allocations. Sized well above the largest observed DKLS Step() + coordinator.Message wrapping for our committee sizes.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// ListenAddrs is the list of multiaddrs to bind to. Defaults to /ip4/0.0.0.0/tcp/0.
ListenAddrs []string
// ProtocolID is the stream protocol identifier. Defaults to /push/tss/1.0.0.
ProtocolID string
// PrivateKeyBase64 optionally contains a base64-encoded libp2p private key.
// If empty, a fresh Ed25519 keypair is generated.
PrivateKeyBase64 string
// DialTimeout bounds outbound dial operations.
DialTimeout time.Duration
// IOTimeout bounds stream read/write operations.
IOTimeout time.Duration
}
Config controls the libp2p network behaviour.
type Network ¶
type Network struct {
// contains filtered or unexported fields
}
Network implements networking.Network using libp2p.
func (*Network) EnsurePeer ¶
EnsurePeer implements networking.Network.
func (*Network) ListenAddrs ¶
ListenAddrs implements networking.Network.
func (*Network) RegisterHandler ¶
func (n *Network) RegisterHandler(handler networking.MessageHandler) error
RegisterHandler implements networking.Network.
Click to show internal directories.
Click to hide internal directories.