Skip to content
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

Exchange Integration Documentation & Example #233

Closed
bytemaster opened this issue Aug 14, 2015 · 9 comments
Closed

Exchange Integration Documentation & Example #233

bytemaster opened this issue Aug 14, 2015 · 9 comments
Assignees
Labels

Comments

@bytemaster
Copy link
Contributor

  1. I need a tutorial for exchanges to automate accepting deposits with graphene CLI wallet
  2. I would like a python scrypt that can connect to a witness node and automatically print out a log file anytime a deposit has been received with at least N confirmations
@theoreticalbts
Copy link
Contributor

Three different strategies suggest themselves:

  • (1) Implement some kind of payment protocol (see Send to "Virtual Address" feature  #119 ) to allow the exchange to communicate off-chain to the user a blob containing the tx amount and memo
  • (2) Have the exchange publish a proposed transaction for the deposit, which must be signed by the user
  • (3) Give the user a memo they must enter, as in BitShares 1.x.

Approach (3) requires the least time for implementation, but requires more from the users. (1) and (2) will need specific UI support in the wallet.

@xeroc
Copy link
Contributor

xeroc commented Aug 16, 2015

I will start writing a tutorial/howto using the websocket API and describe how to subscribe to objects and get notified on incoming transactions .. I would begin with putting them into a pending-deposits array and verify that they are still valid after N confirmations ..

Python script will follow once I have the testnet running and can play with transactions.

Once quick question though: Which object should I subscribe to when monitoring an account for incoming transactions?

@xeroc
Copy link
Contributor

xeroc commented Aug 16, 2015

Reading about #234, I would start implement (1) thus subscribe for (a) new blocks and (b) the account name's history. Simplest thing to do is handle the confirmation verification separately and either fetch the transaction from the blockchain again after N confirmations or track prev block attribute on each block notification such that you can link N blocks in a row. That would result in one less calls to the node but would require some error handling in python in case of a fork ..

@theoreticalbts
Copy link
Contributor

You should subscribe to the account with get_full_accounts(). We're working on a plugin to filter by confirmations, see #237.

@nathanielhourt
Copy link
Contributor

#237 does not filter by confirmations per se; it will create a node which only updates chain state when sufficient confirmations have been accumulated.

@xeroc
Copy link
Contributor

xeroc commented Aug 17, 2015

@theoreticalbts: get_full_accounts() is a call, but wouldn't I want to subscribe to an object? I'd rather use notifications instead of polling.

@svk31
Copy link
Contributor

svk31 commented Aug 17, 2015

@xeroc get_full_accounts gives you a subscription

@xeroc
Copy link
Contributor

xeroc commented Aug 17, 2015

Ok. Thanks!

@xeroc
Copy link
Contributor

xeroc commented Aug 20, 2015

How am I supposed to read the memo?

Currently, I am connecting to the witness via websockets to get a notification on changes to my account (subscriptions from get_full_account) .. then I would like to read the transaction history including the memo from another connection to the cli_wallet .. (#252 #251)

The only way I found so far to decode the memo was get_account_history (cli_wallet) .. which however was unable to decode my memo because the decoding key was missing from the wallet :(

Anyway .. what would be the easiest way to get the decoded memo of a single transaction out of any of those two (witness and client) connections?

@xeroc xeroc closed this as completed Oct 27, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants