@@ -88,8 +88,8 @@ public void copyDhtServersFromGenesisGlobalConfig(String myGlobalConfigLocation)
88
88
String globalConfigContent = FileUtils .readFileToString (new File (MyLocalTon .getInstance ().getSettings ().getGenesisNode ().getNodeGlobalConfigLocation ()), StandardCharsets .UTF_8 );
89
89
String myConfigContent = FileUtils .readFileToString (new File (myGlobalConfigLocation ), StandardCharsets .UTF_8 );
90
90
log .debug ("Replace current list of dht nodes with a new one" );
91
- String myNodes = MyLocalTonUtils .sbb ( myConfigContent , "\" nodes\" : [" );
92
- String globalNodes = MyLocalTonUtils .sbb ( globalConfigContent , "\" nodes\" : [" );
91
+ String myNodes = MyLocalTonUtils .sbb (myConfigContent , "\" nodes\" : [" );
92
+ String globalNodes = MyLocalTonUtils .sbb (globalConfigContent , "\" nodes\" : [" );
93
93
String replacedLocalConfig = StringUtils .replace (myConfigContent , myNodes , globalNodes );
94
94
FileUtils .writeStringToFile (new File (myGlobalConfigLocation ), replacedLocalConfig , StandardCharsets .UTF_8 );
95
95
// log.debug("dht-nodes updated: {}", Files.readString(Paths.get(myGlobalConfig), StandardCharsets.UTF_8));
@@ -138,12 +138,10 @@ private List<String> generateDhtKeys(Node node, long publicIpNum) throws Excepti
138
138
if (file .length () == 64 ) { //take only hash files
139
139
log .debug ("found keyring file {}" , file );
140
140
141
- if (SystemUtils .IS_OS_WINDOWS ) {
142
- dhtNodes .add (new RandomIdExecutor ().execute (node , "-m" , "dht" , "-k" , node .getDhtServerKeyringDir () + file ,
143
- "-a" , "\" {\\ \" @type\\ \" : \\ \" adnl.addressList\\ \" , \\ \" addrs\\ \" :[{\\ \" @type\\ \" : \\ \" adnl.address.udp\\ \" , \\ \" ip\\ \" : " + publicIpNum + ", \\ \" port\\ \" : " + node .getDhtPort () + " } ], \\ \" version\\ \" : 0, \\ \" reinit_date\\ \" : 0, \\ \" priority\\ \" : 0, \\ \" expire_at\\ \" : 0}\" " ));
141
+ if (SystemUtils .IS_OS_WINDOWS || SystemUtils .IS_OS_LINUX ) {
142
+ 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}\" " ));
144
143
} else {
145
- dhtNodes .add (new RandomIdExecutor ().execute (node , "-m" , "dht" , "-k" , node .getDhtServerKeyringDir () + file ,
146
- "-a" , "{\" @type\" : \" adnl.addressList\" , \" addrs\" :[{\" @type\" : \" adnl.address.udp\" , \" ip\" : " + publicIpNum + ", \" port\" : " + node .getDhtPort () + " } ], \" version\" : 0, \" reinit_date\" : 0, \" priority\" : 0, \" expire_at\" : 0}" ));
144
+ 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}" ));
147
145
}
148
146
}
149
147
}
0 commit comments