3 # This script makes the neccesary transactions to migrate
4 # coin between 2 assetchains on the same -ac_cc id
10 address="RFw7byY4xZpZCrtkMk3nFuuG1NTs9rSGgQ"
13 # Alias for running cli on source chain
14 cli_source="komodo-cli -ac_name=$source"
16 # Raw tx that we will work with
17 txraw=`$cli_source createrawtransaction "[]" "{\"$address\":$amount}"`
19 # Convert to an export tx
20 exportData=`$cli_source migrate_converttoexport $txraw $target $amount`
21 exportRaw=`echo $exportData | jq -r .exportTx`
22 exportPayouts=`echo $exportData | jq -r .payouts`
25 exportFundedData=`$cli_source fundrawtransaction $exportRaw`
26 exportFundedTx=`echo $exportFundedData | jq -r .hex`
29 exportSignedData=`$cli_source signrawtransaction $exportFundedTx`
30 exportSignedTx=`echo $exportSignedData | jq -r .hex`
33 echo "Sending export tx"
34 $cli_source sendrawtransaction $exportSignedTx
36 read -p "Wait for a notarisation to KMD, and then two more notarisations from the target chain, and then press enter to continue"
39 importTx=`$cli_source migrate_createimporttransaction $exportSignedTx $payouts`
40 importTx=`komodo-cli migrate_completeimporttransaction $importTx`
43 komodo-cli -ac_name=$target sendrawtransaction $importTx