Use Infura token pulled from environment

This way we can use different token for e2e, release, and devel builds.

Signed-off-by: Jakub Sokołowski <jakub@status.im>
Signed-off-by: Andrea Maria Piana <andrea.maria.piana@gmail.com>
This commit is contained in:
Andrea Maria Piana 2020-06-19 15:43:24 +02:00
parent 095e8e0fc2
commit 1714970e4e
No known key found for this signature in database
GPG Key ID: AA6CCA6DE0E06424
14 changed files with 20 additions and 33 deletions

View File

@ -1,4 +1,4 @@
library 'status-react-jenkins@v1.1.6'
library 'status-react-jenkins@v1.1.7'
pipeline {
agent { label 'linux' }

View File

@ -1,4 +1,4 @@
library 'status-react-jenkins@v1.1.6'
library 'status-react-jenkins@v1.1.7'
pipeline {
agent { label 'linux' }

View File

@ -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') {

View File

@ -1,4 +1,4 @@
library 'status-react-jenkins@v1.1.6'
library 'status-react-jenkins@v1.1.7'
pipeline {
agent { label 'linux' }

View File

@ -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' }

View File

@ -1,4 +1,4 @@
library 'status-react-jenkins@v1.1.6'
library 'status-react-jenkins@v1.1.7'
pipeline {
agent { label params.AGENT_LABEL }

View File

@ -1,4 +1,4 @@
library 'status-react-jenkins@v1.1.6'
library 'status-react-jenkins@v1.1.7'
pipeline {
agent { label 'linux' }

View File

@ -1,4 +1,4 @@
library 'status-react-jenkins@v1.1.6'
library 'status-react-jenkins@v1.1.7'
pipeline {
agent { label 'macos' }

View File

@ -1,4 +1,4 @@
library 'status-react-jenkins@v1.1.6'
library 'status-react-jenkins@v1.1.7'
pipeline {
agent { label 'linux' }

View File

@ -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

View File

@ -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",

View File

@ -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

View File

@ -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"

View File

@ -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")))