From c7791bd4414e536249d0c1e15ba5b791d626e3db Mon Sep 17 00:00:00 2001 From: ehsan shariati Date: Thu, 9 Nov 2023 19:30:51 -0500 Subject: [PATCH] first issue correction after testing 1- poolname contained extra strings "/explore.fula/pools/" 2- added error priniting to FetchUsersAndPopulateSets --- announcements/announcements.go | 1 + blockchain/blockchain.go | 2 ++ blox/blox.go | 4 +++- blox/options.go | 2 +- 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/announcements/announcements.go b/announcements/announcements.go index 047c83cb..d9af1e54 100644 --- a/announcements/announcements.go +++ b/announcements/announcements.go @@ -180,6 +180,7 @@ func (an *FxAnnouncements) AnnounceIExistPeriodically(ctx context.Context) { } func (an *FxAnnouncements) AnnounceJoinPoolRequestPeriodically(ctx context.Context) { + log.Debug("Starting AnnounceJoinPoolRequestPeriodically") defer an.wg.Done() an.announcingJoinPoolMutex.Lock() if an.announcingJoinPoolRequest { diff --git a/blockchain/blockchain.go b/blockchain/blockchain.go index 51d19ab3..b8d54ad0 100644 --- a/blockchain/blockchain.go +++ b/blockchain/blockchain.go @@ -603,6 +603,7 @@ func (bl *FxBlockchain) cleanUnwantedPeers(keepPeers []peer.ID) { } } func (bl *FxBlockchain) FetchUsersAndPopulateSets(ctx context.Context, topicString string, initiate bool) error { + log.Debug("FetchUsersAndPopulateSets is called for ", "topicString: ", topicString, " ,initiate: ", initiate) // Update last fetch time on successful fetch var keepPeers []peer.ID bl.lastFetchTime = time.Now() @@ -668,6 +669,7 @@ func (bl *FxBlockchain) FetchUsersAndPopulateSets(ctx context.Context, topicStri } } } + log.Debugw("stored members are", bl.members) } //Get hte list of both join requests and joined members for the pool diff --git a/blox/blox.go b/blox/blox.go index 98972bf0..cd2760d9 100644 --- a/blox/blox.go +++ b/blox/blox.go @@ -110,7 +110,9 @@ func (p *Blox) Start(ctx context.Context) error { if err := p.bl.Start(ctx); err != nil { return err } - p.bl.FetchUsersAndPopulateSets(ctx, p.topicName, true) + if err := p.bl.FetchUsersAndPopulateSets(ctx, p.topicName, true); err != nil { + log.Errorw("FetchUsersAndPopulateSets failed", "err", err) + } go func() { log.Infow("IPFS RPC server started on address http://localhost:5001") switch err := http.ListenAndServe("localhost:5001", p.ServeIpfsRpc()); { diff --git a/blox/options.go b/blox/options.go index 79760b37..4b9149e7 100644 --- a/blox/options.go +++ b/blox/options.go @@ -50,7 +50,7 @@ func newOptions(o ...Option) (*options, error) { return nil, errors.New("blox pool name must be specified") } if opts.topicName == "" { - opts.topicName = fmt.Sprintf("/explore.fula/pools/%s", path.Clean(opts.name)) + opts.topicName = fmt.Sprintf("%s", path.Clean(opts.name)) } if opts.h == nil { var err error