Last active
August 29, 2015 14:13
-
-
Save pmitchev/fcee1345e20d70108e37 to your computer and use it in GitHub Desktop.
Revisions
-
pmitchev revised this gist
Jan 26, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -10,7 +10,7 @@ def main(): packed_data_tx += bytearray.fromhex("f579ff2174f828b6619a70d791db5297c9769c3e3cf06afb99e364f2bfa94c9f") print 'Packed Value :', binascii.hexlify(packed_data_tx) response_tx = requests.post('http://localhost:29081/get_o_indexes.bin', data=packed_data_tx) print response_tx.status_code print(binascii.hexlify(response_tx.content)) -
pmitchev created this gist
Jan 20, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,32 @@ import binascii import requests import struct def main(): packed_data_tx = struct.pack('@I I B', 16847105, 16908545, 1) # signiture packed_data_tx += struct.pack('@B B 4s', 4, 4, "txid") # type?, length, text packed_data_tx += struct.pack('@B', 10) + bytearray.fromhex("80") # type, strarray? packed_data_tx += bytearray.fromhex("f579ff2174f828b6619a70d791db5297c9769c3e3cf06afb99e364f2bfa94c9f") print 'Packed Value :', binascii.hexlify(packed_data_tx) response_tx = requests.post('http://localhost:29081/o_indexes.bin', data=packed_data_tx) print response_tx.status_code print(binascii.hexlify(response_tx.content)) print struct.unpack('@Q', '1c00000000000000') # 6a04b45400000000 # 1c00000000000000 # Response # 011101010101020101 - #signiture # 08 - # don't know? # 096f5f696e646578657385 - 9 char string (o_inputs) # 1c00000000000000005200000000000000540000000000000055000000000000006900000000000000d9000000000000004d03000000000000 - 7 inputs, no idea what those are # struct.unpack('@Q', binascii.unhexlify('1c00000000000000')) ? # 067374617475730a - 6 chars status # 084f4b - why use string for 2 chars? make it int # don't know what this does # print response_tx.text if __name__ == "__main__": main()