sei-protocol / sei-tendermint

Tendermint fork with ABCI++ support, bug fixes, and custom features
Other
37 stars 36 forks source link

how to analysis the txs from the block query? #192

Open yantao1995 opened 7 months ago

yantao1995 commented 7 months ago

when i query the blcok txs from the interface

func (c *baseRPCClient) Block(ctx context.Context, height *int64) (*coretypes.ResultBlock, error) {
    result := new(coretypes.ResultBlock)
    if err := c.caller.Call(ctx, "block", &coretypes.RequestBlockInfo{
        Height: (*coretypes.Int64)(height),
    }, result); err != nil {
        return nil, err
    }
    return result, nil
}

i get the tx with hex just like

0A8C010A89010A1C2F636F736D6F732E62616E6B2E763162657461312E4D736753656E6412690A2A7365693176666179743576726737336339746D753770786D72736A76636C7936356532736C6536673732122A7365693132687678636E673468396833657074646B6B7A6D767537726C656C6C617778357061613572341A0F0A047573656912073132333435303012680A500A460A1F2F636F736D6F732E63727970746F2E736563703235366B312E5075624B657912230A2102C973D236077605AEA75743B81995EE7A746D968F414596D50AE3FB9E89CDBDF412040A020801180112140A0E0A0475736569120631303030303010A08D061A40E193D9443A3C05F2D2769E86BE3DE50C617EDC218762CEA6217CACCDC91F9A4D11EAA83A978676ADEA27BA9069F59EAB3EA3D06E859EB932B80FABBF61B11E1B

when i print on screen whit golang fmt.Println(string(tx)) , the result


�
�
/cosmos.bank.v1beta1.MsgSendi
*sei1vfayt5vrg73c9tmu7pxmrsjvcly65e2sle6g72*sei12hvxcng4h9h3eptdkkzmvu7rlellawx5paa5r4
usei1234500h
P
F
/cosmos.crypto.secp256k1.PubKey#
!�s�6v��WC���ztm��AE��
����ͽ�


usei100000��@���D:<��v���=�a~�!�bΦ!|����M��:��v��'��i���>��n���2���a�

above all, it seem that the block contains the raw tx . but i don't know how to decode it.

yantao1995 commented 7 months ago

just could cross query tx get the tx info ,but the speed is slowly.so i want one block just query once .