drop les
Signed-off-by: Andrey Shovkoplyas <motor4ik@gmail.com>
This commit is contained in:
parent
2ddfcd4f88
commit
da4d95d85c
|
@ -1,54 +0,0 @@
|
||||||
{
|
|
||||||
"fleets": {
|
|
||||||
"les.dev.ropsten": {
|
|
||||||
"boot": {
|
|
||||||
"node-01.do-ams3.les-rops.misc": "enode://bc827e035cf3a42c249374be7ddc9c2fb819765c440116cf01aa6a8d70d03043d29ccd42b32a283f5ab08294467eb3b92fc40111e9af1770c84bc116edae89c0@104.248.199.52:30303",
|
|
||||||
"node-02.do-ams3.les-rops.misc": "enode://52018eb510f8d3321e68e003de14b151ed31c76b98d760f48d4de6b5d3a1ce39d18e4685b87001cebf582eb0cf9debc3c35b84509e476f00324f4c10347a33ab@104.248.199.213:30303",
|
|
||||||
"node-03.do-ams3.les-rops.misc": "enode://690c93ac2f6e6f711a175cc6a73a3cf3b649eea83c458ce34364c69d1b557bb408693f06bdf6fc31538a744d5c231fdd904cce5665d04ce165032c0fc009a208@104.248.199.160:30303"
|
|
||||||
},
|
|
||||||
"static": {
|
|
||||||
"node-01.do-ams3.les-rops.misc": "enode://bc827e035cf3a42c249374be7ddc9c2fb819765c440116cf01aa6a8d70d03043d29ccd42b32a283f5ab08294467eb3b92fc40111e9af1770c84bc116edae89c0@104.248.199.52:30303",
|
|
||||||
"node-02.do-ams3.les-rops.misc": "enode://52018eb510f8d3321e68e003de14b151ed31c76b98d760f48d4de6b5d3a1ce39d18e4685b87001cebf582eb0cf9debc3c35b84509e476f00324f4c10347a33ab@104.248.199.213:30303",
|
|
||||||
"node-03.do-ams3.les-rops.misc": "enode://690c93ac2f6e6f711a175cc6a73a3cf3b649eea83c458ce34364c69d1b557bb408693f06bdf6fc31538a744d5c231fdd904cce5665d04ce165032c0fc009a208@104.248.199.160:30303"
|
|
||||||
},
|
|
||||||
"mail": {
|
|
||||||
"mail-01.ac-cn-hongkong-c.eth.beta": "enode://da61e9eff86a56633b635f887d8b91e0ff5236bbc05b8169834292e92afb92929dcf6efdbf373a37903da8fe0384d5a0a8247e83f1ce211aa429200b6d28c548@47.91.156.93:30504",
|
|
||||||
"mail-01.do-ams3.eth.beta": "enode://c42f368a23fa98ee546fd247220759062323249ef657d26d357a777443aec04db1b29a3a22ef3e7c548e18493ddaf51a31b0aed6079bd6ebe5ae838fcfaf3a49@206.189.243.162:30504",
|
|
||||||
"mail-01.gc-us-central1-a.eth.beta": "enode://7de99e4cb1b3523bd26ca212369540646607c721ad4f3e5c821ed9148150ce6ce2e72631723002210fac1fd52dfa8bbdf3555e05379af79515e1179da37cc3db@35.188.19.210:30504",
|
|
||||||
"mail-02.ac-cn-hongkong-c.eth.beta": "enode://744098ab6d3308af5cd03920aea60c46d16b2cd3d33bf367cbaf1d01c2fcd066ff8878576d0967897cd7dbb0e63f873cc0b4f7e4b0f1d7222e6b3451a78d9bda@47.89.20.15:30504",
|
|
||||||
"mail-02.do-ams3.eth.beta": "enode://7aa648d6e855950b2e3d3bf220c496e0cae4adfddef3e1e6062e6b177aec93bc6cdcf1282cb40d1656932ebfdd565729da440368d7c4da7dbd4d004b1ac02bf8@206.189.243.169:30504",
|
|
||||||
"mail-02.gc-us-central1-a.eth.beta": "enode://015e22f6cd2b44c8a51bd7a23555e271e0759c7d7f52432719665a74966f2da456d28e154e836bee6092b4d686fe67e331655586c57b718be3997c1629d24167@35.226.21.19:30504",
|
|
||||||
"mail-03.ac-cn-hongkong-c.eth.beta": "enode://74957e361ab290e6af45a124536bc9adee39fbd2f995a77ace6ed7d05d9a1c7c98b78b2df5f8071c439b9c0afe4a69893ede4ad633473f96bc195ddf33f6ce00@47.52.255.195:30504",
|
|
||||||
"mail-03.do-ams3.eth.beta": "enode://8a64b3c349a2e0ef4a32ea49609ed6eb3364be1110253c20adc17a3cebbc39a219e5d3e13b151c0eee5d8e0f9a8ba2cd026014e67b41a4ab7d1d5dd67ca27427@206.189.243.168:30504",
|
|
||||||
"mail-03.gc-us-central1-a.eth.beta": "enode://531e252ec966b7e83f5538c19bf1cde7381cc7949026a6e499b6e998e695751aadf26d4c98d5a4eabfb7cefd31c3c88d600a775f14ed5781520a88ecd25da3c6@35.225.227.79:30504"
|
|
||||||
},
|
|
||||||
"whisper": {
|
|
||||||
"node-01.ac-cn-hongkong-c.eth.beta": "enode://9c2b82304d988cd78bf290a09b6f81c6ae89e71f9c0f69c41d21bd5cabbd1019522d5d73d7771ea933adf0727de5e847c89e751bd807ba1f7f6fc3a0cd88d997@47.52.91.239:30305",
|
|
||||||
"node-01.do-ams3.eth.beta": "enode://66ba15600cda86009689354c3a77bdf1a97f4f4fb3ab50ffe34dbc904fac561040496828397be18d9744c75881ffc6ac53729ddbd2cdbdadc5f45c400e2622f7@206.189.243.176:30305",
|
|
||||||
"node-01.gc-us-central1-a.eth.beta": "enode://0440117a5bc67c2908fad94ba29c7b7f2c1536e96a9df950f3265a9566bf3a7306ea8ab5a1f9794a0a641dcb1e4951ce7c093c61c0d255f4ed5d2ed02c8fce23@35.224.15.65:30305",
|
|
||||||
"node-02.ac-cn-hongkong-c.eth.beta": "enode://a80eb084f6bf3f98bf6a492fd6ba3db636986b17643695f67f543115d93d69920fb72e349e0c617a01544764f09375bb85f452b9c750a892d01d0e627d9c251e@47.89.16.125:30305",
|
|
||||||
"node-02.do-ams3.eth.beta": "enode://4ea35352702027984a13274f241a56a47854a7fd4b3ba674a596cff917d3c825506431cf149f9f2312a293bb7c2b1cca55db742027090916d01529fe0729643b@206.189.243.178:30305",
|
|
||||||
"node-02.gc-us-central1-a.eth.beta": "enode://552942cc4858073102a6bcd0df9fe4de6d9fc52ddf7363e8e0746eba21b0f98fb37e8270bc629f72cfe29e0b3522afaf51e309a05998736e2c0dad5288991148@130.211.215.133:30305",
|
|
||||||
"node-03.ac-cn-hongkong-c.eth.beta": "enode://aa97756bc147d74be6d07adfc465266e17756339d3d18591f4be9d1b2e80b86baf314aed79adbe8142bcb42bc7bc40e83ee3bbd0b82548e595bf855d548906a1@47.52.188.241:30305",
|
|
||||||
"node-03.do-ams3.eth.beta": "enode://ce559a37a9c344d7109bd4907802dd690008381d51f658c43056ec36ac043338bd92f1ac6043e645b64953b06f27202d679756a9c7cf62fdefa01b2e6ac5098e@206.189.243.179:30305",
|
|
||||||
"node-03.gc-us-central1-a.eth.beta": "enode://b33dc678589931713a085d29f9dc0efee1783dacce1d13696eb5d3a546293198470d97822c40b187336062b39fd3464e9807858109752767d486ea699a6ab3de@35.193.151.184:30305",
|
|
||||||
"node-04.ac-cn-hongkong-c.eth.beta": "enode://f34451823b173dc5f2ac0eec1668fdb13dba9452b174249a7e0272d6dce16fb811a01e623300d1b7a67c240ae052a462bff3f60e4a05e4c4bd23cc27dea57051@47.52.173.66:30305",
|
|
||||||
"node-04.do-ams3.eth.beta": "enode://4e0a8db9b73403c9339a2077e911851750fc955db1fc1e09f81a4a56725946884dd5e4d11258eac961f9078a393c45bcab78dd0e3bc74e37ce773b3471d2e29c@206.189.243.171:30305",
|
|
||||||
"node-04.gc-us-central1-a.eth.beta": "enode://eb4cc33c1948b1f4b9cb8157757645d78acd731cc8f9468ad91cef8a7023e9c9c62b91ddab107043aabc483742ac15cb4372107b23962d3bfa617b05583f2260@146.148.66.209:30305",
|
|
||||||
"node-05.ac-cn-hongkong-c.eth.beta": "enode://7c80e37f324bbc767d890e6381854ef9985d33940285413311e8b5927bf47702afa40cd5d34be9aa6183ac467009b9545e24b0d0bc54ef2b773547bb8c274192@47.91.155.62:30305",
|
|
||||||
"node-05.do-ams3.eth.beta": "enode://a8bddfa24e1e92a82609b390766faa56cf7a5eef85b22a2b51e79b333c8aaeec84f7b4267e432edd1cf45b63a3ad0fc7d6c3a16f046aa6bc07ebe50e80b63b8c@206.189.243.172:30305",
|
|
||||||
"node-05.gc-us-central1-a.eth.beta": "enode://c7e00e5a333527c009a9b8f75659d9e40af8d8d896ebaa5dbdd46f2c58fc010e4583813bc7fc6da98fcf4f9ca7687d37ced8390330ef570d30b5793692875083@35.192.123.253:30305",
|
|
||||||
"node-06.ac-cn-hongkong-c.eth.beta": "enode://4b2530d045b1d9e0e45afa7c008292744fe77675462090b4001f85faf03b87aa79259c8a3d6d64f815520ac76944e795cbf32ff9e2ce9ba38f57af00d1cc0568@47.90.29.122:30305",
|
|
||||||
"node-06.do-ams3.eth.beta": "enode://887cbd92d95afc2c5f1e227356314a53d3d18855880ac0509e0c0870362aee03939d4074e6ad31365915af41d34320b5094bfcc12a67c381788cd7298d06c875@206.189.243.177:30305",
|
|
||||||
"node-06.gc-us-central1-a.eth.beta": "enode://2af8f4f7a0b5aabaf49eb72b9b59474b1b4a576f99a869e00f8455928fa242725864c86bdff95638a8b17657040b21771a7588d18b0f351377875f5b46426594@35.232.187.4:30305",
|
|
||||||
"node-07.ac-cn-hongkong-c.eth.beta": "enode://76ee16566fb45ca7644c8dec7ac74cadba3bfa0b92c566ad07bcb73298b0ffe1315fd787e1f829e90dba5cd3f4e0916e069f14e50e9cbec148bead397ac8122d@47.91.226.75:30305",
|
|
||||||
"node-07.do-ams3.eth.beta": "enode://2b01955d7e11e29dce07343b456e4e96c081760022d1652b1c4b641eaf320e3747871870fa682e9e9cfb85b819ce94ed2fee1ac458904d54fd0b97d33ba2c4a4@206.189.240.70:30305",
|
|
||||||
"node-07.gc-us-central1-a.eth.beta": "enode://19872f94b1e776da3a13e25afa71b47dfa99e658afd6427ea8d6e03c22a99f13590205a8826443e95a37eee1d815fc433af7a8ca9a8d0df7943d1f55684045b7@35.238.60.236:30305"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"meta": {
|
|
||||||
"hostname": "bots-01.gc-us-central1-a.eth.test",
|
|
||||||
"timestamp": "2018-09-03T18:10:52.315172"
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -18,9 +18,7 @@
|
||||||
#{content-type-text content-type-emoji content-type-status})
|
#{content-type-text content-type-emoji content-type-status})
|
||||||
|
|
||||||
(def min-password-length 6)
|
(def min-password-length 6)
|
||||||
(def max-chat-name-length 20)
|
|
||||||
(def max-group-chat-participants 10)
|
(def max-group-chat-participants 10)
|
||||||
(def response-suggesstion-resize-duration 100)
|
|
||||||
(def default-number-of-messages 20)
|
(def default-number-of-messages 20)
|
||||||
(def blocks-per-hour 120)
|
(def blocks-per-hour 120)
|
||||||
(def one-earth-day 86400)
|
(def one-earth-day 86400)
|
||||||
|
@ -34,12 +32,7 @@
|
||||||
(def system "system")
|
(def system "system")
|
||||||
|
|
||||||
(def mainnet-networks
|
(def mainnet-networks
|
||||||
{"mainnet" {:id "mainnet",
|
{"mainnet_rpc" {:id "mainnet_rpc",
|
||||||
:name "Mainnet",
|
|
||||||
:config {:NetworkId (ethereum/chain-keyword->chain-id :mainnet)
|
|
||||||
:DataDir "/ethereum/mainnet"
|
|
||||||
:LightEthConfig {:Enabled true}}}
|
|
||||||
"mainnet_rpc" {:id "mainnet_rpc",
|
|
||||||
:name "Mainnet with upstream RPC",
|
:name "Mainnet with upstream RPC",
|
||||||
:config {:NetworkId (ethereum/chain-keyword->chain-id :mainnet)
|
:config {:NetworkId (ethereum/chain-keyword->chain-id :mainnet)
|
||||||
:DataDir "/ethereum/mainnet_rpc"
|
:DataDir "/ethereum/mainnet_rpc"
|
||||||
|
@ -61,38 +54,18 @@
|
||||||
:URL "https://core.poa.network"}}}})
|
:URL "https://core.poa.network"}}}})
|
||||||
|
|
||||||
(def testnet-networks
|
(def testnet-networks
|
||||||
{"testnet" {:id "testnet",
|
{"testnet_rpc" {:id "testnet_rpc",
|
||||||
:name "Ropsten",
|
|
||||||
:config {:NetworkId (ethereum/chain-keyword->chain-id :testnet)
|
|
||||||
:DataDir "/ethereum/testnet"
|
|
||||||
:LightEthConfig {:Enabled true}}}
|
|
||||||
"testnet_ulc" {:id "testnet_ulc",
|
|
||||||
:name "Ropsten ULC",
|
|
||||||
:config {:NetworkId (ethereum/chain-keyword->chain-id :testnet)
|
|
||||||
:DataDir "/ethereum/testnet_ulc"
|
|
||||||
:LightEthConfig {:Enabled true :ULC true}}}
|
|
||||||
"testnet_rpc" {:id "testnet_rpc",
|
|
||||||
:name "Ropsten with upstream RPC",
|
:name "Ropsten with upstream RPC",
|
||||||
:config {:NetworkId (ethereum/chain-keyword->chain-id :testnet)
|
:config {:NetworkId (ethereum/chain-keyword->chain-id :testnet)
|
||||||
:DataDir "/ethereum/testnet_rpc"
|
:DataDir "/ethereum/testnet_rpc"
|
||||||
:UpstreamConfig {:Enabled true
|
:UpstreamConfig {:Enabled true
|
||||||
:URL "https://ropsten.infura.io/v3/f315575765b14720b32382a61a89341a"}}}
|
:URL "https://ropsten.infura.io/v3/f315575765b14720b32382a61a89341a"}}}
|
||||||
"rinkeby" {:id "rinkeby",
|
|
||||||
:name "Rinkeby",
|
|
||||||
:config {:NetworkId (ethereum/chain-keyword->chain-id :rinkeby)
|
|
||||||
:DataDir "/ethereum/rinkeby"
|
|
||||||
:LightEthConfig {:Enabled true}}}
|
|
||||||
"rinkeby_rpc" {:id "rinkeby_rpc",
|
"rinkeby_rpc" {:id "rinkeby_rpc",
|
||||||
:name "Rinkeby with upstream RPC",
|
:name "Rinkeby with upstream RPC",
|
||||||
:config {:NetworkId (ethereum/chain-keyword->chain-id :rinkeby)
|
:config {:NetworkId (ethereum/chain-keyword->chain-id :rinkeby)
|
||||||
:DataDir "/ethereum/rinkeby_rpc"
|
:DataDir "/ethereum/rinkeby_rpc"
|
||||||
:UpstreamConfig {:Enabled true
|
:UpstreamConfig {:Enabled true
|
||||||
:URL "https://rinkeby.infura.io/v3/f315575765b14720b32382a61a89341a"}}}
|
:URL "https://rinkeby.infura.io/v3/f315575765b14720b32382a61a89341a"}}}
|
||||||
"goerli" {:id "goerli",
|
|
||||||
:name "Goerli",
|
|
||||||
:config {:NetworkId (ethereum/chain-keyword->chain-id :goerli)
|
|
||||||
:DataDir "/ethereum/goerli"
|
|
||||||
:LightEthConfig {:Enabled true}}}
|
|
||||||
"goerli_rpc" {:id "goerli_rpc",
|
"goerli_rpc" {:id "goerli_rpc",
|
||||||
:name "Goerli with upstream RPC",
|
:name "Goerli with upstream RPC",
|
||||||
:config {:NetworkId (ethereum/chain-keyword->chain-id :goerli)
|
:config {:NetworkId (ethereum/chain-keyword->chain-id :goerli)
|
||||||
|
@ -100,24 +73,13 @@
|
||||||
:UpstreamConfig {:Enabled true
|
:UpstreamConfig {:Enabled true
|
||||||
:URL "https://goerli.blockscout.com/"}}}})
|
:URL "https://goerli.blockscout.com/"}}}})
|
||||||
|
|
||||||
(defn network-enabled? [network]
|
|
||||||
(let [rpc-network? (get-in (val network) [:config :UpstreamConfig :Enabled])
|
|
||||||
ropsten? (= (ethereum/chain-keyword->chain-id :testnet)
|
|
||||||
(get-in (val network) [:config :NetworkId]))]
|
|
||||||
(if rpc-network?
|
|
||||||
true
|
|
||||||
(if config/rpc-networks-only?
|
|
||||||
false
|
|
||||||
ropsten?)))) ;; limit LES networks to Ropsten for now.
|
|
||||||
|
|
||||||
(def default-networks
|
(def default-networks
|
||||||
(into {} (filter network-enabled?
|
(merge testnet-networks mainnet-networks sidechain-networks))
|
||||||
(merge testnet-networks mainnet-networks sidechain-networks))))
|
|
||||||
|
|
||||||
(def default-multiaccount-settings
|
(def default-multiaccount-settings
|
||||||
{:web3-opt-in? true
|
{:web3-opt-in? true
|
||||||
:preview-privacy? false
|
:preview-privacy? false
|
||||||
:wallet {:visible-tokens {}}})
|
:wallet {:visible-tokens {}}})
|
||||||
|
|
||||||
(def currencies
|
(def currencies
|
||||||
{:aed {:id :aed :code "AED" :display-name (i18n/label :t/currency-display-name-aed) :symbol "د.إ"}
|
{:aed {:id :aed :code "AED" :display-name (i18n/label :t/currency-display-name-aed) :symbol "د.إ"}
|
||||||
|
|
|
@ -75,13 +75,6 @@
|
||||||
(fn [cofx _]
|
(fn [cofx _]
|
||||||
(init/start-app cofx)))
|
(init/start-app cofx)))
|
||||||
|
|
||||||
;; home screen
|
|
||||||
|
|
||||||
(handlers/register-handler-fx
|
|
||||||
:home.ui/sync-info-pressed
|
|
||||||
(fn [cofx _]
|
|
||||||
(node/display-les-debug-info cofx)))
|
|
||||||
|
|
||||||
;; multiaccounts module
|
;; multiaccounts module
|
||||||
(handlers/register-handler-fx
|
(handlers/register-handler-fx
|
||||||
:multiaccounts.update.callback/published
|
:multiaccounts.update.callback/published
|
||||||
|
|
|
@ -16,18 +16,10 @@
|
||||||
(keyword (or (get settings :fleet)
|
(keyword (or (get settings :fleet)
|
||||||
config/fleet)))
|
config/fleet)))
|
||||||
|
|
||||||
(def fleets-with-les
|
|
||||||
[:les.dev.ropsten :les.dev.mainnet])
|
|
||||||
|
|
||||||
(defn fleet-supports-les? [fleet]
|
|
||||||
(not (nil? (some #(= fleet %) fleets-with-les))))
|
|
||||||
|
|
||||||
(def default-fleets (slurp "resources/config/fleets.json"))
|
(def default-fleets (slurp "resources/config/fleets.json"))
|
||||||
(def default-les-fleets (slurp "resources/config/fleets-les.json"))
|
|
||||||
|
|
||||||
(defn fleets [{:keys [custom-fleets]}]
|
(defn fleets [{:keys [custom-fleets]}]
|
||||||
(as-> [(default-fleets)
|
(as-> [(default-fleets)] $
|
||||||
(default-les-fleets)] $
|
|
||||||
(mapv #(:fleets (types/json->clj %)) $)
|
(mapv #(:fleets (types/json->clj %)) $)
|
||||||
(conj $ custom-fleets)
|
(conj $ custom-fleets)
|
||||||
(reduce merge $)))
|
(reduce merge $)))
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
[re-frame.core :as re-frame]
|
[re-frame.core :as re-frame]
|
||||||
[status-im.ethereum.core :as ethereum]
|
[status-im.ethereum.core :as ethereum]
|
||||||
[status-im.ethereum.json-rpc :as json-rpc]
|
[status-im.ethereum.json-rpc :as json-rpc]
|
||||||
[status-im.fleet.core :as fleet-core]
|
|
||||||
[status-im.i18n :as i18n]
|
[status-im.i18n :as i18n]
|
||||||
[status-im.node.core :as node]
|
[status-im.node.core :as node]
|
||||||
[status-im.ui.screens.navigation :as navigation]
|
[status-im.ui.screens.navigation :as navigation]
|
||||||
|
@ -190,28 +189,7 @@
|
||||||
{:ui/show-error "chain-id already defined"}))
|
{:ui/show-error "chain-id already defined"}))
|
||||||
{:ui/show-error "invalid network parameters"}))
|
{:ui/show-error "invalid network parameters"}))
|
||||||
|
|
||||||
(defn- navigate-to-network-details
|
|
||||||
[cofx network show-warning?]
|
|
||||||
(fx/merge cofx
|
|
||||||
(when show-warning?
|
|
||||||
{:utils/show-popup {:title "LES support is experimental!"
|
|
||||||
:content "Use at your own risk!"}})
|
|
||||||
(navigation/navigate-to-cofx :network-details {:networks/selected-network network})))
|
|
||||||
|
|
||||||
(defn- not-supported-warning [fleet]
|
|
||||||
(str (name fleet) " does not support LES!\n"
|
|
||||||
"Please, select one of the supported fleets:"
|
|
||||||
(map name fleet-core/fleets-with-les)))
|
|
||||||
|
|
||||||
(fx/defn open-network-details
|
(fx/defn open-network-details
|
||||||
{:events [::network-entry-pressed]}
|
{:events [::network-entry-pressed]}
|
||||||
[cofx network]
|
[cofx network]
|
||||||
(let [db (:db cofx)
|
(navigation/navigate-to-cofx cofx :network-details {:networks/selected-network network}))
|
||||||
rpc-network? (get-in network [:config :UpstreamConfig :Enabled] false)
|
|
||||||
fleet (fleet-core/current-fleet db)
|
|
||||||
fleet-supports-les? (fleet-core/fleet-supports-les? fleet)]
|
|
||||||
(if (or rpc-network? fleet-supports-les?)
|
|
||||||
(navigate-to-network-details cofx network (not rpc-network?))
|
|
||||||
;; Otherwise, we show an explanation dialog to a user if the current fleet does not suport LES
|
|
||||||
{:utils/show-popup {:title "LES not supported"
|
|
||||||
:content (not-supported-warning fleet)}})))
|
|
|
@ -29,19 +29,14 @@
|
||||||
(def mainnet?
|
(def mainnet?
|
||||||
#{"mainnet" "mainnet_rpc"})
|
#{"mainnet" "mainnet_rpc"})
|
||||||
|
|
||||||
(defn navigate-to-network [network]
|
|
||||||
(re-frame/dispatch [::network/network-entry-pressed network]))
|
|
||||||
|
|
||||||
(defn render-network [current-network]
|
(defn render-network [current-network]
|
||||||
(fn [{:keys [id name] :as network}]
|
(fn [{:keys [id name] :as network}]
|
||||||
(let [connected? (= id current-network)
|
(let [connected? (= id current-network)]
|
||||||
rpc? (get-in network [:config :UpstreamConfig :Enabled] false)]
|
[list/touchable-item #(re-frame/dispatch [::network/network-entry-pressed network])
|
||||||
[list/touchable-item #(navigate-to-network network)
|
|
||||||
[react/view styles/network-item
|
[react/view styles/network-item
|
||||||
[network-icon connected? 40]
|
[network-icon connected? 40]
|
||||||
[react/view {:padding-horizontal 16}
|
[react/view {:padding-horizontal 16}
|
||||||
[react/text {:style styles/network-item-name-text}
|
[react/text {:style styles/network-item-name-text} name]
|
||||||
(if rpc? name (str name " " "(LES)"))]
|
|
||||||
(when connected?
|
(when connected?
|
||||||
[react/text {:style styles/network-item-connected-text
|
[react/text {:style styles/network-item-connected-text
|
||||||
:accessibility-label :connected-text}
|
:accessibility-label :connected-text}
|
||||||
|
@ -69,4 +64,4 @@
|
||||||
:data (:custom networks)}]
|
:data (:custom networks)}]
|
||||||
:key-fn :id
|
:key-fn :id
|
||||||
:default-separator? true
|
:default-separator? true
|
||||||
:render-fn (render-network current-network)}]]]))
|
:render-fn (render-network current-network)}]]]))
|
|
@ -7,8 +7,7 @@
|
||||||
[status-im.utils.config :as config]
|
[status-im.utils.config :as config]
|
||||||
[status-im.utils.fx :as fx]
|
[status-im.utils.fx :as fx]
|
||||||
[status-im.utils.platform :as utils.platform]
|
[status-im.utils.platform :as utils.platform]
|
||||||
[status-im.utils.types :as types]
|
[status-im.utils.types :as types]))
|
||||||
[status-im.utils.utils :as utils]))
|
|
||||||
|
|
||||||
(defn- add-custom-bootnodes [config network all-bootnodes]
|
(defn- add-custom-bootnodes [config network all-bootnodes]
|
||||||
(let [bootnodes (as-> all-bootnodes $
|
(let [bootnodes (as-> all-bootnodes $
|
||||||
|
@ -75,16 +74,6 @@
|
||||||
(if utils.platform/desktop? ""
|
(if utils.platform/desktop? ""
|
||||||
config/log-level-status-go)))
|
config/log-level-status-go)))
|
||||||
|
|
||||||
(defn- ulc-network? [config]
|
|
||||||
(get-in config [:LightEthConfig :ULC] false))
|
|
||||||
|
|
||||||
(defn- add-ulc-trusted-nodes [config trusted-nodes]
|
|
||||||
(if (ulc-network? config)
|
|
||||||
(-> config
|
|
||||||
(assoc-in [:LightEthConfig :TrustedNodes] trusted-nodes)
|
|
||||||
(assoc-in [:LightEthConfig :MinTrustedFraction] 50))
|
|
||||||
config))
|
|
||||||
|
|
||||||
(defn- get-multiaccount-node-config
|
(defn- get-multiaccount-node-config
|
||||||
[{:keys [multiaccount :networks/networks :networks/current-network]
|
[{:keys [multiaccount :networks/networks :networks/current-network]
|
||||||
:or {current-network config/default-network
|
:or {current-network config/default-network
|
||||||
|
@ -139,31 +128,9 @@
|
||||||
use-custom-bootnodes)
|
use-custom-bootnodes)
|
||||||
(add-custom-bootnodes current-network bootnodes)
|
(add-custom-bootnodes current-network bootnodes)
|
||||||
|
|
||||||
:always
|
|
||||||
(add-ulc-trusted-nodes (vals (:static current-fleet)))
|
|
||||||
|
|
||||||
:always
|
:always
|
||||||
(add-log-level log-level))))
|
(add-log-level log-level))))
|
||||||
|
|
||||||
(defn get-verify-multiaccount-config
|
|
||||||
"Is used when the node has to be started before
|
|
||||||
`VerifyAccountPassword` call."
|
|
||||||
[db network]
|
|
||||||
(-> (get-in (:networks/networks db) [network :config])
|
|
||||||
(get-base-node-config)
|
|
||||||
|
|
||||||
(assoc :ShhextConfig {:BackupDisabledDataDir (utils.platform/no-backup-directory)})
|
|
||||||
(assoc :PFSEnabled false
|
|
||||||
:NoDiscovery true)
|
|
||||||
(add-log-level config/log-level-status-go)))
|
|
||||||
|
|
||||||
(fx/defn update-sync-state
|
|
||||||
[{:keys [db]} error sync-state]
|
|
||||||
{:db (assoc db :node/chain-sync-state
|
|
||||||
(if error
|
|
||||||
{:error error}
|
|
||||||
(when sync-state (js->clj sync-state :keywordize-keys true))))})
|
|
||||||
|
|
||||||
(defn get-new-config
|
(defn get-new-config
|
||||||
[db]
|
[db]
|
||||||
(types/clj->json (get-multiaccount-node-config db)))
|
(types/clj->json (get-multiaccount-node-config db)))
|
||||||
|
@ -188,27 +155,4 @@
|
||||||
(re-frame/reg-fx
|
(re-frame/reg-fx
|
||||||
::prepare-new-config
|
::prepare-new-config
|
||||||
(fn [[config callback]]
|
(fn [[config callback]]
|
||||||
(status/prepare-dir-and-update-config config callback)))
|
(status/prepare-dir-and-update-config config callback)))
|
||||||
|
|
||||||
(re-frame/reg-fx
|
|
||||||
:node/les-show-debug-info
|
|
||||||
(fn [[multiaccount]]
|
|
||||||
#_(.getBalance
|
|
||||||
(.-eth eb3)
|
|
||||||
(:address multiaccount)
|
|
||||||
(fn [error-balance balance]
|
|
||||||
(.getBlockNumber
|
|
||||||
(.-eth eb3)
|
|
||||||
(fn
|
|
||||||
[error-block block]
|
|
||||||
(utils/show-popup
|
|
||||||
"LES sync status"
|
|
||||||
(str
|
|
||||||
"* multiaccount=" (:address multiaccount) "\n"
|
|
||||||
"* latest block=" (or error-block block) "\n"
|
|
||||||
"* balance=" (or error-balance balance) "\n"
|
|
||||||
"* eth_getSyncing=" (or chain-sync-state "false")))))))))
|
|
||||||
|
|
||||||
(defn display-les-debug-info
|
|
||||||
[{{:keys [multiaccount]} :db}]
|
|
||||||
{:node/les-show-debug-info [multiaccount]})
|
|
|
@ -1,38 +1,8 @@
|
||||||
(ns status-im.protocol.core
|
(ns status-im.protocol.core
|
||||||
(:require [status-im.constants :as constants]
|
(:require [status-im.constants :as constants]
|
||||||
[status-im.mailserver.core :as mailserver]
|
|
||||||
[status-im.node.core :as node]
|
|
||||||
[status-im.transport.core :as transport]
|
[status-im.transport.core :as transport]
|
||||||
[status-im.utils.fx :as fx]))
|
[status-im.utils.fx :as fx]))
|
||||||
|
|
||||||
;;TODO move this logic to status-go
|
|
||||||
(fx/defn update-sync-state
|
|
||||||
[{{:keys [sync-state sync-data] :as db} :db} error sync]
|
|
||||||
(let [{:keys [highestBlock currentBlock] :as state}
|
|
||||||
(js->clj sync :keywordize-keys true)
|
|
||||||
syncing? (> (- highestBlock currentBlock) constants/blocks-per-hour)
|
|
||||||
new-state (cond
|
|
||||||
error :offline
|
|
||||||
syncing? (if (= sync-state :done)
|
|
||||||
:pending
|
|
||||||
:in-progress)
|
|
||||||
:else (if (or (= sync-state :done)
|
|
||||||
(= sync-state :pending))
|
|
||||||
:done
|
|
||||||
:synced))]
|
|
||||||
{:db (cond-> db
|
|
||||||
(and (not= sync-data state) (= :in-progress new-state))
|
|
||||||
(assoc :sync-data state)
|
|
||||||
(not= sync-state new-state)
|
|
||||||
(assoc :sync-state new-state))}))
|
|
||||||
|
|
||||||
(fx/defn update-syncing-progress
|
|
||||||
{:events [:ethereum.callback/get-syncing-success]}
|
|
||||||
[cofx error sync]
|
|
||||||
(fx/merge cofx
|
|
||||||
(update-sync-state error sync)
|
|
||||||
(node/update-sync-state error sync)))
|
|
||||||
|
|
||||||
(defn add-custom-mailservers
|
(defn add-custom-mailservers
|
||||||
[db custom-mailservers]
|
[db custom-mailservers]
|
||||||
(reduce (fn [db {:keys [fleet] :as mailserver}]
|
(reduce (fn [db {:keys [fleet] :as mailserver}]
|
||||||
|
|
|
@ -78,7 +78,6 @@
|
||||||
(reg-root-key-sub :dimensions/window :dimensions/window)
|
(reg-root-key-sub :dimensions/window :dimensions/window)
|
||||||
(reg-root-key-sub :initial-props :initial-props)
|
(reg-root-key-sub :initial-props :initial-props)
|
||||||
(reg-root-key-sub :fleets/custom-fleets :custom-fleets)
|
(reg-root-key-sub :fleets/custom-fleets :custom-fleets)
|
||||||
(reg-root-key-sub :chain-sync-state :node/chain-sync-state)
|
|
||||||
(reg-root-key-sub :desktop/desktop :desktop/desktop)
|
(reg-root-key-sub :desktop/desktop :desktop/desktop)
|
||||||
(reg-root-key-sub :desktop :desktop)
|
(reg-root-key-sub :desktop :desktop)
|
||||||
(reg-root-key-sub :animations :animations)
|
(reg-root-key-sub :animations :animations)
|
||||||
|
@ -445,11 +444,6 @@
|
||||||
(fn [acc]
|
(fn [acc]
|
||||||
(get acc :settings)))
|
(get acc :settings)))
|
||||||
|
|
||||||
(re-frame/reg-sub
|
|
||||||
:latest-block-number
|
|
||||||
(fn [{:node/keys [latest-block-number]} _]
|
|
||||||
(if latest-block-number latest-block-number 0)))
|
|
||||||
|
|
||||||
(re-frame/reg-sub
|
(re-frame/reg-sub
|
||||||
:settings/current-log-level
|
:settings/current-log-level
|
||||||
:<- [:multiaccount-settings]
|
:<- [:multiaccount-settings]
|
||||||
|
|
|
@ -12,7 +12,6 @@
|
||||||
[status-im.ui.screens.home.styles :as styles]
|
[status-im.ui.screens.home.styles :as styles]
|
||||||
[status-im.ui.screens.home.filter.views :as filter.views]
|
[status-im.ui.screens.home.filter.views :as filter.views]
|
||||||
[status-im.utils.platform :as platform]
|
[status-im.utils.platform :as platform]
|
||||||
[status-im.utils.utils :as utils]
|
|
||||||
[status-im.ui.components.tabbar.styles :as tabs.styles]
|
[status-im.ui.components.tabbar.styles :as tabs.styles]
|
||||||
[status-im.ui.screens.home.views.inner-item :as inner-item]
|
[status-im.ui.screens.home.views.inner-item :as inner-item]
|
||||||
[status-im.ui.components.common.common :as components.common]
|
[status-im.ui.components.common.common :as components.common]
|
||||||
|
@ -22,19 +21,6 @@
|
||||||
[status-im.ui.components.colors :as colors])
|
[status-im.ui.components.colors :as colors])
|
||||||
(:require-macros [status-im.utils.views :as views]))
|
(:require-macros [status-im.utils.views :as views]))
|
||||||
|
|
||||||
(views/defview les-debug-info []
|
|
||||||
(views/letsubs [sync-state [:chain-sync-state]
|
|
||||||
latest-block-number [:latest-block-number]
|
|
||||||
{:keys [rpc-network?] :as network} [:current-network]]
|
|
||||||
(when (and network (not rpc-network?))
|
|
||||||
[react/view {:style styles/sync-wrapper}
|
|
||||||
[react/touchable-highlight {:on-press #(re-frame/dispatch [:home.ui/sync-info-pressed])}
|
|
||||||
[react/text {:style styles/sync-info}
|
|
||||||
(str "LES: 'latest' #" latest-block-number "\n"
|
|
||||||
(if sync-state
|
|
||||||
(str "syncing " (:currentBlock sync-state) " of " (:highestBlock sync-state) " blocks...")
|
|
||||||
(str "not syncing")))]]])))
|
|
||||||
|
|
||||||
(defn welcome []
|
(defn welcome []
|
||||||
[react/view {:style styles/welcome-view}
|
[react/view {:style styles/welcome-view}
|
||||||
[react/view {:flex 1}]
|
[react/view {:flex 1}]
|
||||||
|
|
|
@ -10,8 +10,7 @@
|
||||||
#{:eth.beta
|
#{:eth.beta
|
||||||
:eth.staging
|
:eth.staging
|
||||||
:eth.test
|
:eth.test
|
||||||
:eth.contract
|
:eth.contract}
|
||||||
:les.dev.ropsten}
|
|
||||||
(into #{}
|
(into #{}
|
||||||
(keys (fleet/fleets {})))))))
|
(keys (fleet/fleets {})))))))
|
||||||
(testing "passing a custom fleet"
|
(testing "passing a custom fleet"
|
||||||
|
|
Loading…
Reference in New Issue