504's and and cloudflare blocking requests

I recommend to use web3api directly without a Moralis Server, either using moralis v1 sdk with moralisSecret parameter, or REST API, or moralis v2 SDK

But what about the various API-limited calls? Don’t I need server credentials to increase limits?

Is the REST API not “limited”?

This is basically what I’m using:

const Moralis = require('moralis-v1/node');
const options = {
  serverUrl: dAppServerUrl,
  appId: appId,
  masterKey: masterKey,
};

await Moralis.start(options);

I’m using that object to then make the majority of calls. What’s the problem with that specifically? :thinking:

you should use only moralisSecret for those options if you only use web3api

you don’t need to increase those limits, those limits can not be increased more than the limits that you have for your account, increasing them more will make it hit the account rate limit

These are the relevant calls we make to the Moralis object from the app:

...Web3API.token.getTokenMetadata

...Web3API.token.getTokenPrice

...Web3API.native.getTransaction

...Web3API.account.getTokenBalances

...Web3API.native.getLogsByAddress

...Plugins.oneInch.getSupportedTokens

...Web3API.defi.getPairAddress

...Web3API.defi.getPairReserves

...Cloud.run

You mind providing a specific example of one that you’d swap out for a different SDK or call?

it looks like you don’t use only web3api, there is also 1Inch and running cloud functions

The 1Inch call is a raaaaaare call. Like weekly. The only cloud functions involve boot-up coreservices_addEventSync just to ensure that sync actions are running for retrieval later via Mongo.

The native/token/account calls are what generate the traffic.

I mean that you can not completely stop using the server now, you are still using it for other things besides web3api

for web3api you should get a specific error message when you hit the rate limit

I think we might be conflating two issues:

  1. Moralis rate-limit

  2. CloudFlare IP banning

My primary issue isn’t rate-limiting . . . I expect this to happen. The primary issue is that CF randomly decides to ban the IP, and I can no longer access Moralis things. I have to change my IP to regain access then everything works fine again.

If you stop making requests when you hit the rate limit then you shouldn’t get any ban. I think that you will get a ban if you make too many requests, like thousands in a second.

So, basically (pricing aside), if I’m looking for “wide open” data access, Moralis is not what I need?

Do direct Mongo calls count against the IP?

Direct mongo calls don’t count towards rate limit. The rate limit doesn’t seem to be the issue now, more like it is ignored. You can get a higher rate limit with a better plan if needed.
But calls to the server could trigger cloudflare protections as the server is behind cloudflare.

Yeah, that’s my concern. Regardless of tier, I might still get CF’ed. Is it possible to get an IP “whitelisted” all the way through? :thinking:

I am not sure now about that.