paritytech / substrate-api-sidecar

REST service that makes it easy to interact with blockchain nodes built using Substrate's FRAME framework.
https://paritytech.github.io/substrate-api-sidecar/dist/
GNU General Public License v3.0
245 stars 151 forks source link

Add api to query pending extrinsics status #168

Closed hewigovens closed 4 years ago

hewigovens commented 4 years ago

Hi, I found that there is no api in sidecar to query extrinsic status? the corresponding rpc might be author_pendingExtrinsics

Thanks

hewigovens commented 4 years ago

@joepetrowski is anyone working on this? I'd like to help, it seems author_pendingExtrinsics always returns empty data for me

{
  "id": 45,
  "jsonrpc": "2.0",
  "method": "author_pendingExtrinsics",
  "params": []
}
joepetrowski commented 4 years ago

It probably returns empty data because without a lot of network congestion, transactions don't stay pending for long. This is definitely something we're planning to have and it is in our v1 API spec. We are trying to release this in the next 1-2 months, so we can definitely include it in that. We can try to get it in a bit early too, but we have some others we are prioritizing.

@emostov can tell you the best way to structure the code.

hewigovens commented 4 years ago

that's great, would be nice to allow filtering by account or transaction hash as well

emostov commented 4 years ago

Hey @hewigovens - would be great if you would like to contribute. As Joe mentioned the API for the transaction pool is defined here. I think this will be a relatively straightforward one to implement and the most challenging part will likely just be making a unit test for the service (or controller), which we like to have as a simple way to track changes to the API.

Similar to the structure of the other endpoints, I would start by making a folder in both controllers and services called node and then put the respective NodeTransactionPool{Controller, Service} in each of the folders. I think the services and controller for something simple like RuntimeMetadata might be a good example of how to format things. You can also reach me at zeke:matrix.parity.io.

xakbel commented 1 year ago

This method returns me {'jsonrpc': '2.0', 'result': ['0x4502846a9081b6ca2414f14c5c859880fe52f831b5d991fa0401597e23e615135a7f2b01e632d68dbaa25381d398f9a0541598694cc60bba29fb1cea87e7553e4d2cbd6b5f60ecb0b0220407dd0a2685f78b1acf7b1eb77a113efecc322a718ed60333832400b502003b06000000000200000000204aa9d10100000000000000000000a6e47d186d133b000000000000000000'], 'id': 154} What the hell in result? How to decode it?

TarikGul commented 1 year ago

@xakbel Please file a separate issue with the following: