2019-10-09 03:16:35 +00:00
|
|
|
package build
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"strings"
|
|
|
|
|
2019-11-22 16:20:56 +00:00
|
|
|
"github.com/filecoin-project/lotus/lib/addrutil"
|
|
|
|
|
2019-10-09 03:16:35 +00:00
|
|
|
rice "github.com/GeertJohan/go.rice"
|
|
|
|
"github.com/libp2p/go-libp2p-core/peer"
|
|
|
|
)
|
|
|
|
|
|
|
|
func BuiltinBootstrap() ([]peer.AddrInfo, error) {
|
2020-06-22 18:41:52 +00:00
|
|
|
if DisableBuiltinAssets {
|
|
|
|
return nil, nil
|
|
|
|
}
|
|
|
|
|
2019-10-09 03:16:35 +00:00
|
|
|
b := rice.MustFindBox("bootstrap")
|
2019-12-05 05:14:19 +00:00
|
|
|
|
2021-01-06 21:03:29 +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
|
|
|
}
|
|
|
|
|
2021-01-06 21:03:29 +00:00
|
|
|
return nil, nil
|
2019-10-09 03:16:35 +00:00
|
|
|
}
|