itering / substrate-api-rpc

Substrate RPC lib

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Decode Extrinsic

crossle opened this issue · comments

  1. When decode extrinsic, must fill metadataInstant ?
  2. How to get the transaction fee only use RPC via http?
commented
  1. When decode extrinsic, must fill metadataInstant ?
  2. How to get the transaction fee only use RPC via http?
  1. Must fill metadataInstant, metadata info like ethereum contract Abi
  2. You can find there
    func SystemPaymentQueryInfo(id int, encodedExtrinsic string) []byte {
    .

Thanks, BTW, How to get the extrinsic status? success or failure?

	decodeEvent, err := substrate.DecodeEvent(event, metaInstant, specVersion)
	if err != nil {
		return nil, err
	}

When decode event like block 2088622, error:

Recovering from panic in DecodeEvent error is: runtime error: index out of range [5] with length 3

Sometime error Recovering from panic in DecodeEvent error is: Vec length 672001531 exceeds 1000

commented

@crossle Your need to check using event relate metadata and custom type

How to use event metadata, i get the metadata from rpc state_getMetadata

commented

@crossle state_getMetadata,you need use event block relate metadata
curl -X POST -H "Content-Type: application/json" --data '{"id":6,"jsonrpc":"2.0","method":"state_getMetadata","params":[blockHash]}'

@crossle state_getMetadata,you need use event block relate metadata
curl -X POST -H "Content-Type: application/json" --data '{"id":6,"jsonrpc":"2.0","method":"state_getMetadata","params":[blockHash]}'

Thanks, I lost the blockHash param...

Sometime error Recovering from panic in DecodeEvent error is: Vec length 672001531 exceeds 1000

@freehere107 spec version must match the metadata?

commented

Sometime error Recovering from panic in DecodeEvent error is: Vec length 672001531 exceeds 1000

@freehere107 spec version must match the metadata?

@crossle Right!

@crossle Your need to check using event relate metadata and custom type

@freehere107 Can you commit the polkadot custom type to the project? like decode event, or where i can find the custom type?

@crossle you may reference https://github.com/itering/scale.go/tree/master/network

Why not make the json to go file? others can import it

commented

@crossle In fact, this custom JSON can only be used for testing. The custom JSON used by subscan.io is not open source.

@crossle In fact, this custom JSON can only be used for testing. The custom JSON used by subscan.io is not open source.

Any different?

Updates are not frequent

How about make the json to *.go file?