Developers Forum for XinFin XDC Network

Discussion on: Archive RPC

Collapse
s4njk4n profile image
s4njk4n

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.

Collapse
scarzerolab profile image
Trahwidhi Author

hey, i have deployed the app with Vercel with this endpoint: earpc.xinfin.network/

but i still have and encounter the same CORS error

(index):1 Access to fetch at 'https://earpc.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.
Enter fullscreen mode Exit fullscreen mode

is there someway to contact the RPC to open it's CORS for us or ways to register for it to happend

Collapse
s4njk4n profile image
s4njk4n

You’d have to contact XinFin to ask that.. easier solution to test is just deploy an archive node locally in your office. Then set your local NAT to forward the public-facing RPC port of the NAT to the RPC port on your local archive node machine. That will let you test it. If it works on your own archive node then it means everything is working on your app fine. And then you know that the issue is purely the CORS issue.

Another option is to reach out to blockscan and/or ankr and ask them directly via their support if they have a CORS-permissive archive node you can use for your app. If they say yes then I imagine access would be quite affordable

Thread Thread
s4njk4n profile image
s4njk4n

Also plugin.global have an RPC service available as well but I think at present it was aiming for full nodes…. You could ask them if they have archive nodes as well, and if so how to access and whether you can test on it or how much access will cost. I imagine they’ll be competitive with the other commercial RPC providers..

Collapse
s4njk4n profile image
s4njk4n

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

Collapse
scarzerolab profile image
Trahwidhi Author

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

Collapse
s4njk4n profile image
s4njk4n

The issue will likely be localhost as the origin

Thread Thread
scarzerolab profile image
Trahwidhi Author

is there possible way i can use archive RPC that's available with localhost?

Thread Thread
s4njk4n profile image
s4njk4n

Sure is. Just run an archive node locally and I think it should be available at localhost: