solution: revise for the latest etherjar

This commit is contained in:
Igor Artamonov
2019-11-08 18:53:50 -05:00
parent 9c07b18912
commit 559a464252
3 changed files with 11 additions and 7 deletions

View File

@@ -132,13 +132,14 @@ open class ConfiguredUpstreams(
}
conn.rpc?.let { endpoint ->
val rpcClient = ReactorHttpRpcClient.newBuilder()
.setTarget(endpoint.url)
.connectTo(endpoint.url)
.alwaysSeparate()
conn.rpc?.basicAuth?.let { auth ->
rpcClient.setBasicAuth(auth.username, auth.password)
rpcClient.basicAuth(auth.username, auth.password)
}
conn.rpc?.tls?.let { tls ->
tls.ca?.let { ca ->
fileResolver.resolve(ca).inputStream().use { cert -> rpcClient.setTrustedCertificate(cert) }
fileResolver.resolve(ca).inputStream().use { cert -> rpcClient.trustedCertificate(cert) }
}
}
rpcApi = DirectEthereumApi(

View File

@@ -45,10 +45,13 @@ class EthereumWs(
fun connect() {
log.info("Connecting to WebSocket: $uri")
val client = WebsocketClient(uri, origin)
val clientBuilder = WebsocketClient.newBuilder()
.connectTo(uri)
.origin(origin)
basicAuth?.let { auth ->
client.setBasicAuth(auth.username, auth.password)
clientBuilder.basicAuth(auth.username, auth.password)
}
val client = clientBuilder.build()
try {
client.connect()
} catch (e: Exception) {

View File

@@ -74,8 +74,8 @@ class GrpcUpstreams(
val client = ReactorBlockchainGrpc.newReactorStub(channel.build())
this.client = client
this.grpcTransport = ReactorEmeraldClient.newBuilder()
.forChannel(client.channel)
.setObjectMapper(objectMapper)
.connectUsing(client.channel)
.objectMapper(objectMapper)
.build()
val statusSubscription = AtomicReference<Disposable>()