perone/protocoin — pull request #7 by snarez (2014-01-30 11:38:45+00:00)
Title: Support for altcoins

This small patch makes it easier to build clients for other altcoins based on protocoin. Here is a sample Litecoin client based on the provided examples:

```python
import socket
from protocoin.clients import *

class LitecoinClient(BitcoinClient):
coin = "litecoin"

def handle_message_header(self, message_header, payload):
print "Received message:", message_header.command

def handle_send_message(self, message_header, message):
print "Message sent:", message_header.command

def run_main():
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect(("82.27.193.66", 9333))
client = LitecoinClient(sock)
client.handshake()
client.loop()

run_main()
```

To add other altcoins we'd just need to add to the MAGIC_VALUES dict.