nip-13: difficulty filter #62

Merged
offbyn merged 1 commits from feed-difficulty-filter into master 1 year ago
offbyn commented 1 year ago
Owner

added a slider to adjust the difficulty filter, current default is
0 so all notes are rendered. increasing the filter will hide notes
with lower difficulty target.

changed the max difficulty from 256 to 32 for now so that the
range slider is usable.

this does not yet hide reactions with lower difficulty.

added a slider to adjust the difficulty filter, current default is 0 so all notes are rendered. increasing the filter will hide notes with lower difficulty target. changed the max difficulty from 256 to 32 for now so that the range slider is usable. this does not yet hide reactions with lower difficulty.
offbyn added 1 commit 1 year ago
ci/woodpecker/pr/woodpecker Pipeline was successful Details
ci/woodpecker/push/woodpecker Pipeline was successful Details
caf5083caa
nip-13: difficulty filter
added a slider to adjust the difficulty filter, current default is
0 so all notes are rendered. increasing the filter will hide notes
with lower difficulty target.

changed the max difficulty from 256 to 32 for now so that the
range slider is usable.

this does not yet hide reactions with lower difficulty.
offbyn reviewed 1 year ago
@ -326,2 +326,3 @@
function renderFeed() {
const sortedFeeds = textNoteList.sort(sortByCreatedAt).reverse();
const sortedFeeds = textNoteList
.filter(note => !fitlerDifficulty || note.tags.some(([tag, , commitment]) => tag === 'nonce' && commitment >= fitlerDifficulty))
offbyn commented 1 year ago
Poster
Owner

I forgot if checking the commitment is enough, assuming relays don't forward events with commitment that do not match the nonce.

I forgot if checking the commitment is enough, assuming relays don't forward events with commitment that do not match the nonce.
offbyn merged commit caf5083caa into master 1 year ago
offbyn deleted branch feed-difficulty-filter 1 year ago
ci/woodpecker/pr/woodpecker Pipeline was successful
ci/woodpecker/push/woodpecker Pipeline was successful
The pull request has been merged as caf5083caa.
You can also view command line instructions.

Step 1:

From your project repository, check out a new branch and test the changes.
git checkout -b feed-difficulty-filter master
git pull origin feed-difficulty-filter

Step 2:

Merge the changes and update on Gitea.
git checkout master
git merge --no-ff feed-difficulty-filter
git push origin master
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: nostr/nostrweb#62
Loading…
There is no content yet.