]> Git Repo - VerusCoin.git/blame - migratecoin.sh
Testnet fixes
[VerusCoin.git] / migratecoin.sh
CommitLineData
a839f9bc
SS
1#!/usr/bin/bash
2
3# This script makes the neccesary transactions to migrate
4# coin between 2 assetchains on the same -ac_cc id
5
6set -e
7
8source=TXSCL
9target=TXSCL000
10address="RFw7byY4xZpZCrtkMk3nFuuG1NTs9rSGgQ"
11amount=1
12
13# Alias for running cli on source chain
14cli_source="komodo-cli -ac_name=$source"
15
16# Raw tx that we will work with
17txraw=`$cli_source createrawtransaction "[]" "{\"$address\":$amount}"`
18
19# Convert to an export tx
20exportData=`$cli_source migrate_converttoexport $txraw $target $amount`
21exportRaw=`echo $exportData | jq -r .exportTx`
22exportPayouts=`echo $exportData | jq -r .payouts`
23
24# Fund
25exportFundedData=`$cli_source fundrawtransaction $exportRaw`
26exportFundedTx=`echo $exportFundedData | jq -r .hex`
27
28# Sign
29exportSignedData=`$cli_source signrawtransaction $exportFundedTx`
30exportSignedTx=`echo $exportSignedData | jq -r .hex`
31
32# Send
33echo "Sending export tx"
34$cli_source sendrawtransaction $exportSignedTx
35
36read -p "Wait for a notarisation to KMD, and then two more notarisations from the target chain, and then press enter to continue"
37
38# Create import
39importTx=`$cli_source migrate_createimporttransaction $exportSignedTx $payouts`
40importTx=`komodo-cli migrate_completeimporttransaction $importTx`
41
42# Send import
43komodo-cli -ac_name=$target sendrawtransaction $importTx
This page took 0.050227 seconds and 4 git commands to generate.