chore(dev): add STATUS_PORT env var forwarding to status-go

This commit is contained in:
Stefan 2022-09-22 19:08:24 +02:00 committed by Iuri Matias
parent a9d2ecf839
commit b0a0b1d4e4
3 changed files with 6 additions and 7 deletions

View File

@ -607,7 +607,7 @@ run: $(RUN_TARGET)
ICON_TOOL := node_modules/.bin/fileicon
# Currently not in use: https://github.com/status-im/status-desktop/pull/1858
# Will only work at password login. Keycard login doesn't forward the configuration
# STATUS_PORT ?= 30306
run-linux: nim_status_client

View File

@ -180,8 +180,6 @@ var NODE_CONFIG* = %* {
"EnableNTPSync": true,
"KeyStoreDir": "./keystore",
"IPFSDir": "./ipfs",
# TODO: commented since it's not necessary (we do the connections thru C bindings). Enable it thru an option once status-nodes are able to be configured in desktop
#"ListenAddr": ":30304",
"LogEnabled": true,
"LogFile": "geth.log",
"LogLevel": $LogLevel.INFO,

View File

@ -284,9 +284,6 @@ proc getDefaultNodeConfig*(self: Service, installationId: string): JsonNode =
result["ClusterConfig"]["FilterNodes"] = %* self.fleetConfiguration.getNodes(fleet, FleetNodes.Waku)
result["ClusterConfig"]["LightpushNodes"] = %* self.fleetConfiguration.getNodes(fleet, FleetNodes.Waku)
# TODO: commented since it's not necessary (we do the connections thru C bindings). Enable it thru an option once status-nodes are able to be configured in desktop
# result["ListenAddr"] = if existsEnv("STATUS_PORT"): newJString("0.0.0.0:" & $getEnv("STATUS_PORT")) else: newJString("0.0.0.0:30305")
result["KeyStoreDir"] = newJString(self.keyStoreDir.replace(main_constants.STATUSGODIR, ""))
proc setLocalAccountSettingsFile(self: Service) =
@ -508,6 +505,10 @@ proc login*(self: Service, account: AccountDto, password: string): string =
"OutputMessageCSVEnabled": output_csv
}
# Source the connection port from the environment for debugging or if default port not accessible
if existsEnv("STATUS_PORT"):
nodeCfg["ListenAddr"] = newJString("0.0.0.0:" & $getEnv("STATUS_PORT"))
let response = status_account.login(account.name, account.keyUid, hashedPassword, thumbnailImage,
largeImage, $nodeCfg)
var error = "response doesn't contain \"error\""
@ -536,7 +537,7 @@ proc loginAccountKeycard*(self: Service, keycardData: KeycardEvent): string =
}
var settingsJson: JsonNode
self.addKeycardDetails(settingsJson, accountDataJson)
let hashedPassword = hashString(keycardData.keyUid) # using hashed keyUid as password
let response = status_account.loginWithKeycard(keycardData.whisperKey.privateKey,