Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions build/extract.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@ module.exports = async function(callback) {
// start from first block, block 0 is genesis, it doesn't contain any transaction
for (var i = 1; i <= await web3.eth.getBlockNumber(); i++) {
var block = await web3.eth.getBlock(i)
for (var idx = 0; idx < block.transactions.length; idx++)
var transaction = await web3.eth.getTransaction(block.transactions[idx])
console.log("from: " + transaction.from + " to:" + transaction.to + " Nonce:" + transaction.nonce)
var tx_json = JSON.stringify(transaction) + "\n"
fs.appendFileSync(logFile, tx_json);
for (var idx = 0; idx < block.transactions.length; idx++) {
var transaction = await web3.eth.getTransaction(block.transactions[idx])
console.log("from: " + transaction.from + " to:" + transaction.to + " Nonce:" + transaction.nonce)
var tx_json = JSON.stringify(transaction) + "\n"
fs.appendFileSync(logFile, tx_json);
}
}
}