How to make OP_RETURN Testnet in Python


#1

Hello I need create a OP_RETURN notarization for my blockchain in Python 3.6 however I am begginer this programming language and I dont know how to start generating blocks and transactions using
send-OP_RETURN.py :

    import sys, string
    from OP_RETURN import *
   
 if len(sys.argv)<4:
    sys.exit(
 dummy, send_address, send_amount, metadata = sys.argv[0:4]
if len(sys.argv)>4:
	testnet=bool(sys.argv[4])
else:
	testnet=False

metadata_from_hex=OP_RETURN_hex_to_bin(metadata)
if metadata_from_hex is not None:
	metadata=metadata_from_hex

result=OP_RETURN_send(send_address, float(send_amount), metadata, testnet)

if 'error' in result:
	print('Error: '+result['error'])
else:
	print('TxID: '+result['txid']+'\nWait a few seconds then check on: http://'+
('testnet.' if testnet else '')+'coinsecrets.org/')

#2

Try using this library: https://github.com/PeerAssets/btcpy
It’s more complex buy you will get more control.