-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ledger
method crash when use Clio server
#632
Comments
The |
Heya @jungsooyun , we cannot reproduce the problem that you are facing. Please be specific with the following information.
Attempt to ReproductionThis is our attempt to reproduction. # using xrpl-py==2.2.0
#
from xrpl.clients import JsonRpcClient
from xrpl.models.requests import Ledger
import logging
logger = logging.getLogger(__name__)
logging.basicConfig(level=logging.INFO)
def main():
mainnet_url = "https://s1.ripple.com:51234"
clio_url = "https://s2-clio.ripple.com:51234"
for url in (mainnet_url, clio_url):
logger.info("URL: %s", url)
xrpl_client = JsonRpcClient(url)
ledger_req = Ledger()
logger.info(ledger_req)
response = xrpl_client.request(ledger_req)
logger.info(response)
if __name__ == "__main__":
main() INFO:__main__:URL: https://s1.ripple.com:51234
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.SUCCESS: 'success'>, result={'ledger_hash': 'BBB4A839B5772CEB63DB44539CD44E635C72072BB0EF9554BE556710D9585CF6', 'ledger_index': 81881624, 'validated': True, 'ledger': {'accepted': True, 'account_hash': '4B3943C645774B33FA17E7D7B0D792CB8EE9E7BE275BF16A95405CB8AB90F341', 'close_flags': 0, 'close_time': 745510861, 'close_time_human': '2023-Aug-16 14:21:01.000000000 UTC', 'close_time_resolution': 10, 'closed': True, 'hash': 'BBB4A839B5772CEB63DB44539CD44E635C72072BB0EF9554BE556710D9585CF6', 'ledger_hash': 'BBB4A839B5772CEB63DB44539CD44E635C72072BB0EF9554BE556710D9585CF6', 'ledger_index': '81881624', 'parent_close_time': 745510860, 'parent_hash': 'DB68EE348581E9059948A358BAC4F8AA6DA417ED2ECB8D0DFC979BBA7938A29D', 'seqNum': '81881624', 'totalCoins': '99988495351869696', 'total_coins': '99988495351869696', 'transaction_hash': '4F45A0C9538E916479DA29DA496E5FC62C6B16515E68BEF7DD33FE5B35566549'}}, id=None, type=<ResponseType.RESPONSE: 'response'>)
INFO:__main__:URL: https://s2-clio.ripple.com:51234
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.SUCCESS: 'success'>, result={'ledger_hash': 'BBB4A839B5772CEB63DB44539CD44E635C72072BB0EF9554BE556710D9585CF6', 'ledger_index': 81881624, 'validated': True, 'ledger': {'accepted': True, 'account_hash': '4B3943C645774B33FA17E7D7B0D792CB8EE9E7BE275BF16A95405CB8AB90F341', 'close_flags': 0, 'close_time': 745510861, 'close_time_human': '2023-Aug-16 14:21:01.000000000 UTC', 'close_time_resolution': 10, 'closed': True, 'hash': 'BBB4A839B5772CEB63DB44539CD44E635C72072BB0EF9554BE556710D9585CF6', 'ledger_hash': 'BBB4A839B5772CEB63DB44539CD44E635C72072BB0EF9554BE556710D9585CF6', 'ledger_index': '81881624', 'parent_close_time': 745510860, 'parent_hash': 'DB68EE348581E9059948A358BAC4F8AA6DA417ED2ECB8D0DFC979BBA7938A29D', 'seqNum': '81881624', 'totalCoins': '99988495351869696', 'total_coins': '99988495351869696', 'transaction_hash': '4F45A0C9538E916479DA29DA496E5FC62C6B16515E68BEF7DD33FE5B35566549'}}, id=None, type=<ResponseType.RESPONSE: 'response'>)``` |
Sorry for late response.
# using xrpl-py==2.2.0
#
from xrpl.clients import JsonRpcClient
from xrpl.models.requests import Ledger, ServerInfo
import logging
logger = logging.getLogger(__name__)
logging.basicConfig(level=logging.INFO)
def main():
mainnet_url = "https://s1.ripple.com:51234"
cluster_url = "https://xrplcluster.com"
clio_url = "https://{masking}.xrp-mainnet.quiknode.pro/{masking}"
# clio_url = "https://s2-clio.ripple.com:51234"
for url in (mainnet_url, cluster_url, clio_url):
logger.info("URL: %s", url)
xrpl_client = JsonRpcClient(url)
ledger_req = Ledger()
logger.info(ledger_req)
response = xrpl_client.request(ledger_req)
logger.info(response)
if __name__ == "__main__":
main()
Given that the latest version deployed on github clio is 1.0.4, I'm not certain if it's a version issue. If it is a version issue, using the term 'crash' seems to have been a mistake. I apologize. However, if making a request using the |
I can replicate a difference in Clio/rippled response, but I can't replicate an error with |
Hello, I've discovered that when using the Ledger method to retrieve ledger data, a crash occurs if the server is not pure rippled but Clio.
If it's a method that doesn't exist in Clio, the Clio server relays the request to the rippled server without any problem. However, since both Clio and rippled have the Ledger method but require different parameters, a crash occurs when sending a request to Clio using the Ledger model at https://github.com/XRPLF/xrpl-py/blob/master/xrpl/models/requests/ledger.py.
I personally use a
ClioLedger
model as shown below, but I'm curious about what the developers think. Since there seems to be a similar issue in xrpl.js, I think it might be necessary to coordinate opinions with the xrpl.js team and the Clio / rippled teams. If you think the method below is also fine, I'll submit it as a PR.from CryptoQuant,
The text was updated successfully, but these errors were encountered: