Closed cakcora closed 6 years ago
Hi, thank you,
See information here: https://github.com/ZuInnoTe/hadoopcryptoledger/wiki/Useful-Utility-functions:
I hope it helps.
Best regards
Thank you Jorn for your reply. This library will be very useful; we should write a tutorial about it. Here is the final code
val noOfTransactionPair = bitcoinBlocksRDD.map(e => {
val txList = new ListBuffer[(String,String,Int,Int)]()
val blk: BitcoinBlock = e._2
val transactions: util.List[BitcoinTransaction] = blk.getTransactions
for(x<-0 to transactions.size()-1){
val transaction: BitcoinTransaction = transactions.get(x)
val hash:String = BitcoinUtil.convertByteArrayToHexString(BitcoinUtil.reverseByteArray(BitcoinUtil.getTransactionHash(transaction)))
txList+=((hash,blk.getTime.toString,transaction.getListOfInputs.size,transaction.getListOfOutputs.size()))
println(hash)
}
txList.toList
})
Hi,
Thanks a lot for developing this library. I was going through blocks and transactions contained within them. When I tried to get hashes of transactions, I could not find them. By hash i mean the tx id: d77435177fe87b96d8e751221bfd1dfba9dc23e0cd521df59ed1725dba2c74f3 as in https://blockchain.info/tx/d77435177fe87b96d8e751221bfd1dfba9dc23e0cd521df59ed1725dba2c74f3
My code is stuck at this point:
Please let me know what i am missing.