dydxprotocol / v4-clients

Other
61 stars 51 forks source link

get.py grpc_message:"DNS resolution failed... #129

Closed AVOlight closed 1 month ago

AVOlight commented 6 months ago

post.py working with fix https://github.com/dydxprotocol/v4-clients/issues/99#issuecomment-1868433704

any fix for get.py? tried many formats for VALIDATOR_GRPC_MAINNET and supported nodes from list

VALIDATOR_GRPC_MAINNET = 'grpc+https://dydx-ops-grpc.kingnodes.com:443'
# VALIDATOR_GRPC_MAINNET = 'https://dydx-ops-grpc.kingnodes.com:443'
# VALIDATOR_GRPC_MAINNET = 'https://dydx-ops-grpc.kingnodes.com'
NETWORK_ID_MAINNET = 'dydx-mainnet-1'
INDEXER_API_HOST_MAINNET = 'https://indexer.dydx.trade'
INDEXER_WS_HOST_MAINNET = 'wss://indexer.dydx.trade'
NETWORK=Network(
    env='mainnet',
    validator_config=ValidatorConfig(
        grpc_endpoint=VALIDATOR_GRPC_MAINNET, 
        chain_id=NETWORK_ID_MAINNET, 
        ssl_enabled=True
    ),
    indexer_config=IndexerConfig(
        rest_endpoint=INDEXER_API_HOST_MAINNET, 
        websocket_endpoint=INDEXER_WS_HOST_MAINNET, 
    ),
    faucet_endpoint='',
)

client = CompositeClient(
    NETWORK,
)

client.validator_client.get.bank_balance(subaccount.address, 'ibc/8E27BA2D5493AF5636760E354E46004562C46AB7EC0CC4C1CA14E9E20E2545B5')
raise _InactiveRpcError(state)  # pytype: disable=not-instantiable
grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
        status = StatusCode.UNAVAILABLE
        details = "DNS resolution failed for grpc+https://dydx-ops-grpc.kingnodes.com:443: UNAVAILABLE: WSA Error"
        debug_error_string = "UNKNOWN:Error received from peer  {grpc_message:"DNS resolution failed for grpc+https://dydx-ops-grpc.kingnodes.com:443: UNAVAILABLE: WSA Error", grpc_status:14, created_time:"2024-03-12T03:10:48.338824+00:00"}"
linear[bot] commented 6 months ago

GH-16 get.py grpc_message:"DNS resolution failed...

AVOlight commented 5 months ago

working alternative

client.indexer_client.account.get_subaccount_asset_positions(subaccount.address, 0)

kory- commented 5 months ago

@AVOlight client.get_current_block() I am having the same problem, was this resolved?

AVOlight commented 5 months ago

@AVOlight client.get_current_block() I am having the same problem, was this resolved?

still have the same issue but I only need block height so using this alternative

import requests
constant_headers = {
  'Accept': 'application/json'
}
constant_indexer_base_URL = 'https://indexer.dydx.trade/v4'
block_height_response = requests.get(f'{constant_indexer_base_URL}/height', headers = constant_headers)
block_height = int(block_height_response.json()['height'])
kory- commented 5 months ago

Thank you! I'll refer to it.

h17 commented 1 month ago

Seems like same issue I get when trying to run simple test for mainnet:

ERROR IS:

    status = StatusCode.UNAVAILABLE
    details = "DNS resolution failed for [https://dydx-ops-rpc.kingnodes.com:443](https://dydx-ops-rpc.kingnodes.com/): C-ares status is not ARES_SUCCESS qtype=AAAA name=[https://dydx-ops-rpc.kingnodes.com:443](https://dydx-ops-rpc.kingnodes.com/) is_balancer=0: Domain name not found"
    debug_error_string = "UNKNOWN:Error received from peer  {created_time:"2024-07-25T15:33:19.910389391+00:00", grpc_status:14, grpc_message:"DNS resolution failed for [https://dydx-ops-rpc.kingnodes.com:443](https://dydx-ops-rpc.kingnodes.com/): C-ares status is not ARES_SUCCESS qtype=AAAA name=[https://dydx-ops-rpc.kingnodes.com:443](https://dydx-ops-rpc.kingnodes.com/) is_balancer=0: Domain name not found"}"

The code is simplification v4-client-py-v2/examples/short_term_order_composite_example.py changed to MAINNET


websocket_indexer = "wss://indexer.dydx.trade/v4/ws"
#node_url = 'https://dydx-ops-rpc.kingnodes.com'
node_url = 'https://dydx-ops-rpc.kingnodes.com:443'

MAINNET = make_mainnet(rest_indexer,websocket_indexer,node_url)

NET = MAINNET
async def test():

    node = await NodeClient.connect(NET.node)
    indexer = IndexerClient(NET.rest_indexer)

    market = Market((await indexer.markets.get_perpetual_markets(MARKET_ID))["markets"][MARKET_ID])
    wallet = await Wallet.from_mnemonic(node, a9m, a9)

    place = await node.place_order(
        wallet,
        market.order(
            order_id,
            to_order_side["BUY"],
            size=0.001,
            price=order.get("price", 3003.3),
            time_in_force=order_execution_to_time_in_force["DEFAULT"],
            reduce_only=False,
            good_til_block=good_til_block,
        ),
    )
    wallet.sequence += 1
    time.sleep(5)

asyncio.run(test())```

I tested with every nodes that are listed on dydx here and get the same error, i.e all of these nodes below give the same error:
Polkachu | https://dydx-dao-rpc.polkachu.com:443 | 300 req/m
Bware Labs | https://dydx-mainnet-full-rpc.public.blastapi.io:443 | 20 req/s
KingNodes | https://dydx-ops-rpc.kingnodes.com:443 | 250 req/m
Lavender.Five | https://dydx-rpc.lavenderfive.com:443 |  
AutoStake | https://dydx-mainnet-rpc.autostake.com:443 | 4 req/s
EcoStake | https://rpc-dydx.ecostake.com:443 |  
PublicNode | https://dydx-rpc.publicnode.com:443 |  
Enigma | https://dydx-rpc.enigma-validator.com:443
samtin0x commented 1 month ago

Issue related to #214

samtin0x commented 1 month ago

Issue related to #214 . tldr: related to geo blocks