-
Notifications
You must be signed in to change notification settings - Fork 12
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
account_tx comes back blank #381
Comments
@RichardAH (account: rpEZRGPj3miukn48yfQGePQFjqVhHJLm1C,
Script require 'http'
require 'json'
require 'securerandom'
account = 'rpEZRGPj3miukn48yfQGePQFjqVhHJLm1C'
20.times do |i|
query = {
'jsonrpc': '2.0',
id: SecureRandom.uuid,
method: 'account_tx',
params: [
{
ledger_index_min: -1,
ledger_index_max: -1,
account: account
}.compact
]
}
response =
HTTP
.headers('Content-Type' => 'application/json')
.post('https://xahau.network', body: query.to_json)
.then { JSON.parse(_1.to_s) }
if response.dig('result', 'status') != 'success'
raise "Request failed"
end
marker, txns, ledger_index_min, ledger_index_max =
response['result'].values_at(
'marker', 'transactions', 'ledger_index_min', 'ledger_index_max'
)
puts "Txns: #{txns.count}, Marker: #{marker}, ledger_index_min: #{ledger_index_min}, ledger_index_max: #{ledger_index_max}"
end |
Are you sure you're not being rate limited? |
When I encounter rate limit, the response code is 429 and the body is This is a different story. Here's the output with bodies of "0 txs" responses:
|
Workaround: retry each request until |
I see. I'm curious what you're trying to accomplish? Why are you increasing the ledger_max by 1? And in your last request you are looking for transactions between 9508962 - 9509538 and there are none... So its correct. If you want all the transactions for an account what you are doing isn't correct.
|
I'm showing that the API is unstable. In my example, I'm repeating the same request with exactly the same params 20 times. Some responses are ok (those that have a marker and txs.count == 200), others are broken. The broken ones have empty txs list, no marker and a very high |
It appears that some nodes in the Xahaud cluster are holding only the most recent ledger instead of the full history node. (or in backfill). This is the result of running server_info rpc multiple times and getting complete_ledgers.
|
I'll leave this issue open and rename it, but the original issued was fixed by 8b0d427 I believe |
Issue Description
Steps to Reproduce
Expected Result
Actual Result
Environment
Supporting Files
The text was updated successfully, but these errors were encountered: