conf.GetConfig().BootstrapAddress
This commit is contained in:
@@ -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(),
|
||||
|
||||
Reference in New Issue
Block a user