OMNI 让别的地址代出手续费

https://github.com/OmniLayer/omnicore/wiki/Is-it-possible-to-pay-transaction-fees-from-a-different-source%3F

listunspent 找出有钱的txid

./omnicore-cli "listunspent" 0 999999
  {
    "txid": "e8eabf19dc2466d5401c8c85767e4ba6b588ba18f602c4505b1c8dac5feae936",
    "vout": 0,
    "address": "mr9apo8ZazJs9iYnngwzFXmjsp9Fr74e3D",
    "account": "",
    "scriptPubKey": "76a914749eb9e8565f0678016b0397a2cb8b9db536d5c688ac",
    "amount": 0.87874976,
    "confirmations": 236,
    "spendable": true,
    "solvable": true
  },

构造代币和金额

omnicore-cli "omni_createpayload_simplesend" 2 "0.1"
00000000000000020000000000989680

构造交易数据

txid 和 vout 取之前 listunspent 查到的钱最多的那条

./omnicore-cli "createrawtransaction" '[{"txid":"e8eabf19dc2466d5401c8c85767e4ba6b588ba18f602c4505b1c8dac5feae936","vout":0}]' '{}'
010000000136e9ea5fac8d1c5b50c402f618ba88b5a64b7e76858c1c40d56624dc19bfeae80000000000ffffffff0000000000

在交易数据中加上omni代币数据

omnicore-cli "omni_createrawtx_opreturn" "010000000136e9ea5fac8d1c5b50c402f618ba88b5a64b7e76858c1c40d56624dc19bfeae80000000000ffffffff0000000000" "00000000000000020000000000989680"
010000000136e9ea5fac8d1c5b50c402f618ba88b5a64b7e76858c1c40d56624dc19bfeae80000000000ffffffff010000000000000000166a146f6d6e690000000000000002000000000098968000000000

交易数据上加上接收地址

./omnicore-cli "omni_createrawtx_reference" "010000000136e9ea5fac8d1c5b50c402f618ba88b5a64b7e76858c1c40d56624dc19bfeae80000000000ffffffff010000000000000000166a146f6d6e690000000000000002000000000098968000000000" "mrEkdJV5Pfer7VPHzdgdwsmVTXCPwqzsK6"
010000000136e9ea5fac8d1c5b50c402f618ba88b5a64b7e76858c1c40d56624dc19bfeae80000000000ffffffff020000000000000000166a146f6d6e690000000000000002000000000098968022020000000000001976a9147598fcf86895d79e81bbf86b308b2c010a8f36eb88ac00000000

指定矿工费用

可选

签名

./omnicore-cli "signrawtransaction" "010000000136e9ea5fac8d1c5b50c402f618ba88b5a64b7e76858c1c40d56624dc19bfeae80000000000ffffffff020000000000000000166a146f6d6e690000000000000002000000000098968022020000000000001976a9147598fcf86895d79e81bbf86b308b2c010a8f36eb88ac00000000"
{
  "hex": "010000000136e9ea5fac8d1c5b50c402f618ba88b5a64b7e76858c1c40d56624dc19bfeae8000000006a47304402205bd85d2bd3a6f56feba6ff139046fd94050c28c63eb2079ccaff9ea28309ea220220302c686d7fb9a00d6113f2d0618b8beb7cfeb3a54d1d70c8d28ccd5fc043bc2c0121027a31fd0526c98b6d0e74cc1c3b54dfcbbf272fc0b999f7509c664e32c7958403ffffffff020000000000000000166a146f6d6e690000000000000002000000000098968022020000000000001976a9147598fcf86895d79e81bbf86b308b2c010a8f36eb88ac00000000",
  "complete": true
}

广播


./omnicore-cli "sendrawtransaction" "010000000136e9ea5fac8d1c5b50c402f618ba88b5a64b7e76858c1c40d56624dc19bfeae8000000006a47304402205bd85d2bd3a6f56feba6ff139046fd94050c28c63eb2079ccaff9ea28309ea220220302c686d7fb9a00d6113f2d0618b8beb7cfeb3a54d1d70c8d28ccd5fc043bc2c0121027a31fd0526c98b6d0e74cc1c3b54dfcbbf272fc0b999f7509c664e32c7958403ffffffff020000000000000000166a146f6d6e690000000000000002000000000098968022020000000000001976a9147598fcf86895d79e81bbf86b308b2c010a8f36eb88ac00000000"

官方

https://github.com/OmniLayer/omnicore/pull/658

提供的方法生成了 omni_createfunded_send

./omnicore-cli omni_createfunded_send  mw7yogQhSTc2KmAB3DHZPdaHzWzR2Afdpj mrEkdJV5Pfer7VPHzdgdwsmVTXCPwqzsK6 1  0.1 mr9apo8ZazJs9iYnngwzFXmjsp9Fr74e3D
0100000001b3c7bdf8695ab08b91f43e514d1e490daab24d02756e685d77cd24db088dc95f0000000000ffffffff037d830100000000001976a914749eb9e8565f0678016b0397a2cb8b9db536d5c688ac0000000000000000166a146f6d6e690000000000000001000000000098968022020000000000001976a9147598fcf86895d79e81bbf86b308b2c010a8f36eb88ac00000000

签名

./omnicore-cli "signrawtransaction" 0100000001b3c7bdf8695ab08b91f43e514d1e490daab24d02756e685d77cd24db088dc95f0000000000ffffffff037d830100000000001976a914749eb9e8565f0678016b0397a2cb8b9db536d5c688ac0000000000000000166a146f6d6e690000000000000001000000000098968022020000000000001976a9147598fcf86895d79e81bbf86b308b2c010a8f36eb88ac00000000
{
  "hex": "0100000001b3c7bdf8695ab08b91f43e514d1e490daab24d02756e685d77cd24db088dc95f000000006b483045022100c0b3918672342e055aec03b7c0825a0ca7c4877d67eb47bd8332e1546377bd680220473eab8de44dc8eb7417fbb03f4e4ddbe5ae8583fdf5271db3a3bd5b1dd9a06e012103b00094230d74d36aaacf3daf7f736a7b03fb87c00fcfd3e865772cef41cb454affffffff037d830100000000001976a914749eb9e8565f0678016b0397a2cb8b9db536d5c688ac0000000000000000166a146f6d6e690000000000000001000000000098968022020000000000001976a9147598fcf86895d79e81bbf86b308b2c010a8f36eb88ac00000000",
  "complete": true
}

广播:

./omnicore-cli "sendrawtransaction" "0100000001b3c7bdf8695ab08b91f43e514d1e490daab24d02756e685d77cd24db088dc95f000000006b483045022100c0b3918672342e055aec03b7c0825a0ca7c4877d67eb47bd8332e1546377bd680220473eab8de44dc8eb7417fbb03f4e4ddbe5ae8583fdf5271db3a3bd5b1dd9a06e012103b00094230d74d36aaacf3daf7f736a7b03fb87c00fcfd3e865772cef41cb454affffffff037d830100000000001976a914749eb9e8565f0678016b0397a2cb8b9db536d5c688ac0000000000000000166a146f6d6e690000000000000001000000000098968022020000000000001976a9147598fcf86895d79e81bbf86b308b2c010a8f36eb88ac00000000"

成功:

./omnicore-cli "sendrawtransaction" "0100000001b3c7bdf8695ab08b91f43e514d1e490daab24d02756e685d77cd24db088dc95f000000006b483045022100c0b3918672342e055aec03b7c0825a0ca7c4877d67eb47bd8332e1546377bd680220473eab8de44dc8eb7417fbb03f4e4ddbe5ae8583fdf5271db3a3bd5b1dd9a06e012103b00094230d74d36aaacf3daf7f736a7b03fb87c00fcfd3e865772cef41cb454affffffff037d830100000000001976a914749eb9e8565f0678016b0397a2cb8b9db536d5c688ac0000000000000000166a146f6d6e690000000000000001000000000098968022020000000000001976a9147598fcf86895d79e81bbf86b308b2c010a8f36eb88ac00000000"
a84b9bf4a25553eeadead76815cb810df6e7bc5e3de35d3fe1d77b580e901af2

再次测试

生成一个地址

./omnicore-cli getnewaddress mgxPp67ytTEEbTxkfwKH8CYgtFczxjYJ3d

转入 omni

./omnicore-cli omni_send mr9apo8ZazJs9iYnngwzFXmjsp9Fr74e3D mgxPp67ytTEEbTxkfwKH8CYgtFczxjYJ3d 1 0.3

生成

./omnicore-cli omni_createfunded_send mgxPp67ytTEEbTxkfwKH8CYgtFczxjYJ3d mr9apo8ZazJs9iYnngwzFXmjsp9Fr74e3D 1 0.3 mr9apo8ZazJs9iYnngwzFXmjsp9Fr74e3D