Skip to content

Commit

Permalink
fix devnet API issue
Browse files Browse the repository at this point in the history
  • Loading branch information
LexLuthr committed Jan 22, 2025
1 parent eca3dfe commit 72ae5fc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
13 changes: 8 additions & 5 deletions deps/apiinfo.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"math/rand"
"net/http"
"reflect"
"strings"
"sync"
"time"

Expand Down Expand Up @@ -71,11 +72,13 @@ func GetFullNodeAPIV1Curio(ctx *cli.Context, ainfoCfg []string) (api.Chain, json
}

// Compare with binary's network using BuildTypeString()
if string(networkName) != build.BuildTypeString()[1:] {
clog.Warnf("Network mismatch for node %s: binary built for %s but node is on %s",
head.addr, build.BuildTypeString()[1:], networkName)
closer()
continue
if !(strings.HasPrefix(string(networkName), "test") || strings.HasPrefix(string(networkName), "local")) {
if string(networkName) != build.BuildTypeString()[1:] {
clog.Warnf("Network mismatch for node %s: binary built for %s but node is on %s",
head.addr, build.BuildTypeString()[1:], networkName)
closer()
continue
}
}

fullNodes = append(fullNodes, v1api)
Expand Down
5 changes: 5 additions & 0 deletions market/ipni/ipni-provider/ipni-provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import (
"github.com/multiformats/go-multiaddr"
"golang.org/x/xerrors"

"github.com/filecoin-project/curio/build"
"github.com/filecoin-project/curio/deps"
"github.com/filecoin-project/curio/harmony/harmonydb"
"github.com/filecoin-project/curio/lib/pieceprovider"
Expand Down Expand Up @@ -435,6 +436,10 @@ func Routes(r *chi.Mux, p *Provider) {

// StartPublishing starts a poller which publishes the head for each provider every 10 minutes.
func (p *Provider) StartPublishing(ctx context.Context) {
// Don't publish for devnet or calibnet
if !(build.BuildTypeString()[1:] == "mainnet") {
return
}
// A poller which publishes head for each provider
// every 10 minutes
ticker := time.NewTicker(publishInterval)
Expand Down

0 comments on commit 72ae5fc

Please sign in to comment.