Skip to content

Instantly share code, notes, and snippets.

@aludwiko
Last active November 28, 2017 17:50
Show Gist options
  • Save aludwiko/ff7b364a49d9dd749f8edd666bec44d3 to your computer and use it in GitHub Desktop.
Save aludwiko/ff7b364a49d9dd749f8edd666bec44d3 to your computer and use it in GitHub Desktop.
Source(infiniteTransactionsStream)
 .log(“got transaction”)
 .grouped(5)
 .log(“grouped transactions”)
 .scan(0.hashCode.toString) { (previousBlockHash, transactions) => 
  (transactions.hashCode(), previousBlockHash).hashCode.toString 
 }
 .log(“hashed block”)
 .mapAsync(1)(saveHashAndReturnIt)
 .log(“saved block”)
.withAttributes(logLevels(onElement = DebugLevel))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment