Skip to content

Update network.py wtih get_digest method - #106

Open
CodeDruidX wants to merge 1 commit into
bmuller:masterfrom
CodeDruidX:patch-1
Open

CodeDruidX wants to merge 1 commit into
bmuller:masterfrom
CodeDruidX:patch-1

Conversation

@CodeDruidX

Copy link
Copy Markdown

Server node has an ability to set entry in DHT by its key digest representation, but cant get value with it.

Add get_digest method
Comment thread kademlia/network.py
self.ksize, self.alpha)
return await spider.find()

async def get_digest(self, dkey):

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would make most sense to remove lines 145 - 155 and replace them with a call to this method (so there isn't any unnecessary duplication).

Comment thread kademlia/network.py
Returns:
:class:`None` if not found, the value otherwise.
"""
log.info("Looking up key %s", dkey)

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
log.info("Looking up key %s", dkey)
log.info("Looking up key digest %s", dkey)

@bmuller

bmuller commented Mar 31, 2025

Copy link
Copy Markdown
Owner

Are there cases where you know the digest but not the original key? If so - I'm happy to merge w/ the comments here addressed. 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants