Skip to content
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

Add IPFS repo stats to brave://ipfs page #13528

Closed
bbondy opened this issue Jan 13, 2021 · 2 comments · Fixed by brave/brave-core#7758
Closed

Add IPFS repo stats to brave://ipfs page #13528

bbondy opened this issue Jan 13, 2021 · 2 comments · Fixed by brave/brave-core#7758

Comments

@bbondy
Copy link
Member

bbondy commented Jan 13, 2021

Add IPFS repo stats to brave://ipfs page, something like:

NumObjects: 838
RepoSize:   32340835
StorageMax: 1000000000
RepoPath:   /Users/bbondy/Library/Application Support/BraveSoftware/Brave-Browser-Nightly/brave_ipfs
Version:    fs-repo@10

You can run this manually to get the data:
./go-ipfs_v0.7.0_darwin-amd64 --api=/ip4/127.0.0.1/tcp/45004 repo stat
But see below for how to get it through the API port like we do for getting the address config that we display on that same page.

That way when you clear cache for example, you can see it got lower.

@yrliou
Copy link
Member

yrliou commented Jan 13, 2021

HTTP API reference: https://docs.ipfs.io/reference/http/api/#api-v0-repo-stat, we could use IpfsService::CreateURLLoader to use HTTP API to retrieve the result.
See IpfsService::GetAddressesConfig & IpfsService::OnGetAddressesConfig for reference.

@stephendonner
Copy link

stephendonner commented Feb 14, 2021

Verified FIXED using inline testcase on

Brave 1.21.51 Chromium: 88.0.4324.152 (Official Build) beta (x86_64)
Revision 6579930fc53b4dc589c042bec9d0a3778326974d-refs/branch-heads/4324@{#2106}
OS macOS Version 11.2.1 (Build 20D74)

Screen Shot 2021-02-14 at 2 58 15 PM

Screen Shot 2021-02-14 at 2 58 53 PM

Checked and verified that reloading the tab updates:

  • connected peers
  • objects
  • size

Verification passed on

Brave 1.21.52 Chromium: 88.0.4324.152 (Official Build) dev (64-bit)
Revision 6579930fc53b4dc589c042bec9d0a3778326974d-refs/branch-heads/4324@{#2106}
OS Ubuntu 18.04 LTS

Verified the above test plan
Verified that both connected peers, objects and size were present, with sane values
image


Verification passed on

Brave | 1.21.56 Chromium: 88.0.4324.152 (Official Build) dev (64-bit)
-- | --
Revision | 6579930fc53b4dc589c042bec9d0a3778326974d-refs/branch-heads/4324@{#2106}
OS | Windows 10 OS Version 2004 (Build 19041.804)

Checked and verified that reloading the tab updates:

  • connected peers
  • objects
  • size
    image
    image

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