XRPLF / rippled

Decentralized cryptocurrency blockchain daemon implementing the XRP Ledger protocol in C++
https://xrpl.org
ISC License
4.48k stars 1.45k forks source link

Question: Transactions and JSON/RPC #2080

Closed gituser closed 7 years ago

gituser commented 7 years ago

Hello.

I'm sorry if I'm spamming too much here.

But you guys are answering here very quickly and on point, I couldn't find much info on the forums or somewhere else.

Just have quick questions:

  1. Is there any analog of bitcoin's walletnotify to get notified of the new transactions coming to the ripple wallet? So instead of querying the daemon every minute to get instant notification of the new incoming transaction from the daemon itself..

  2. Is there confirmations of the transaction?

  3. How do I make a new account via JSON-RPC.

  4. Fee is fixed or is it dynamic?

Thanks.

MarkusTeufelberger commented 7 years ago
  1. You can subscribe to various event streams, I think there is also one where you can watch certain account activity.
  2. If it is included in a ledger, it is immutable. Unlike PoW coins like Bitcoin where you always just have a probability of actually being at the current tip of the chain, in RCL creating a fork needs manual intervention and coordination by a supermajority of relevant validators.
  3. Send a transaction of at least the account reserve in XRP to a new address. You can generate that new address offline or (not recommended) get a random secret (effectively a private key) from a rippled server.
  4. dynamic with a fixed floor.
gituser commented 7 years ago

@MarkusTeufelberger

Thank you, but you didn't exactly answered my questions.

  1. how do I create a new account (e.g. new wallet address), e.g. ./bitcoin-cli getnewaddress is for bitcoin, how do I do this in ripple?

  2. So regarding confirmations you're saying there is no point in checking them for ripple? Once transaction is there it's valid as long as validators are there?

  3. How can I send ripple coins via JSON-RPC?

  4. How do I get that fee? Can I calculate it before sending out ripple ?

Thanks a lot.

MarkusTeufelberger commented 7 years ago
  1. You create a public-private keypair yourself and encode the public key to get the address or you let your local rippled server do it for you (or ripple-lib or some custom software you wrote yourself or got from somewhere else) - see https://ripple.com/build/rippled-apis/#wallet-propose for example

  2. Yes. Once it was successful it requires external intervention to remove it, which would be a major event in Ripple. In PoW scenarios, you only have a certain probability that your chain actually is the longest one, so you need to wait for a few more blocks to be relatively sure that you are actually on the main one. RCL only has a single one.

  3. & 4. see the documentation and/or read the forums. (https://ripple.com/build/fees-disambiguation/ and https://ripple.com/build/transactions/)

gituser commented 7 years ago

Hi. Another question I have.

How do I distinguish multiple payments via destination_tag to the same wallet address ?

I can't seem to find an example how to submit a transaction with destination_tag via JSON/RPC or command line.

Maybe @MarkusTeufelberger you know it?

Thank you.

MarkusTeufelberger commented 7 years ago

1) Look up the DestinationTag field in the transaction you received.

2) https://ripple.com/build/transactions/#payment --> set the DestinationTag field to whatever you want, sign the transaction and submit it.

gituser commented 7 years ago

Ok, thanks again @MarkusTeufelberger

Do you know why https://ripple.com/build/rippled-apis/#tx-history tx_history method is considered to be deprecated and what to use instead for getting history of the account?

And also is there any way to determine time of the transaction in tx_history? I do not see any field in the output representing time of the arrival.

Thanks again!

MarkusTeufelberger commented 7 years ago

1) No

2) look at the time of the ledger a transaction was included in.

gituser commented 7 years ago

@MarkusTeufelberger upon further inspection of the docs I've found this: https://ripple.com/build/rippled-apis/#account-tx

So it seems to be possible and there is a date already present.

gituser commented 7 years ago

@MarkusTeufelberger how do I check if Ripple address is valid? Is there any function to do that? (e.g. checksum or something like in bitcoin)

Thanks.

MarkusTeufelberger commented 7 years ago

Sorry, but I am not your personal free support person. Please ask these kind of questions on stackoverflow or contact Ripple Inc. Maybe someone else wants to drop in and answer your questions?

Alternatively feel free to make an offer to hire me as a consultant.

gituser commented 7 years ago

I'm sorry for the spam here :)) Your help was much appreciated!

MadhusudhanReddyKalathuru commented 6 years ago

I have Two Test Accounts in Ripple I Can Send XRP One Account To Another Account is there any possibility help me thank you

MadhusudhanReddyKalathuru commented 6 years ago

For Testing Purpose

MarkusTeufelberger commented 6 years ago

Sorry, but I am not your personal free support person. Please ask these kind of questions on stackoverflow or contact Ripple Inc. or read https://ripple.com/build/. Maybe someone else wants to drop in and answer your questions?

Alternatively feel free to make an offer to hire me as a consultant.

gituser commented 6 years ago

Please don't re-animate old issues @MadhusudhanReddyKalathuru :)