ResourceExhausted error

Hello everyone. I was trying to pull all the moment minted events from the access node by looping through all the block height range. However I got this error message:

panic: client: rpc error: code = ResourceExhausted desc = grpc: received message larger than max (4577912 vs. 4194304)

Any idea how to fix it? Thank you!

Hi! If you want to query a large amount of events your best bet is to use an event indexer like:

In regards to your specific error, if you are using the CLI’s flow events get <eventId> command, keep in mind that the access nodes have a rate limit of ~2k/s. Is your call rate close to that? Due to load balancing, you might get the error a bit sooner