ULC mode for Ropsten

Signed-off-by: Igor Mandrigin <i@mandrigin.ru>
This commit is contained in:
Igor Mandrigin 2018-10-25 16:20:12 +02:00
parent fecb9bed7e
commit c081f7f49c
No known key found for this signature in database
GPG Key ID: 4A0EDDE26E66BC8B
2 changed files with 18 additions and 0 deletions

View File

@ -70,6 +70,11 @@
: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",
:config {:NetworkId (ethereum/chain-keyword->chain-id :testnet)

View File

@ -77,6 +77,16 @@
(if utils.platform/desktop? ""
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-account-node-config [db address]
(let [accounts (get db :accounts/accounts)
current-fleet-key (fleet/current-fleet db address)
@ -121,6 +131,9 @@
use-custom-bootnodes)
(add-custom-bootnodes network bootnodes)
:always
(add-ulc-trusted-nodes (vals (:static current-fleet)))
:always
(add-log-level log-level))))