pub fn get_response_metadata(
    response: &str
) -> Box<dyn Future<Item = String, Error = ErrorCode>>
Expand description

Parse transaction response to fetch metadata. The important use case for this method is validation of Node’s response freshens.

Distributed Ledgers can reply with outdated information for consequence read request after write. To reduce pool load libindy sends read requests to one random node in the pool. Consensus validation is performed based on validation of nodes multi signature for current ledger Merkle Trie root. This multi signature contains information about the latest ldeger’s transaction ordering time and sequence number that this method returns.

If node that returned response for some reason is out of consensus and has outdated ledger it can be caught by analysis of the returned latest ledger’s transaction ordering time and sequence number.

There are two ways to filter outdated responses: 1) based on “seqNo” - sender knows the sequence number of transaction that he consider as a fresh enough. 2) based on “txnTime” - sender knows the timestamp that he consider as a fresh enough.

Note: response of GET_VALIDATOR_INFO request isn’t supported

Arguments

  • response - response of write or get request.

Note: response of GET_VALIDATOR_INFO request isn’t supported

Returns

response metadata { “seqNo”: Option - transaction sequence number, “txnTime”: Option - transaction ordering time, “lastSeqNo”: Option - the latest transaction seqNo for particular Node, “lastTxnTime”: Option - the latest transaction ordering time for particular Node }