From 06155c535c1a44624988687396d2ee91c11a914e Mon Sep 17 00:00:00 2001 From: Daniel N <2color@users.noreply.github.com> Date: Thu, 15 Aug 2024 12:25:44 +0200 Subject: [PATCH 01/14] feat: add check using only a CID Fixes #6 --- daemon.go | 109 ++++++++++++++++++++++++++++++++++++++++-------------- main.go | 19 +++++++++- 2 files changed, 100 insertions(+), 28 deletions(-) diff --git a/daemon.go b/daemon.go index c922595..2a5a525 100644 --- a/daemon.go +++ b/daemon.go @@ -2,10 +2,8 @@ package main import ( "context" - "errors" "fmt" "log" - "net/url" "sync" "time" @@ -38,6 +36,10 @@ type daemon struct { createTestHost func() (host.Host, error) } +// number of providers at which to stop looking for providers in the DHT +// When doing a check only with a CID +var MaxProvidersCount = 3 + func newDaemon(ctx context.Context, acceleratedDHT bool) (*daemon, error) { rm, err := NewResourceManager() if err != nil { @@ -108,18 +110,79 @@ func (d *daemon) mustStart() { } -func (d *daemon) runCheck(query url.Values) (*output, error) { - maStr := query.Get("multiaddr") - cidStr := query.Get("cid") +type providerOutput struct { + ID string + Addrs []string + ConnectionMaddrs []string + BitswapCheckOutput BitswapCheckOutput +} - if maStr == "" { - return nil, errors.New("missing 'multiaddr' argument") +func (d *daemon) runCidCheck(cidStr string) (*[]providerOutput, error) { + cid, err := cid.Decode(cidStr) + if err != nil { + return nil, err } - if cidStr == "" { - return nil, errors.New("missing 'cid' argument") + ctx := context.Background() + out := make([]providerOutput, 0, 3) + + queryCtx, cancel := context.WithCancel(ctx) + defer cancel() + provsCh := d.dht.FindProvidersAsync(queryCtx, cid, MaxProvidersCount) + + for provider := range provsCh { + addrs := make([]string, len(provider.Addrs)) + for i, addr := range provider.Addrs { + addrs[i] = addr.String() + } + + provOutput := providerOutput{ + ID: provider.ID.String(), + Addrs: addrs, + BitswapCheckOutput: BitswapCheckOutput{}, + } + + testHost, err := d.createTestHost() + if err != nil { + return nil, fmt.Errorf("server error: %w", err) + } + defer testHost.Close() + + // Test Is the target connectable + dialCtx, dialCancel := context.WithTimeout(ctx, time.Second*15) + + // we call NewStream to force NAT hole punching + // See https://github.com/libp2p/go-libp2p/issues/2714 + testHost.Connect(dialCtx, provider) + _, connErr := testHost.NewStream(dialCtx, provider.ID, "/ipfs/bitswap/1.2.0", "/ipfs/bitswap/1.1.0", "/ipfs/bitswap/1.0.0", "/ipfs/bitswap") + dialCancel() + + if connErr != nil { + provOutput.BitswapCheckOutput.Error = fmt.Sprintf("error dialing to peer: %s", connErr.Error()) + } else { + // TODO: Modify checkBitswapCID and vole to accept `AddrInfo` so that it can test any of the connections + provOutput.BitswapCheckOutput = checkBitswapCID(ctx, testHost, cid, provider.Addrs[0]) + + for _, c := range testHost.Network().ConnsToPeer(provider.ID) { + provOutput.ConnectionMaddrs = append(provOutput.ConnectionMaddrs, c.RemoteMultiaddr().String()) + } + } + + out = append(out, provOutput) } + return &out, nil +} + +type peerCheckOutput struct { + ConnectionError string + PeerFoundInDHT map[string]int + CidInDHT bool + ConnectionMaddrs []string + DataAvailableOverBitswap BitswapCheckOutput +} + +func (d *daemon) runPeerCheck(maStr, cidStr string) (*peerCheckOutput, error) { ma, err := multiaddr.NewMultiaddr(maStr) if err != nil { return nil, err @@ -139,11 +202,11 @@ func (d *daemon) runCheck(query url.Values) (*output, error) { } ctx := context.Background() - out := &output{} + out := &peerCheckOutput{} connectionFailed := false - out.CidInDHT = providerRecordInDHT(ctx, d.dht, c, ai.ID) + out.CidInDHT = providerRecordForPeerInDHT(ctx, d.dht, c, ai.ID) addrMap, peerAddrDHTErr := peerAddrsInDHT(ctx, d.dht, d.dhtMessenger, ai.ID) out.PeerFoundInDHT = addrMap @@ -202,6 +265,13 @@ func (d *daemon) runCheck(query url.Values) (*output, error) { return out, nil } +type BitswapCheckOutput struct { + Duration time.Duration + Found bool + Responded bool + Error string +} + func checkBitswapCID(ctx context.Context, host host.Host, c cid.Cid, ma multiaddr.Multiaddr) BitswapCheckOutput { log.Printf("Start of Bitswap check for cid %s by attempting to connect to ma: %v with the temporary peer: %s", c, ma, host.ID()) out := BitswapCheckOutput{} @@ -223,21 +293,6 @@ func checkBitswapCID(ctx context.Context, host host.Host, c cid.Cid, ma multiadd return out } -type BitswapCheckOutput struct { - Duration time.Duration - Found bool - Responded bool - Error string -} - -type output struct { - ConnectionError string - PeerFoundInDHT map[string]int - CidInDHT bool - ConnectionMaddrs []string - DataAvailableOverBitswap BitswapCheckOutput -} - func peerAddrsInDHT(ctx context.Context, d kademlia, messenger *dhtpb.ProtocolMessenger, p peer.ID) (map[string]int, error) { closestPeers, err := d.GetClosestPeers(ctx, string(p)) if err != nil { @@ -281,7 +336,7 @@ func peerAddrsInDHT(ctx context.Context, d kademlia, messenger *dhtpb.ProtocolMe return addrMap, nil } -func providerRecordInDHT(ctx context.Context, d kademlia, c cid.Cid, p peer.ID) bool { +func providerRecordForPeerInDHT(ctx context.Context, d kademlia, c cid.Cid, p peer.ID) bool { queryCtx, cancel := context.WithCancel(ctx) defer cancel() provsCh := d.FindProvidersAsync(queryCtx, c, 0) diff --git a/main.go b/main.go index c330cb0..1f85045 100644 --- a/main.go +++ b/main.go @@ -4,6 +4,7 @@ import ( "context" "crypto/subtle" "encoding/json" + "errors" "log" "net" "net/http" @@ -77,7 +78,23 @@ func startServer(ctx context.Context, d *daemon, tcpListener, metricsUsername, m checkHandler := func(w http.ResponseWriter, r *http.Request) { w.Header().Add("Access-Control-Allow-Origin", "*") - data, err := d.runCheck(r.URL.Query()) + + maStr := r.URL.Query().Get("multiaddr") + cidStr := r.URL.Query().Get("cid") + + if cidStr == "" { + err = errors.New("missing 'cid' argument") + } + + var err error + var data interface{} + + if maStr == "" { + data, err = d.runCidCheck(cidStr) + } else { + data, err = d.runPeerCheck(maStr, cidStr) + } + if err == nil { w.Header().Add("Content-Type", "application/json") _ = json.NewEncoder(w).Encode(data) From cdb4edc9d2bb25e01acb3c767bb11991d75e96b9 Mon Sep 17 00:00:00 2001 From: Daniel N <2color@users.noreply.github.com> Date: Mon, 26 Aug 2024 16:47:42 +0200 Subject: [PATCH 02/14] feat: run checks concurrently --- daemon.go | 74 ++++++++++++++++++++++++++++++++----------------------- 1 file changed, 43 insertions(+), 31 deletions(-) diff --git a/daemon.go b/daemon.go index 2a5a525..a0c6758 100644 --- a/daemon.go +++ b/daemon.go @@ -124,53 +124,65 @@ func (d *daemon) runCidCheck(cidStr string) (*[]providerOutput, error) { } ctx := context.Background() - out := make([]providerOutput, 0, 3) + out := make([]providerOutput, 0, MaxProvidersCount) queryCtx, cancel := context.WithCancel(ctx) defer cancel() provsCh := d.dht.FindProvidersAsync(queryCtx, cid, MaxProvidersCount) + var wg sync.WaitGroup + var mu sync.Mutex + for provider := range provsCh { - addrs := make([]string, len(provider.Addrs)) - for i, addr := range provider.Addrs { - addrs[i] = addr.String() - } + wg.Add(1) + go func(provider peer.AddrInfo) { + defer wg.Done() - provOutput := providerOutput{ - ID: provider.ID.String(), - Addrs: addrs, - BitswapCheckOutput: BitswapCheckOutput{}, - } + addrs := make([]string, len(provider.Addrs)) + for i, addr := range provider.Addrs { + addrs[i] = addr.String() + } - testHost, err := d.createTestHost() - if err != nil { - return nil, fmt.Errorf("server error: %w", err) - } - defer testHost.Close() + provOutput := providerOutput{ + ID: provider.ID.String(), + Addrs: addrs, + BitswapCheckOutput: BitswapCheckOutput{}, + } - // Test Is the target connectable - dialCtx, dialCancel := context.WithTimeout(ctx, time.Second*15) + testHost, err := d.createTestHost() + if err != nil { + log.Printf("Error creating test host: %v", err) + return + } + defer testHost.Close() - // we call NewStream to force NAT hole punching - // See https://github.com/libp2p/go-libp2p/issues/2714 - testHost.Connect(dialCtx, provider) - _, connErr := testHost.NewStream(dialCtx, provider.ID, "/ipfs/bitswap/1.2.0", "/ipfs/bitswap/1.1.0", "/ipfs/bitswap/1.0.0", "/ipfs/bitswap") - dialCancel() + // Test Is the target connectable + dialCtx, dialCancel := context.WithTimeout(ctx, time.Second*15) + defer dialCancel() - if connErr != nil { - provOutput.BitswapCheckOutput.Error = fmt.Sprintf("error dialing to peer: %s", connErr.Error()) - } else { - // TODO: Modify checkBitswapCID and vole to accept `AddrInfo` so that it can test any of the connections - provOutput.BitswapCheckOutput = checkBitswapCID(ctx, testHost, cid, provider.Addrs[0]) + // we call NewStream to force NAT hole punching + // See https://github.com/libp2p/go-libp2p/issues/2714 + testHost.Connect(dialCtx, provider) + _, connErr := testHost.NewStream(dialCtx, provider.ID, "/ipfs/bitswap/1.2.0", "/ipfs/bitswap/1.1.0", "/ipfs/bitswap/1.0.0", "/ipfs/bitswap") - for _, c := range testHost.Network().ConnsToPeer(provider.ID) { - provOutput.ConnectionMaddrs = append(provOutput.ConnectionMaddrs, c.RemoteMultiaddr().String()) + if connErr != nil { + provOutput.BitswapCheckOutput.Error = fmt.Sprintf("error dialing to peer: %s", connErr.Error()) + } else { + // TODO: Modify checkBitswapCID and vole to accept `AddrInfo` so that it can test any of the connections + provOutput.BitswapCheckOutput = checkBitswapCID(ctx, testHost, cid, provider.Addrs[0]) + + for _, c := range testHost.Network().ConnsToPeer(provider.ID) { + provOutput.ConnectionMaddrs = append(provOutput.ConnectionMaddrs, c.RemoteMultiaddr().String()) + } } - } - out = append(out, provOutput) + mu.Lock() + out = append(out, provOutput) + mu.Unlock() + }(provider) } + wg.Wait() return &out, nil } From 99c8ffd4b3ea364a8a2f65db4608d8dafad3363b Mon Sep 17 00:00:00 2001 From: Daniel N <2color@users.noreply.github.com> Date: Mon, 26 Aug 2024 21:44:43 +0200 Subject: [PATCH 03/14] fix: use idiomatic approach with ctx termination --- daemon.go | 89 ++++++++++++++++++++++++++++++------------------------- 1 file changed, 48 insertions(+), 41 deletions(-) diff --git a/daemon.go b/daemon.go index a0c6758..8c3785e 100644 --- a/daemon.go +++ b/daemon.go @@ -133,57 +133,64 @@ func (d *daemon) runCidCheck(cidStr string) (*[]providerOutput, error) { var wg sync.WaitGroup var mu sync.Mutex - for provider := range provsCh { - wg.Add(1) - go func(provider peer.AddrInfo) { - defer wg.Done() - - addrs := make([]string, len(provider.Addrs)) - for i, addr := range provider.Addrs { - addrs[i] = addr.String() + for { + select { + case provider, ok := <-provsCh: + if !ok { + // Channel closed, all providers processed + return &out, nil } + wg.Add(1) + go func(provider peer.AddrInfo) { + defer wg.Done() - provOutput := providerOutput{ - ID: provider.ID.String(), - Addrs: addrs, - BitswapCheckOutput: BitswapCheckOutput{}, - } + addrs := make([]string, len(provider.Addrs)) + for i, addr := range provider.Addrs { + addrs[i] = addr.String() + } - testHost, err := d.createTestHost() - if err != nil { - log.Printf("Error creating test host: %v", err) - return - } - defer testHost.Close() + provOutput := providerOutput{ + ID: provider.ID.String(), + Addrs: addrs, + BitswapCheckOutput: BitswapCheckOutput{}, + } - // Test Is the target connectable - dialCtx, dialCancel := context.WithTimeout(ctx, time.Second*15) - defer dialCancel() + testHost, err := d.createTestHost() + if err != nil { + log.Printf("Error creating test host: %v", err) + return + } + defer testHost.Close() - // we call NewStream to force NAT hole punching - // See https://github.com/libp2p/go-libp2p/issues/2714 - testHost.Connect(dialCtx, provider) - _, connErr := testHost.NewStream(dialCtx, provider.ID, "/ipfs/bitswap/1.2.0", "/ipfs/bitswap/1.1.0", "/ipfs/bitswap/1.0.0", "/ipfs/bitswap") + // Test Is the target connectable + dialCtx, dialCancel := context.WithTimeout(ctx, time.Second*15) + defer dialCancel() - if connErr != nil { - provOutput.BitswapCheckOutput.Error = fmt.Sprintf("error dialing to peer: %s", connErr.Error()) - } else { - // TODO: Modify checkBitswapCID and vole to accept `AddrInfo` so that it can test any of the connections - provOutput.BitswapCheckOutput = checkBitswapCID(ctx, testHost, cid, provider.Addrs[0]) + // we call NewStream to force NAT hole punching + // See https://github.com/libp2p/go-libp2p/issues/2714 + testHost.Connect(dialCtx, provider) + _, connErr := testHost.NewStream(dialCtx, provider.ID, "/ipfs/bitswap/1.2.0", "/ipfs/bitswap/1.1.0", "/ipfs/bitswap/1.0.0", "/ipfs/bitswap") - for _, c := range testHost.Network().ConnsToPeer(provider.ID) { - provOutput.ConnectionMaddrs = append(provOutput.ConnectionMaddrs, c.RemoteMultiaddr().String()) + if connErr != nil { + provOutput.BitswapCheckOutput.Error = fmt.Sprintf("error dialing to peer: %s", connErr.Error()) + } else { + // TODO: Modify checkBitswapCID and vole to accept `AddrInfo` so that it can test any of the connections + provOutput.BitswapCheckOutput = checkBitswapCID(ctx, testHost, cid, provider.Addrs[0]) + + for _, c := range testHost.Network().ConnsToPeer(provider.ID) { + provOutput.ConnectionMaddrs = append(provOutput.ConnectionMaddrs, c.RemoteMultiaddr().String()) + } } - } - mu.Lock() - out = append(out, provOutput) - mu.Unlock() - }(provider) + mu.Lock() + out = append(out, provOutput) + mu.Unlock() + }(provider) + case <-ctx.Done(): + // Context cancelled + return &out, ctx.Err() + } } - - wg.Wait() - return &out, nil } type peerCheckOutput struct { From ac2e96d12c7264d99337435fddcb2d3ea1f7d0eb Mon Sep 17 00:00:00 2001 From: Daniel N <2color@users.noreply.github.com> Date: Mon, 26 Aug 2024 22:21:16 +0200 Subject: [PATCH 04/14] fix: rename output field and simplify code fixes #43 --- README.md | 14 +++++++------- daemon.go | 31 +++++++++++++------------------ integration_test.go | 6 +++--- test/e2e_test.go | 10 +++++----- test/tools.go | 2 +- web/index.html | 2 +- 6 files changed, 30 insertions(+), 35 deletions(-) diff --git a/README.md b/README.md index 6337cdb..fe2e1be 100644 --- a/README.md +++ b/README.md @@ -75,11 +75,11 @@ The server performs several checks given a CID. The results of the check are exp ```go type output struct { - ConnectionError string - PeerFoundInDHT map[string]int - CidInDHT bool - ConnectionMaddrs string[] - DataAvailableOverBitswap BitswapCheckOutput + ConnectionError string + PeerFoundInDHT map[string]int + ProviderRecordFromPeerInDHT bool + ConnectionMaddrs []string + DataAvailableOverBitswap BitswapCheckOutput } type BitswapCheckOutput struct { @@ -90,9 +90,9 @@ type BitswapCheckOutput struct { } ``` -1. Is the CID (really multihash) advertised in the DHT (or later IPNI)? +1. Is the CID (really multihash) advertised in the DHT by the Passed PeerID (or later IPNI)? -- `CidInDHT` +- `ProviderRecordFromPeerInDHT` 2. Are the peer's addresses discoverable (particularly useful if the announcements are DHT based, but also independently useful) diff --git a/daemon.go b/daemon.go index e16ab36..4d3819a 100644 --- a/daemon.go +++ b/daemon.go @@ -144,7 +144,7 @@ func (d *daemon) runCheck(query url.Values) (*output, error) { connectionFailed := false - out.CidInDHT = providerRecordInDHT(ctx, d.dht, c, ai.ID) + out.ProviderRecordFromPeerInDHT = ProviderRecordFromPeerInDHT(ctx, d.dht, c, ai.ID) addrMap, peerAddrDHTErr := peerAddrsInDHT(ctx, d.dht, d.dhtMessenger, ai.ID) out.PeerFoundInDHT = addrMap @@ -183,21 +183,16 @@ func (d *daemon) runCheck(query url.Values) (*output, error) { dialCancel() if connErr != nil { out.ConnectionError = fmt.Sprintf("error dialing to peer: %s", connErr.Error()) - connectionFailed = true + return out, nil } } - if connectionFailed { - out.DataAvailableOverBitswap.Error = "could not connect to peer" - } else { - // If so is the data available over Bitswap? - out.DataAvailableOverBitswap = checkBitswapCID(ctx, testHost, c, ma) + // If so is the data available over Bitswap? + out.DataAvailableOverBitswap = checkBitswapCID(ctx, testHost, c, ma) - // Get the direct connection in case it was hole punched and we have both a limited connection - // directMaddr := getDirectMaddr() - for _, c := range testHost.Network().ConnsToPeer(ai.ID) { - out.ConnectionMaddrs = append(out.ConnectionMaddrs, c.RemoteMultiaddr().String()) - } + // Get all connection maddrs to the peer (in case we hole punched, there will usually be two: limited relay and direct) + for _, c := range testHost.Network().ConnsToPeer(ai.ID) { + out.ConnectionMaddrs = append(out.ConnectionMaddrs, c.RemoteMultiaddr().String()) } return out, nil @@ -232,11 +227,11 @@ type BitswapCheckOutput struct { } type output struct { - ConnectionError string - PeerFoundInDHT map[string]int - CidInDHT bool - ConnectionMaddrs []string - DataAvailableOverBitswap BitswapCheckOutput + ConnectionError string + PeerFoundInDHT map[string]int + ProviderRecordFromPeerInDHT bool + ConnectionMaddrs []string + DataAvailableOverBitswap BitswapCheckOutput } func peerAddrsInDHT(ctx context.Context, d kademlia, messenger *dhtpb.ProtocolMessenger, p peer.ID) (map[string]int, error) { @@ -282,7 +277,7 @@ func peerAddrsInDHT(ctx context.Context, d kademlia, messenger *dhtpb.ProtocolMe return addrMap, nil } -func providerRecordInDHT(ctx context.Context, d kademlia, c cid.Cid, p peer.ID) bool { +func ProviderRecordFromPeerInDHT(ctx context.Context, d kademlia, c cid.Cid, p peer.ID) bool { queryCtx, cancel := context.WithCancel(ctx) defer cancel() provsCh := d.FindProvidersAsync(queryCtx, c, 0) diff --git a/integration_test.go b/integration_test.go index 6dd2da0..fbb341a 100644 --- a/integration_test.go +++ b/integration_test.go @@ -112,7 +112,7 @@ func TestBasicIntegration(t *testing.T) { obj := test.Query(t, "http://localhost:1234", testCid.String(), hostAddr.String()) - obj.Value("CidInDHT").Boolean().IsTrue() + obj.Value("ProviderRecordFromPeerInDHT").Boolean().IsTrue() obj.Value("ConnectionError").String().IsEmpty() obj.Value("ConnectionMaddrs").Array().ContainsAll(h.Addrs()[0]) obj.Value("DataAvailableOverBitswap").Object().Value("Error").String().IsEmpty() @@ -132,7 +132,7 @@ func TestBasicIntegration(t *testing.T) { obj := test.Query(t, "http://localhost:1234", testCid.String(), hostAddr.String()) - obj.Value("CidInDHT").Boolean().IsFalse() + obj.Value("ProviderRecordFromPeerInDHT").Boolean().IsFalse() obj.Value("ConnectionError").String().IsEmpty() obj.Value("ConnectionMaddrs").Array().ContainsAll(h.Addrs()[0]) obj.Value("DataAvailableOverBitswap").Object().Value("Error").String().IsEmpty() @@ -150,7 +150,7 @@ func TestBasicIntegration(t *testing.T) { obj := test.Query(t, "http://localhost:1234", testCid.String(), hostAddr.String()) - obj.Value("CidInDHT").Boolean().IsTrue() + obj.Value("ProviderRecordFromPeerInDHT").Boolean().IsTrue() obj.Value("ConnectionError").String().IsEmpty() obj.Value("ConnectionMaddrs").Array().ContainsAll(h.Addrs()[0]) obj.Value("DataAvailableOverBitswap").Object().Value("Error").String().IsEmpty() diff --git a/test/e2e_test.go b/test/e2e_test.go index a05a5cd..1fdcd0d 100644 --- a/test/e2e_test.go +++ b/test/e2e_test.go @@ -39,7 +39,7 @@ func TestEmptyDirOnBoostrapPeer(t *testing.T) { } obj := Q(t, EMPTY_DIR_CID, BOOTSTRAP_PEER_ADDR) - obj.Value("CidInDHT").Boolean().IsTrue() + obj.Value("ProviderRecordFromPeerInDHT").Boolean().IsTrue() obj.Value("ConnectionError").String().IsEmpty() obj.Value("DataAvailableOverBitswap").Object().Value("Error").String().IsEmpty() obj.Value("DataAvailableOverBitswap").Object().Value("Found").Boolean().IsTrue() @@ -51,7 +51,7 @@ func TestWikipediaOnSomeProviderPeer(t *testing.T) { t.Skip("Skipping e2e tests") } obj := Q(t, WIKIPEDIA_CID, WIKIPEDIA_PEER_ADDR) - obj.Value("CidInDHT").Boolean().IsTrue() + obj.Value("ProviderRecordFromPeerInDHT").Boolean().IsTrue() // It seems that most peers do not provide over bitswap: // obj.Value("ConnectionError").String().IsEmpty() // obj.Value("DataAvailableOverBitswap").Object().Value("Error").String().IsEmpty() @@ -72,7 +72,7 @@ func TestRandomFileOnBootstrapPeer(t *testing.T) { time.Sleep(60 * time.Second) obj := Q(t, randomFileCid, BOOTSTRAP_PEER_ADDR) - obj.Value("CidInDHT").Boolean().IsTrue() + obj.Value("ProviderRecordFromPeerInDHT").Boolean().IsTrue() obj.Value("ConnectionError").String().IsEmpty() obj.Value("DataAvailableOverBitswap").Object().Value("Error").String().IsEmpty() obj.Value("DataAvailableOverBitswap").Object().Value("Found").Boolean().IsTrue() @@ -97,7 +97,7 @@ func TestRandomFileOnLocalPeer(t *testing.T) { time.Sleep(25 * time.Second) obj := Q(t, randomFileCid, localAddr) - obj.Value("CidInDHT").Boolean().IsTrue() + obj.Value("ProviderRecordFromPeerInDHT").Boolean().IsTrue() obj.Value("ConnectionError").String().IsEmpty() obj.Value("DataAvailableOverBitswap").Object().Value("Error").String().IsEmpty() obj.Value("DataAvailableOverBitswap").Object().Value("Found").Boolean().IsTrue() @@ -115,7 +115,7 @@ func TestRandomFileNeverUploadedOnBootstrapPeer(t *testing.T) { obj := Q(t, randomFileCid, BOOTSTRAP_PEER_ADDR) - obj.Value("CidInDHT").Boolean().IsFalse() + obj.Value("ProviderRecordFromPeerInDHT").Boolean().IsFalse() obj.Value("DataAvailableOverBitswap").Object().Value("Found").Boolean().IsFalse() obj.Value("DataAvailableOverBitswap").Object().Value("Responded").Boolean().IsTrue() } diff --git a/test/tools.go b/test/tools.go index 39cc275..dd4b4bf 100644 --- a/test/tools.go +++ b/test/tools.go @@ -62,7 +62,7 @@ func GetEnv(key string, fallback string) string { Example of outputs: ```json { - "CidInDHT": true, + "ProviderRecordFromPeerInDHT": true, "ConnectionError": "no addresses", "DataAvailableOverBitswap": { "Duration": 0, diff --git a/web/index.html b/web/index.html index a5e92fe..c921c24 100644 --- a/web/index.html +++ b/web/index.html @@ -226,7 +226,7 @@
+