diff --git a/src/main/kotlin/io/emeraldpay/dshackle/rpc/Describe.kt b/src/main/kotlin/io/emeraldpay/dshackle/rpc/Describe.kt index e0f20a6b..7b0c27d3 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/rpc/Describe.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/rpc/Describe.kt @@ -19,6 +19,7 @@ import io.emeraldpay.api.proto.BlockchainOuterClass import io.emeraldpay.api.proto.Common import io.emeraldpay.dshackle.startup.QuorumForLabels import io.emeraldpay.dshackle.upstream.* +import io.emeraldpay.dshackle.upstream.bitcoin.BitcoinUpstream import io.emeraldpay.dshackle.upstream.ethereum.EthereumUpstream import io.emeraldpay.dshackle.upstream.grpc.EthereumGrpcUpstream import org.springframework.beans.factory.annotation.Autowired @@ -47,6 +48,8 @@ class Describe( val nodes = QuorumForLabels() if (up is EthereumUpstream) { nodes.add(up.node) + } else if (up is BitcoinUpstream) { + nodes.add(up.node) } else if (up is EthereumGrpcUpstream) { nodes.add(up.getNodes()) } diff --git a/src/main/kotlin/io/emeraldpay/dshackle/startup/ConfiguredUpstreams.kt b/src/main/kotlin/io/emeraldpay/dshackle/startup/ConfiguredUpstreams.kt index 5d1ac9fb..02eb54bb 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/startup/ConfiguredUpstreams.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/startup/ConfiguredUpstreams.kt @@ -129,7 +129,9 @@ open class ConfiguredUpstreams( } rpcApi?.let { api -> val upstream = BitcoinUpstream(config.id - ?: "bitcoin-${seq.getAndIncrement()}", chain, api, options, objectMapper) + ?: "bitcoin-${seq.getAndIncrement()}", chain, api, + options, QuorumForLabels.QuorumItem(1, config.labels), + objectMapper) upstream.start() currentUpstreams.update(UpstreamChange(chain, upstream, UpstreamChange.ChangeType.ADDED)) diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/bitcoin/BitcoinUpstream.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/bitcoin/BitcoinUpstream.kt index 4f59f5df..52753baf 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/bitcoin/BitcoinUpstream.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/bitcoin/BitcoinUpstream.kt @@ -2,6 +2,7 @@ package io.emeraldpay.dshackle.upstream.bitcoin import com.fasterxml.jackson.databind.ObjectMapper import io.emeraldpay.dshackle.config.UpstreamsConfig +import io.emeraldpay.dshackle.startup.QuorumForLabels import io.emeraldpay.dshackle.upstream.* import io.emeraldpay.grpc.Chain import org.slf4j.LoggerFactory @@ -14,6 +15,7 @@ class BitcoinUpstream( val chain: Chain, private val api: BitcoinApi, options: UpstreamsConfig.Options, + val node: QuorumForLabels.QuorumItem, private val objectMapper: ObjectMapper ) : DefaultUpstream(id, options, DefaultBitcoinMethods()), Lifecycle {