Difference between revisions of "P2Pool code documentation"

From Bitcoin Wiki
Jump to: navigation, search
Line 15: Line 15:
 
Gets address to use for payout either from  file or bitcoind.
 
Gets address to use for payout either from  file or bitcoind.
 
Validates address and checks local bitcoind owns it.
 
Validates address and checks local bitcoind owns it.
 +
 +
==p2pool/util/pack.py==
 +
I think this handles all the binary data types used in the bitcoin protocol to send data over the network wire.
 +
These are nasty as very low level and many big endian/little endian complications.
 +
The p2pool network protocol uses these also.
 +
Do not think you need to really understand this unless making changes at this low level.

Revision as of 22:37, 11 June 2012

Ignore this page for the minute. Is just a scratch pad for documenting the p2pool code. Will tidy up once initial pass done.

p2pool/main.py

Makes extensive use of twisted.defer. This allows it to "yield" to allow long running network code to complete. Read up on Python Generators and this before progressing!

Contains main startup code.

Tests connection to bitcoind. Prints hash of latest block to show bitcoind is up to date.

Tests connection to p2pool network.

Gets address to use for payout either from file or bitcoind. Validates address and checks local bitcoind owns it.

p2pool/util/pack.py

I think this handles all the binary data types used in the bitcoin protocol to send data over the network wire. These are nasty as very low level and many big endian/little endian complications. The p2pool network protocol uses these also. Do not think you need to really understand this unless making changes at this low level.