From 2e29673392a588d1d9092a3eaf3bfb15f6da3a1f Mon Sep 17 00:00:00 2001 From: Andrius Dagys Date: Mon, 19 Dec 2016 15:34:35 +0000 Subject: [PATCH] Distributed notary: manually initialize the serializer for copycat server & client. This fixes the issue where one of the nodes is unable to connect to the cluster. --- .../node/services/transactions/RaftUniquenessProvider.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/node/src/main/kotlin/net/corda/node/services/transactions/RaftUniquenessProvider.kt b/node/src/main/kotlin/net/corda/node/services/transactions/RaftUniquenessProvider.kt index 125e5e823b..a3e1f992e7 100644 --- a/node/src/main/kotlin/net/corda/node/services/transactions/RaftUniquenessProvider.kt +++ b/node/src/main/kotlin/net/corda/node/services/transactions/RaftUniquenessProvider.kt @@ -1,6 +1,7 @@ package net.corda.node.services.transactions import com.google.common.net.HostAndPort +import io.atomix.catalyst.serializer.Serializer import io.atomix.catalyst.transport.Address import io.atomix.catalyst.transport.Transport import io.atomix.catalyst.transport.netty.NettyTransport @@ -62,11 +63,13 @@ class RaftUniquenessProvider(storagePath: Path, myAddress: HostAndPort, clusterA val address = Address(myAddress.hostText, myAddress.port) val storage = buildStorage(storagePath) val transport = buildTransport(config) + val serializer = Serializer() val server = CopycatServer.builder(address) .withStateMachine(stateMachineFactory) .withStorage(storage) .withServerTransport(transport) + .withSerializer(serializer) .build() val serverFuture = if (clusterAddresses.isNotEmpty()) { @@ -81,6 +84,7 @@ class RaftUniquenessProvider(storagePath: Path, myAddress: HostAndPort, clusterA val client = CopycatClient.builder(address) .withTransport(transport) // TODO: use local transport for client-server communications .withConnectionStrategy(ConnectionStrategies.EXPONENTIAL_BACKOFF) + .withSerializer(serializer) .build() _clientFuture = serverFuture.thenCompose { client.connect(address) } }