2017-08-21 14:49:31 +00:00
|
|
|
(ns status-im.constants
|
2017-10-26 13:13:24 +00:00
|
|
|
(:require [status-im.i18n :as i18n]
|
2017-11-22 10:37:20 +00:00
|
|
|
[status-im.utils.ethereum.core :as ethereum]
|
2017-10-26 13:13:24 +00:00
|
|
|
[status-im.utils.types :as types]
|
2017-10-20 07:15:56 +00:00
|
|
|
[status-im.utils.config :as config]))
|
2016-03-23 19:05:42 +00:00
|
|
|
|
|
|
|
(def ethereum-rpc-url "http://localhost:8545")
|
|
|
|
|
2016-06-23 12:52:54 +00:00
|
|
|
(def server-address "http://api.status.im/")
|
2016-04-08 09:17:10 +00:00
|
|
|
;; (def server-address "http://10.0.3.2:3000/")
|
2016-05-19 08:51:13 +00:00
|
|
|
;; (def server-address "http://localhost:3000/")
|
2016-03-28 12:14:57 +00:00
|
|
|
|
|
|
|
(def text-content-type "text/plain")
|
2017-05-21 14:52:52 +00:00
|
|
|
(def content-type-log-message "log-message")
|
2016-04-04 15:19:52 +00:00
|
|
|
(def content-type-command "command")
|
2018-01-16 03:36:48 +00:00
|
|
|
(def content-type-command-request "command-request")
|
2016-04-22 10:51:14 +00:00
|
|
|
(def content-type-status "status")
|
2016-05-25 09:44:00 +00:00
|
|
|
|
2017-11-09 19:23:53 +00:00
|
|
|
(def min-password-length 6)
|
2016-05-25 09:44:00 +00:00
|
|
|
(def max-chat-name-length 20)
|
2016-05-30 13:50:23 +00:00
|
|
|
(def response-suggesstion-resize-duration 100)
|
2016-07-18 13:22:32 +00:00
|
|
|
(def default-number-of-messages 20)
|
2016-10-06 09:52:58 +00:00
|
|
|
(def blocks-per-hour 120)
|
2016-08-19 13:14:59 +00:00
|
|
|
|
2016-09-23 13:22:35 +00:00
|
|
|
(def console-chat-id "console")
|
2017-08-21 14:49:31 +00:00
|
|
|
|
2018-03-28 12:49:53 +00:00
|
|
|
(def default-network config/default-network)
|
2017-10-05 11:23:25 +00:00
|
|
|
|
2017-10-26 13:13:24 +00:00
|
|
|
(def default-wallet-transactions
|
|
|
|
{:filters
|
|
|
|
{:type [{:id :inbound :label (i18n/label :t/incoming) :checked? true}
|
|
|
|
{:id :outbound :label (i18n/label :t/outgoing) :checked? true}
|
|
|
|
{:id :pending :label (i18n/label :t/pending) :checked? true}
|
|
|
|
;; TODO(jeluard) Restore once we support postponing transaction
|
|
|
|
#_
|
|
|
|
{:id :postponed :label (i18n/label :t/postponed) :checked? true}]}})
|
|
|
|
|
2018-03-20 00:59:36 +00:00
|
|
|
(def default-account-settings
|
|
|
|
{:wallet {:visible-tokens {:testnet #{:STT}
|
|
|
|
:mainnet #{:SNT}}}})
|
|
|
|
|
2017-10-05 11:23:25 +00:00
|
|
|
(defn- transform-config [networks]
|
|
|
|
(->> networks
|
|
|
|
(map (fn [[network-name {:keys [config] :as data}]]
|
|
|
|
[network-name (assoc data
|
|
|
|
:config (types/clj->json config)
|
|
|
|
:raw-config config)]))
|
|
|
|
(into {})))
|
|
|
|
|
2017-10-20 07:15:56 +00:00
|
|
|
(def mainnet-networks
|
|
|
|
{"mainnet" {:id "mainnet",
|
|
|
|
:name "Mainnet",
|
2017-12-16 10:00:56 +00:00
|
|
|
:config {:NetworkId (ethereum/chain-keyword->chain-id :mainnet)
|
2017-10-20 07:15:56 +00:00
|
|
|
:DataDir "/ethereum/mainnet"}}
|
|
|
|
"mainnet_rpc" {:id "mainnet_rpc",
|
|
|
|
:name "Mainnet with upstream RPC",
|
2017-12-16 10:00:56 +00:00
|
|
|
:config {:NetworkId (ethereum/chain-keyword->chain-id :mainnet)
|
2017-10-20 07:15:56 +00:00
|
|
|
:DataDir "/ethereum/mainnet_rpc"
|
|
|
|
:UpstreamConfig {:Enabled true
|
|
|
|
:URL "https://mainnet.infura.io/z6GCTmjdP3FETEJmMBI4"}}}})
|
|
|
|
|
|
|
|
(def testnet-networks
|
|
|
|
{"testnet" {:id "testnet",
|
|
|
|
:name "Ropsten",
|
2017-12-16 10:00:56 +00:00
|
|
|
:config {:NetworkId (ethereum/chain-keyword->chain-id :testnet)
|
2017-10-20 07:15:56 +00:00
|
|
|
:DataDir "/ethereum/testnet"}}
|
|
|
|
"testnet_rpc" {:id "testnet_rpc",
|
|
|
|
:name "Ropsten with upstream RPC",
|
2017-12-16 10:00:56 +00:00
|
|
|
:config {:NetworkId (ethereum/chain-keyword->chain-id :testnet)
|
2017-10-20 07:15:56 +00:00
|
|
|
:DataDir "/ethereum/testnet_rpc"
|
|
|
|
:UpstreamConfig {:Enabled true
|
|
|
|
:URL "https://ropsten.infura.io/z6GCTmjdP3FETEJmMBI4"}}}
|
|
|
|
"rinkeby" {:id "rinkeby",
|
|
|
|
:name "Rinkeby",
|
2017-12-16 10:00:56 +00:00
|
|
|
:config {:NetworkId (ethereum/chain-keyword->chain-id :rinkeby)
|
2017-10-20 07:15:56 +00:00
|
|
|
:DataDir "/ethereum/rinkeby"}}
|
|
|
|
"rinkeby_rpc" {:id "rinkeby_rpc",
|
|
|
|
:name "Rinkeby with upstream RPC",
|
2017-12-16 10:00:56 +00:00
|
|
|
:config {:NetworkId (ethereum/chain-keyword->chain-id :rinkeby)
|
2017-10-20 07:15:56 +00:00
|
|
|
:DataDir "/ethereum/rinkeby_rpc"
|
|
|
|
:UpstreamConfig {:Enabled true
|
|
|
|
:URL "https://rinkeby.infura.io/z6GCTmjdP3FETEJmMBI4"}}}})
|
2017-08-21 14:49:31 +00:00
|
|
|
(def default-networks
|
2017-10-05 11:23:25 +00:00
|
|
|
(transform-config
|
2017-10-20 07:15:56 +00:00
|
|
|
(merge testnet-networks
|
|
|
|
(when config/mainnet-networks-enabled? mainnet-networks))))
|
2017-10-04 14:50:17 +00:00
|
|
|
|
2017-12-19 17:40:01 +00:00
|
|
|
;; adamb's status-cluster enode
|
2018-01-16 03:36:48 +00:00
|
|
|
(def default-wnode "main")
|
2017-12-19 17:40:01 +00:00
|
|
|
|
2018-01-16 03:36:48 +00:00
|
|
|
(def default-wnodes
|
2018-02-28 10:39:29 +00:00
|
|
|
{"main" {:id "main"
|
|
|
|
:name "Status mailserver A"
|
|
|
|
:address "enode://fa63a6cc730468c5456eab365b2a7a68a166845423c8c9acc363e5f8c4699ff6d954e7ec58f13ae49568600cff9899561b54f6fc2b9923136cd7104911f31cce@163.172.168.202:30303"}
|
|
|
|
"backup" {:id "backup"
|
|
|
|
:name "Status mailserver B"
|
|
|
|
:address "enode://90cbf961c87eb837adc1300a0a6722a57134d843f0028a976d35dff387f101a2754842b6b694e50a01093808f304440d4d968bcbc599259e895ff26e5a1a17cf@51.15.194.39:30303"}})
|
2017-12-19 17:40:01 +00:00
|
|
|
|
2017-12-27 09:25:39 +00:00
|
|
|
;; TODO(oskarth): Determine if this is the correct topic or not
|
|
|
|
(def inbox-topic "0xaabb11ee")
|
|
|
|
(def inbox-password "status-offline-inbox")
|
|
|
|
|
2017-10-04 14:50:17 +00:00
|
|
|
(def ^:const send-transaction-no-error-code "0")
|
|
|
|
(def ^:const send-transaction-default-error-code "1")
|
|
|
|
(def ^:const send-transaction-password-error-code "2")
|
|
|
|
(def ^:const send-transaction-timeout-error-code "3")
|
|
|
|
(def ^:const send-transaction-discarded-error-code "4")
|