Skip to content

Commit 72ae5fc

Browse files
committed
fix devnet API issue
1 parent eca3dfe commit 72ae5fc

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

deps/apiinfo.go

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"math/rand"
88
"net/http"
99
"reflect"
10+
"strings"
1011
"sync"
1112
"time"
1213

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

7374
// Compare with binary's network using BuildTypeString()
74-
if string(networkName) != build.BuildTypeString()[1:] {
75-
clog.Warnf("Network mismatch for node %s: binary built for %s but node is on %s",
76-
head.addr, build.BuildTypeString()[1:], networkName)
77-
closer()
78-
continue
75+
if !(strings.HasPrefix(string(networkName), "test") || strings.HasPrefix(string(networkName), "local")) {
76+
if string(networkName) != build.BuildTypeString()[1:] {
77+
clog.Warnf("Network mismatch for node %s: binary built for %s but node is on %s",
78+
head.addr, build.BuildTypeString()[1:], networkName)
79+
closer()
80+
continue
81+
}
7982
}
8083

8184
fullNodes = append(fullNodes, v1api)

market/ipni/ipni-provider/ipni-provider.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import (
2828
"github.com/multiformats/go-multiaddr"
2929
"golang.org/x/xerrors"
3030

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

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

0 commit comments

Comments
 (0)