#!/usr/bin/env python3
from liquid_rpc_class import RPCHost
import json
import sys
from liquid_utils import connect

if len(sys.argv) != 2:
    print('Usage: python ' + sys.argv[0] + ' LABEL')
    sys.exit(1)

label = sys.argv[1]
res = {}
host_1, host_2, host_3, host_4, host_5, host_6, host_7, host_8, host_9 = connect(
)

res['participants'] = []

# Get unblinded addresses, private and public from each participant, in M>2 add lines from other wallets
address_1 = host_1.call('getnewaddress', label)
address_1_info = host_1.call('getaddressinfo', address_1)
res['participants'].append({
    'name': 'first',
    'address': address_1,
    'pubkey': address_1_info['pubkey']
})

address_2 = host_2.call('getnewaddress', label)
address_2_info = host_2.call('getaddressinfo', address_2)
res['participants'].append({
    'name': 'second',
    'address': address_2,
Ejemplo n.º 2
0
if len(sys.argv) != 7:
    print(
        'Usage: python ' + sys.argv[0] +
        ' AMOUNT ASSET_ADDRESS ENTROPY REISSUANCE_TOKEN REISSUANCE_TOKEN_ADDRESS REISSUANCE_TOKEN_CHANGE_ADDRESS'
    )
    sys.exit(1)

amount = sys.argv[1]
asset_address = sys.argv[2]
entropy = sys.argv[3]
reissuance_token = sys.argv[4]
reissuance_token_address = sys.argv[5]
reissuance_token_change_address = sys.argv[6]

res = {}
host_1, host_2, host_3 = connect()

# Prepare base transaction for reissuance
base = host_1.call('createrawtransaction', [],
                   {reissuance_token_address: reissuance_token_amount}, 0,
                   False, {reissuance_token_address: reissuance_token})
bitcoin_change = host_1.call('getrawchangeaddress')
funded = host_1.call(
    'fundrawtransaction', base, {
        'feeRate': feerate,
        'includeWatching': True,
        'changeAddress': {
            'bitcoin': bitcoin_change,
            reissuance_token: reissuance_token_change_address
        }
    })