Skip to content

Commit

Permalink
DNS: Remove seed configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
Muhammed Kadir Yücel authored and mkykadir committed Jun 16, 2022
1 parent 5819e91 commit 0984fe0
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 68 deletions.
3 changes: 0 additions & 3 deletions doc/config.example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -229,9 +229,6 @@ network:
# Supported value: IPv4, IPv6
- http://192.168.1.42:2828
- http://192.168.0.44:2828
dns:
# Supported value: FQDN seed
- seed.bosagora.io

################################################################################
## Logging options ##
Expand Down
1 change: 0 additions & 1 deletion source/agora/cli/multi/main.d
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ private int main (string[] args)
node : config.node,
validator : config.validator,
network : assumeUnique(converted_network),
dns_seeds : config.dns_seeds,
logging: config.logging,
admin: config.admin,
};
Expand Down
59 changes: 0 additions & 59 deletions source/agora/network/Manager.d
Original file line number Diff line number Diff line change
Expand Up @@ -302,10 +302,6 @@ public class NetworkManager

// add the IP seeds
this.addAddresses(Set!Address.from(config.network));

// add the DNS seeds
if (config.dns_seeds.length > 0)
this.addAddresses(resolveDNSSeeds(config.dns_seeds, this.log));
}

///
Expand Down Expand Up @@ -1264,61 +1260,6 @@ public class NetworkManager
}
}

/*******************************************************************************
Resolves IPs out of a list of DNS seeds
Params:
addresses = the set of DNS seeds
Returns:
The resolved set of IPs
*******************************************************************************/

private Set!Address resolveDNSSeeds (in string[] dns_seeds, ref Logger log)
{
import std.conv;
import std.string;
import std.socket : getAddressInfo, AddressFamily, ProtocolType;

Set!Address resolved_ips;

foreach (host; dns_seeds)
try
{
log.info("DNS: contacting seed '{}'..", host);
foreach (addr_info; getAddressInfo(host))
{
log.trace("DNS: checking address {}", addr_info);
if (addr_info.family != AddressFamily.INET &&
addr_info.family != AddressFamily.INET6)
{
log.trace("DNS: rejected non-IP family {}", addr_info.family);
continue;
}

// we only support TCP for now
if (addr_info.protocol != ProtocolType.TCP)
{
log.trace("DNS: rejected non-TCP node {}", addr_info);
continue;
}

// if the port is set to zero, assume default Boa schema
auto ip = "agora://" ~ addr_info.address.to!string;
log.info("DNS: accepted IP {}", ip);
resolved_ips.put(Address(ip));
}
}
catch (Exception ex)
{
log.error("Error contacting DNS seed: {}", ex.message);
}

return resolved_ips;
}

/// A range over the list of peers that can be invalidated
public struct PeerRange
{
Expand Down
4 changes: 0 additions & 4 deletions source/agora/node/Config.d
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,6 @@ public struct Config
/// The list of IPs for use with network discovery
public @Optional immutable Address[] network;

/// The list of DNS FQDN seeds for use with network discovery
@Name("dns")
public @Optional immutable string[] dns_seeds;

/// Logging config
@Key("name")
public immutable(LoggerConfig)[] logging = [ {
Expand Down
1 change: 0 additions & 1 deletion source/agora/node/main.d
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,6 @@ private Nullable!Config makeTestNetConfig (AgoraCLIArgs cmdln)
admin: config.admin,
registry: config.registry,
network: config.network,
dns_seeds: config.dns_seeds,
logging: config.logging,
event_handlers: config.event_handlers,
};
Expand Down

0 comments on commit 0984fe0

Please sign in to comment.