The two functions you care most about are write-message and read-message. write-message will convert hashmaps to Bytebuffers. read-message will bring Bytebuffers back to hashmaps. Not all functionality has been tested yet. If you run into an error, please report it to me. I'll be especially happy to accept test.check or unit tests that demonstrate the failure.
Presently, read-message and write-message is expected to work for
version verack addr getaddr inv ping pong reject
while these are around, but are untested.
alert block getdata notfound getblocks getheaders tx