kindelia / Kindelia

An efficient, secure cryptocomputer
https://kindelia.org/
603 stars 39 forks source link

Resolve domain names #245

Open steinerkelvin opened 1 year ago

steinerkelvin commented 1 year ago

Domain names should work as peer arguments and on config file.

This patch on the default config file should work:

diff --git a/kindelia/default.toml b/kindelia/default.toml
index 588a578..d3e439e 100644
--- a/kindelia/default.toml
+++ b/kindelia/default.toml
@@ -6,8 +6,8 @@ network_id = "0xCAFE0006"

 [node.networks.0xCAFE0006]
 initial_peers = [
-  "64.227.110.69",
-  "188.166.3.140",
+  "node-ams3.testnet.kindelia.org",
+  "node-sfo3.testnet.kindelia.org",
 ]

Note: we don't have IPv6 support yet.

dan-da commented 1 year ago

yeah, I thought about this a bit. Rust std lib has SocketAddr which supports ip:port. It would be nice to have an enum type that supports [domain|ip]:port and maybe resolves the domain for us. Probably exists in a 3rd party crate somewhere. This is so common I've gotta think it is well solved.