diff --git a/ci/Jenkinsfile.android b/ci/Jenkinsfile.android index e2db414185..a2762bf13d 100644 --- a/ci/Jenkinsfile.android +++ b/ci/Jenkinsfile.android @@ -1,4 +1,4 @@ -library 'status-react-jenkins@v1.1.6' +library 'status-react-jenkins@v1.1.7' pipeline { agent { label 'linux' } diff --git a/ci/Jenkinsfile.combined b/ci/Jenkinsfile.combined index 7a91e64e4b..a594f33412 100644 --- a/ci/Jenkinsfile.combined +++ b/ci/Jenkinsfile.combined @@ -1,4 +1,4 @@ -library 'status-react-jenkins@v1.1.6' +library 'status-react-jenkins@v1.1.7' pipeline { agent { label 'linux' } diff --git a/ci/Jenkinsfile.ios b/ci/Jenkinsfile.ios index 9eeae4486a..901275ac1d 100644 --- a/ci/Jenkinsfile.ios +++ b/ci/Jenkinsfile.ios @@ -1,4 +1,4 @@ -library 'status-react-jenkins@v1.1.6' +library 'status-react-jenkins@v1.1.7' pipeline { agent { label 'macos-xcode-11.4.1' } @@ -77,7 +77,7 @@ pipeline { stage('Build') { stages { stage('JSBundle') { steps { - script { sh 'make jsbundle-ios' } + script { ios.jsbundle() } } } stage('Bundle') { diff --git a/ci/Jenkinsfile.linux b/ci/Jenkinsfile.linux index cae829e013..929027633d 100644 --- a/ci/Jenkinsfile.linux +++ b/ci/Jenkinsfile.linux @@ -1,4 +1,4 @@ -library 'status-react-jenkins@v1.1.6' +library 'status-react-jenkins@v1.1.7' pipeline { agent { label 'linux' } diff --git a/ci/Jenkinsfile.macos b/ci/Jenkinsfile.macos index 9687385ea7..8e649ffcb7 100644 --- a/ci/Jenkinsfile.macos +++ b/ci/Jenkinsfile.macos @@ -1,4 +1,4 @@ -library 'status-react-jenkins@v1.1.6' +library 'status-react-jenkins@v1.1.7' pipeline { agent { label 'macos-xcode-11.4.1' } diff --git a/ci/Jenkinsfile.nix-cache b/ci/Jenkinsfile.nix-cache index 3ba1b16a43..915be25412 100644 --- a/ci/Jenkinsfile.nix-cache +++ b/ci/Jenkinsfile.nix-cache @@ -1,4 +1,4 @@ -library 'status-react-jenkins@v1.1.6' +library 'status-react-jenkins@v1.1.7' pipeline { agent { label params.AGENT_LABEL } diff --git a/ci/Jenkinsfile.windows b/ci/Jenkinsfile.windows index 81bcd15665..d4e658697e 100644 --- a/ci/Jenkinsfile.windows +++ b/ci/Jenkinsfile.windows @@ -1,4 +1,4 @@ -library 'status-react-jenkins@v1.1.6' +library 'status-react-jenkins@v1.1.7' pipeline { agent { label 'linux' } diff --git a/ci/tools/Jenkinsfile.fastlane-clean b/ci/tools/Jenkinsfile.fastlane-clean index 7009d5b7dc..b320eae5d3 100644 --- a/ci/tools/Jenkinsfile.fastlane-clean +++ b/ci/tools/Jenkinsfile.fastlane-clean @@ -1,4 +1,4 @@ -library 'status-react-jenkins@v1.1.6' +library 'status-react-jenkins@v1.1.7' pipeline { agent { label 'macos' } diff --git a/ci/tools/Jenkinsfile.playstore-meta b/ci/tools/Jenkinsfile.playstore-meta index a37e8be797..e6b4fc38a6 100644 --- a/ci/tools/Jenkinsfile.playstore-meta +++ b/ci/tools/Jenkinsfile.playstore-meta @@ -1,4 +1,4 @@ -library 'status-react-jenkins@v1.1.6' +library 'status-react-jenkins@v1.1.7' pipeline { agent { label 'linux' } diff --git a/shadow-cljs.edn b/shadow-cljs.edn index f117b31a38..5dcc0b8c31 100644 --- a/shadow-cljs.edn +++ b/shadow-cljs.edn @@ -36,6 +36,7 @@ {:target :react-native :output-dir "app" :init-fn status-im.core/init + :closure-defines {"status-im.utils.config/INFURA_TOKEN" #shadow/env "INFURA_TOKEN"} :dev {:devtools {:after-load status-im.reloader/reload :preloads [re-frisk-remote.preload]} :compiler-options {:closure-defines @@ -63,6 +64,7 @@ {:output-to "target/test/test.js" :output-dir "target/test" :optimizations :simple + :closure-defines {status-im.utils.config/INFURA_TOKEN #shadow/env "INFURA_TOKEN"} :target :node-test :compiler-options {;; needed because we override require and it ;; messes with source-map which reports callstack diff --git a/src/status_im/constants.cljs b/src/status_im/constants.cljs index 9ff808aa08..6807068e15 100644 --- a/src/status_im/constants.cljs +++ b/src/status_im/constants.cljs @@ -45,7 +45,7 @@ (def system "system") -(def mainnet-rpc-url "https://mainnet.infura.io/v3/f315575765b14720b32382a61a89341a") +(def mainnet-rpc-url (str "https://mainnet.infura.io/v3/" config/INFURA_TOKEN)) (def mainnet-networks [{:id "mainnet_rpc", @@ -77,14 +77,14 @@ :config {:NetworkId (ethereum/chain-keyword->chain-id :testnet) :DataDir "/ethereum/testnet_rpc" :UpstreamConfig {:Enabled true - :URL "https://ropsten.infura.io/v3/f315575765b14720b32382a61a89341a"}}} + :URL (str "https://ropsten.infura.io/v3/" config/INFURA_TOKEN)}}} {:id "rinkeby_rpc", :etherscan-link "https://rinkeby.etherscan.io/address/", :name "Rinkeby with upstream RPC", :config {:NetworkId (ethereum/chain-keyword->chain-id :rinkeby) :DataDir "/ethereum/rinkeby_rpc" :UpstreamConfig {:Enabled true - :URL "https://rinkeby.infura.io/v3/f315575765b14720b32382a61a89341a"}}} + :URL (str "https://rinkeby.infura.io/v3/" config/INFURA_TOKEN)}}} {:id "goerli_rpc", :etherscan-link "https://goerli.etherscan.io/address/", :name "Goerli with upstream RPC", diff --git a/src/status_im/multiaccounts/login/core.cljs b/src/status_im/multiaccounts/login/core.cljs index 53b04c9e35..f6f3a6db37 100644 --- a/src/status_im/multiaccounts/login/core.cljs +++ b/src/status_im/multiaccounts/login/core.cljs @@ -20,9 +20,7 @@ [status-im.stickers.core :as stickers] [status-im.ui.screens.mobile-network-settings.events :as mobile-network] [status-im.navigation :as navigation] - [status-im.utils.config :as config] [status-im.utils.fx :as fx] - [status-im.utils.handlers :as handlers] [status-im.utils.identicon :as identicon] [status-im.utils.keychain.core :as keychain] [status-im.utils.logging.core :as logging] @@ -34,25 +32,11 @@ [status-im.wallet.prices :as prices] [taoensso.timbre :as log])) -(def rpc-endpoint "https://goerli.infura.io/v3/f315575765b14720b32382a61a89341a") -(def contract-address "0xfbf4c8e2B41fAfF8c616a0E49Fb4365a5355Ffaf") -(def contract-fleet? #{:eth.contract}) - -(defn fetch-nodes [current-fleet resolve _] +(defn fetch-nodes [_ resolve _] (let [default-nodes (-> (node/fleets {}) (get-in [:eth.staging :mail]) vals)] - (if config/contract-nodes-enabled? - (do - (log/debug "fetching contract fleet" current-fleet) - (status/get-nodes-from-contract - rpc-endpoint - contract-address - (handlers/response-handler resolve - (fn [_] - (log/warn "could not fetch nodes from contract defaulting to eth.staging") - (resolve default-nodes))))) - (resolve default-nodes)))) + (resolve default-nodes))) (re-frame/reg-fx ::login diff --git a/src/status_im/network/core_test.cljs b/src/status_im/network/core_test.cljs index 42874af068..1c4df48307 100644 --- a/src/status_im/network/core_test.cljs +++ b/src/status_im/network/core_test.cljs @@ -21,7 +21,7 @@ (testing "an https url" (is (network.core/valid-rpc-url? "https://valid.something.else"))) (testing "a fully qualified url" - (is (network.core/valid-rpc-url? "https://mainnet.infura.io:6523/v3/f315575765b14720b32382a61a89341a"))) + (is (network.core/valid-rpc-url? "https://mainnet.infura.io:6523/v3/some-token"))) (testing "an ip address" (is (network.core/valid-rpc-url? "https://192.168.1.1"))) (testing "localhost" diff --git a/src/status_im/utils/config.cljs b/src/status_im/utils/config.cljs index f8f23b3a95..49ce086c27 100644 --- a/src/status_im/utils/config.cljs +++ b/src/status_im/utils/config.cljs @@ -17,6 +17,8 @@ ;; NOTE(oskarth): Feature flag deprecation lifecycles. We want to make sure ;; flags stay up to date and are removed once behavior introduced is stable. +(goog-define INFURA_TOKEN "40ec14d9d9384d52b7fbcfecdde4e2c0") + (def bootnodes-settings-enabled? (enabled? (get-config :BOOTNODES_SETTINGS_ENABLED "1"))) (def rpc-networks-only? (enabled? (get-config :RPC_NETWORKS_ONLY "1"))) (def mailserver-confirmations-enabled? (enabled? (get-config :MAILSERVER_CONFIRMATIONS_ENABLED))) @@ -28,7 +30,6 @@ (def erc20-contract-warnings-enabled? (enabled? (get-config :ERC20_CONTRACT_WARNINGS))) (def tr-to-talk-enabled? (enabled? (get-config :TRIBUTE_TO_TALK 0))) (def max-message-delivery-attempts (js/parseInt (get-config :MAX_MESSAGE_DELIVERY_ATTEMPTS "6"))) -(def contract-nodes-enabled? (enabled? (get-config :CONTRACT_NODES "0"))) (def mobile-ui-for-desktop? (enabled? (get-config :MOBILE_UI_FOR_DESKTOP "0"))) ;; NOTE: only disabled in releases (def local-notifications? (enabled? (get-config :LOCAL_NOTIFICATIONS "1")))