What is the "id": 1 in the body for?

+2 votes

Hi!

I'm exploring Multichain API.

C:\Multichain>multichain-cli chain1 liststreams
{"method":"liststreams","params":[],"id":1,"chain_name":"chain1"}

- Anybody can explain to me what the "id": 1 in the body is for?

Thank you!

asked May 9 by d2phap

1 Answer

+1 vote
 
Best answer

Multichain uses RPC 1.0 calls.

The RPC 1.0 protocol request specifies to send an ID. This is the id you are referring to. It can be whatever integer you want. 

Quote from JSON-RPC:

  • id - The request id. This can be of any type. It is used to match the response with the request that it is replying to.

More info on RPC specification (Check --> 1.1 Request (method invocation)):

https://www.jsonrpc.org/specification_v1

answered May 10 by kgiannis
selected May 10 by d2phap
Thank you for the details!
...