conf.GetConfig().BootstrapAddress

This commit is contained in:
mr
2026-01-27 16:23:28 +01:00
parent f7f9d722bd
commit cdbf83ee8b
3 changed files with 16 additions and 0 deletions

View File

@@ -20,6 +20,7 @@ import (
dht "github.com/libp2p/go-libp2p-kad-dht"
"github.com/libp2p/go-libp2p/core/crypto"
"github.com/libp2p/go-libp2p/core/host"
"github.com/libp2p/go-libp2p/core/peer"
)
type DHTRecord struct {
@@ -78,6 +79,17 @@ func Init(ctx context.Context) (*DHTService, error) {
if err != nil {
return nil, err
}
pi, err := peer.AddrInfoFromString(conf.GetConfig().BootstrapAddress)
if err != nil {
return nil, err
}
logger := oclib.GetLogger()
if err := h.Connect(ctx, *pi); err != nil {
logger.Err(fmt.Errorf("Failed to connect to MAIN bootstrap peer %s: %s", pi.ID, err))
} else {
logger.Info().Msg(fmt.Sprintf("Connected to MAIN bootstrap peer %s", pi.ID))
}
singletonService = service
if VerifyPubWithPriv() {
if _, err := singletonService.ClaimName(context.Background(),