class AutoDiscovery implements Discovery {

    @Override
    public void onUpdate(final NodeInfo nodeInfo) {

        LOGGER.debug("Processing node info {}", nodeInfo);

        final NodeUri callerNodeUri = NodeUri.create(nodeInfo.getUrl());

        LOGGER.debug("Update node {}", callerNodeUri);

        final Set<PublicKey> keys = nodeInfo.getRecipients().stream()
            .filter(r -> NodeUri.create(r.getUrl()).equals(callerNodeUri))
            .map(Recipient::getKey)
            .collect(Collectors.toSet());

        final ActiveNode activeNode =
                ActiveNode.Builder.create()
                        .withUri(callerNodeUri)
                        .withKeys(keys)
                        .withSupportedVersions(nodeInfo.supportedApiVersions())
                        .build();

        networkStore.store(activeNode);
    }

    public  AutoDiscovery(NetworkStore networkStore);

}