mirror of
https://github.com/status-im/status-react.git
synced 2025-01-10 19:16:59 +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) {
|
||||
|
||||
}
|
||||
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);
|
||||
|
||||
@ -237,7 +247,16 @@ class StatusModule extends ReactContextBaseJavaModule implements LifecycleEventL
|
||||
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);
|
||||
if (res.startsWith("{\"error\":\"\"")) {
|
||||
|
@ -205,6 +205,7 @@ RCT_EXPORT_METHOD(startNode:(NSString *)configString) {
|
||||
[resultingConfigJson setValue:logUrl.path forKey:@"LogFile"];
|
||||
[resultingConfigJson setValue:([logLevel length] == 0 ? [NSString stringWithUTF8String: "ERROR"] : logLevel) forKey:@"LogLevel"];
|
||||
|
||||
[resultingConfigJson setValue:[NSNumber numberWithBool:YES] forKeyPath:@"WhisperConfig.LightClient"];
|
||||
if(upstreamURL != nil) {
|
||||
[resultingConfigJson setValue:[NSNumber numberWithBool:YES] forKeyPath:@"UpstreamConfig.Enabled"];
|
||||
[resultingConfigJson setValue:upstreamURL forKeyPath:@"UpstreamConfig.URL"];
|
||||
|
Loading…
x
Reference in New Issue
Block a user