Sample Client

Client.py

#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
import glob
import time
import socket
from cbor2 import dumps, loads, CBORTag


def sendRequest(s, payload):
    length = len(payload)
    lenPrefix = length.to_bytes(2, 'big')
    full = lenPrefix + payload
    s.sendall(lenPrefix)
    s.sendall(payload)
    prefix = s.recv(2)
    leng = int.from_bytes(prefix, byteorder='big')
    raw = s.recv(leng)
    data = loads(raw)
    print ('Received', data)


def client(host, port):
    print ('Starting...')
    s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    s.connect((host, int(port)))
    return s


if len(sys.argv) < 3:
    print ('Invalid args, need: <hostname> <port>')
    exit(0)

sock = client(sys.argv[1], sys.argv[2])

while True:

    x1 = dumps((0, 1, 'HEIGHT->BLOCK', [(0, 100)]))

    x2 = dumps((0, 1, '[HEIGHT]->[BLOCK]', [(1, [100, 101, 102])]))

    x3 = dumps((0, 1, 'HASH->BLOCK', [(2,
               '00000000d1145790a8694403d4063f323d499e655c83426834d4ce2f8dd4a2ee'
               )]))

    x4 = dumps((0, 1, '[HASH]->[BLOCK]', [(3,
               ['000000000000000002af2a6de04d4a1a73973827eae348fe4d3f4d05610ff968'
               ,
               '000000000000000007fc734cbf1fc04c59cf7ecb6af0707fd5cf5b8d46dc4c75'
               ])]))

    x5 = dumps((0, 1, 'TXID->TX', [(4,
               '7d3eb236b526bd681b7fc499d657d237b4d3bc21ef25b37fc1c70822849f1243'
               )]))

    x6 = dumps((0, 1, '[TXID]->[TX]', [(5,
               ['6c828920ea3a968f0c3c4a8f14d70b696e0440d8e4e1d019cced1ba2cc63cd51'
               ,
               '097cf9d4ec10711e809f316b7738bbbff94efe32ea2cd55e57ddf5840f828741'
               ])]))

    x7 = dumps((0, 1, 'ADDR->[OUTPUT]', [(6,
               '13n561iVozTtMXJzAJNA5TQsnTboRvpxae')]))

    x8 = dumps((0, 1, '[ADDR]->[OUTPUT]', [(7,
               ['1P8Jd8qQM7y45iXLM1eiXCCmGRhCPjykZB',
               '16qgC3hzi38xo1vn2gGsNVwWaW1sEH3h9R'])]))

    x9 = dumps((0, 1, 'TXID->[MNODE]', [(8,
               '571c7508413415debe4ba146a2ed141e4d4204d0743169ab3366b1f1e1960a5d'
               )]))

    sendRequest(sock, x1)
    sendRequest(sock, x2)
    sendRequest(sock, x3)
    sendRequest(sock, x4)
    sendRequest(sock, x5)
    sendRequest(sock, x6)
    sendRequest(sock, x7)
    sendRequest(sock, x8)
    sendRequest(sock, x9)

    time.sleep(10)

config.yaml

logFile: ./node.log
sbound: 20
secretKey: 7c0d17afbb302c2856f2b1f5988fd7d08289b5d483ba2d8dac3c33976164dcc3
pingThreshold: 5
kademliaConcurrencyFactor: 3
udpPort: 5682
listenIP: 127.0.0.1
endPointListenPort: 9090
endPointListenIP: 127.0.0.1
tcpPort: 5682
myNodeId: 896a3386911188e653a5a08af2cbad69ff51313126f80d6a2e0ebed4e633ee9fb8444be24104c214d98176af3f3f772a345fb2b5873d83d735974c8639c6de3f

trustedPeers:
- nodeID: f86bec585015d30eed21ac2f774226ad319f68aa68bce1864c23f8ee5f13d3527ce2c731d2d9be36e4f1396bfaa519d3d1f560e2aa9d4183bee2fc6df6ba7a75
  endPoint:
    nodeIp: 51.89.40.95
    udpPort: 5678
    tcpPort: 5678

endpoint.log

EndPoint connection established from 127.0.0.1:44392
handleNewConnectionRequest
handleRequest
Decoded ("HEIGHT->BLOCK")
handleRequest
handleRPCReqResp(1, RPCRequest {rqMethod = "HEIGHT->BLOCK", rqParams = Just (GetBlockByHeight {gbHeight = 100})})
"fetchResource"
RPCResponse {rsStatusCode = 200, rsStatusMessage = Nothing, rsBody = Just (RespBlockByHash {block = BlockRecord {rbHeight = 100, rbHash = "000000007bc154e0fa7ea32218a72fe2c1bb9f86cf8c9ebf9a715ed27fdb229a", rbHeader = "{\"blockBits\":486604799,\"prevBlock\":\"00000000cd9b12643e6854cb25939b39cd7a1ad0af31a9bd8b2efe67854b1995\",\"blockVersion\":1,\"merkleRoot\":\"660802c98f18fd34fd16d61c63cf447568370124ac5f3be626c2e1c3c9f0052d\",\"blockTimestamp\":1231660825,\"bhNonce\":1573057331}"}})}
Decoded ("[HEIGHT]->[BLOCK]")
handleRequest
handleRPCReqResp(1, RPCRequest {rqMethod = "[HEIGHT]->[BLOCK]", rqParams = Just (GetBlocksByHeight {gbHeights = [100,101,102]})})
"fetchResource"
RPCResponse {rsStatusCode = 200, rsStatusMessage = Nothing, rsBody = Just (RespBlocksByHashes {blocks = [BlockRecord {rbHeight = 100, rbHash = "000000007bc154e0fa7ea32218a72fe2c1bb9f86cf8c9ebf9a715ed27fdb229a", rbHeader = "{\"blockBits\":486604799,\"prevBlock\":\"00000000cd9b12643e6854cb25939b39cd7a1ad0af31a9bd8b2efe67854b1995\",\"blockVersion\":1,\"merkleRoot\":\"660802c98f18fd34fd16d61c63cf447568370124ac5f3be626c2e1c3c9f0052d\",\"blockTimestamp\":1231660825,\"bhNonce\":1573057331}"},BlockRecord {rbHeight = 101, rbHash = "00000000b69bd8e4dc60580117617a466d5c76ada85fb7b87e9baea01f9d9984", rbHeader = "{\"blockBits\":486604799,\"prevBlock\":\"000000007bc154e0fa7ea32218a72fe2c1bb9f86cf8c9ebf9a715ed27fdb229a\",\"blockVersion\":1,\"merkleRoot\":\"f7a5d0816883ec2f4d237082b47b4d3a6a26549d65ac50d8527b67ab4cb7e6cf\",\"blockTimestamp\":1231661741,\"bhNonce\":4136106517}"},BlockRecord {rbHeight = 102, rbHash = "000000001604181f13f19fd3cc89366ec95ce1dd64b776784ef8855210622f19", rbHeader = "{\"blockBits\":486604799,\"prevBlock\":\"00000000b69bd8e4dc60580117617a466d5c76ada85fb7b87e9baea01f9d9984\",\"blockVersion\":1,\"merkleRoot\":\"ceefaf23adb1009753545c230a374c48851676ccb7d6f004b66dd302ceb5443b\",\"blockTimestamp\":1231662670,\"bhNonce\":1906126361}"}]})}
Decoded ("HASH->BLOCK")
handleRequest
handleRPCReqResp(1, RPCRequest {rqMethod = "HASH->BLOCK", rqParams = Just (GetBlockByHash {gbBlockHash = "00000000d1145790a8694403d4063f323d499e655c83426834d4ce2f8dd4a2ee"})})
"fetchResource"
RPCResponse {rsStatusCode = 200, rsStatusMessage = Nothing, rsBody = Just (RespBlockByHash {block = BlockRecord {rbHeight = 170, rbHash = "00000000d1145790a8694403d4063f323d499e655c83426834d4ce2f8dd4a2ee", rbHeader = "{\"blockBits\":486604799,\"prevBlock\":\"000000002a22cfee1f2c846adbd12b3e183d4f97683f85dad08a79780a84bd55\",\"blockVersion\":1,\"merkleRoot\":\"ff104ccb05421ab93e63f8c3ce5c2c2e9dbb37de2764b3a3175c8166562cac7d\",\"blockTimestamp\":1231731025,\"bhNonce\":1889418792}"}})}
Decoded ("[HASH]->[BLOCK]")
handleRequest
handleRPCReqResp(1, RPCRequest {rqMethod = "[HASH]->[BLOCK]", rqParams = Just (GetBlocksByHashes {gbBlockHashes = ["000000000000000002af2a6de04d4a1a73973827eae348fe4d3f4d05610ff968","000000000000000007fc734cbf1fc04c59cf7ecb6af0707fd5cf5b8d46dc4c75"]})})
"fetchResource"
RPCResponse {rsStatusCode = 200, rsStatusMessage = Nothing, rsBody = Just (RespBlocksByHashes {blocks = [BlockRecord {rbHeight = 505012, rbHash = "000000000000000002af2a6de04d4a1a73973827eae348fe4d3f4d05610ff968", rbHeader = "{\"blockBits\":403108785,\"prevBlock\":\"0000000000000000059938946425a9582aaa0d8fe5f3fdd0d320c8e10be3dfe2\",\"blockVersion\":536870912,\"merkleRoot\":\"580432aab122171ab858444fc38e4a38f2344ab6a719248bc9ff3f21657fd495\",\"blockTimestamp\":1511205051,\"bhNonce\":2863327913}"},BlockRecord {rbHeight = 356303, rbHash = "000000000000000007fc734cbf1fc04c59cf7ecb6af0707fd5cf5b8d46dc4c75", rbHeader = "{\"blockBits\":404165597,\"prevBlock\":\"000000000000000001bbbcc2d3c4f0b7708790f421b77513a5bf836a0e0a8136\",\"blockVersion\":2,\"merkleRoot\":\"369bec4d7c42285839880aa59bdc9c02e33ab3f1e3901c52d4e850fd95ba5b58\",\"blockTimestamp\":1431553391,\"bhNonce\":1952425675}"}]})}
Decoded ("TXID->TX")
handleRequest
handleRPCReqResp(1, RPCRequest {rqMethod = "TXID->TX", rqParams = Just (GetTransactionByTxID {gtTxHash = "7d3eb236b526bd681b7fc499d657d237b4d3bc21ef25b37fc1c70822849f1243"})})
"fetchResource"
RPCResponse {rsStatusCode = 200, rsStatusMessage = Nothing, rsBody = Just (RespTransactionByTxID {tx = TxRecord {txId = "7d3eb236b526bd681b7fc499d657d237b4d3bc21ef25b37fc1c70822849f1243", txBlockInfo = BlockInfo' {binfBlockHash = "000000000000000002c97f75410cedb6d5854385ceb9e931d2ab14beecce1b05", binfTxIndex = 502, binfBlockHeight = 600068}, txSerialized = "\SOH\NUL\NUL\NUL\SOHTXqtqC\NULx\139\233\134\168\150\186\185<Y\DEL\205\147\167C\254\198\242\152\229R\ENQ\231U6\SOH\NUL\NUL\NULkH0E\STX!\NUL\129\240\&3\191\204\197{\218\226\227i\226\180X\236I\218\133l\151\248_\DC1g\148jrj\255<5\251\STX O\133\ETB\187\212s\146\195c\215(*\230\218\DC1\184\204\ETXst\191\181\240\151\ACK%\a`\208\206XtA!\STX\187b\236\162Lm2\b[Y\163\&1\152VAo\152#\t\189_\141a\212\RS\249\254\&0\219I\192&\255\255\255\255\STX\223\190\DC2\NUL\NUL\NUL\NUL\NUL\ETB\169\DC4u\153u\DEL\192\150\220B,o\f%,\131\230\nH\238\143\174\135\228\145V\SOH\NUL\NUL\NUL\NUL\EMv\169\DC4\NUL\204\n\168r\DC1&\156\155\190@\170\&9\224\232\&4\159\US.S\136\172\NUL\NUL\NUL\NUL"}})}
Decoded ("[TXID]->[TX]")
handleRequest
handleRPCReqResp(1, RPCRequest {rqMethod = "[TXID]->[TX]", rqParams = Just (GetTransactionsByTxIDs {gtTxHashes = ["6c828920ea3a968f0c3c4a8f14d70b696e0440d8e4e1d019cced1ba2cc63cd51","097cf9d4ec10711e809f316b7738bbbff94efe32ea2cd55e57ddf5840f828741"]})})
"fetchResource"
RPCResponse {rsStatusCode = 200, rsStatusMessage = Nothing, rsBody = Just (RespTransactionsByTxIDs {txs = [TxRecord {txId = "097cf9d4ec10711e809f316b7738bbbff94efe32ea2cd55e57ddf5840f828741", txBlockInfo = BlockInfo' {binfBlockHash = "00000000000000000459e1bb62745173cb2d04090cdd5d2ab268cff7b442f003", binfTxIndex = 3528, binfBlockHeight = 600060}, txSerialized = "\SOH\NUL\NUL\NUL\SOH\168\140\209@\131\228\248\&6K\132\180\145\217\245\183\211\SOz\DELKd\158\231\231T\199@\193\171\179\181\246\DC4\NUL\NUL\NULkH0E\STX!\NUL\224\227\ESC\NUL\175\DC1S70E\184R\158\222\&2\ETB\199^\160K&\246\DEL;\156\187\&2\155\215\165\179V\STX  \239(\216\220\FSG\EM\228\&6\DC3j8\147\250\STX\208\&9\173=a\255\162\ESC\RSvm\217me|\207A!\STX\231$\221\201\STXV\134K\158\"\168x\225\192nYgt\FStc\164\199\DC19\192\220\163\180&\138|\255\255\255\255\SYNH\ETX\NUL\NUL\NUL\NUL\NUL\NUL\EMv\169\DC4\255bS\131\143\181X\235\229}\184X\147MD\229\170v\198\220\136\172H\ETX\NUL\NUL\NUL\NUL\NUL\NUL\EMv\169\DC4\150\141\208\164\188P\189\213\SI\253\195\140\239\133\132\200#\185\NUL\"\136\172H\ETX\NUL\NUL\NUL\NUL\NUL\NUL\EMv\169\DC4\US\250[#>G\227\241+\161\195\215<\190\STX\248\253Ccb\136\172H\ETX\NUL\NUL\NUL\NUL\NUL\NUL\EMv\169\DC4'\145\SI\158\129\163g\171\137ow\217\191\NAK\188U_\242\146F\136\172H\ETX\NUL\NUL\NUL\NUL\NUL\NUL\EMv\169\DC4Z}\215\240\151\189Z>@\181\ETX\211:\154b\233\SO\EOT\195\140\136\172H\ETX\NUL\NUL\NUL\NUL\NUL\NUL\EMv\169\DC4\142\168\247\177\177\147\226\230\&7\147j\178P\230\211f\255\EM3~\136\172H\ETX\NUL\NUL\NUL\NUL\NUL\NUL\EMv\169\DC4\138rK\161\133i~\253\&3\231N\243\ESC]\NUL\206\171\EOT\181\&3\136\172H\ETX\NUL\NUL\NUL\NUL\NUL\NUL\EMv\169\DC4\243 /\219?\STX\ACK\171S\254I\v\147s\131~\232pR \136\172H\ETX\NUL\NUL\NUL\NUL\NUL\NUL\EMv\169\DC4\255\253>\182\&8\237\SUB\232D\237%\205h]\134A\188\226lt\136\172H\ETX\NUL\NUL\NUL\NUL\NUL\NUL\EMv\169\DC49.\235\200B\132\251\221-\130!\205\STX\241\142\204{a\176\DC1\136\172H\ETX\NUL\NUL\NUL\NUL\NUL\NUL\EMv\169\DC4\196OwV\ACK\206\244\136\USeS\238\136\140\n\251\189\245\128(\136\172H\ETX\NUL\NUL\NUL\NUL\NUL\NUL\EMv\169\DC4&\220?J\179\176\ETBW\213\ACK\134\203C\219'[4\135\ETX/\136\172H\ETX\NUL\NUL\NUL\NUL\NUL\NUL\EMv\169\DC4\223\n\155\DC3\v)\SO\186\SOH\235\175\ETB8\186\240\250\SUB\253\149\EOT\136\172H\ETX\NUL\NUL\NUL\NUL\NUL\NUL\EMv\169\DC4\193\\\157\142\136E\ENQ#\GS\226`\171\&3*2\214\223\233\237\220\136\172H\ETX\NUL\NUL\NUL\NUL\NUL\NUL\EMv\169\DC4\180\DC4\184\SOH)\ACK\175\&8\218*\183\214\130\163\&8\199\193\195\239\220\136\172H\ETX\NUL\NUL\NUL\NUL\NUL\NUL\EMv\169\DC4XC\174ML\207]\230\157\178\199\RS&\NUL\143\&8\186\ACK$/\136\172H\ETX\NUL\NUL\NUL\NUL\NUL\NUL\EMv\169\DC4K\EOT\146]\209)\253\f!\131\245w8\167G\244\194\208\221\202\136\172H\ETX\NUL\NUL\NUL\NUL\NUL\NUL\EMv\169\DC4<\CAN\227\161\136MJ\225\FS\ESC\241\181OGh\224\234!\158\&7\136\172H\ETX\NUL\NUL\NUL\NUL\NUL\NUL\EMv\169\DC4WO\231\223\EOT\SO_\DC3\164\207\v\233\162\168\234i\138\250=s\136\172H\ETX\NUL\NUL\NUL\NUL\NUL\NUL\EMv\169\DC4v\143\187\141\\\228\244\251\172\180\&2'#h\185\210's\183!\136\172N\231;\NUL\NUL\NUL\NUL\NUL\EMv\169\DC4\ETB<\211\231\242X\129\178\203-\200\187;s2\179\165\202w\v\136\172\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL;j9Send via Bitcoin SV Transaction Gun http://bit.ly/2Z1nzfN\NUL\NUL\NUL\NUL"},TxRecord {txId = "6c828920ea3a968f0c3c4a8f14d70b696e0440d8e4e1d019cced1ba2cc63cd51", txBlockInfo = BlockInfo' {binfBlockHash = "00000000000000000459e1bb62745173cb2d04090cdd5d2ab268cff7b442f003", binfTxIndex = 1488, binfBlockHeight = 600060}, txSerialized = "\SOH\NUL\NUL\NUL\SOHW\GS\196\138\139L\177k\200\SYN\\\252\203\ENQ\166 \194\137A\147Yt/\239\GS\128\220\175PuQ\SYN\SOH\NUL\NUL\NULjG0D\STX ?\158\176\251\216\163\&1\137\143Z\DLE3$\146\204\DLE\244\SUB\EOT\128\ETX\209\139/\131\208^B\189\181i\236\STX \DC1\242\DC3\190\219\207'X\137\DC1-@\128C\217cK\192-\\_.\178:I\206\208\146\142\162\230\242A!\STX\213\152\226\230K\254\167/\210\200>\DC3\206\166/\CAN{j\169\&1\203\135\195\209\214\142x\164\206\ETBQ\219\255\255\255\255\STX\NUL\NUL\NUL\NUL\NUL\NUL\NUL\NUL\136j\"1LtyME6b5AnMopQrBPLk4FGN8UBuhxKqrn\SOH\SOH3{\"t\":24.64,\"h\":19,\"p\":1021,\"c\":1,\"ws\":2.6,\"wd\":360}\"12aDXuZfxRCzso9aYBip9kveJVtBXjYtyH\n1568516306\241\b&\NUL\NUL\NUL\NUL\NUL\EMv\169\DC4\DC1@P~\174\170\241\DEL\151\239\175\240j\189`/\DC4f\DC1\202\136\172\NUL\NUL\NUL\NUL"}]})}
Decoded ("ADDR->[OUTPUT]")
handleRequest
handleRPCReqResp(1, RPCRequest {rqMethod = "ADDR->[OUTPUT]", rqParams = Just (GetOutputsByAddress {gaAddrOutputs = "13n561iVozTtMXJzAJNA5TQsnTboRvpxae"})})
"fetchResource"
RPCResponse {rsStatusCode = 200, rsStatusMessage = Nothing, rsBody = Just (RespOutputsByAddress {saddressOutputs = [AddressOutputs {aoAddress = "13n561iVozTtMXJzAJNA5TQsnTboRvpxae", aoOutput = OutPoint' {opTxHash = "06032a172f88ba823785f87341eab26ee7a2eb2de9d2f105220d6580e3affc16", opIndex = 59}, aoBlockInfo = BlockInfo' {binfBlockHash = "00000000201016a83272835468d457d15965d57f57c0da5944dc94ea9389f360", binfTxIndex = 15968, binfBlockHeight = 2}, aoIsBlockConfirmed = False, aoIsOutputSpent = False, aoIsTypeReceive = False, aoOtherAddress = "12higDjoCCNXSA95xZMWUdPvXNmkAduhWv", aoPrevOutpoint = OutPoint' {opTxHash = "486f67c9f2c1599a208a7bcbea195b482a273cba64d4422666374703d5c9ecfe", opIndex = 0}, aoValue = 300000000000},AddressOutputs {aoAddress = "13n561iVozTtMXJzAJNA5TQsnTboRvpxae", aoOutput = OutPoint' {opTxHash = "486f67c9f2c1599a208a7bcbea195b482a273cba64d4422666374703d5c9ecfe", opIndex = 0}, aoBlockInfo = BlockInfo' {binfBlockHash = "00000000787bb5153d76225b438596b3fc01cf8a27beec9c9fb48c20b911edfc", binfTxIndex = 15241, binfBlockHeight = 1}, aoIsBlockConfirmed = False, aoIsOutputSpent = False, aoIsTypeReceive = True, aoOtherAddress = "", aoPrevOutpoint = OutPoint' {opTxHash = "0000000000000000000000000000000000000000000000000000000000000000", opIndex = -1}, aoValue = 5000000000}]})}
Decoded ("[ADDR]->[OUTPUT]")
handleRPCReqResp(1, RPCRequest {rqMethod = "[ADDR]->[OUTPUT]", rqParams = Just (GetOutputsByAddresses {gasAddrOutputs = ["1P8Jd8qQM7y45iXLM1eiXCCmGRhCPjykZB","16qgC3hzi38xo1vn2gGsNVwWaW1sEH3h9R"]})})
"fetchResource"
handleRequest
RPCResponse {rsStatusCode = 200, rsStatusMessage = Nothing, rsBody = Just (RespOutputsByAddresses {maddressOutputs = [AddressOutputs {aoAddress = "16qgC3hzi38xo1vn2gGsNVwWaW1sEH3h9R", aoOutput = OutPoint' {opTxHash = "b5d50046994f7e8bc4a77cc9762d274d724af08ea09e7433652b6fef2b058057", opIndex = 0}, aoBlockInfo = BlockInfo' {binfBlockHash = "000000005aa54c73c253c5a5dd8ca1dff3d092f8bbecc965f0eb3e72a83e2386", binfTxIndex = 16772, binfBlockHeight = 1}, aoIsBlockConfirmed = False, aoIsOutputSpent = False, aoIsTypeReceive = True, aoOtherAddress = "", aoPrevOutpoint = OutPoint' {opTxHash = "0000000000000000000000000000000000000000000000000000000000000000", opIndex = -1}, aoValue = 5000000000},AddressOutputs {aoAddress = "1P8Jd8qQM7y45iXLM1eiXCCmGRhCPjykZB", aoOutput = OutPoint' {opTxHash = "4f4e3fe8df599be5a98f9faeebf28fe25db5adcc53a3fb73850c925aefd4b8ef", opIndex = 0}, aoBlockInfo = BlockInfo' {binfBlockHash = "00000000000000000459e1bb62745173cb2d04090cdd5d2ab268cff7b442f003", binfTxIndex = 600060, binfBlockHeight = 5080}, aoIsBlockConfirmed = False, aoIsOutputSpent = False, aoIsTypeReceive = True, aoOtherAddress = "", aoPrevOutpoint = OutPoint' {opTxHash = "7d8a81964df2a73300d4635475332d90b4e04d87ae4024d30743bc194631dfb8", opIndex = 1}, aoValue = 0}]})}
Decoded ("TXID->[MNODE]")
handleRequest
handleRPCReqResp(1, RPCRequest {rqMethod = "TXID->[MNODE]", rqParams = Just (GetMerkleBranchByTxID {gmbMerkleBranch = "571c7508413415debe4ba146a2ed141e4d4204d0743169ab3366b1f1e1960a5d"})})
"fetchResource"
RPCResponse {rsStatusCode = 200, rsStatusMessage = Nothing, rsBody = Just (RespMerkleBranchByTxID {merkleBranch = [MerkleBranchNode' {nodeValue = "c1b274c4b5063b3ab9842848bdcfee1368a643366c21b04110df02bee86aef0b", isLeftNode = False},MerkleBranchNode' {nodeValue = "dbb6cd6fd7484c2d29c2bec9d4b9d93202c27e32b9fc448a0d0a7fe5d13986b3", isLeftNode = False},MerkleBranchNode' {nodeValue = "c2a1939b00cf9bb2d30af200c7a3c356b0d04c66baa8058aca0036969c4fe4bc", isLeftNode = True},MerkleBranchNode' {nodeValue = "6fdbd28219ee97a235abc07e8fbfc51d8d0c2d9619762025edce50f363d363e9", isLeftNode = True},MerkleBranchNode' {nodeValue = "7ad59b57e68a4f9b105cece84bb951f78a8f8c38562acdd7fe04e19f598c94e8", isLeftNode = True},MerkleBranchNode' {nodeValue = "a57b8c5523a5d7b5a95102d202e3609c660622fdacb918cc53513b3dfd2d7632", isLeftNode = False},MerkleBranchNode' {nodeValue = "b16c1b2816fe778941e23b5dd63bbad1bc1de739a110e7c3867e7c139a6c6669", isLeftNode = False},MerkleBranchNode' {nodeValue = "6fc28bf5d8b4c662a455da29b1213438324ffce36b9728f5bcff1711a1a1cc8f", isLeftNode = False},MerkleBranchNode' {nodeValue = "6f31df729d941f77ffb82c0f5cac40b3ddf2923e67afdcad5cbafe7e5d460a73", isLeftNode = False},MerkleBranchNode' {nodeValue = "edd63731c5501db690ee8bd6ff10d1cf10935c5a97db148f70049edf73c14e52", isLeftNode = False},MerkleBranchNode' {nodeValue = "53ea7690bcdc27617f49333f500af10d721d21584a8fb4f1100d569b0b8d4ed9", isLeftNode = True}]})}
Connection closed.

output.txt

$ python client.py 127.0.0.1 9090
Starting...
Received [0, 1, 200, [], [[2, [0, 100, '000000007bc154e0fa7ea32218a72fe2c1bb9f86cf8c9ebf9a715ed27fdb229a', '{"blockBits":486604799,"prevBlock":"00000000cd9b12643e6854cb25939b39cd7a1ad0af31a9bd8b2efe67854b1995","blockVersion":1,"merkleRoot":"660802c98f18fd34fd16d61c63cf447568370124ac5f3be626c2e1c3c9f0052d","blockTimestamp":1231660825,"bhNonce":1573057331}']]]]
Received [0, 1, 200, [], [[3, [[0, 100, '000000007bc154e0fa7ea32218a72fe2c1bb9f86cf8c9ebf9a715ed27fdb229a', '{"blockBits":486604799,"prevBlock":"00000000cd9b12643e6854cb25939b39cd7a1ad0af31a9bd8b2efe67854b1995","blockVersion":1,"merkleRoot":"660802c98f18fd34fd16d61c63cf447568370124ac5f3be626c2e1c3c9f0052d","blockTimestamp":1231660825,"bhNonce":1573057331}'], [0, 101, '00000000b69bd8e4dc60580117617a466d5c76ada85fb7b87e9baea01f9d9984', '{"blockBits":486604799,"prevBlock":"000000007bc154e0fa7ea32218a72fe2c1bb9f86cf8c9ebf9a715ed27fdb229a","blockVersion":1,"merkleRoot":"f7a5d0816883ec2f4d237082b47b4d3a6a26549d65ac50d8527b67ab4cb7e6cf","blockTimestamp":1231661741,"bhNonce":4136106517}'], [0, 102, '000000001604181f13f19fd3cc89366ec95ce1dd64b776784ef8855210622f19', '{"blockBits":486604799,"prevBlock":"00000000b69bd8e4dc60580117617a466d5c76ada85fb7b87e9baea01f9d9984","blockVersion":1,"merkleRoot":"ceefaf23adb1009753545c230a374c48851676ccb7d6f004b66dd302ceb5443b","blockTimestamp":1231662670,"bhNonce":1906126361}']]]]]
Received [0, 1, 200, [], [[2, [0, 170, '00000000d1145790a8694403d4063f323d499e655c83426834d4ce2f8dd4a2ee', '{"blockBits":486604799,"prevBlock":"000000002a22cfee1f2c846adbd12b3e183d4f97683f85dad08a79780a84bd55","blockVersion":1,"merkleRoot":"ff104ccb05421ab93e63f8c3ce5c2c2e9dbb37de2764b3a3175c8166562cac7d","blockTimestamp":1231731025,"bhNonce":1889418792}']]]]
Received [0, 1, 200, [], [[3, [[0, 505012, '000000000000000002af2a6de04d4a1a73973827eae348fe4d3f4d05610ff968', '{"blockBits":403108785,"prevBlock":"0000000000000000059938946425a9582aaa0d8fe5f3fdd0d320c8e10be3dfe2","blockVersion":536870912,"merkleRoot":"580432aab122171ab858444fc38e4a38f2344ab6a719248bc9ff3f21657fd495","blockTimestamp":1511205051,"bhNonce":2863327913}'], [0, 356303, '000000000000000007fc734cbf1fc04c59cf7ecb6af0707fd5cf5b8d46dc4c75', '{"blockBits":404165597,"prevBlock":"000000000000000001bbbcc2d3c4f0b7708790f421b77513a5bf836a0e0a8136","blockVersion":2,"merkleRoot":"369bec4d7c42285839880aa59bdc9c02e33ab3f1e3901c52d4e850fd95ba5b58","blockTimestamp":1431553391,"bhNonce":1952425675}']]]]]
Received [0, 1, 200, [], [[4, [0, '7d3eb236b526bd681b7fc499d657d237b4d3bc21ef25b37fc1c70822849f1243', [0, '000000000000000002c97f75410cedb6d5854385ceb9e931d2ab14beecce1b05', 502, 600068], b'\x01\x00\x00\x00\x01TXqtqC\x00x\x8b\xe9\x86\xa8\x96\xba\xb9<Y\x7f\xcd\x93\xa7C\xfe\xc6\xf2\x98\xe5R\x05\xe7U6\x01\x00\x00\x00kH0E\x02!\x00\x81\xf03\xbf\xcc\xc5{\xda\xe2\xe3i\xe2\xb4X\xecI\xda\x85l\x97\xf8_\x11g\x94jrj\xff<5\xfb\x02 O\x85\x17\xbb\xd4s\x92\xc3c\xd7(*\xe6\xda\x11\xb8\xcc\x03st\xbf\xb5\xf0\x97\x06%\x07`\xd0\xceXtA!\x02\xbbb\xec\xa2Lm2\x08[Y\xa31\x98VAo\x98#\t\xbd_\x8da\xd4\x1e\xf9\xfe0\xdbI\xc0&\xff\xff\xff\xff\x02\xdf\xbe\x12\x00\x00\x00\x00\x00\x17\xa9\x14u\x99u\x7f\xc0\x96\xdcB,o\x0c%,\x83\xe6\nH\xee\x8f\xae\x87\xe4\x91V\x01\x00\x00\x00\x00\x19v\xa9\x14\x00\xcc\n\xa8r\x11&\x9c\x9b\xbe@\xaa9\xe0\xe84\x9f\x1f.S\x88\xac\x00\x00\x00\x00']]]]
Received [0, 1, 200, [], [[5, [[0, '097cf9d4ec10711e809f316b7738bbbff94efe32ea2cd55e57ddf5840f828741', [0, '00000000000000000459e1bb62745173cb2d04090cdd5d2ab268cff7b442f003', 3528, 600060], b'\x01\x00\x00\x00\x01\xa8\x8c\xd1@\x83\xe4\xf86K\x84\xb4\x91\xd9\xf5\xb7\xd3\x0ez\x7fKd\x9e\xe7\xe7T\xc7@\xc1\xab\xb3\xb5\xf6\x14\x00\x00\x00kH0E\x02!\x00\xe0\xe3\x1b\x00\xaf\x11S70E\xb8R\x9e\xde2\x17\xc7^\xa0K&\xf6\x7f;\x9c\xbb2\x9b\xd7\xa5\xb3V\x02  \xef(\xd8\xdc\x1cG\x19\xe46\x13j8\x93\xfa\x02\xd09\xad=a\xff\xa2\x1b\x1evm\xd9me|\xcfA!\x02\xe7$\xdd\xc9\x02V\x86K\x9e"\xa8x\xe1\xc0nYgt\x1ctc\xa4\xc7\x119\xc0\xdc\xa3\xb4&\x8a|\xff\xff\xff\xff\x16H\x03\x00\x00\x00\x00\x00\x00\x19v\xa9\x14\xffbS\x83\x8f\xb5X\xeb\xe5}\xb8X\x93MD\xe5\xaav\xc6\xdc\x88\xacH\x03\x00\x00\x00\x00\x00\x00\x19v\xa9\x14\x96\x8d\xd0\xa4\xbcP\xbd\xd5\x0f\xfd\xc3\x8c\xef\x85\x84\xc8#\xb9\x00"\x88\xacH\x03\x00\x00\x00\x00\x00\x00\x19v\xa9\x14\x1f\xfa[#>G\xe3\xf1+\xa1\xc3\xd7<\xbe\x02\xf8\xfdCcb\x88\xacH\x03\x00\x00\x00\x00\x00\x00\x19v\xa9\x14\'\x91\x0f\x9e\x81\xa3g\xab\x89ow\xd9\xbf\x15\xbcU_\xf2\x92F\x88\xacH\x03\x00\x00\x00\x00\x00\x00\x19v\xa9\x14Z}\xd7\xf0\x97\xbdZ>@\xb5\x03\xd3:\x9ab\xe9\x0e\x04\xc3\x8c\x88\xacH\x03\x00\x00\x00\x00\x00\x00\x19v\xa9\x14\x8e\xa8\xf7\xb1\xb1\x93\xe2\xe67\x93j\xb2P\xe6\xd3f\xff\x193~\x88\xacH\x03\x00\x00\x00\x00\x00\x00\x19v\xa9\x14\x8arK\xa1\x85i~\xfd3\xe7N\xf3\x1b]\x00\xce\xab\x04\xb53\x88\xacH\x03\x00\x00\x00\x00\x00\x00\x19v\xa9\x14\xf3 /\xdb?\x02\x06\xabS\xfeI\x0b\x93s\x83~\xe8pR \x88\xacH\x03\x00\x00\x00\x00\x00\x00\x19v\xa9\x14\xff\xfd>\xb68\xed\x1a\xe8D\xed%\xcdh]\x86A\xbc\xe2lt\x88\xacH\x03\x00\x00\x00\x00\x00\x00\x19v\xa9\x149.\xeb\xc8B\x84\xfb\xdd-\x82!\xcd\x02\xf1\x8e\xcc{a\xb0\x11\x88\xacH\x03\x00\x00\x00\x00\x00\x00\x19v\xa9\x14\xc4OwV\x06\xce\xf4\x88\x1feS\xee\x88\x8c\n\xfb\xbd\xf5\x80(\x88\xacH\x03\x00\x00\x00\x00\x00\x00\x19v\xa9\x14&\xdc?J\xb3\xb0\x17W\xd5\x06\x86\xcbC\xdb\'[4\x87\x03/\x88\xacH\x03\x00\x00\x00\x00\x00\x00\x19v\xa9\x14\xdf\n\x9b\x13\x0b)\x0e\xba\x01\xeb\xaf\x178\xba\xf0\xfa\x1a\xfd\x95\x04\x88\xacH\x03\x00\x00\x00\x00\x00\x00\x19v\xa9\x14\xc1\\\x9d\x8e\x88E\x05#\x1d\xe2`\xab3*2\xd6\xdf\xe9\xed\xdc\x88\xacH\x03\x00\x00\x00\x00\x00\x00\x19v\xa9\x14\xb4\x14\xb8\x01)\x06\xaf8\xda*\xb7\xd6\x82\xa38\xc7\xc1\xc3\xef\xdc\x88\xacH\x03\x00\x00\x00\x00\x00\x00\x19v\xa9\x14XC\xaeML\xcf]\xe6\x9d\xb2\xc7\x1e&\x00\x8f8\xba\x06$/\x88\xacH\x03\x00\x00\x00\x00\x00\x00\x19v\xa9\x14K\x04\x92]\xd1)\xfd\x0c!\x83\xf5w8\xa7G\xf4\xc2\xd0\xdd\xca\x88\xacH\x03\x00\x00\x00\x00\x00\x00\x19v\xa9\x14<\x18\xe3\xa1\x88MJ\xe1\x1c\x1b\xf1\xb5OGh\xe0\xea!\x9e7\x88\xacH\x03\x00\x00\x00\x00\x00\x00\x19v\xa9\x14WO\xe7\xdf\x04\x0e_\x13\xa4\xcf\x0b\xe9\xa2\xa8\xeai\x8a\xfa=s\x88\xacH\x03\x00\x00\x00\x00\x00\x00\x19v\xa9\x14v\x8f\xbb\x8d\\\xe4\xf4\xfb\xac\xb42\'#h\xb9\xd2\'s\xb7!\x88\xacN\xe7;\x00\x00\x00\x00\x00\x19v\xa9\x14\x17<\xd3\xe7\xf2X\x81\xb2\xcb-\xc8\xbb;s2\xb3\xa5\xcaw\x0b\x88\xac\x00\x00\x00\x00\x00\x00\x00\x00;j9Send via Bitcoin SV Transaction Gun http://bit.ly/2Z1nzfN\x00\x00\x00\x00'], [0, '6c828920ea3a968f0c3c4a8f14d70b696e0440d8e4e1d019cced1ba2cc63cd51', [0, '00000000000000000459e1bb62745173cb2d04090cdd5d2ab268cff7b442f003', 1488, 600060], b'\x01\x00\x00\x00\x01W\x1d\xc4\x8a\x8bL\xb1k\xc8\x16\\\xfc\xcb\x05\xa6 \xc2\x89A\x93Yt/\xef\x1d\x80\xdc\xafPuQ\x16\x01\x00\x00\x00jG0D\x02 ?\x9e\xb0\xfb\xd8\xa31\x89\x8fZ\x103$\x92\xcc\x10\xf4\x1a\x04\x80\x03\xd1\x8b/\x83\xd0^B\xbd\xb5i\xec\x02 \x11\xf2\x13\xbe\xdb\xcf\'X\x89\x11-@\x80C\xd9cK\xc0-\\_.\xb2:I\xce\xd0\x92\x8e\xa2\xe6\xf2A!\x02\xd5\x98\xe2\xe6K\xfe\xa7/\xd2\xc8>\x13\xce\xa6/\x18{j\xa91\xcb\x87\xc3\xd1\xd6\x8ex\xa4\xce\x17Q\xdb\xff\xff\xff\xff\x02\x00\x00\x00\x00\x00\x00\x00\x00\x88j"1LtyME6b5AnMopQrBPLk4FGN8UBuhxKqrn\x01\x013{"t":24.64,"h":19,"p":1021,"c":1,"ws":2.6,"wd":360}"12aDXuZfxRCzso9aYBip9kveJVtBXjYtyH\n1568516306\xf1\x08&\x00\x00\x00\x00\x00\x19v\xa9\x14\x11@P~\xae\xaa\xf1\x7f\x97\xef\xaf\xf0j\xbd`/\x14f\x11\xca\x88\xac\x00\x00\x00\x00']]]]]
Received [0, 1, 200, [], [[6, [[0, '13n561iVozTtMXJzAJNA5TQsnTboRvpxae', [0, '06032a172f88ba823785f87341eab26ee7a2eb2de9d2f105220d6580e3affc16', 59], [0, '00000000201016a83272835468d457d15965d57f57c0da5944dc94ea9389f360', 15968, 2], False, False, False, '12higDjoCCNXSA95xZMWUdPvXNmkAduhWv', [0, '486f67c9f2c1599a208a7bcbea195b482a273cba64d4422666374703d5c9ecfe', 0], 300000000000], [0, '13n561iVozTtMXJzAJNA5TQsnTboRvpxae', [0, '486f67c9f2c1599a208a7bcbea195b482a273cba64d4422666374703d5c9ecfe', 0], [0, '00000000787bb5153d76225b438596b3fc01cf8a27beec9c9fb48c20b911edfc', 15241, 1], False, False, True, '', [0, '0000000000000000000000000000000000000000000000000000000000000000', -1], 5000000000]]]]]
Received [0, 1, 200, [], [[7, [[0, '16qgC3hzi38xo1vn2gGsNVwWaW1sEH3h9R', [0, 'b5d50046994f7e8bc4a77cc9762d274d724af08ea09e7433652b6fef2b058057', 0], [0, '000000005aa54c73c253c5a5dd8ca1dff3d092f8bbecc965f0eb3e72a83e2386', 16772, 1], False, False, True, '', [0, '0000000000000000000000000000000000000000000000000000000000000000', -1], 5000000000], [0, '1P8Jd8qQM7y45iXLM1eiXCCmGRhCPjykZB', [0, '4f4e3fe8df599be5a98f9faeebf28fe25db5adcc53a3fb73850c925aefd4b8ef', 0], [0, '00000000000000000459e1bb62745173cb2d04090cdd5d2ab268cff7b442f003', 600060, 5080], False, False, True, '', [0, '7d8a81964df2a73300d4635475332d90b4e04d87ae4024d30743bc194631dfb8', 1], 0]]]]]
Received [0, 1, 200, [], [[8, [[0, 'c1b274c4b5063b3ab9842848bdcfee1368a643366c21b04110df02bee86aef0b', False], [0, 'dbb6cd6fd7484c2d29c2bec9d4b9d93202c27e32b9fc448a0d0a7fe5d13986b3', False], [0, 'c2a1939b00cf9bb2d30af200c7a3c356b0d04c66baa8058aca0036969c4fe4bc', True], [0, '6fdbd28219ee97a235abc07e8fbfc51d8d0c2d9619762025edce50f363d363e9', True], [0, '7ad59b57e68a4f9b105cece84bb951f78a8f8c38562acdd7fe04e19f598c94e8', True], [0, 'a57b8c5523a5d7b5a95102d202e3609c660622fdacb918cc53513b3dfd2d7632', False], [0, 'b16c1b2816fe778941e23b5dd63bbad1bc1de739a110e7c3867e7c139a6c6669', False], [0, '6fc28bf5d8b4c662a455da29b1213438324ffce36b9728f5bcff1711a1a1cc8f', False], [0, '6f31df729d941f77ffb82c0f5cac40b3ddf2923e67afdcad5cbafe7e5d460a73', False], [0, 'edd63731c5501db690ee8bd6ff10d1cf10935c5a97db148f70049edf73c14e52', False], [0, '53ea7690bcdc27617f49333f500af10d721d21584a8fb4f1100d569b0b8d4ed9', True]]]]]