Peer.byIp constructor

Peer.byIp(
  1. String ip,
  2. int port
)

connect to a node by its ip address and port

Implementation

factory Peer.byIp(String ip, int port) {
  final address = InternetAddress.tryParse(ip);
  if (address == null) throw Exception("Invalid IP address");
  return Peer(address, port);
}