wormhole-foundation / wormhole-explorer

We could have named this super-parakeet. Tweet tweet.
Other
30 stars 28 forks source link

Add cosmoshub support #784

Open mliu-xlabs opened 11 months ago

mliu-xlabs commented 11 months ago

Task Set up cosmoshub - need channel to be able to test. Martin will provide.

mliu-xlabs commented 11 months ago

Channel for cosmoshub. see notion page for more details

Gateway --> transfer -- channel-5 -- connection-6 -- 07-tendermint-8 Cosmoshub --> transfer -- channel-3086 --

https://www.notion.so/wormholefoundation/General-Wormchaind-Commands-e51f3c7db577420dbc3c57796d18ef3b#767bf44e11f54d19a2774ed4cd7faf75

walker-16 commented 11 months ago

Do we know which are the appropriate rpc to use for cosmoshub testing/mainnet?

I found the following rpc:

https://api.cosmos.network
https://cosmos-api.polkachu.com
https://cosmos-testnet-api.polkachu.com
mliu-xlabs commented 11 months ago

use this one:

https://rpc.sentry-02.theta-testnet.polypore.xyz/

don't worry about mainnet, there will not be mainnet support at the moment

walker-16 commented 10 months ago

Reviewing the vaa on testnet, I understand that this vaa seems to be from cosmohub

curl --request GET \
  --url 'http://api.testnet.wormscan.io/api/v1/vaas/?txHash=25043f5cc44ac0af3415fad706a6af855ba633d22ef013cf36fc7a58a7770515'

{
    "data": [
        {
            "sequence": 133,
            "id": "3104/ef5251ea1e99ae48732800ccc7b83b57881232a73eb796b63b1d86ed2ea44e27/133",
            "version": 1,
            "emitterChain": 3104,
            "emitterAddr": "ef5251ea1e99ae48732800ccc7b83b57881232a73eb796b63b1d86ed2ea44e27",
            "guardianSetIndex": 0,
            "vaa": "AQAAAAABAFKPjsobh0+qfHU7fWTN00rGtR0Gffn7rxHd/N3AYJCKIn0AV7VmV5Fgt4aYpFECQ38FexWwuOcWg1xdLI/+Hq0BZTE/bQAAFvAMIO9SUeoema5IcygAzMe4O1eIEjKnPreWtjsdhu0upE4nAAAAAAAAAIUAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYagAAAAAAAAAAAAAAAA8ZSv31CwPmm9fQV8GqnhDJlU5MkADue1+IpU2H4MR1cFqDUQwfABVqSiGPIJWISxnf68pjwZABYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==",
            "timestamp": "2023-10-19T14:38:37Z",
            "updatedAt": "2023-10-19T14:38:42.672Z",
            "indexedAt": "2023-10-19T14:38:42.672Z",
            "txHash": "25043f5cc44ac0af3415fad706a6af855ba633d22ef013cf36fc7a58a7770515"
        }
    ],
    "pagination": {
        "next": ""
    }
}
walker-16 commented 10 months ago

Then, I execute the endpoint to get wormchain transactios details


curl --request GET \
  --url 'https://wormchain-testnet.jumpisolated.com/tx?hash=0x25043f5cc44ac0af3415fad706a6af855ba633d22ef013cf36fc7a58a7770515'

...
{\"key\":\"packet_timeout_timestamp\",\"value\":\"1697726481996999936\"},{\"key\":\"packet_sequence\",\"value\":\"51\"},{\"key\":\"packet_src_port\",\"value\":\"transfer\"},{\"key\":\"packet_src_channel\",\"value\":\"channel-3086\"},{\"key\":\"packet_dst_port\",\"value\":\"transfer\"},{\"key\":\"packet_dst_channel\",\"value\":\"channel-5\"},{\"key\":\"packet_channel_ordering\",\"value\":\"ORDER_UNORDERED\"},{\"key\":\"packet_connection\",\"value\":\"connection-6\"}]},{\"type\":\"tf_burn\",\"attributes\":[{\"key\":\"burn_from_address\",\"value\":\"wormhole1ctnjk7an90lz5wjfvr3cf6x984a8cjnv8dpmztmlpcq4xteaa2xs9pwmzk\"},
...
walker-16 commented 10 months ago

I execute the query that we use to get data for the cosmos chain and we dont have results. example:

curl --request POST \
  --url https://rpc.sentry-02.theta-testnet.polypore.xyz/ \
  --header 'Content-Type: application/json' \
  --data '{
  "jsonrpc": "2.0",
  "id": "",
  "method": "tx_search",
  "params": {
    "query": "send_packet.packet_src_channel='\''channel-3086'\'' AND send_packet.packet_dst_channel='\''channel-5'\'' AND send_packet.packet_sequence=51",
    "page": "1"
  }
}'

response:

{
    "jsonrpc": "2.0",
    "id": "",
    "result": {
        "txs": [],
        "total_count": "0"
    }
}
walker-16 commented 10 months ago

Using the timestamp it is not found either. The question I have is if this endpoint is fine https://rpc.sentry-02.theta-testnet.polypore.xyz or if another query should be sent to identify the cosmoshubs transactions.

walker-16 commented 10 months ago

for the other path, the one that cosomoshub is the targetChain, I coudnt find a transactions for this case.

SamantaCasal commented 10 months ago

@M-Picco could you help us with this doubt? "Using the timestamp it is not found either. The question I have is if this endpoint is fine https://rpc.sentry-02.theta-testnet.polypore.xyz/ or if another query should be sent to identify the cosmoshubs transactions." FYI: @walker-16

walker-16 commented 10 months ago

example cosmoshub as target chain

curl --request POST \
  --url http://localhost:3005/vaas/parse \
  --header 'Content-Type: text/plain' \
  --data 'AQAAAAABAPrzZu4dewjVUO8qAN2OmsvBxVjccW2sQ2eQIwQrc3LyE22D4qPuM0+Lrf9m2pdA36SNUDst8esL5m9C0Y7rjUAAZWiVEp9AAQAABgAAAAAAAAAAAAAAAGHkTlBspWWebAu6m2eFhvotcpdWAAAAAAAAOcIBAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABkAAAAAAAAAAAAAAAAVCWJApiu1gFZWnCrgVyWcRoxvGUABsLnK3uzK/4qOklg44ToxT16fEpsO0OxL38OAVMvPeqNDCAAAAAAAAAAAAAAAAAFwAnEwfGYPUuRXBRfTngt4j06OHsiZ2F0ZXdheV90cmFuc2ZlciI6eyJjaGFpbiI6NDAwMCwibm9uY2UiOjk1OTcsInJlY2lwaWVudCI6IlkyOXpiVzl6TVRka2VIVjJaR1puZUhVd1ozQjViVE5vZFRobmJHTmpkRGxyYW1OamJqUjRlSEJqTnpCbCIsImZlZSI6IjAifX0='

response:

{
    "appIds": [
        "PORTAL_TOKEN_BRIDGE",
        "WORMCHAIN_GATEWAY_TRANSFER"
    ],
    "parsedPayload": {
        "payloadType": 3,
        "callerAppId": "WORMCHAIN_GATEWAY_TRANSFER",
        "amount": "100",
        "tokenAddress": "0000000000000000000000005425890298aed601595a70ab815c96711a31bc65",
        "tokenChain": 6,
        "toAddress": "c2e72b7bb32bfe2a3a4960e384e8c53d7a7c4a6c3b43b12f7f0e01532f3dea8d",
        "toChain": 3104,
        "fee": "",
        "fromAddress": "00000000000000000000000005c009c4c1f1983d4b915c145f4e782de23d3a38",
        "payload": "eyJnYXRld2F5X3RyYW5zZmVyIjp7ImNoYWluIjo0MDAwLCJub25jZSI6OTU5NywicmVjaXBpZW50IjoiWTI5emJXOXpNVGRrZUhWMlpHWm5lSFV3WjNCNWJUTm9kVGhuYkdOamREbHJhbU5qYmpSNGVIQmpOekJsIiwiZmVlIjoiMCJ9fQ==",
        "parsedPayload": {
            "gateway_transfer": {
                "chain": 4000,
                "nonce": 9597,
                "recipient": "Y29zbW9zMTdkeHV2ZGZneHUwZ3B5bTNodThnbGNjdDlramNjbjR4eHBjNzBl",
                "fee": "0"
            }
        }
    },
    "vaa": {
        "emitterChain": 6,
        "payload": "AwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABkAAAAAAAAAAAAAAAAVCWJApiu1gFZWnCrgVyWcRoxvGUABsLnK3uzK/4qOklg44ToxT16fEpsO0OxL38OAVMvPeqNDCAAAAAAAAAAAAAAAAAFwAnEwfGYPUuRXBRfTngt4j06OHsiZ2F0ZXdheV90cmFuc2ZlciI6eyJjaGFpbiI6NDAwMCwibm9uY2UiOjk1OTcsInJlY2lwaWVudCI6IlkyOXpiVzl6TVRka2VIVjJaR1puZUhVd1ozQjViVE5vZFRobmJHTmpkRGxyYW1OamJqUjRlSEJqTnpCbCIsImZlZSI6IjAifX0=",
        "sequence": "14786",
        "emitterAddress": "00000000000000000000000061e44e506ca5659e6c0bba9b678586fa2d729756",
        "guardianSetIndex": 0,
        "timestamp": "1970-01-20T16:35:52.722Z",
        "nonce": 2671771904,
        "hash": "WPvFhGOnQQr0GtOgnfEY1qFgxiKcVUugTKM9cOB5Upc=",
        "version": 1,
        "consistencyLevel": 1,
        "guardianSignatures": [
            {
                "index": 0,
                "signature": "+vNm7h17CNVQ7yoA3Y6ay8HFWNxxbaxDZ5AjBCtzcvITbYPio+4zT4ut/2bal0DfpI1QOy3x6wvmb0LRjuuNQAA="
            }
        ]
    },
    "standardizedProperties": {
        "appIds": [
            "PORTAL_TOKEN_BRIDGE",
            "WORMCHAIN_GATEWAY_TRANSFER"
        ],
        "fromChain": 6,
        "fromAddress": "0x05c009c4c1f1983d4b915c145f4e782de23d3a38",
        "toChain": 3104,
        "toAddress": "wormhole1ctnjk7an90lz5wjfvr3cf6x984a8cjnv8dpmztmlpcq4xteaa2xs9pwmzk",
        "tokenChain": 6,
        "tokenAddress": "0x5425890298aed601595a70ab815c96711a31bc65",
        "amount": "100",
        "feeAddress": "0x5425890298aed601595a70ab815c96711a31bc65",
        "feeChain": 6,
        "fee": ""
    }
}
walker-16 commented 10 months ago

Blocked until we have an example to check the path comoshub as source chain