add predefined ethereum networks

This commit is contained in:
Roman Volosovskyi 2017-10-02 22:26:08 +02:00
parent 8d2992d1a4
commit 4b6f920e43
3 changed files with 26 additions and 12 deletions

2
.env
View File

@ -3,4 +3,4 @@ WALLET_WIP_ENABLED=1
NOTIFICATIONS_WIP_ENABLED=1
DEBUG_LOGS_ENABLED=1
STUB_STATUS_GO=0
NETWORK_SWITCHING=0
NETWORK_SWITCHING=1

View File

@ -30,18 +30,13 @@
(def default-network "testnet_rpc")
(def default-networks
{"mainnet" {:id "mainnet",
:name "Mainnet",
:config (types/clj->json
{:NetworkId 1
:DataDir "/ethereum/mainnet"})}
"testnet" {:id "testnet",
{"testnet" {:id "testnet",
:name "Ropsten",
:config (types/clj->json
{:NetworkId 3
:DataDir "/ethereum/testnet"})}
"testnet_rpc" {:id "testnet_rpc",
:name "Ropsten with RPC",
:name "Ropsten with upstream RPC",
:config (types/clj->json
{:NetworkId 3
:DataDir "/ethereum/testnet_rpc"
@ -51,4 +46,23 @@
:name "Rinkeby",
:config (types/clj->json
{:NetworkId 4
:DataDir "/ethereum/rinkeby"})}})
:DataDir "/ethereum/rinkeby"})}
"rinkeby_rpc" {:id "rinkeby_rpc",
:name "Rinkeby with upstream RPC",
:config (types/clj->json
{:NetworkId 4
:DataDir "/ethereum/rinkeby_rpc"
:UpstreamConfig {:Enabled true
:URL "https://rinkeby.infura.io/z6GCTmjdP3FETEJmMBI4"}})}
"mainnet" {:id "mainnet",
:name "Mainnet",
:config (types/clj->json
{:NetworkId 1
:DataDir "/ethereum/mainnet"})}
"mainnet_rpc" {:id "mainnet_rpc",
:name "Mainnet with upstream RPC",
:config (types/clj->json
{:NetworkId 1
:DataDir "/ethereum/mainnet_rpc"
:UpstreamConfig {:Enabled true
:URL "https://mainnet.infura.io/z6GCTmjdP3FETEJmMBI4 "}})}})

View File

@ -5,9 +5,9 @@
(defn get-network-subdomain [network]
(case network
"testnet" "ropsten"
"testnet_rpc" "ropsten"
"mainnet" "api"))
("testnet" "testnet_rpc") "ropsten"
("mainnet" "mainnet_rpc") "api"
("rinkeby" "rinkeby_rpc") "rinkeby"))
(defn get-transaction-details-url [network hash]
(let [network-subdomain (get-network-subdomain network)]