Skip to content

Commit

Permalink
add extra slash (testing)
Browse files Browse the repository at this point in the history
  • Loading branch information
neodix42 committed Dec 22, 2024
1 parent 7b530b8 commit e0cba73
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/main/java/org/ton/executors/dhtserver/DhtServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ public void copyDhtServersFromGenesisGlobalConfig(String myGlobalConfigLocation)
String globalConfigContent = FileUtils.readFileToString(new File(MyLocalTon.getInstance().getSettings().getGenesisNode().getNodeGlobalConfigLocation()), StandardCharsets.UTF_8);
String myConfigContent = FileUtils.readFileToString(new File(myGlobalConfigLocation), StandardCharsets.UTF_8);
log.debug("Replace current list of dht nodes with a new one");
String myNodes = MyLocalTonUtils.sbb( myConfigContent, "\"nodes\": [");
String globalNodes = MyLocalTonUtils.sbb( globalConfigContent, "\"nodes\": [");
String myNodes = MyLocalTonUtils.sbb(myConfigContent, "\"nodes\": [");
String globalNodes = MyLocalTonUtils.sbb(globalConfigContent, "\"nodes\": [");
String replacedLocalConfig = StringUtils.replace(myConfigContent, myNodes, globalNodes);
FileUtils.writeStringToFile(new File(myGlobalConfigLocation), replacedLocalConfig, StandardCharsets.UTF_8);
// log.debug("dht-nodes updated: {}", Files.readString(Paths.get(myGlobalConfig), StandardCharsets.UTF_8));
Expand Down Expand Up @@ -138,12 +138,10 @@ private List<String> generateDhtKeys(Node node, long publicIpNum) throws Excepti
if (file.length() == 64) { //take only hash files
log.debug("found keyring file {}", file);

if (SystemUtils.IS_OS_WINDOWS) {
dhtNodes.add(new RandomIdExecutor().execute(node, "-m", "dht", "-k", node.getDhtServerKeyringDir() + file,
"-a", "\"{\\\"@type\\\": \\\"adnl.addressList\\\", \\\"addrs\\\":[{\\\"@type\\\": \\\"adnl.address.udp\\\", \\\"ip\\\": " + publicIpNum + ", \\\"port\\\": " + node.getDhtPort() + " } ], \\\"version\\\": 0, \\\"reinit_date\\\": 0, \\\"priority\\\": 0, \\\"expire_at\\\": 0}\""));
if (SystemUtils.IS_OS_WINDOWS || SystemUtils.IS_OS_LINUX) {
dhtNodes.add(new RandomIdExecutor().execute(node, "-m", "dht", "-k", node.getDhtServerKeyringDir() + file, "-a", "\"{\\\"@type\\\": \\\"adnl.addressList\\\", \\\"addrs\\\":[{\\\"@type\\\": \\\"adnl.address.udp\\\", \\\"ip\\\": " + publicIpNum + ", \\\"port\\\": " + node.getDhtPort() + " } ], \\\"version\\\": 0, \\\"reinit_date\\\": 0, \\\"priority\\\": 0, \\\"expire_at\\\": 0}\""));
} else {
dhtNodes.add(new RandomIdExecutor().execute(node, "-m", "dht", "-k", node.getDhtServerKeyringDir() + file,
"-a", "{\"@type\": \"adnl.addressList\", \"addrs\":[{\"@type\": \"adnl.address.udp\", \"ip\": " + publicIpNum + ", \"port\": " + node.getDhtPort() + " } ], \"version\": 0, \"reinit_date\": 0, \"priority\": 0, \"expire_at\": 0}"));
dhtNodes.add(new RandomIdExecutor().execute(node, "-m", "dht", "-k", node.getDhtServerKeyringDir() + file, "-a", "{\"@type\": \"adnl.addressList\", \"addrs\":[{\"@type\": \"adnl.address.udp\", \"ip\": " + publicIpNum + ", \"port\": " + node.getDhtPort() + " } ], \"version\": 0, \"reinit_date\": 0, \"priority\": 0, \"expire_at\": 0}"));
}
}
}
Expand Down

0 comments on commit e0cba73

Please sign in to comment.