chore_: remove passing node config when sync (#20949)
* chore_: remove passing node config when sync
4a43b2b2...01f7787c
* chore_: remove passing deviceType
* chore_: update status-go
* fix_: remove calculating keystorePath and rootDataDir
* chore_: update status-go
* chore_: update status-go to v0.184.43
---------
Co-authored-by: Igor Sirotin <sirotin@status.im>
This commit is contained in:
parent
cd81519e9a
commit
fe28f44d4b
|
@ -36,11 +36,6 @@ class NetworkManager(private val reactContext: ReactApplicationContext) : ReactC
|
|||
@ReactMethod
|
||||
fun inputConnectionStringForBootstrapping(connectionString: String, configJSON: String, callback: Callback) {
|
||||
val jsonConfig = JSONObject(configJSON)
|
||||
val receiverConfig = jsonConfig.getJSONObject("receiverConfig")
|
||||
val keyStorePath = utils.pathCombine(utils.getNoBackupDirectory(), "/keystore")
|
||||
receiverConfig.put("keystorePath", keyStorePath)
|
||||
receiverConfig.getJSONObject("nodeConfig").put("rootDataDir", utils.getNoBackupDirectory())
|
||||
|
||||
utils.executeRunnableStatusGoMethod(
|
||||
{ Statusgo.inputConnectionStringForBootstrapping(connectionString, jsonConfig.toString()) },
|
||||
callback
|
||||
|
|
|
@ -35,21 +35,7 @@ RCT_EXPORT_METHOD(inputConnectionStringForBootstrapping:(NSString *)cs
|
|||
configJSON:(NSString *)configJSON
|
||||
callback:(RCTResponseSenderBlock)callback) {
|
||||
|
||||
NSData *configData = [configJSON dataUsingEncoding:NSUTF8StringEncoding];
|
||||
NSError *error;
|
||||
NSMutableDictionary *configDict = [NSJSONSerialization JSONObjectWithData:configData options:NSJSONReadingMutableContainers error:&error];
|
||||
NSMutableDictionary *receiverConfig = configDict[@"receiverConfig"];
|
||||
NSMutableDictionary *nodeConfig = receiverConfig[@"nodeConfig"];
|
||||
NSFileManager *fileManager = [NSFileManager defaultManager];
|
||||
NSURL *rootUrl =[[fileManager URLsForDirectory:NSLibraryDirectory inDomains:NSUserDomainMask] lastObject];
|
||||
NSURL *multiaccountKeystoreDir = [rootUrl URLByAppendingPathComponent:@"keystore"];
|
||||
NSString *keystoreDir = multiaccountKeystoreDir.path;
|
||||
NSString *rootDataDir = rootUrl.path;
|
||||
|
||||
[receiverConfig setValue:keystoreDir forKey:@"keystorePath"];
|
||||
[nodeConfig setValue:rootDataDir forKey:@"rootDataDir"];
|
||||
NSString *modifiedConfigJSON = [Utils jsonStringWithPrettyPrint:NO fromDictionary:configDict];
|
||||
NSString *result = StatusgoInputConnectionStringForBootstrapping(cs, modifiedConfigJSON);
|
||||
NSString *result = StatusgoInputConnectionStringForBootstrapping(cs, configJSON);
|
||||
callback(@[result]);
|
||||
}
|
||||
|
||||
|
|
|
@ -123,8 +123,6 @@
|
|||
:waku.test
|
||||
["enrtree://AOGYWMBYOUIMOENHXCHILPKY3ZRFEULMFI4DOM442QSZ73TT2A7VI@test.waku.nodes.status.im"]})
|
||||
|
||||
(def default-kdf-iterations 3200)
|
||||
|
||||
(def community-accounts-selection-enabled? true)
|
||||
(def fetch-messages-enabled? (enabled? (get-config :FETCH_MESSAGES_ENABLED "1")))
|
||||
(def test-networks-enabled? (enabled? (get-config :TEST_NETWORKS_ENABLED "0")))
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
[clojure.string :as string]
|
||||
[native-module.core :as native-module]
|
||||
[react-native.platform :as platform]
|
||||
[status-im.config :as config]
|
||||
[status-im.constants :as constants]
|
||||
[status-im.contexts.profile.config :as profile.config]
|
||||
[status-im.contexts.syncing.utils :as sync-utils]
|
||||
[taoensso.timbre :as log]
|
||||
[utils.i18n :as i18n]
|
||||
|
@ -21,26 +21,6 @@
|
|||
{:events [:syncing/clear-states]}
|
||||
[{:keys [db]} role]
|
||||
{:db (dissoc db :syncing)})
|
||||
|
||||
(defn- get-default-node-config
|
||||
[]
|
||||
(let [log-level config/log-level
|
||||
log-config (if (empty? log-level)
|
||||
{:LogLevel "ERROR" :LogEnabled false}
|
||||
{:LogLevel log-level :LogEnabled true})]
|
||||
(merge {:WalletConfig (cond-> {:Enabled true}
|
||||
(not= config/opensea-api-key "")
|
||||
(assoc :OpenseaAPIKey config/opensea-api-key))
|
||||
:WakuV2Config {;; Temporary fix until https://github.com/status-im/status-go/issues/3024
|
||||
;; is resolved
|
||||
:Nameserver "8.8.8.8"
|
||||
:LightClient true}
|
||||
:ShhextConfig {:VerifyTransactionURL config/verify-transaction-url
|
||||
:VerifyENSURL config/verify-ens-url
|
||||
:VerifyENSContractAddress config/verify-ens-contract-address
|
||||
:VerifyTransactionChainID config/verify-transaction-chain-id}}
|
||||
log-config)))
|
||||
|
||||
(defn- input-connection-string-callback
|
||||
[res]
|
||||
(log/info "[local-pairing] input-connection-string-for-bootstrapping callback"
|
||||
|
@ -69,24 +49,15 @@
|
|||
(rf/defn initiate-local-pairing-with-connection-string
|
||||
{:events [:syncing/input-connection-string-for-bootstrapping]}
|
||||
[{:keys [db]} connection-string]
|
||||
(let [default-node-config-string (.stringify js/JSON (clj->js (get-default-node-config)))
|
||||
callback
|
||||
(fn [final-node-config]
|
||||
(let [config-map (.stringify js/JSON
|
||||
(clj->js
|
||||
{:receiverConfig
|
||||
{:kdfIterations config/default-kdf-iterations
|
||||
:nodeConfig final-node-config
|
||||
:settingCurrentNetwork config/default-network
|
||||
:deviceType platform/os
|
||||
:deviceName
|
||||
(native-module/get-installation-name)}}))]
|
||||
(rf/dispatch [:syncing/update-role constants/local-pairing-role-receiver])
|
||||
(native-module/input-connection-string-for-bootstrapping
|
||||
connection-string
|
||||
config-map
|
||||
input-connection-string-callback)))]
|
||||
(native-module/prepare-dir-and-update-config "" default-node-config-string callback)))
|
||||
(let [config-map (.stringify js/JSON
|
||||
(clj->js
|
||||
{:receiverConfig
|
||||
{:createAccount (profile.config/create)}}))]
|
||||
(rf/dispatch [:syncing/update-role constants/local-pairing-role-receiver])
|
||||
(native-module/input-connection-string-for-bootstrapping
|
||||
connection-string
|
||||
config-map
|
||||
input-connection-string-callback)))
|
||||
|
||||
(rf/defn preparations-for-connection-string
|
||||
{:events [:syncing/get-connection-string]}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
"_comment": "Instead use: scripts/update-status-go.sh <rev>",
|
||||
"owner": "status-im",
|
||||
"repo": "status-go",
|
||||
"version": "v0.183.43",
|
||||
"commit-sha1": "1f7816dd1a5dbf8ecc4754fd90eea4431648ff69",
|
||||
"src-sha256": "1qy4h9glx6qhjwrwjjqx0kl292p6psd3iv4zqf666pz3w0kr1nsn"
|
||||
"version": "v0.184.43",
|
||||
"commit-sha1": "d394da0fc169cd432f01e1c3ba4c8490f5a937d1",
|
||||
"src-sha256": "0zf753qjknb55fidskziy4m9flbba0447wk80j8xl02s4j1zp3km"
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue