# Gavin Andresen # 2011-10-07 23:19:53 # https://bitcointalk.org/index.php?topic=46485.msg562452#msg562452 @s{quotedtext} @s{quotedtext} @p{brk} Mmmm.... Twisted.... @p{par} I started defining a BitcoinProtocol class derived from twisted.internet.protocol.Protocol for my cross-implementation at-the-network-level testing project. I plan on using Twisted and Trial (the Twisted unit testing framework) to feed canned block-chains to "empty" nodes and make sure they Do The Right Thing (reject blocks that violate the blockchain rules or contain invalid transactions, accept blocks that contain weird-but-valid transactions, etc). @p{brk} @s{(link)} @p{par} Anyway, the BitcoinProtocol class might be a good place to start for anybody who wants to do some python-based bitcoin network programming. Good example to demonstrate is a little dump-blocks tool I wrote to spit out a blockchain in JSON format: @p{brk} @s{(link)} @p{par} @p{brk} (I'm a Twisted newbie, so improvements, suggestions, etc are very much appreciated)