lotus/build/bootstrap.go

31 lines
546 B
Go
Raw Normal View History

package build
import (
"context"
"strings"
"github.com/filecoin-project/lotus/lib/addrutil"
rice "github.com/GeertJohan/go.rice"
"github.com/libp2p/go-libp2p-core/peer"
)
func BuiltinBootstrap() ([]peer.AddrInfo, error) {
if DisableBuiltinAssets {
return nil, nil
}
b := rice.MustFindBox("bootstrap")
2019-12-05 05:14:19 +00:00
if BootstrappersFile != "" {
spi := b.MustString(BootstrappersFile)
if spi == "" {
return nil, nil
}
return addrutil.ParseAddresses(context.TODO(), strings.Split(strings.TrimSpace(spi), "\n"))
2021-01-05 05:32:15 +00:00
}
return nil, nil
}