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?
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:
-
Moralis rate-limit
-
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?
I am not sure now about that.