Closed immartian closed 7 years ago
The InternalTx table may have some inconsistent data from listener program(it's another bug we should report, created in #10 ), but temporarily I switched to Transaction table to make it simply work.
As I think more about this, I think it has to do with the internal transactions. When a PPP event occurs, the following happens.
Right now, I'm querying the history of the artist profile contract A and hoping to see calls to "ppp", but that's not right. The call to A is an internal transaction of Tx and will not have its own transaction. The "input" that is coming back from the API could be orbiter's (or parity's) representation of the internal transaction.
For now, I think I can actually work around this issue with the existing API. If you look at this example:
http://orbiter.musicoin.org/addr/0x0697fdc2a44ec94fd9532711d1759dbf8effe55b
In block 113042, you can see a transaction that shows a payment
{ from: 0xf751fd1140173550daaadcaaf64b3a6db6d9c4e6, to: 0x0697fdc2a44ec94fd9532711d1759dbf8effe55b}
where, 0xf751fd1140173550daaadcaaf64b3a6db6d9c4e6 = "Our Times" PPP contract 0x0697fdc2a44ec94fd9532711d1759dbf8effe55b = My artist profile contract
However, if you show the details of that transaction (http://orbiter.musicoin.org/tx/0xeb05f6b79c82c74e5c6e8167f4e00f8a6c44cb5f9365f01736da71cf850b98f5) you see:
from: 0xb560530ea7939a88093123af648f718f15e540cc (musicoin account) to: 0xf751fd1140173550daaadcaaf64b3a6db6d9c4e6 (our times PPP contract input: 0x93e84cd9 (ppp method)
So, the orbiter history API is doing the hard work of extracting the internal transactions and making sure they get grouped under the right transaction id. This means I can use it to pull a list of all the top-level transactions that ultimately send coins to the profile account, and then I can look up those transactions (locally) to see what they actually where and what type of action they were.
ok, I leave you to investigate first, so I can refer to fine tune orbiter presentation as well.
I'm now providing 2 entry point: /top and /low, maybe easier for you reuse?
query the top level of tx, related to PPP:
curl -H "Content-Type: application/json" -X POST -d '{"addr":"0x2f9b31db7388addbfc4fdde21cfef757e6138ae3","count": 20}' http://orbiger.musicoin.org/top
query the low level(internal tx) with distribution:
curl -H "Content-Type: application/json" -X POST -d '{"addr":"0x2f9b31db7388addbfc4fdde21cfef757e6138ae3","count": 20}' http://orbiter.musicoin.org/low
I'm not sure if they are matching what you meant above.
solved in #6 or seeing the implementation at https://github.com/Musicoin/core/commit/68a42edb1f3d9df860bb1025fdc32900e4d81b75
we can close this issue as the quest has been addressed and all aspects achieved in both orbiter and musicoin catalog.
(copied from Slack by @phiferd ):
http://orbiter.musicoin.org/tx/0xeb05f6b79c82c74e5c6e8167f4e00f8a6c44cb5f9365f01736da71cf850b98f5 orbiter.musicoin.org Musicoin Block Explorer
[8:37]
then curl that same address:
[8:37]
which gives
[8:39]
note
"input":"0x"
in the curl response andinputData: 0x93e84cd9
in the tx detail page