Author Topic: Investigating support of a BTS web app.  (Read 1704 times)

0 Members and 1 Guest are viewing this topic.

Offline PotatoPeeler

  • Newbie
  • *
  • Posts: 8
    • View Profile
Ok so it appears wallet_address_create can replace getnewaddress.

blockchain_list_address_transactions seems to be what I want but I'd prefer a block number.

Are there other commands that I missed that could be used for transaction scanning?
There is a 'block_num' field in the returned object of 'blockchain_list_address_transactions', isn't it?
Or maybe you need 'blockchain_get_block_transactions'?


I didn't understand this last night. My brain was stuck on the need for the timestamp but that can be set to 0 and blockchain_list_address_transactions is the equivalent to getreceivedbyaddress.  So it seems that a basic BTC mapping can be made.

blockchain_get_block_transactions is useful too, but it would require more changes.

I still don't understand the prefix option in blockchain_get_transaction unless it was meant to make shorter database entries directly usable with the wallet db.  I get how it works but I would like to understand reasoning behind having it in the first place.

Offline abit

  • Committee member
  • Hero Member
  • *
  • Posts: 4664
    • View Profile
    • Abit's Hive Blog
  • BitShares: abit
  • GitHub: abitmore
You may have interest in this command:
Code: [Select]
wallet_address_create <account_name> [label] [legacy_network_byte]
                      Creates an address which can be used for a simple (non-TITAN) transfer.
Creates an address which can be used for a simple (non-TITAN) transfer.

Parameters:
  account_name (string, required): The account name that will own this address
  label (string, optional, defaults to ""):
  legacy_network_byte (int32_t, optional, defaults to -1): If not -1, use this as the network byte for a BTC-style address.

Returns:
  string

aliases: new_address

What options are there for scanning transactions?

What is the point of “prefixes” in blockchain_get_transaction? What would make transactions share a prefix?

I think if the 'exact' parameter is omitted, the 'prefix' should be a full transaction id, otherwise it could be a part of trx id.
Code: [Select]
Usage:
blockchain_get_transaction <transaction_id_prefix> [exact]
                      Get detailed information about an in-wallet transaction

Parameters:
  transaction_id_prefix (string, required): the base58 transaction ID to return
  exact (bool, optional, defaults to false): whether or not a partial match is ok

blockchain_list_address_transactions seems to be what I want but I'd prefer a block number.

Are there other commands that I missed that could be used for transaction scanning?
There is a 'block_num' field in the returned object of 'blockchain_list_address_transactions', isn't it?
Or maybe you need 'blockchain_get_block_transactions'?
« Last Edit: January 11, 2015, 04:35:35 pm by abit »
BitShares committee member: abit
BitShares witness: in.abit

Offline liondani

  • Hero Member
  • *****
  • Posts: 3737
  • Inch by inch, play by play
    • View Profile
    • My detailed info
  • BitShares: liondani
  • GitHub: liondani

Greetings. I am examining porting an existing bitcoin web app into bitshares.

The current app uses 5 RPC calls.

GetBalance, validateAddress, sendFrom, getNewAddress, getReceivedByAddresss.

The first 3 are easily replaced but I am investigating the last 2.

This is a system that doesn't force user logins. It currently uses cookies and unique addresses. By generating a new address with getnewaddress() then a link can be made with the session that was given this new address and the cookie created for the phpsession.

Then all that is needed is a periodic poll to call getreceivedbyaddress() to see if the person has deposited into their account which can be triggered on the user's side.

  • With TITAN this does not work. The current answer from using exchanges is to have the user put something in the memo field to make their deposit unique. This works but is ugly and confusing. Developers can come up with multiple excuses why this is easy enough but it really is a strange process from a user's perspective. To maximize click-thru something simpler is preferred.
  • Another alternative is to use the login protocol to authenticate the php session with the Bitshares user-id. This would be preferable in some ways but not a clear win. It requires the client up and running to login. This would prevent people from using a demo method without a different set of code.
  • A third option is to let someone input their user-id into the web-site but this causes security issues where someone else could try to claim funds. Possibly use this with a combination of login authentication when warranted.
  • A fourth option would be to use just something like getnewaddress. Was there ever anything like this created or plans for it in the future?


So assuming there is no #4 then #3 would be the best.


What options are there for scanning transactions?

What is the point of “prefixes” in blockchain_get_transaction? What would make transactions share a prefix?

blockchain_list_address_transactions seems to be what I want but I'd prefer a block number.

Are there other commands that I missed that could be used for transaction scanning?

@bytemaster or @vikram ?

Offline CLains

  • Hero Member
  • *****
  • Posts: 2606
    • View Profile
  • BitShares: clains
I wouldn't know, but I think they will make TITAN optional soon, if that helps. In any case, it sounds like an interesting project so good luck!

Offline PotatoPeeler

  • Newbie
  • *
  • Posts: 8
    • View Profile

Greetings. I am examining porting an existing bitcoin web app into bitshares.

The current app uses 5 RPC calls.

GetBalance, validateAddress, sendFrom, getNewAddress, getReceivedByAddresss.

The first 3 are easily replaced but I am investigating the last 2.

This is a system that doesn't force user logins. It currently uses cookies and unique addresses. By generating a new address with getnewaddress() then a link can be made with the session that was given this new address and the cookie created for the phpsession.

Then all that is needed is a periodic poll to call getreceivedbyaddress() to see if the person has deposited into their account which can be triggered on the user's side.

  • With TITAN this does not work. The current answer from using exchanges is to have the user put something in the memo field to make their deposit unique. This works but is ugly and confusing. Developers can come up with multiple excuses why this is easy enough but it really is a strange process from a user's perspective. To maximize click-thru something simpler is preferred.
  • Another alternative is to use the login protocol to authenticate the php session with the Bitshares user-id. This would be preferable in some ways but not a clear win. It requires the client up and running to login. This would prevent people from using a demo method without a different set of code.
  • A third option is to let someone input their user-id into the web-site but this causes security issues where someone else could try to claim funds. Possibly use this with a combination of login authentication when warranted.
  • A fourth option would be to use just something like getnewaddress. Was there ever anything like this created or plans for it in the future?


So assuming there is no #4 then #3 would be the best.


What options are there for scanning transactions?

What is the point of “prefixes” in blockchain_get_transaction? What would make transactions share a prefix?

blockchain_list_address_transactions seems to be what I want but I'd prefer a block number.

Are there other commands that I missed that could be used for transaction scanning?