Add goerli testnet

Signed-off-by: Igor Mandrigin <i@mandrigin.ru>
This commit is contained in:
Dmitry 2019-03-14 11:22:13 +02:00 committed by Igor Mandrigin
parent 590ba7c874
commit 8014f05837
No known key found for this signature in database
GPG Key ID: 4A0EDDE26E66BC8B
2 changed files with 16 additions and 3 deletions

View File

@ -83,7 +83,18 @@
: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",
:name "Goerli with upstream RPC",
:config {:NetworkId (ethereum/chain-keyword->chain-id :goerli)
:DataDir "/ethereum/goerli_rpc"
:UpstreamConfig {:Enabled true
:URL "https://goerli.blockscout.com/"}}}})
(defn network-enabled? [network] (defn network-enabled? [network]
(let [rpc-network? (get-in (val network) [:config :UpstreamConfig :Enabled]) (let [rpc-network? (get-in (val network) [:config :UpstreamConfig :Enabled])

View File

@ -11,7 +11,8 @@
:testnet {:id 3 :name "Ropsten"} :testnet {:id 3 :name "Ropsten"}
:rinkeby {:id 4 :name "Rinkeby"} :rinkeby {:id 4 :name "Rinkeby"}
:xdai {:id 100 :name "xDai"} :xdai {:id 100 :name "xDai"}
:poa {:id 99 :name "POA"}}) :poa {:id 99 :name "POA"}
:goerli {:id 5 :name "Goerli"}})
(defn chain-id->chain-keyword [i] (defn chain-id->chain-keyword [i]
(or (some #(when (= i (:id (val %))) (key %)) chains) (or (some #(when (= i (:id (val %))) (key %)) chains)
@ -22,7 +23,8 @@
(defn testnet? [id] (defn testnet? [id]
(contains? #{(chain-keyword->chain-id :testnet) (contains? #{(chain-keyword->chain-id :testnet)
(chain-keyword->chain-id :rinkeby)} id)) (chain-keyword->chain-id :rinkeby)
(chain-keyword->chain-id :goerli)} id))
(defn sidechain? [id] (defn sidechain? [id]
(contains? #{(chain-keyword->chain-id :xdai) (contains? #{(chain-keyword->chain-id :xdai)