solution: goerli support
Co-authored-by: Chase Wright <mysticryuujin@protonmail.com>
This commit is contained in:
@@ -29,7 +29,7 @@ Dshackle allows to build a mesh network of interconnected Dshackle servers for b
|
||||
|
||||
Blockchain support:
|
||||
|
||||
- Ethereum, Ethereum Classic and Kovan testnet
|
||||
- Ethereum, Ethereum Classic, Kovan testnet, and Goerli testnet
|
||||
- Bitcoin and Bitcoin Testnet
|
||||
|
||||
WARNING: The project is still under development, please use with caution.
|
||||
|
||||
@@ -46,7 +46,7 @@ repositories {
|
||||
maven { url "https://repo.spring.io/snapshot" }
|
||||
maven { url "https://repo.spring.io/milestone" }
|
||||
maven { url "https://dl.bintray.com/infinitape/etherjar" }
|
||||
maven { url "https://dl.bintray.com/emerald/emerald-grpc" }
|
||||
maven { url "https://dl.bintray.com/emerald/emerald-api" }
|
||||
}
|
||||
|
||||
configurations {
|
||||
@@ -57,7 +57,7 @@ configurations {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation "io.emeraldpay:emerald-grpc:0.6.0-0.2"
|
||||
implementation "io.emeraldpay:emerald-api:0.7.1"
|
||||
|
||||
implementation "io.grpc:grpc-protobuf:${grpcVersion}"
|
||||
implementation "io.grpc:grpc-stub:${grpcVersion}"
|
||||
|
||||
@@ -19,3 +19,9 @@ cluster:
|
||||
ethereum:
|
||||
rpc:
|
||||
url: "https://kovan.infura.io/v3/${INFURA_USER}"
|
||||
- id: infura-goerli
|
||||
chain: goerli
|
||||
connection:
|
||||
ethereum:
|
||||
rpc:
|
||||
url: "https://goerli.infura.io/v3/${INFURA_USER}"
|
||||
|
||||
@@ -434,7 +434,7 @@ Fallback role mean that the upstream is used only after other upstreams failed o
|
||||
| yes
|
||||
| Blockchain which is the provided by the upstream.
|
||||
Cluster may have multiple upstreams for a single blockchain.
|
||||
Accepted types: `bitcoin`, `bitcoin-testnet`, `ethereum`, `ethereum-classic`, or `kovan`
|
||||
Accepted types: `bitcoin`, `bitcoin-testnet`, `ethereum`, `ethereum-classic`, `kovan`, or `goerli`
|
||||
|
||||
| `labels`
|
||||
| no
|
||||
|
||||
@@ -5,7 +5,7 @@ protocVersion=3.7.1
|
||||
# Main Libs
|
||||
slf4jVersion=1.7.25
|
||||
jacksonVersion=2.11.0
|
||||
grpcVersion=1.20.0
|
||||
grpcVersion=1.25.0
|
||||
protobufVersion=3.7.1
|
||||
springBootVersion=2.1.14.RELEASE
|
||||
springVersion=5.2.6.RELEASE
|
||||
|
||||
@@ -23,6 +23,7 @@ enum ChainRef {
|
||||
CHAIN_KOVAN = 10002;
|
||||
CHAIN_TESTNET_BITCOIN = 10003;
|
||||
CHAIN_FLOONET = 10004;
|
||||
CHAIN_GOERLI = 10005;
|
||||
|
||||
// Non-standard starts from 50000
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ enum class BlockchainType {
|
||||
companion object {
|
||||
@JvmStatic
|
||||
fun fromBlockchain(blockchain: Chain): BlockchainType {
|
||||
if (blockchain == Chain.ETHEREUM || blockchain == Chain.ETHEREUM_CLASSIC || blockchain == Chain.TESTNET_KOVAN || blockchain == Chain.TESTNET_MORDEN) {
|
||||
if (blockchain == Chain.ETHEREUM || blockchain == Chain.ETHEREUM_CLASSIC || blockchain == Chain.TESTNET_KOVAN || blockchain == Chain.TESTNET_MORDEN || blockchain == Chain.TESTNET_GOERLI) {
|
||||
return ETHEREUM
|
||||
}
|
||||
if (blockchain == Chain.BITCOIN || blockchain == Chain.TESTNET_BITCOIN) {
|
||||
|
||||
@@ -63,6 +63,8 @@ open class ConfiguredUpstreams(
|
||||
"morden" to Chain.TESTNET_MORDEN,
|
||||
"kovan" to Chain.TESTNET_KOVAN,
|
||||
"kovan-testnet" to Chain.TESTNET_KOVAN,
|
||||
"goerli" to Chain.TESTNET_GOERLI,
|
||||
"goerli-testnet" to Chain.TESTNET_GOERLI,
|
||||
"bitcoin" to Chain.BITCOIN,
|
||||
"bitcoin-testnet" to Chain.TESTNET_BITCOIN
|
||||
)
|
||||
|
||||
@@ -123,6 +123,9 @@ class DefaultEthereumMethods(
|
||||
Chain.TESTNET_KOVAN == chain -> {
|
||||
"42"
|
||||
}
|
||||
Chain.TESTNET_GOERLI == chain -> {
|
||||
"5"
|
||||
}
|
||||
else -> throw RpcException(-32602, "Invalid chain")
|
||||
}
|
||||
}
|
||||
@@ -140,6 +143,9 @@ class DefaultEthereumMethods(
|
||||
Chain.TESTNET_KOVAN == chain -> {
|
||||
"\"0x2a\""
|
||||
}
|
||||
Chain.TESTNET_GOERLI == chain -> {
|
||||
"\"0x5\""
|
||||
}
|
||||
else -> throw RpcException(-32602, "Invalid chain")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ class BlockchainTypeSpec extends Specification {
|
||||
expect:
|
||||
BlockchainType.fromBlockchain(chain) == BlockchainType.ETHEREUM
|
||||
where:
|
||||
chain << [Chain.ETHEREUM, Chain.ETHEREUM_CLASSIC, Chain.TESTNET_KOVAN, Chain.TESTNET_MORDEN]
|
||||
chain << [Chain.ETHEREUM, Chain.ETHEREUM_CLASSIC, Chain.TESTNET_KOVAN, Chain.TESTNET_GOERLI, Chain.TESTNET_MORDEN]
|
||||
}
|
||||
|
||||
def "Correct type for bitcoin"() {
|
||||
|
||||
@@ -51,7 +51,7 @@ class MainConfigReaderSpec extends Specification {
|
||||
port == 8082
|
||||
tls != null
|
||||
routes != null
|
||||
routes.size() == 3
|
||||
routes.size() == 4
|
||||
with(routes[0]) {
|
||||
id == "eth"
|
||||
blockchain == Chain.ETHEREUM
|
||||
@@ -64,6 +64,10 @@ class MainConfigReaderSpec extends Specification {
|
||||
id == "kovan"
|
||||
blockchain == Chain.TESTNET_KOVAN
|
||||
}
|
||||
with(routes[3]) {
|
||||
id == "goerli"
|
||||
blockchain == Chain.TESTNET_GOERLI
|
||||
}
|
||||
}
|
||||
act.upstreams != null
|
||||
with(act.upstreams) {
|
||||
|
||||
@@ -22,5 +22,6 @@ class DefaultEthereumMethodsSpec extends Specification {
|
||||
Chain.ETHEREUM | '"0x0"'
|
||||
Chain.ETHEREUM_CLASSIC | '"0x3d"'
|
||||
Chain.TESTNET_KOVAN | '"0x2a"'
|
||||
Chain.TESTNET_GOERLI | '"0x5"'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,6 +33,8 @@ proxy:
|
||||
blockchain: ethereum_classic
|
||||
- id: kovan
|
||||
blockchain: kovan
|
||||
- id: goerli
|
||||
blockchain: goerli
|
||||
|
||||
cluster:
|
||||
defaults:
|
||||
|
||||
Reference in New Issue
Block a user