Hey everyone,
I'm currently working on a project and encountering some issues trying to query from block 1. I need an archive node, but the RPCs I've tried so far don't exactly works.
Here is what I've tested:
https://rpc.ankr.com/xdc - This throws an error whenever I query block 1 (I suspect it’s a standard full node and trims historical state).
https://arpc.xinfin.network & https://rpc.xdcrpc.com/ - These seem to have the archive data, but they block my frontend requests (http://localhost:5173) due to CORS policies.
Here is the exact error I get on the latter two:
Access to fetch at 'https://arpc.xinfin.network/' from origin 'http://localhost:5173' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
My questions:
Are there any free, public Archive RPC nodes available for XDC that support frontend/CORS requests?
If free options aren't available, are there any recommended paid providers that guarantee genesis block queries and allow custom origin headers?
Thanks in advance for any recommendations!
Discussion (14)
Are you encountering it by using a webpage/html file on your local machine? I’m thinking back and from memory I THINK I got around it by just hosting the page remotely on GitHub Pages for free (so it would have a valid domain as its origin).
The epoch rewards calculator page I linked in my other reply I think may have been the page that had it but now queries RPCs fine.. also I’ve just been using the Ankr RPC and not getting any missing Trie errors , and have managed to query quite far back so I figured it was an archive node but I think u may be right. Could’ve been pruned at some point if can’t get block 1?
the earpc RPC address mentioned by someone else is def an archive node.
hey, i have deployed the app with Vercel with this endpoint: earpc.xinfin.network/
but i still have and encounter the same CORS error
is there someway to contact the RPC to open it's CORS for us or ways to register for it to happend
yes, i am working on XDC archive node. maybe i should try hosting it on vercel because yes i am using localhost to access it. also i'm gonna try the new earpc RPC
The issue will likely be localhost as the origin
is there possible way i can use archive RPC that's available with localhost?
Sure is. Just run an archive node locally and I think it should be available at localhost:
To clarify.. if ur using a html page on ur local machine then it doesn’t have a domain so the origin will show as null and it will get rejected. But if hosted remotely, it shows as the domain instead of null.
Another option is to just run an archive node urself locally. Just set up a mainnet node as normal. Start the node. Stop the node. Delete any initial chain data. Set gcmode=archive then restart the node and let it sync from genesis (or download the latest archive chain snapshot and sync from wherever that gets the node up to.
Good luck
Hey I used the ankr one in this webpage. If you click on the instructions link at the top it will take u to the GitHub repository where u can view all the JavaScript in a single index.html file
s4njk4n.github.io/XDC_Masternode_R...
Please checkout latest RPC as Service by Plugin RPC : rpc.plugin.global/home
interesting, i did make an email asking regarding Plugin services and they said the RPC are full node not archive node. can you confirm is it archive or full node
Plugin RPCs are full node not archive node. You can try with earpc.xinfin.network (archive node).
Please try “Plugin RPC” which has been recently launched by XDC’s native Oracle, Plugin DON core team members:
rpc.plugin.global/
I did make an email asking regarding Plugin services and they said the RPC are full node not archive node. i tried it and i believe it have the same error (CORS error which i believe because it's in localhost). Does Plugin provide mainnet RPC for that customizable for local development
Hello @scarzerolab
Please try with earpc.xinfin.network