@Override
public MessageLite getHandshakeResponse(BitClientHandshake inbound) throws Exception {
// logger.debug("Handling handshake from other bit. {}", inbound);
if (inbound.getRpcVersion() != DataRpcConfig.RPC_VERSION)
throw new RpcException(String.format("Invalid rpc version. Expected %d, actual %d.",
inbound.getRpcVersion(), DataRpcConfig.RPC_VERSION));
if (inbound.getChannel() != RpcChannel.BIT_DATA)
throw new RpcException(String.format("Invalid NodeMode. Expected BIT_DATA but received %s.",
inbound.getChannel()));
return BitServerHandshake.newBuilder().setRpcVersion(DataRpcConfig.RPC_VERSION).build();
}