Skip to content

Commit

Permalink
refactor(local pair sync)_: move partial config to backend (#19753)
Browse files Browse the repository at this point in the history
  • Loading branch information
qfrank authored Apr 25, 2024
1 parent 56ff84f commit ce3d32d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ class AccountManager(private val reactContext: ReactApplicationContext) : ReactC

private fun updateConfig(jsonConfigString: String, absRootDirPath: String, keystoreDirPath: String): String {
val jsonConfig = JSONObject(jsonConfigString)
val dataDirPath = jsonConfig.getString("DataDir")
// when doing local pair syncing, backend will provide default data dir
val dataDirPath = jsonConfig.optString("DataDir","")
val logEnabled = jsonConfig.getBoolean("LogEnabled")
val gethLogFile = if (logEnabled) logManager.prepareLogsFile(reactContext) else null
val gethLogDirPath = gethLogFile?.parent
Expand Down Expand Up @@ -140,7 +141,6 @@ class AccountManager(private val reactContext: ReactApplicationContext) : ReactC
updatedJsonConfigString
} catch (e: JSONException) {
Log.e(TAG, "updateConfig failed: ${e.message}")
System.exit(1)
""
}
}
Expand Down
3 changes: 3 additions & 0 deletions modules/react-native-status/ios/RCTStatus/AccountManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ -(NSString *) prepareDirAndUpdateConfig:(NSString *)config
NSData *configData = [config dataUsingEncoding:NSUTF8StringEncoding];
NSDictionary *configJSON = [NSJSONSerialization JSONObjectWithData:configData options:NSJSONReadingMutableContainers error:nil];
NSString *relativeDataDir = [configJSON objectForKey:@"DataDir"];
if (relativeDataDir == nil) {
relativeDataDir = @"";
}
NSString *absDataDir = [rootUrl.path stringByAppendingString:relativeDataDir];
NSURL *absDataDirUrl = [NSURL fileURLWithPath:absDataDir];
NSString *keystoreDir = [@"/keystore/" stringByAppendingString:keyUID];
Expand Down
8 changes: 2 additions & 6 deletions src/legacy/status_im/node/core.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
[clojure.string :as string]
[legacy.status-im.utils.deprecated-types :as types]
[react-native.platform :as platform]
[status-im.config :as config]
[utils.ethereum.chain :as chain]))
[status-im.config :as config]))

(defn- add-log-level
[config log-level]
Expand Down Expand Up @@ -117,10 +116,7 @@
{:keys [installation-id log-level
waku-bloom-filter-mode]}
profile]
(cond-> {:NetworkId (chain/chain-keyword->chain-id :mainnet)
:DataDir "/ethereum/mainnet_rpc"
:UpstreamConfig {:Enabled true
:URL config/mainnet-rpc-url}}
(cond-> {}
:always
(get-base-node-config)

Expand Down
6 changes: 3 additions & 3 deletions status-go-version.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"_comment": "Instead use: scripts/update-status-go.sh <rev>",
"owner": "status-im",
"repo": "status-go",
"version": "v0.179.9",
"commit-sha1": "ebca8b87d1c0a17262c604ea3c07157eaca7a7db",
"src-sha256": "1nf0pz4k502vh1va1pc45birnm3p83y56a82cynj80y1y7rjmc2m"
"version": "v0.179.10",
"commit-sha1": "90b18d4f8801b09f68bb5b794a5b6af92001d26e",
"src-sha256": "0dlrnpr7wj9z2ywm90avgdzdr9wg71dy82v5jjc9wmiz537mn7wy"
}

0 comments on commit ce3d32d

Please sign in to comment.