Skip to content
This repository was archived by the owner on Mar 28, 2023. It is now read-only.

Commit 52861e8

Browse files
committed
Ping search endpoint to search.ob1.io
1 parent 2dacc0f commit 52861e8

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

core/core.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package core
33
import (
44
"errors"
55
"fmt"
6+
"net/http"
67
"path"
78
"sync"
89
"time"
@@ -156,6 +157,19 @@ func (n *OpenBazaarNode) SeedNode() error {
156157
return aerr
157158
}
158159
n.RootHash = rootHash
160+
161+
go func() {
162+
// Ping search endpoint with published hash
163+
peerId, _ := n.GetNodeID()
164+
endpoint := fmt.Sprintf("https://search.ob1.io/ping/%s/%s", peerId.PeerID, rootHash)
165+
log.Infof("Publishing new rootHash to: %s\n", endpoint)
166+
resp, err := http.Get(endpoint)
167+
if err != nil {
168+
log.Errorf("Search Ping did not succeed. %v\n", err)
169+
}
170+
log.Debugf("%s respone: %v", endpoint, resp)
171+
}()
172+
159173
n.seedLock.Unlock()
160174
n.InitalPublishComplete = true
161175
go n.publish(rootHash)

0 commit comments

Comments
 (0)