Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pythd] mainnet: error=failed to handshake websocket: Too Many Requests #71

Closed
tnedev opened this issue Oct 1, 2021 · 5 comments
Closed

Comments

@tnedev
Copy link

tnedev commented Oct 1, 2021

Hi,

I'm trying to use pythd with mainnet-beta, but I can't connect. It runs fine using devnet, but mainet-beta fails.

./pythd -k $KDIR -r $RHOST
[2021-10-01T10:01:03.758888Z 722534 INF publish_key ] key_name=CZfEVuDoUKEgpyuoBtTHDkUcetvyKrTKWfPJsYfqv355
[2021-10-01T10:01:03.758935Z 722534 INF mapping_key ] key_name=AHtgzX45WTKfkPG53L6WYhGEXwQkN1BVknET3sVsLL8J
[2021-10-01T10:01:03.758949Z 722534 INF program_key ] key_name=FsJ3A3u2vn5cTVofAjvy6y5kwABJAqYWpe4975bi2epH
[2021-10-01T10:01:03.796309Z 722534 INF listening ] port=8910,content_dir=
[2021-10-01T10:01:03.796316Z 722534 INF initialized ] version=2,rpc_host=api.mainnet-beta.solana.com,tx_host=localhost,capture_file=,commitment=confirmed,publish_interval(ms)=227
[2021-10-01T10:01:03.865403Z 722534 INF rpc_connected ]
[2021-10-01T10:01:03.926304Z 722534 INF received_recent_block_hash ] curr_slot=99230323,hash_slot=99230269,round_trip_time(ms)=30.283889
[2021-10-01T10:01:03.957041Z 722534 INF add_mapping ] account=AHtgzX45WTKfkPG53L6WYhGEXwQkN1BVknET3sVsLL8J,num_products=43
[2021-10-01T10:01:03.987762Z 722534 INF add_product ] account=5uKdRzB3FzdmwyCHrqSGq4u2URja617jqtKkM71BVrkw,attr={"asset_type":"Crypto","symbol":"BCH/USD","country":"US","quote_currency":"USD","description":"BCH/USD","tenor":"Spot","generic_symbol":"BCHUSD"}
[2021-10-01T10:01:03.988206Z 722534 INF add_product ] account=ETuC4VK6kuHfxc9MCU14dASfnGBfzgFUVCs1oVowawHb,attr={"asset_type":"Crypto","symbol":"LTC/USD","country":"US","quote_currency":"USD","description":"LTC/USD","tenor":"Spot","generic_symbol":"LTCUSD"}
[2021-10-01T10:01:03.988539Z 722534 INF add_product ] account=4aDoSXJ5o3AuvL7QFeR6h44jALQfTmUUCTVGDD6aoJTM,attr={"asset_type":"Crypto","symbol":"BTC/USD","country":"US","quote_currency":"USD","description":"BTC/USD","tenor":"Spot","generic_symbol":"BTCUSD"}
[2021-10-01T10:01:03.988871Z 722534 INF add_product ] account=4ANvG59u4YToJnVi2CkZbbfTE9mWHpyNbMmm69R43E3q,attr={"asset_type":"Crypto","symbol":"BNB/USD","country":"US","quote_currency":"USD","description":"BNB/USD","tenor":"Spot","generic_symbol":"BNBUSD"}
[2021-10-01T10:01:03.989246Z 722534 INF add_product ] account=GeSpWQucSvWhaXVvC2RJihpne9dCdL25pn46BTiDLyYs,attr={"asset_type":"Crypto","symbol":"DOGE/USD","country":"US","quote_currency":"USD","description":"DOGE/USD","tenor":"Spot","generic_symbol":"XDGUSD"}
[2021-10-01T10:01:03.989538Z 722534 INF add_product ] account=Av6XyAMJnyi68FdsKSPYgzfXGjYrrt6jcAMwtvzLCqaM,attr={"asset_type":"Crypto","symbol":"USDT/USD","country":"US","quote_currency":"USD","description":"USDT/USD","tenor":"Spot","generic_symbol":"USDTUSD"}
[2021-10-01T10:01:03.989866Z 722534 INF add_product ] account=ALP8SdU9oARYVLgLR7LrqMNCYBnhtnQz1cj6bwgwQmgj,attr={"asset_type":"Crypto","symbol":"SOL/USD","country":"US","quote_currency":"USD","description":"SOL/USD","tenor":"Spot","generic_symbol":"SOLUSD"}
[2021-10-01T10:01:03.990104Z 722534 INF add_product ] account=8GWTTbNiXdmyZREXbjsZBmCRuzdPrW55dnZGDkTRjWvb,attr={"asset_type":"Crypto","symbol":"USDC/USD","country":"US","quote_currency":"USD","description":"USDC/USD","tenor":"Spot","generic_symbol":"USDCUSD"}
[2021-10-01T10:01:03.990411Z 722534 INF add_product ] account=EMkxjGC1CQ7JLiutDbfYb7UKb3zm9SJcUmr1YicBsdpZ,attr={"asset_type":"Crypto","symbol":"ETH/USD","country":"US","quote_currency":"USD","description":"ETH/USD","tenor":"Spot","generic_symbol":"ETHUSD"}
[2021-10-01T10:01:03.990688Z 722534 INF add_product ] account=6T1eJbKWyhZXEjmuBej9gPk3SRTagzrEQovCSwAWD57P,attr={"asset_type":"Crypto","symbol":"SRM/USD","country":"US","quote_currency":"USD","description":"SRM/USD","tenor":"Spot","generic_symbol":"SRMUSD"}
[2021-10-01T10:01:04.020090Z 722534 ERR rpc_http_reset ] error=fail to read [104 Connection reset by peer],host=api.mainnet-beta.solana.com,port=80
[2021-10-01T10:01:04.088382Z 722534 ERR rpc_websocket_reset ] error=failed to handshake websocket: Too Many Requests,host=api.mainnet-beta.solana.com,port=80
[2021-10-01T10:01:06.083764Z 722534 ERR rpc_websocket_reset ] error=failed to handshake websocket: Too Many Requests,host=api.mainnet-beta.solana.com,port=80
[2021-10-01T10:01:10.084534Z 722534 ERR rpc_websocket_reset ] error=failed to handshake websocket: Too Many Requests,host=api.mainnet-beta.solana.com,port=80
[2021-10-01T10:01:18.086001Z 722534 INF rpc_connected ]
[2021-10-01T10:01:18.152652Z 722534 INF received_recent_block_hash ] curr_slot=99230356,hash_slot=99230321,round_trip_time(ms)=33.398536
[2021-10-01T10:01:18.186456Z 722534 INF add_mapping ] account=AHtgzX45WTKfkPG53L6WYhGEXwQkN1BVknET3sVsLL8J,num_products=43
[2021-10-01T10:01:18.186835Z 722534 INF add_product ] account=5uKdRzB3FzdmwyCHrqSGq4u2URja617jqtKkM71BVrkw,attr={"asset_type":"Crypto","symbol":"BCH/USD","country":"US","quote_currency":"USD","description":"BCH/USD","tenor":"Spot","generic_symbol":"BCHUSD"}
[2021-10-01T10:01:18.187316Z 722534 INF add_price ] account=5ALDzwcRJfSyGdGyhP3kP628aqBNHZzLuVww7o9kdspe,product=5uKdRzB3FzdmwyCHrqSGq4u2URja617jqtKkM71BVrkw,symbol=BCH/USD,price_type=price,version=2,exponent=-8,num_publishers=9
[2021-10-01T10:01:18.187568Z 722534 INF add_product ] account=ETuC4VK6kuHfxc9MCU14dASfnGBfzgFUVCs1oVowawHb,attr={"asset_type":"Crypto","symbol":"LTC/USD","country":"US","quote_currency":"USD","description":"LTC/USD","tenor":"Spot","generic_symbol":"LTCUSD"}
[2021-10-01T10:01:18.188111Z 722534 INF add_price ] account=8RMnV1eD55iqUFJLMguPkYBkq8DCtx81XcmAja93LvRR,product=ETuC4VK6kuHfxc9MCU14dASfnGBfzgFUVCs1oVowawHb,symbol=LTC/USD,price_type=price,version=2,exponent=-8,num_publishers=11
[2021-10-01T10:01:18.188375Z 722534 INF add_product ] account=4aDoSXJ5o3AuvL7QFeR6h44jALQfTmUUCTVGDD6aoJTM,attr={"asset_type":"Crypto","symbol":"BTC/USD","country":"US","quote_currency":"USD","description":"BTC/USD","tenor":"Spot","generic_symbol":"BTCUSD"}
[2021-10-01T10:01:18.188793Z 722534 INF add_price ] account=GVXRSBjFk6e6J3NbVPXohDJetcTjaeeuykUpbQF8UoMU,product=4aDoSXJ5o3AuvL7QFeR6h44jALQfTmUUCTVGDD6aoJTM,symbol=BTC/USD,price_type=price,version=2,exponent=-8,num_publishers=17
[2021-10-01T10:01:18.189053Z 722534 INF add_product ] account=4ANvG59u4YToJnVi2CkZbbfTE9mWHpyNbMmm69R43E3q,attr={"asset_type":"Crypto","symbol":"BNB/USD","country":"US","quote_currency":"USD","description":"BNB/USD","tenor":"Spot","generic_symbol":"BNBUSD"}
[2021-10-01T10:01:18.221274Z 722534 ERR rpc_http_reset ] error=fail to read [104 Connection reset by peer],host=api.mainnet-beta.solana.com,port=80
[2021-10-01T10:01:19.088638Z 722534 INF rpc_connected ]
[2021-10-01T10:01:19.160880Z 722534 INF received_recent_block_hash ] curr_slot=99230359,hash_slot=99230322,round_trip_time(ms)=37.319143
pythd: Connection rate limits exceeded, contact your app developer or support@rpcpool.com.
[2021-10-01T10:01:19.193679Z 722534 INF pythd_teardown

@tnedev tnedev changed the title Pythd mainnet: error=failed to handshake websocket: Too Many Requests [pythd] mainnet: error=failed to handshake websocket: Too Many Requests Oct 1, 2021
@SEJeff
Copy link
Contributor

SEJeff commented Oct 1, 2021

Hello @tnedev, are you trying to publish data to the pyth network or wanting to use it as a source of data?

Generally speaking, you need to use a dedicated solana rpc node for or get an api key from the rpcpool folks to run pythd effectively.

@tnedev
Copy link
Author

tnedev commented Oct 1, 2021 via email

@tnedev
Copy link
Author

tnedev commented Oct 6, 2021

@SEJeff Is there a chance that this error is due to pythd sending add_product requests too fast?
I've had similar disconnects when I was subscribing to products using the websocket, so I had to add sleep between them.

@jhunsaker
Copy link
Contributor

as @SEJeff was alluding to, public Solana rpc nodes have rate limiting behavior to prevent any one user from overloading them

pyth client implemention does not currently have logic to handle / deal with rate limiting and works best on dedicated or private Solana rpc nodes

@tnedev
Copy link
Author

tnedev commented Oct 11, 2021

I've tried to use a shared node from https://runnode.com
But they provide an api key in the url, which pythd doesn't seem to like and the C++ code around that it's a bit hard to understand for me.

@tnedev tnedev closed this as completed Oct 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants