// ConnectToBootstrapNodes initialize connection to hardcoded ipfs nodes addr.
ConnectToBootstrapNodes initialize connection to hardcoded ipfs nodes addr.
// ConnectToBootstrapNodes initialize connection to hardcoded ipfs nodes addr .
func ConnectToBootstrapNodes(ln *LNode) {
	var wg sync.WaitGroup
	for _, peerAddr := range getBootstrapAddrs() {
		peerinfo, _ := peerstore.InfoFromP2pAddr(peerAddr)
		wg.Add(1)
		go func(peerAddr maddr.Multiaddr) {
			defer wg.Done()
			if err := ln.Connect(ln.GetContext(), *peerinfo); err != nil {
				log.WithFields(log.Fields{
					"peer-id": peerinfo.ID,
					"err-msg": err.Error(),
				}).Warn("Connection to peer failed")
				return
			}
			log.WithFields(log.Fields{
				"peer-id":   peerinfo.ID,
				"peer-addr": peerAddr.String(),
			}).Info("Connection established with peer")
		}(peerAddr)
	}
	wg.Wait()
}
func ConnectToBootstrapNodes ( ln * LNode ) { var wg sync . WaitGroup for _ , peerAddr := range getBootstrapAddrs ( ) { peerinfo , _ := peerstore . InfoFromP2pAddr ( peerAddr ) wg . Add ( 1 ) go func ( peerAddr maddr . Multiaddr ) { defer wg . Done ( ) if err := ln . Connect ( ln . GetContext ( ) , * peerinfo ) ; err != nil { log . WithFields ( log . Fields { " " : peerinfo . ID , " " : err . Error ( ) , } ) . Warn ( " " ) return } log . WithFields ( log . Fields { " " : peerinfo . ID , " " : peerAddr . String ( ) , } ) . Info ( " " ) } ( peerAddr ) } wg . Wait ( ) }
ConnectToBootstrapNodes initialize connection to hardcoded ipfs nodes addr.
ConnectToBootstrapNodes initialize connection to hardcoded ipfs nodes addr .