clio icon indicating copy to clipboard operation
clio copied to clipboard

Research solutions to workaround xrpl-py/issues/632

Open godexsoft opened this issue 1 year ago • 3 comments

See https://github.com/XRPLF/xrpl-py/issues/632 Clio only supports validated ledgers and even provides a separate document describing ledger command functionality. However, if there is a mix of rippled and clio nodes on s1/s2 then clients can have difficulties parsing the response as it may be different for rippled and clio. Let's try to find a solution to this (even if it's fixing response parsing on the library side).

godexsoft avatar Sep 20 '23 16:09 godexsoft

The issue in https://github.com/XRPLF/xrpl-py/issues/632 seems not exist anymore.

INFO:__main__:Ledger(ledger_hash=None, ledger_index=None, method=<RequestMethod.LEDGER: 'ledger'>, id=None, full=False, accounts=False, transactions=False, expand=False, owner_funds=False, binary=False, queue=False, type=None)
INFO:__main__:Response(status=<ResponseStatus.ERROR: 'error'>, result={'error': 'notSupported', 'error_code': 75, 'error_message': 'Operation not supported.', 'type': 'response', 'request': {'method': 'ledger', 'params': [{'full': False, 'accounts': False, 'transactions': False, 'expand': False, 'owner_funds': False, 'binary': False, 'queue': False}]}}, id=None, type=<ResponseType.RESPONSE: 'response'>)

Clio has fixed this issue in 2.0. Previously, even "full", "accounts","queue" is false, clio will respond "notSupport". Currently , clio will forward the request to rippled if these fields are 'true'.

But clio indeed has different response structure as rippled. Rippled's response contains two sub node "closed", "open". Clio can not obtain open ledger, so there is only one layer in Clio's response. Clio should be friendly to the existing frontend code. Clio can add "closed" sub node.

cindyyan317 avatar Sep 21 '23 12:09 cindyyan317

We can add "closed" but that would change our existing API. I'm not sure there is another way though.

godexsoft avatar Sep 22 '23 12:09 godexsoft

@godexsoft there will be change in API when rippled version 2.0 is released. Since we will need to release clio with matching API changes, this seems like a good opportunity to unify the interface between the two.

Bronek avatar Sep 22 '23 13:09 Bronek