Skip to content

Commit

Permalink
Show green check in peer check if content advertised in DHT or IPNI
Browse files Browse the repository at this point in the history
  • Loading branch information
gammazero committed Sep 19, 2024
1 parent 31acb13 commit 54cabb8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ type providerOutput struct {
func (d *daemon) runCidCheck(ctx context.Context, cidKey cid.Cid, ipniURL string) (cidCheckOutput, error) {
crClient, err := client.New(ipniURL, client.WithStreamResultsRequired())
if err != nil {
return nil, fmt.Errorf("failed to creat content router client: %w", err)
return nil, fmt.Errorf("failed to create content router client: %w", err)

Check warning on line 154 in daemon.go

View check run for this annotation

Codecov / codecov/patch

daemon.go#L154

Added line #L154 was not covered by tests
}
routerClient := contentrouter.NewContentRoutingClient(crClient)

Expand Down
18 changes: 10 additions & 8 deletions web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -265,15 +265,17 @@ <h2 class="f4">What does it mean if I get an error?</h2>
}
}

if (respObj.ProviderRecordFromPeerInDHT === true) {
outText += "✅ Found multihash advertised in the dht\n"
} else {
outText += "❌ Could not find the multihash in the dht\n"
}
if (respObj.ProviderRecordFromPeerInIPNI === true) {
outText += "✅ Found multihash advertised in IPNI\n"
if (respObj.ProviderRecordFromPeerInDHT === true || respObj.ProviderRecordFromPeerInIPNI === true) {
outText += "✅ Found multihash advertised in "
if (respObj.ProviderRecordFromPeerInDHT === true && respObj.ProviderRecordFromPeerInIPNI === true) {
outText += "DHT and IPNI\n"
} else if (respObj.ProviderRecordFromPeerInDHT === true) {
outText += "DHT\n"
} else {
outText += "IPNI\n"
}
} else {
outText += "❌ Could not find the multihash in IPNI\n"
outText += "❌ Could not find the multihash in DHR or IPNI\n"
}

if (respObj.DataAvailableOverBitswap.Error !== "") {
Expand Down

0 comments on commit 54cabb8

Please sign in to comment.