mirror of
https://github.com/status-im/status-mobile.git
synced 2025-02-02 11:57:04 +00:00
Pass WhisperConfig.LightClient: true
in node config. Closes #3442
- Add code to completely dump the JSON config, not just the first 4000 characters. Signed-off-by: Julien Eluard <julien.eluard@gmail.com>
This commit is contained in:
parent
a86e59dbbe
commit
bb2a008a27
@ -228,6 +228,16 @@ class StatusModule extends ReactContextBaseJavaModule implements LifecycleEventL
|
|||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
JSONObject whisperConfig = (JSONObject) jsonConfig.get("WhisperConfig");
|
||||||
|
if (whisperConfig == null) {
|
||||||
|
whisperConfig = new JSONObject();
|
||||||
|
}
|
||||||
|
whisperConfig.put("LightClient", true);
|
||||||
|
jsonConfig.put("WhisperConfig", whisperConfig);
|
||||||
|
} catch (Exception e) {
|
||||||
|
|
||||||
}
|
}
|
||||||
jsonConfig.put("KeyStoreDir", newKeystoreDir);
|
jsonConfig.put("KeyStoreDir", newKeystoreDir);
|
||||||
|
|
||||||
@ -237,7 +247,16 @@ class StatusModule extends ReactContextBaseJavaModule implements LifecycleEventL
|
|||||||
Log.d(TAG, "Default configuration will be used");
|
Log.d(TAG, "Default configuration will be used");
|
||||||
}
|
}
|
||||||
|
|
||||||
Log.d(TAG, "Node config " + config);
|
String configOutput = config;
|
||||||
|
final int maxOutputLen = 4000;
|
||||||
|
while (!configOutput.isEmpty()) {
|
||||||
|
Log.d(TAG, "Node config:" + configOutput.substring(0, Math.min(maxOutputLen, configOutput.length())));
|
||||||
|
if (configOutput.length() > maxOutputLen) {
|
||||||
|
configOutput = configOutput.substring(maxOutputLen);
|
||||||
|
} else {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
String res = Statusgo.StartNode(config);
|
String res = Statusgo.StartNode(config);
|
||||||
if (res.startsWith("{\"error\":\"\"")) {
|
if (res.startsWith("{\"error\":\"\"")) {
|
||||||
|
@ -205,6 +205,7 @@ RCT_EXPORT_METHOD(startNode:(NSString *)configString) {
|
|||||||
[resultingConfigJson setValue:logUrl.path forKey:@"LogFile"];
|
[resultingConfigJson setValue:logUrl.path forKey:@"LogFile"];
|
||||||
[resultingConfigJson setValue:([logLevel length] == 0 ? [NSString stringWithUTF8String: "ERROR"] : logLevel) forKey:@"LogLevel"];
|
[resultingConfigJson setValue:([logLevel length] == 0 ? [NSString stringWithUTF8String: "ERROR"] : logLevel) forKey:@"LogLevel"];
|
||||||
|
|
||||||
|
[resultingConfigJson setValue:[NSNumber numberWithBool:YES] forKeyPath:@"WhisperConfig.LightClient"];
|
||||||
if(upstreamURL != nil) {
|
if(upstreamURL != nil) {
|
||||||
[resultingConfigJson setValue:[NSNumber numberWithBool:YES] forKeyPath:@"UpstreamConfig.Enabled"];
|
[resultingConfigJson setValue:[NSNumber numberWithBool:YES] forKeyPath:@"UpstreamConfig.Enabled"];
|
||||||
[resultingConfigJson setValue:upstreamURL forKeyPath:@"UpstreamConfig.URL"];
|
[resultingConfigJson setValue:upstreamURL forKeyPath:@"UpstreamConfig.URL"];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user