-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bitswap: add ledger
subcommand
#2852
Conversation
please take a look at #2814 |
fmt.Fprintf(buf, "\tdup blocks received: %d\n", out.DupBlksReceived) | ||
fmt.Fprintf(buf, "\tdup data received: %s\n", humanize.Bytes(out.DupDataReceived)) | ||
fmt.Fprintf(buf, "\twantlist [%d keys]\n", len(out.Wantlist)) | ||
fmt.Fprintf(buf, "bitswap status\n"+ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These should all be initially capitalized, I think.
Hi @whyrusleeping, is |
@thomas-gardner The find or create is necessary for the function of the bitswap code. Its an atomic operation to fetch the ledger for a peer (and create one while holding the lock if it doesnt exist). Also, this PR is mostly a duplicate of #2814 |
@whyrusleeping---right, something about creating an unneeded ledger was
confusing to me, but I can see how using `findOrCreate` keeps things
tidy and atomic.
Re diff #2814, this PR doesn't export any of the `Bitswap` fields, & gets
the locking right now ( ...I hope.)
|
@thomas-gardner alright, if you could add a |
Nice!
|
We should move bitswap out into go-bitswap so it can get dev cycles faster
|
License: MIT Signed-off-by: Thomas Gardner <tmg@fastmail.com>
Jeromy Johnson:
Rebased & added. |
alright, LGTM |
Bring on the Strategies.