Claim search port #5
Labels
No labels
consider soon
documentation
good first issue
hacktoberfest
help wanted
priority: blocker
priority: high
priority: low
priority: medium
type: bug
type: discussion
type: improvement
type: new feature
type: refactor
type: task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: LBRYCommunity/herald.go#5
Loading…
Reference in a new issue
No description provided.
Delete branch "claim_search_port"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
closes #2
Still need to add tests and fix the response.
@ -0,0 +1,5 @@
FROM debian:10-slim
what makes debian better than ubuntu or alpine?
@ -0,0 +1,4 @@
#!/bin/bash
go build .
sudo docker build . -t lbry/hub:latest
sudo
in a build script is not a good idea. i think you can use docker without sudo if you a dd yourself to the docker group@ -3,40 +3,167 @@ package main
import (
"context"
"fmt"
"github.com/lbryio/hub/util"
plz sort imports like this
i recommend putting
*q
as the first param in all these functions. its consistent and it's clear that you're adding to the query.you don't need this if check. if array is empty then the loop won't be run
or if you did wanna leave it, Go prefers the exit-early strategy over many levels of nesting (let me know if this isn't clear and i'll show you an example)
@ -46,0 +142,4 @@
if err != nil {
log.Println(err)
return nil, err
}
this function is massive. you could break it up into building the query and then doing the search. and maybe into even smaller chunks
@ -58,0 +220,4 @@
Offset: uint32(int64(from) + searchResult.TotalHits()),
Blocked: blocked,
BlockedTotal: blockedTotal,
}, nil
by convention
ctx
is generally the first param@ -0,0 +1,47 @@
package util
in my experience, packages like this turn into a disorganized heap of stuff. i recommend moving these into the package where you use them, or putting them somewhere in lbry.go as functions that normalize names and convert hashes to txids
if you don't want them in lbry.go, you can make the package here. but make it about what its about instead of a generic
util
@ -0,0 +1,4 @@
#!/bin/bash
go build .
sudo docker build . -t lbry/hub:latest
You're right, I set this up on a new ubuntu system and was too lazy to do that.
@ -0,0 +1,47 @@
package util
I think moving them into lbry.go is probably a good idea, I could see these being used elsewhere, I'll do that.
Agreed
Yeah, I'll remove the check, I'm pretty sure I know what you're talking about with the exit-early strategy, you do the checks first for default cases and return in those, and then don't have the ifs around the main code. It's the same style as I learned in C, should have remembered that :)
@ -58,0 +220,4 @@
Offset: uint32(int64(from) + searchResult.TotalHits()),
Blocked: blocked,
BlockedTotal: blockedTotal,
}, nil
Makes sense
@ -0,0 +1,5 @@
FROM debian:10-slim
I think I copied this from somewhere originally, but I can't find the original now, there wasn't really any thought behind it. Do we generally use alpine? I do think maybe ubuntu would be a bit bigger than needed since it's a static binary with no dependencies.
@ -0,0 +1,5 @@
FROM debian:10-slim
Found it, this is why I used debian, copied from here https://github.com/lbryio/lbry-sdk/blob/master/docker/Dockerfile.wallet_server#L1
@ -0,0 +1,5 @@
FROM debian:10-slim
@shyba why did you use debian and not alpine or ubuntu?