hide mainnet networks in prod build

This commit is contained in:
Roman Volosovskyi 2017-10-20 09:15:56 +02:00
parent 576ece4032
commit 7dd0ba21a2
5 changed files with 41 additions and 31 deletions

1
.env
View File

@ -4,3 +4,4 @@ DEBUG_LOGS_ENABLED=1
STUB_STATUS_GO=0
NETWORK_SWITCHING=1
ETHEREUM_DEV_CLUSTER=1
MAINNET_NETWORKS_ENABLED=1

View File

@ -4,3 +4,4 @@ DEBUG_LOGS_ENABLED=1
STUB_STATUS_GO=0
NETWORK_SWITCHING=1
ETHEREUM_DEV_CLUSTER=1
MAINNET_NETWORKS_ENABLED=1

View File

@ -4,3 +4,4 @@ DEBUG_LOGS_ENABLED=0
STUB_STATUS_GO=0
NETWORK_SWITCHING=0
ETHEREUM_DEV_CLUSTER=0
MAINNET_NETWORKS_ENABLED=0

View File

@ -1,5 +1,6 @@
(ns status-im.constants
(:require [status-im.utils.types :as types]))
(:require [status-im.utils.types :as types]
[status-im.utils.config :as config]))
(def ethereum-rpc-url "http://localhost:8545")
@ -42,38 +43,43 @@
(= testnet-id rinkeby-id) "Rinkeby"
:else "Unknown"))
(def mainnet-networks
{"mainnet" {:id "mainnet",
:name "Mainnet",
:config {:NetworkId mainnet-id
:DataDir "/ethereum/mainnet"}}
"mainnet_rpc" {:id "mainnet_rpc",
:name "Mainnet with upstream RPC",
:config {:NetworkId mainnet-id
:DataDir "/ethereum/mainnet_rpc"
:UpstreamConfig {:Enabled true
:URL "https://mainnet.infura.io/z6GCTmjdP3FETEJmMBI4"}}}})
(def testnet-networks
{"testnet" {:id "testnet",
:name "Ropsten",
:config {:NetworkId ropsten-id
:DataDir "/ethereum/testnet"}}
"testnet_rpc" {:id "testnet_rpc",
:name "Ropsten with upstream RPC",
:config {:NetworkId ropsten-id
:DataDir "/ethereum/testnet_rpc"
:UpstreamConfig {:Enabled true
:URL "https://ropsten.infura.io/z6GCTmjdP3FETEJmMBI4"}}}
"rinkeby" {:id "rinkeby",
:name "Rinkeby",
:config {:NetworkId rinkeby-id
:DataDir "/ethereum/rinkeby"}}
"rinkeby_rpc" {:id "rinkeby_rpc",
:name "Rinkeby with upstream RPC",
:config {:NetworkId rinkeby-id
:DataDir "/ethereum/rinkeby_rpc"
:UpstreamConfig {:Enabled true
:URL "https://rinkeby.infura.io/z6GCTmjdP3FETEJmMBI4"}}}})
(def default-networks
(transform-config
{"testnet" {:id "testnet",
:name "Ropsten",
:config {:NetworkId ropsten-id
:DataDir "/ethereum/testnet"}}
"testnet_rpc" {:id "testnet_rpc",
:name "Ropsten with upstream RPC",
:config {:NetworkId ropsten-id
:DataDir "/ethereum/testnet_rpc"
:UpstreamConfig {:Enabled true
:URL "https://ropsten.infura.io/z6GCTmjdP3FETEJmMBI4"}}}
"rinkeby" {:id "rinkeby",
:name "Rinkeby",
:config {:NetworkId rinkeby-id
:DataDir "/ethereum/rinkeby"}}
"rinkeby_rpc" {:id "rinkeby_rpc",
:name "Rinkeby with upstream RPC",
:config {:NetworkId rinkeby-id
:DataDir "/ethereum/rinkeby_rpc"
:UpstreamConfig {:Enabled true
:URL "https://rinkeby.infura.io/z6GCTmjdP3FETEJmMBI4"}}}
"mainnet" {:id "mainnet",
:name "Mainnet",
:config {:NetworkId mainnet-id
:DataDir "/ethereum/mainnet"}}
"mainnet_rpc" {:id "mainnet_rpc",
:name "Mainnet with upstream RPC",
:config {:NetworkId mainnet-id
:DataDir "/ethereum/mainnet_rpc"
:UpstreamConfig {:Enabled true
:URL "https://mainnet.infura.io/z6GCTmjdP3FETEJmMBI4 "}}}}))
(merge testnet-networks
(when config/mainnet-networks-enabled? mainnet-networks))))
(def ^:const send-transaction-no-error-code "0")
(def ^:const send-transaction-default-error-code "1")

View File

@ -21,4 +21,5 @@
(def notifications-wip-enabled? (enabled? (get-config :NOTIFICATIONS_WIP_ENABLED 0)))
(def stub-status-go? (enabled? (get-config :STUB_STATUS_GO 0)))
(def network-switching-enabled? (enabled? (get-config :NETWORK_SWITCHING 0)))
(def mainnet-networks-enabled? (enabled? (get-config :MAINNET_NETWORKS_ENABLED 0)))