From 81ccfef0686a4cf721e773df7c381aee8644bdc9 Mon Sep 17 00:00:00 2001 From: Igor Artamonov Date: Sun, 23 Feb 2020 22:01:11 -0500 Subject: [PATCH] solution: warn if WS is not configured for an upstream --- .../emeraldpay/dshackle/upstream/ethereum/EthereumUpstream.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/EthereumUpstream.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/EthereumUpstream.kt index 89a20ad4..f2929b6a 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/EthereumUpstream.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/ethereum/EthereumUpstream.kt @@ -88,13 +88,15 @@ open class EthereumUpstream( val ws = EthereumWsHead(ethereumWs).apply { this.start() } - val rpc = EthereumRpcHead(api, Duration.ofSeconds(20)).apply { + // receive bew blocks through Websockets, but periodically verify with RPC + val rpc = EthereumRpcHead(api, Duration.ofSeconds(30)).apply { this.start() } EthereumHeadMerge(listOf(rpc.getFlux(), ws.getFlux())).apply { this.start() } } else { + log.warn("Setting up upstream $id with RPC-only access, less effective than WS+RPC") EthereumRpcHead(api).apply { this.start() }