Skip to content

Commit

Permalink
solution: support Holesky and Sepolia out of box (#283)
Browse files Browse the repository at this point in the history
  • Loading branch information
splix authored Mar 28, 2024
1 parent 8c874b4 commit d379d5d
Show file tree
Hide file tree
Showing 12 changed files with 34 additions and 19 deletions.
3 changes: 2 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ repositories {
maven { url "https://repo.spring.io/snapshot" }
maven { url "https://repo.spring.io/milestone" }
maven { url "https://maven.emrld.io" }
maven { url "https://maven-snapshots.emrld.io" }
}

configurations {
Expand Down Expand Up @@ -105,7 +106,7 @@ dependencies {
implementation "io.emeraldpay.etherjar:etherjar-contract:$etherjarVersion"
implementation "io.emeraldpay.etherjar:etherjar-erc20:$etherjarVersion"

implementation "io.emeraldpay:emerald-api:0.12-alpha.7"
implementation "io.emeraldpay:emerald-api:0.13-SNAPSHOT"

implementation "org.bitcoinj:bitcoinj-core:0.16.2"

Expand Down
12 changes: 3 additions & 9 deletions demo/quick-start/dshackle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,9 @@ cluster:
url: "https://mainnet.infura.io/v3/${INFURA_USER}"
ws:
url: "wss://mainnet.infura.io/ws/v3/${INFURA_USER}"
- id: infura-kovan
chain: kovan
- id: infura-sepolia
chain: sepolia
connection:
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}"
url: "https://sepolia.infura.io/v3/${INFURA_USER}"
4 changes: 2 additions & 2 deletions docs/06-monitoring.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ The log contains the JSON lines similar to:
"id":"c23a5391-1b8c-40b0-a32f-fa736b8175a2",
"success":true,
"upstream":{
"id":"goerli",
"id":"sepolia",
"channel":"WSJSONRPC",
"type":"JSONRPC"
},
Expand All @@ -143,7 +143,7 @@ The log contains the JSON lines similar to:
"method":"eth_getBlockByHash",
"id":218
},
"blockchain":"TESTNET_GOERLI",
"blockchain":"TESTNET_SEPOLIA",
"execute":"2022-11-09T01:13:25.540592Z",
"complete":"2022-11-09T01:13:25.652683Z",
"responseSize":6243,
Expand Down
2 changes: 1 addition & 1 deletion docs/reference-configuration.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -772,7 +772,7 @@ configuration, and may be omitted for most of the situations.
| 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`, `kovan-testnet`, `rinkeby-testnet`, `ropsten-testnet`, or `goerli-testnet`
Accepted types: `bitcoin`, `bitcoin-testnet`, `ethereum`, `ethereum-classic`, or `sepolia-testnet`


| `labels`
Expand Down
2 changes: 2 additions & 0 deletions proto/common.proto
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ enum ChainRef {
CHAIN_GOERLI = 10005;
CHAIN_ROPSTEN = 10006;
CHAIN_RINKEBY = 10007;
CHAIN_HOLESKY = 10008;
CHAIN_SEPOLIA = 10009;

// Non-standard starts from 20_000
}
Expand Down
4 changes: 4 additions & 0 deletions src/main/kotlin/io/emeraldpay/dshackle/Global.kt
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ class Global {
"kovan-testnet" to Chain.TESTNET_KOVAN,
"goerli" to Chain.TESTNET_GOERLI,
"goerli-testnet" to Chain.TESTNET_GOERLI,
"holesky" to Chain.TESTNET_HOLESKY,
"holesky-testnet" to Chain.TESTNET_HOLESKY,
"sepolia" to Chain.TESTNET_SEPOLIA,
"sepolia-testnet" to Chain.TESTNET_SEPOLIA,
"rinkeby" to Chain.TESTNET_RINKEBY,
"rinkeby-testnet" to Chain.TESTNET_RINKEBY,
"ropsten" to Chain.TESTNET_ROPSTEN,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class ForkWatchFactory(
// at this moment (Aug 2022) it's still a PoW, but upgrade is coming in weeks, so it's better to configure everything in advance
Chain.ETHEREUM,
// those are upgraded to Merge
Chain.TESTNET_GOERLI, Chain.TESTNET_ROPSTEN
Chain.TESTNET_GOERLI, Chain.TESTNET_ROPSTEN, Chain.TESTNET_HOLESKY, Chain.TESTNET_SEPOLIA
)

fun create(chain: Chain): ForkWatch {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,12 @@ class DefaultEthereumMethods(
Chain.TESTNET_GOERLI == chain -> {
"\"5\""
}
Chain.TESTNET_HOLESKY == chain -> {
"\"17000\""
}
Chain.TESTNET_SEPOLIA == chain -> {
"\"11155111\""
}
else -> throw RpcException(-32602, "Invalid chain")
}
}
Expand Down Expand Up @@ -172,6 +178,12 @@ class DefaultEthereumMethods(
Chain.TESTNET_GOERLI == chain -> {
"\"0x5\""
}
Chain.TESTNET_HOLESKY == chain -> {
"\"0x4268\""
}
Chain.TESTNET_SEPOLIA == chain -> {
"\"0xaa36a7\""
}
else -> throw RpcException(-32602, "Invalid chain")
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ open class EthereumMultistream(
private var subscribe = EthereumEgressSubscription(this, NoPendingTxes())

private val supportsEIP1559 = when (chain) {
Chain.ETHEREUM, Chain.TESTNET_ROPSTEN, Chain.TESTNET_GOERLI, Chain.TESTNET_RINKEBY -> true
Chain.ETHEREUM, Chain.TESTNET_ROPSTEN, Chain.TESTNET_GOERLI, Chain.TESTNET_HOLESKY, Chain.TESTNET_SEPOLIA, Chain.TESTNET_RINKEBY -> true
else -> false
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ class MainConfigReaderSpec extends Specification {
blockchain == Chain.TESTNET_GOERLI
}
with(routes[4]) {
id == "rinkeby"
blockchain == Chain.TESTNET_RINKEBY
id == "sepolia"
blockchain == Chain.TESTNET_SEPOLIA
}
}
with(act.health) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,7 @@ class DefaultEthereumMethodsSpec extends Specification {
Chain.TESTNET_GOERLI | '"0x5"'
Chain.TESTNET_RINKEBY | '"0x4"'
Chain.TESTNET_ROPSTEN | '"0x3"'
Chain.TESTNET_SEPOLIA | '"0xaa36a7"'
Chain.TESTNET_HOLESKY | '"0x4268"'
}
}
4 changes: 2 additions & 2 deletions src/test/resources/configs/dshackle-full.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ proxy:
blockchain: kovan
- id: goerli
blockchain: goerli
- id: rinkeby
blockchain: rinkeby
- id: sepolia
blockchain: sepolia

cluster:
defaults:
Expand Down

0 comments on commit d379d5d

Please sign in to comment.