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

Query the block results #721

Open
Segfaultd opened this issue Jan 20, 2025 · 1 comment
Open

Query the block results #721

Segfaultd opened this issue Jan 20, 2025 · 1 comment

Comments

@Segfaultd
Copy link

Segfaultd commented Jan 20, 2025

Hi,

I'm unable to find a way to query block results (begin / end events, val updates) from my SDK generated through Telescope. I do see Telescope has a few references over these but they are never included in the final clients, nor consumable.

CosmJS do have a method for it, but i'd like to avoid as much as possible creating a second client.
https://github.com/cosmos/cosmjs/blob/68e1ec8d9cc51263f38cdb13da0a01e9f8b729fd/packages/tendermint-rpc/src/comet38/comet38client.ts#L98

Am I doing something wrong?

Thanks

@Segfaultd
Copy link
Author

Only workaround for now is to manually query with a simple HTTP payload

try {
            const customRequest = {
                jsonrpc: '2.0',
                id: 1,
                method: 'block_results',
                params: [height.toString()],
            };

            const response = await lastValueFrom(
                this._httpService.post(chainRpcUrl, customRequest, {
                    headers: {
                        'Content-Type': 'application/json',
                    },
                }),
            );
            if (!response || response.status > 201) {
                return null;
            }

            // Gives you the height, txs_results, begin_block_events, end_block_events, validator_updates and consensus_param_updates
            console.dir(response.data, { depth: 4 });
        } catch (e) {
            console.error(e);
            return null;
        }

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

1 participant