Welcome to the Dash Forum!

Please sign up to discuss the most innovative cryptocurrency!

InstantSend Questions

Discussion in 'Development Tech Discussion' started by Instacoins, May 27, 2017.

  1. Instacoins

    Instacoins Member

    Joined:
    May 27, 2017
    Messages:
    51
    Likes Received:
    5
    Trophy Points:
    48
    Hello guys,

    I am Adrian Kreter from Instacoins.

    I will post the project here once completed. Before that I have a few technical questions regarding InstantSend.

    I am refering to this guide: https dashpay.atlassian .net/wiki/display/DOC/InstantSend+Integration
    (I am splitting the link because I might not be allowed to post links).

    Essentially we will have a really really big of incomming and outgoing transactions.
    InstantSend seemed to be perfect, but a few things are clear to me.

    1) The recieve example uses ZMQ to "identify" a new transaction and RPC to confirm the transaction went through.
    The RPC example calls:
    ./dash-cli importaddress yVAoPqfD9M9JCvQqBDRuysTX2PbeBDY2zr

    then they call all activity of this importaddress since a certain block.
    It gives back both the pending instantSend and normal transactions that are unconfirmed.
    a) If it essentially crawls a block why does it give back pending transactions?
    b) Will this work always for all InstantSend and normal transactions in all cases?
    c) Will it also return all approved transaction from this importaddress?

    2) Can the same be achived with a local library? I found bitcore. Which might be able to do that.
    Is there a C++ Version?

    3) For instantSend sending I found https github .com/snogcel/instantsend-broadcast
    Again it works with the bitcore JS version. C++ available to achive the same? Otherwise we could also work with the Node.js version but C++ would be prefered.

    Looking forward to work with Dash.

    Kind Regards
    Adrian Kreter
     
  2. UdjinM6

    UdjinM6 Official Dash Dev
    Dash Core Team Moderator

    Joined:
    May 20, 2014
    Messages:
    3,637
    Likes Received:
    3,536
    Trophy Points:
    1,183
    1)
    a) listsinceblock is used to demonstrate the difference, it doesn't filter out normal/pending/non-IS txes
    b) it should... why wouldn't it?
    c) yes, you can see txes with bcconfirmations > 0 in the example

    2) there is no special lib for this in C++, you just need to invoke RPC call (http request) - use "help listsinceblock" in console ("dash-cli help listsinceblock" in cmd line) to get additional info and an example

    3) same, see "help instantsendtoaddress"
     
  3. Instacoins

    Instacoins Member

    Joined:
    May 27, 2017
    Messages:
    51
    Likes Received:
    5
    Trophy Points:
    48
    Is there somewhere a full RPC docu including of the config file of the underlying dash deamon? That would be very helpfull.
     
    #3 Instacoins, May 28, 2017
    Last edited: May 28, 2017
  4. moocowmoo

    moocowmoo Bovine Bit-flipper
    Foundation Member

    Joined:
    Jun 15, 2014
    Messages:
    483
    Likes Received:
    603
    Trophy Points:
    263
    Dash Address:
    XmoocowYfrPKUR6p6M5aJZdVntQe71irCX
    Both the daemon and the client have built-in help for pretty much everything.

    Code:
    $ dashd --help
    $ dash-cli help
    
    ---

    For inbound transactions and instantsends, I recommend zmq for the lowest latency.
    Pushes are always better than polls.


    Here's a doc covering the basics:
    https://dashpay.atlassian.net/wiki/display/DOC/Receiving+InstantSend+Transactions


    You can subscribe to standard transactions (hashes or bodies) through its interface as well.

    Code:
    $ dashd --help | grep zmq
      -zmqpubhashblock=<address>
      -zmqpubhashtx=<address>
      -zmqpubhashtxlock=<address>
      -zmqpubrawblock=<address>
      -zmqpubrawtx=<address>
      -zmqpubrawtxlock=<address>
    
    Let me know if you need more information. I'm happy to help.
     
    • Like Like x 1
  5. Instacoins

    Instacoins Member

    Joined:
    May 27, 2017
    Messages:
    51
    Likes Received:
    5
    Trophy Points:
    48
    Thanks a lot
     
  6. Instacoins

    Instacoins Member

    Joined:
    May 27, 2017
    Messages:
    51
    Likes Received:
    5
    Trophy Points:
    48
    Can someone of the core devs write me? I was writing with someone yesterday but couldnt Really get replies afterwards.

    Let me get straight to the point. I personally did a bitcoin integration and I am extreamly experienced with credit card gateways, so its not like I have no clue or something (which the instantRecieve and instantSend topic kind of makes me feel).
    There is apperently a lot of different ways how to do this. ZMQ RPC insight-API. I saw someone using bitcore in js.
    But there is clearly a lack of good documentation and example projects.

    Is there someone (who is actually experienced enough like a core dev) who is willing to guide us through this. We dont need someone writing code. We are 6 devs here (maybe frontend devs doesnt count).

    I am willing to pay in dash or € or $ or bitcoin.

    Thanks and have a nice day.
     
  7. Instacoins

    Instacoins Member

    Joined:
    May 27, 2017
    Messages:
    51
    Likes Received:
    5
    Trophy Points:
    48
    This was my reply regarding the ZMQ solution presented above:

    This seems to be less suitable if you have a lot of addresses you watch since you need to beform deamon restarts.

    I found the insight-api with socket.io
    Has anyone implemented larger scale applications on top of that yet? Can I pay you for consultancy? That would potentially help to kickstart this projects.

    We need the following components.

    1) Generating of HD wallets.
    2) Address generation.
    3) Check if you get a transaction (instant or normal) on one of the addresses where you expect a transaction to happen). We also need access to the amount of confirmation.
    4) instantSend implementation to send transaction.

    The program is in a windows environment but we would like to avoid running a dash deamon in there. If the deamon is needed we would host them on a seperate linux Machine.

    Thanks a lot. Looking forward to your reply.

    ___________________________________________________________________________

    Regarding my 4)

    We would like to specifically choose the inputs and generate for the remainer a new address.
     
  8. Instacoins

    Instacoins Member

    Joined:
    May 27, 2017
    Messages:
    51
    Likes Received:
    5
    Trophy Points:
    48
    Looks like that job is taken. Thanks guys that was quick :)
     
  9. UdjinM6

    UdjinM6 Official Dash Dev
    Dash Core Team Moderator

    Joined:
    May 20, 2014
    Messages:
    3,637
    Likes Received:
    3,536
    Trophy Points:
    1,183
    Why is that?
     
  10. Instacoins

    Instacoins Member

    Joined:
    May 27, 2017
    Messages:
    51
    Likes Received:
    5
    Trophy Points:
    48
    I got someone here for consultancy. The problem is the amount of transaction in a multi threaded environment. I might post here the solution I went with.
     
  11. moocowmoo

    moocowmoo Bovine Bit-flipper
    Foundation Member

    Joined:
    Jun 15, 2014
    Messages:
    483
    Likes Received:
    603
    Trophy Points:
    263
    Dash Address:
    XmoocowYfrPKUR6p6M5aJZdVntQe71irCX
    I think he just got bad info.

    dashd does not need to be restarted to monitor freshly added keys or watch addresses.

    @UdjinM6 am I correct that only addresses/keys present in the wallet will trigger zmq messages? if useful for some use case, is there a firehose mode? (notify all traffic)
     
  12. Instacoins

    Instacoins Member

    Joined:
    May 27, 2017
    Messages:
    51
    Likes Received:
    5
    Trophy Points:
    48
    Yes correct. Restart doesnt seem to be needed. But if wallets need to be part of the deamon its not really any better. If you have many wallets then its a lot easier to handle wallet management including address management outside. Just sign Transactions and hand them over and somehow keep beeing updated about changes.
     
  13. UdjinM6

    UdjinM6 Official Dash Dev
    Dash Core Team Moderator

    Joined:
    May 20, 2014
    Messages:
    3,637
    Likes Received:
    3,536
    Trophy Points:
    1,183
    "instantsendnotify" only works for wallet addresses while zmq should work for all IS txes iirc
     
  14. arush11

    arush11 New Member

    Joined:
    May 17, 2017
    Messages:
    32
    Likes Received:
    2
    Trophy Points:
    8
    Great information thanks for sharing.