Closed krau5 closed 1 year ago
I've updated the python version. It's not about the python. Why does the code locally and on server executes differently, although it's the same ( I literally cloned the repo and copied the configuration )
Hmm, Forbidden usually means trongrid bans ip? Check if maybe it's cloudflare doing it's stuff You can test with ankr RPCs too
Won't it say on trongrid that the api key has blocked some requests if it banned the ip? By the way, which cloudflare are you talking about?
I've just created a new API key, no changes, same error + TronGrid does not give any information if the request using exact API key was blocked or sth
Trongrid might be behind cloudflare and it might be banning your server. Usually by checking response headers you can know
But the error is from the tronpy library. It's not the part of my code which fails and I can get the response directly
Specifically on this line
File "/root/venv/lib/python3.11/site-packages/tronpy/tron.py", line 966, in get_contract
info = self.provider.make_request("wallet/getcontract", {"value": addr, "visible": True})
But the error is from the tronpy library
Not it is not, it is from sending the request to trongrid Try with another rpc like https://www.ankr.com/rpc/tron
Uhm... but it literally says venv/lib/python3.11/site-packages/tronpy/tron.py
in line
info = self.provider.make_request("wallet/getcontract", {"value": addr, "visible": True})
I'll have a look at that rpc, although I do not understand how it's related to the issue
Because it sends an internet request, and status code forbidden means server (the rpc, not the library) blocked your request for some reason
So I can somehow pass the specified rpc inside the library or should I change the approach in the code if so?
I've made a contact with trongrid, they did not have an explanation either, so I've moved a server from one location to another and it works fine now
Weird thing, tbh
Yeah, as I've told you could switch from trongrid to something better or investiate why cloudflare blocks your server. Glad you got it resolved
I have the following line, where I am getting the usdt contract by its address
But when I run the code, I receive
The API key for TronGrid provider is alright ( it works locally ), but when I try to run the same code on the server - it fails. The only difference is python version ( 3.10 on server & 3.11 locally ), but could it even raise such a problem?
What should I do?