XRPLF / clio

An XRP Ledger API Server
https://xrpl.org
ISC License
64 stars 53 forks source link

Handle `server_info` while Clio is loading ledger data #1299

Open mounikakun opened 7 months ago

mounikakun commented 7 months ago

Summary

Currently Clio returns "error": "notReady" if a request was sent while it is loading ledger data and do not serve any requests until it loads the initial ledger.

Feature request is to handle server_info and include current ledger sequence even when Clio is loading data similar to rippled.

Motivation

If Clio is setup with new database it can take up to 10 minutes to load ledger data so the user has to keep checking or track time while waiting for Clio to be in sync.It will be more informative for the user to gauge the approximate wait time if Clio can return current sequence in server_info while loading data.

Moreover rippled is handling server_info and returning current sequence while loading ledger data from the network so it will be good to have the same for Clio.

Solution

Handle server_info while loading ledger data and response should have seq. It is good replicate rippled's behavior for other params.

Sample expected response:

{
    "result": {
        "info": {
           .
           .
           .
            "validated_ledger": {
                .
                .
                _**"seq": 54**_
            }
           .
           .
        },
        "status": "success"
    }
}

Paths Not Taken

godexsoft commented 4 months ago

Idea: have a separate handler for notReady situation. Clio will always call it instead of any RPC the user requested while Clio is not ready to handle requests. The new handler can contain info to help diagnose Clio's startup.