Bitcoin Forum
May 04, 2024, 09:21:36 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: « 1 2 [3]  All
  Print  
Author Topic: Ripple API  (Read 3744 times)
nelisky (OP)
Legendary
*
Offline Offline

Activity: 1540
Merit: 1001


View Profile
March 11, 2013, 10:37:04 PM
 #41

Yes, I did. Had I not done it there would be an error 'No such ledger'.
I don't think account_tx will ever give you "no such ledger". You can query for transactions from ledger zero to ledger one million and it will give you the latest 200. (Arguably, it probably should tell you which ledgers it has in the reply, but you can always check, it's published to the "server" stream.)

Oh, but it does, at least if you do "account_tx account ledger" for a specific ledger id (as opposed to a range).

Still haven't had a chance to try this over a better machine but I'll report on that once I get it done.
1714857696
Hero Member
*
Offline Offline

Posts: 1714857696

View Profile Personal Message (Offline)

Ignore
1714857696
Reply with quote  #2

1714857696
Report to moderator
1714857696
Hero Member
*
Offline Offline

Posts: 1714857696

View Profile Personal Message (Offline)

Ignore
1714857696
Reply with quote  #2

1714857696
Report to moderator
"In a nutshell, the network works like a distributed timestamp server, stamping the first transaction to spend a coin. It takes advantage of the nature of information being easy to spread but hard to stifle." -- Satoshi
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714857696
Hero Member
*
Offline Offline

Posts: 1714857696

View Profile Personal Message (Offline)

Ignore
1714857696
Reply with quote  #2

1714857696
Report to moderator
1714857696
Hero Member
*
Offline Offline

Posts: 1714857696

View Profile Personal Message (Offline)

Ignore
1714857696
Reply with quote  #2

1714857696
Report to moderator
JoelKatz
Legendary
*
Offline Offline

Activity: 1596
Merit: 1012


Democracy is vulnerable to a 51% attack.


View Profile WWW
March 12, 2013, 12:27:42 AM
 #42

Oh, but it does, at least if you do "account_tx account ledger" for a specific ledger id (as opposed to a range).
You're correct. It's kind of a quirk in the code. If you specify a ledger range, special code for ranges of ledgers handles it. If you specify one specific ledger, generic code that fails if the ledger isn't available handles it.

I am an employee of Ripple. Follow me on Twitter @JoelKatz
1Joe1Katzci1rFcsr9HH7SLuHVnDy2aihZ BM-NBM3FRExVJSJJamV9ccgyWvQfratUHgN
nelisky (OP)
Legendary
*
Offline Offline

Activity: 1540
Merit: 1001


View Profile
March 12, 2013, 08:35:06 PM
 #43

Tried on a new, much better system, same difference. Opened an issue with the command outputs and config file.
nelisky (OP)
Legendary
*
Offline Offline

Activity: 1540
Merit: 1001


View Profile
March 13, 2013, 09:35:27 AM
 #44

Oh, but it does, at least if you do "account_tx account ledger" for a specific ledger id (as opposed to a range).
You're correct. It's kind of a quirk in the code. If you specify a ledger range, special code for ranges of ledgers handles it. If you specify one specific ledger, generic code that fails if the ledger isn't available handles it.

@JoelKatz with the db fix mentioned in the issue I opened everything works great, thank you!

To infinity and beyond!

Now, a small doubt on workflow; I submit a payment for which no trust line exists, I assume this transaction never gets submitted to a ledger, right? At least I could not find my test one. The issue I'm having is one of atomicity, where I submit a tx and note the request ID to match the response, but say between send and response my ws dies, and don't get this response at all.

Can I poll for it afterwards? Or is the assumption that if I don't see it in a ledger for a set period of time I can just resubmit the request? The latter feels dangerous if the network is busy and lags a bit.
ahbritto
Full Member
***
Offline Offline

Activity: 132
Merit: 100


Ripple


View Profile WWW
March 13, 2013, 10:30:48 AM
 #45

Now, a small doubt on workflow; I submit a payment for which no trust line exists, I assume this transaction never gets submitted to a ledger, right? At least I could not find my test one. The issue I'm having is one of atomicity, where I submit a tx and note the request ID to match the response, but say between send and response my ws dies, and don't get this response at all.

Can I poll for it afterwards? Or is the assumption that if I don't see it in a ledger for a set period of time I can just resubmit the request? The latter feels dangerous if the network is busy and lags a bit.

If a transaction could possibly apply, it is forwarded to the rest of the network. If a trust line doesn't exist, that won't stop a transaction from propagating because another transaction could create the line.

Take a look at this: https://ripple.com/wiki/Robustly_submitting_a_transaction

This describes how to submit transactions in an idempotent way. Generally, you want to build and store your transactions before you send them. Then you can send them as many times as you want. If you are coming back after a power failure, you could look for transactions that have been applied to your account since a specific ledger.
nelisky (OP)
Legendary
*
Offline Offline

Activity: 1540
Merit: 1001


View Profile
March 13, 2013, 11:12:29 AM
 #46

Now, a small doubt on workflow; I submit a payment for which no trust line exists, I assume this transaction never gets submitted to a ledger, right? At least I could not find my test one. The issue I'm having is one of atomicity, where I submit a tx and note the request ID to match the response, but say between send and response my ws dies, and don't get this response at all.

Can I poll for it afterwards? Or is the assumption that if I don't see it in a ledger for a set period of time I can just resubmit the request? The latter feels dangerous if the network is busy and lags a bit.

If a transaction could possibly apply, it is forwarded to the rest of the network. If a trust line doesn't exist, that won't stop a transaction from propagating because another transaction could create the line.

Take a look at this: https://ripple.com/wiki/Robustly_submitting_a_transaction

This describes how to submit transactions in an idempotent way. Generally, you want to build and store your transactions before you send them. Then you can send them as many times as you want. If you are coming back after a power failure, you could look for transactions that have been applied to your account since a specific ledger.

Of course, I knew that from my first read of the documentation... thank you for pointing out just how spread I am Smiley
Pages: « 1 2 [3]  All
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!