Files
status-go/pkg/messaging/api_store_nodes.go
Igor SirotinandClaude Opus 4.8 ca5c6a9be0 feat(messaging): resolve store nodes inside the Waku node (#7599)
The store nodes belong to the fleet, and the waku node already knows its
fleet, so it now resolves them itself (fleets.StoreNodes) at Start and feeds
its StoreClient — instead of the messenger resolving them and pushing them
down via SetStorenodes.

- wakuv2 resolves + dials the fleet's store nodes in Start; the
  StoreNode -> peer.AddrInfo conversion moves from messaging.API into the node.
- Remove the SetStorenodes push chain: the Waku interface method, the transport
  and messaging.API wrappers, and the messenger's AllMailservers/SetStorenodes call.
- The history-sync gate no longer checks storenode availability: the waku node
  always has the fleet's store nodes, so shouldSync just honors the
  mailservers-enabled setting.
- Drop the now-orphaned params.DefaultStoreNodes and the messenger's
  AllMailservers / allMailserversByFleet / getFleet helpers.
- Stop populating MessengerResponse.StoreNodes (the client-visible "mailservers"
  list); store nodes no longer leave the waku node.

Part of pm#380 / status-go#7589 — store-node peer selection was the last piece
of peer management still done above the Waku object.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-03 12:56:18 +01:00

24 lines
814 B
Go

package messaging
import (
"context"
adapters "github.com/status-im/status-go/pkg/messaging/adapters"
types "github.com/status-im/status-go/pkg/messaging/types"
)
// Query retrieves historic messages for a single batch (one pubsub topic and its
// content topics over [batch.From, batch.To]). The store node is selected
// internally — callers no longer pass a peer. shouldProcessNextPage (may be nil)
// is the per-page early-stop; processEnvelopes controls synchronous handling of
// fetched envelopes.
func (a *API) Query(
ctx context.Context,
batch types.StoreNodeBatch,
pageLimit uint64,
shouldProcessNextPage func(int) (bool, uint64),
processEnvelopes bool,
) error {
return a.core.stack.Transport.Query(ctx, *adapters.ToWakuBatch(&batch), pageLimit, shouldProcessNextPage, processEnvelopes)
}