BitShares Forum

Main => General Discussion => Topic started by: monsterer on October 27, 2015, 05:16:40 pm

Title: Any block explorer site that can look up a transaction by txid?
Post by: monsterer on October 27, 2015, 05:16:40 pm
I'd like to update the link to transactions in metaexchange's display, but I'm not sure if any website yet provides a TXID lookup URL?
Title: Re: Any block explorer site that can look up a transaction by txid?
Post by: roadscape on October 27, 2015, 05:42:55 pm
How's this for URL format? What's the easiest?
http://cryptofresh.com/tx/1.11.1111

It will look much better in a week or two :)
Title: Re: Any block explorer site that can look up a transaction by txid?
Post by: monsterer on October 27, 2015, 05:57:39 pm
How's this for URL format? What's the easiest?
http://cryptofresh.com/tx/1.11.1111

It will look much better in a week or two :)

For metaexchange it needs to be the hash form, not the object id, so like:

http://cryptofresh.com/tx/a5fea9b2abaaededabd4bd9af22e1e95da9f8ef2

If you could do that, it would be awesome!
Title: Re: Any block explorer site that can look up a transaction by txid?
Post by: roadscape on October 27, 2015, 06:02:12 pm
How's this for URL format? What's the easiest?
http://cryptofresh.com/tx/1.11.1111

It will look much better in a week or two :)

For metaexchange it needs to be the hash form, not the object id, so like:

http://cryptofresh.com/tx/a5fea9b2abaaededabd4bd9af22e1e95da9f8ef2

If you could do that, it would be awesome!

Hmm.. I haven't dealt with any hashes yet. Is there any way to do a lookup on this hash or do I need to implement some form of hash-id map manually?
Title: Re: Any block explorer site that can look up a transaction by txid?
Post by: ByronP on October 27, 2015, 06:17:16 pm
Why keep a long hash instead of a simple set of numbers?

I ask because I am not keeping track of the hash just the id.
Title: Re: Any block explorer site that can look up a transaction by txid?
Post by: monsterer on October 27, 2015, 06:18:52 pm
Why keep a long hash instead of a simple set of numbers?

I ask because I am not keeping track of the hash just the id.

Because when you send a transaction, the object id isn't known, making it rather difficult to log :)
Title: Re: Any block explorer site that can look up a transaction by txid?
Post by: monsterer on October 27, 2015, 06:23:48 pm
Hmm.. I haven't dealt with any hashes yet. Is there any way to do a lookup on this hash or do I need to implement some form of hash-id map manually?

There is get_recent_transaction_by_id which works for some amount of time. When that fails, I trawl through each block looking in the transaction_ids array inside each block.

Really the wallet should support full queries for this.
Title: Re: Any block explorer site that can look up a transaction by txid?
Post by: ByronP on October 27, 2015, 06:40:37 pm
I use the nonce returned in signed_transaction and then get the history and match the nonces then keep the id. I have not had a problem so far do you foresee any issues with this route?
Title: Re: Any block explorer site that can look up a transaction by txid?
Post by: bytemaster on October 27, 2015, 06:49:23 pm
There are several things going on here.

1.  Given a Transaction ID you want to find the Transaction.
2.  You want to know which Block the transaction was included in.

It would be relatively simple to add this to the existing API *except* that the node running with this feature enabled would require extra RAM.
Title: Re: Any block explorer site that can look up a transaction by txid?
Post by: monsterer on October 27, 2015, 07:26:29 pm
There are several things going on here.

1.  Given a Transaction ID you want to find the Transaction.
2.  You want to know which Block the transaction was included in.

It would be relatively simple to add this to the existing API *except* that the node running with this feature enabled would require extra RAM.

I don't need 2 at all, I just need 1, but for any transaction.

I certainly wouldn't advise storing such a map in ram; this is a prime candidate for a database.
Title: Re: Any block explorer site that can look up a transaction by txid?
Post by: bytemaster on October 27, 2015, 09:40:39 pm
There are several things going on here.

1.  Given a Transaction ID you want to find the Transaction.
2.  You want to know which Block the transaction was included in.

It would be relatively simple to add this to the existing API *except* that the node running with this feature enabled would require extra RAM.

I don't need 2 at all, I just need 1, but for any transaction.

I certainly wouldn't advise storing such a map in ram; this is a prime candidate for a database.

Just because you know the transaction from the ID doesn't mean you know it is VALID.
Title: Re: Any block explorer site that can look up a transaction by txid?
Post by: monsterer on October 27, 2015, 10:01:06 pm
Just because you know the transaction from the ID doesn't mean you know it is VALID.

This is true. But I wouldn't expect the wallet to keep track of invalid transactions.
Title: Re: Any block explorer site that can look up a transaction by txid?
Post by: roadscape on October 27, 2015, 10:34:54 pm
Ok.. txs can now be looked up by hash (if they were included in a block):

http://cryptofresh.com/tx/a5fea9b2abaaededabd4bd9af22e1e95da9f8ef2

I still don't get why get_block returns the hash but NOT the id... and get_object(1.11.x) returns the id and block_num but NOT the hash.
Is there any way to get the tx id and hash in the same call?
Title: Re: Any block explorer site that can look up a transaction by txid?
Post by: bytemaster on October 27, 2015, 10:49:40 pm
Ok.. txs can now be looked up by hash (if they were included in a block):

http://cryptofresh.com/tx/a5fea9b2abaaededabd4bd9af22e1e95da9f8ef2

I still don't get why get_block returns the hash but NOT the id... and get_object(1.11.x) returns the id and block_num but NOT the hash.
Is there any way to get the tx id and hash in the same call?

Great work but it should probably include the block number the transaction was included in as well.

Also, the URL should support the confirmation ID format used in the GUI

#c0099400499b5a18c383916c56240871906bf686@92856
Title: Re: Any block explorer site that can look up a transaction by txid?
Post by: roadscape on October 27, 2015, 11:13:30 pm
Ok.. txs can now be looked up by hash (if they were included in a block):

http://cryptofresh.com/tx/a5fea9b2abaaededabd4bd9af22e1e95da9f8ef2

I still don't get why get_block returns the hash but NOT the id... and get_object(1.11.x) returns the id and block_num but NOT the hash.
Is there any way to get the tx id and hash in the same call?

Great work but it should probably include the block number the transaction was included in as well.

Also, the URL should support the confirmation ID format used in the GUI

#c0099400499b5a18c383916c56240871906bf686@92856

Ok: http://cryptofresh.com/tx/f1353039b90d6d90f0968c3ee7593d2603a4008e@408275
Title: Re: Any block explorer site that can look up a transaction by txid?
Post by: monsterer on October 28, 2015, 07:57:55 am
Ok.. txs can now be looked up by hash (if they were included in a block):

http://cryptofresh.com/tx/a5fea9b2abaaededabd4bd9af22e1e95da9f8ef2

I still don't get why get_block returns the hash but NOT the id... and get_object(1.11.x) returns the id and block_num but NOT the hash.
Is there any way to get the tx id and hash in the same call?

That is fantastic! Thank you very much-  I'll get that integrated into metaexchange :)