michaelhly / solana-py

Solana Python SDK

Home Page:https://michaelhly.github.io/solana-py

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Adding proxies

monkeyden opened this issue · comments

I'm going to take a stab at adding proxy support. Is it safe to start with master or should I use v0.34.0?

Master is safe. But what do you mean by proxy?

Requests are made through a rotating proxy service. Common method to get around overly stringent rate limits.

Solana mainnet allows 10 RPC calls per second. Each proxy IP is a multiplier of that.

Oh. Like fallback endpoints?

In this case, the client is passing requests through a proxy, in order to mask the original source.

Let's use ProxyMesh as an example. Solana itself restricts RPC calls to 10 per second. Using ProxyMesh, I could use something like xxxx.proxymesh.com:1234, passing all my requests through a proxy first, and in turn have access to 10|20|50|100 distinct IPs making the requests for me.

Other crypto libraries, like ccxt, have something similar. Consider chart data. Binance does the most volume of any CEX, therefore its price data is the best better barometer for the market. If your country isn't served by Binance but you still want to make REST calls, you can either use a VPN or pass the requests through something like ProxyMesh.

Note: Not an endorsement of ProxyMesh. It just happens to be the service I'm looking at right now.

I do not think that should be added to this library. Perhaps you can start your own package and wrap the Client or AsyncClient.

cc @kevinheavey, he may have thoughts.

I can absolutely appreciate that perspective.

Yeah agreed with @michaelhly. But do let us know if something about solana-py's design makes it unnecessarily difficult to add proxy support in a new library