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

/cosmos/tx/v1beta1/txs endpoints new alternative? #10448

Closed
4 tasks
BenWolfaardt opened this issue Oct 27, 2021 · 6 comments
Closed
4 tasks

/cosmos/tx/v1beta1/txs endpoints new alternative? #10448

BenWolfaardt opened this issue Oct 27, 2021 · 6 comments
Assignees
Labels
T:Docs Changes and features related to documentation.

Comments

@BenWolfaardt
Copy link

BenWolfaardt commented Oct 27, 2021

Issue

Since upgrading our system to Cosmos SDK v0.42.6 (Gaia v5.0.2 / cosmoshub-4) we have noticed that some of the endpoints have been depreciated (according to Swagger Docs). For our use purposes these include:

  • height
  • minheight

Which were previously, and still are, accessible via: /txs?tx.minheight=25

Our question is, is this support temporary or will they properly be depreciated and implemented in another manner, for example making use of the cosmos/tx/v1beta1/txs?events=<query> - where <query> could look something like <tx.minheight=25> for example?

Similar Issues

It seems that @gagbo or @alexanderbez might be able to help based on the previously mentioned issues.

Version

Cosmos SDK v0.42.6 (Gaia v5.0.2 / cosmoshub-4)

Notes

P.S. This is most likely not considered a "bug", but unfortunately considering the options available when selecting an issue this was the "best fit".

Thanks for your appreciated assistance.
Kind regards,


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@gagbo
Copy link
Contributor

gagbo commented Oct 28, 2021

Hello,

Sorry I don't work on Cosmos integration for Ledger anymore, so I didn't really follow the updates on this front. Your best bet is to go through the proto files to see what kind of input the new endpoints take, and see whether you're able to apply the filters as you want.

Iirc you'll want to target where the sdk transforms the proto request into the tendermint request for the node, and that should show what kind of filter you can apply.

Regards,
Gerry

@BenWolfaardt
Copy link
Author

Thanks for your appreciated assistance Gerry, I'll take a more in depth look at it.

@clevinson clevinson added the T:Docs Changes and features related to documentation. label Oct 29, 2021
@amaury1093
Copy link
Contributor

amaury1093 commented Oct 29, 2021

The /txs?tx.height=25 endpoint, which belongs to the legacy REST API, has been deprecated since 0.42, and will be removed in the next release (0.45).

It has been replaced cosmos/tx/v1beta1/txs?events=. The following should work:

  • cosmos/tx/v1beta1/txs?events=tx.height=25

Let me know if that solves your issue!

@BenWolfaardt
Copy link
Author

BenWolfaardt commented Nov 2, 2021

Thank you @AmauryM for your help.

I've tried calling Cosmos endpoints as suggested; indeed the tx.height=<HEIGHT> param works, however, if I try the tx.minheight=<HEIGHT> param I receive an empty response (the second call was made by subtracting 1 from the height of the first call).

Below are the calls that I've made, the first being the tx.height=<height>:

GET https://api.cosmos.network//cosmos/tx/v1beta1/txs?events=tx.height=8215392

Response:

{
    "txs": [
        ...
    ],
    "tx_responses": [
        {
            "height": "8215392",
            "txhash": "E010A0985811A96CD154F4D0BB770E4597AA705151D6BC824B2604F21015D65D",
            ...
        }
    ],
    "pagination": {
        "next_key": null,
        "total": "1"
    }
}

tx.minheight=<minheight>:

GET https://api.cosmos.network//cosmos/tx/v1beta1/txs?events=tx.minheight=8215391

Response:

{
    "txs": [],
    "tx_responses": [],
    "pagination": {
        "next_key": null,
        "total": "0"
    }
}

Your assistance will be appreciated.
Kind regards,

@BenWolfaardt
Copy link
Author

Dear @AmauryM,

Before the depreciation of the previously used methods, to perform the above-outlined tasks, in the next release (0.45) we kindly ask that you please get back to us regarding the tx.minheight=<HEIGHT> endpoint.

Awaiting your helpful response.

@amaury1093
Copy link
Contributor

Try tx.height>=8279865 instead of minHeight.

it seems that minHeight hasn't been migrated to the new Protobuf endpoints. I created an issue to decide whether we should add that minHeight helper, or use just <=, >=: #10506.

Closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T:Docs Changes and features related to documentation.
Projects
None yet
Development

No branches or pull requests

4 participants