I tried to follow the voter-key guide and ran into some problems.
I set up the hot client and cold storage addresses according to the guide. My voter address is DVSCp2UnK2SYacZbrhuA1XCSnej9cGsLgqDW. My cold storage address is DVS2AgMjmUsKhUvgv9eRNkfKrqgtdadYrku8. I moved 100 DVS to that address creating a balance with an ID of DVS4sfmSA1jXb7swUkDRm323vhoqXxT69BGj.
(wallet closed) >>> blockchain_list_balances DVS4sfmSA1jXb7swUkDRm323vhoqXxT69BGj 1
[[
"DVS4sfmSA1jXb7swUkDRm323vhoqXxT69BGj",{
"condition": {
"asset_id": 0,
"slate_id": 14656263436760093262,
"type": "withdraw_signature_type",
"data": {
"owner": "DVS2AgMjmUsKhUvgv9eRNkfKrqgtdadYrku8",
"memo": null
}
},
"balance": 10000000,
"restricted_owner": null,
"snapshot_info": null,
"deposit_date": "2015-01-24T23:59:30",
"last_update": "2015-01-24T23:59:30",
"meta_data": null
}
]
]
Then from my cold-storage wallet I do the following:
cold-storage (unlocked) >>> wallet_balance_set_vote_info DVS4sfmSA1jXb7swUkDRm323vhoqXxT69BGj DVSCp2UnK2SYacZbrhuA1XCSnej9cGsLgqDW vote_all false
{
"transaction_record": {
"index": 0,
"record_id": "0000000000000000000000000000000000000000",
"block_num": 0,
"is_virtual": false,
"is_confirmed": false,
"is_market": false,
"trx": {
"expiration": "2015-01-25T05:19:39",
"slate_id": null,
"operations": [{
"type": "update_balance_vote_op_type",
"data": {
"balance_id": "DVS4sfmSA1jXb7swUkDRm323vhoqXxT69BGj",
"new_restricted_owner": "DVSCp2UnK2SYacZbrhuA1XCSnej9cGsLgqDW",
"new_slate": 0
}
}
],
"signatures": []
},
"ledger_entries": [{
"from_account": null,
"to_account": null,
"amount": {
"amount": 0,
"asset_id": 0
},
"memo": "Set balance vote info",
"memo_from_account": null
}
],
"fee": {
"amount": 100000,
"asset_id": 0
},
"created_time": "1970-01-01T00:00:00",
"received_time": "1970-01-01T00:00:00",
"extra_addresses": []
},
"required_signatures": [
"DVS2AgMjmUsKhUvgv9eRNkfKrqgtdadYrku8"
],
"outstanding_balances": [],
"notices": []
}
The JSON output is also stored in the file "/home/arhag/.DevShares/wallets/trx/latest.trx". I copy that to builder.trx in the same directory.
I tried to use the command in the guide, but I had to set the broadcast flag to false because it is supposed to be a cold-storage environment meaning that I shouldn't have an internet connection to broadcast the transaction (I only want to sign it). However, as you will see it gave me an error:
cold-storage (unlocked) >>> wallet_builder_add_signature null false "/home/arhag/.DevShares/wallets/trx/builder.trx"
7 bad_cast_exception: Bad Cast
Invalid cast from type 'null_type' to Object
{"type":"null_type"}
th_a variant.cpp:568 get_object
{"command":"wallet_builder_add_signature"}
th_a cli.cpp:626 execute_command
So, I gave up on following the guide and tried to figure it out for myself. I used the "wallet_builder_file_add_signature" command instead:
cold-storage (unlocked) >>> wallet_builder_file_add_signature false
{
"transaction_record": {
"index": 0,
"record_id": "588316c670f32541363755f28d515f484668bc4a",
"block_num": 0,
"is_virtual": false,
"is_confirmed": false,
"is_market": false,
"trx": {
"expiration": "2015-01-25T05:19:39",
"slate_id": null,
"operations": [{
"type": "update_balance_vote_op_type",
"data": {
"balance_id": "DVS4sfmSA1jXb7swUkDRm323vhoqXxT69BGj",
"new_restricted_owner": "DVSCp2UnK2SYacZbrhuA1XCSnej9cGsLgqDW",
"new_slate": 0
}
}
],
"signatures": [
"207d264bb6f0a41d6455cd6b9f2d6c1942f87fe461997e46d9b2f0941d6a95e8726d4182dbf05b828e09d93457667622d162abd9448b0cf75b57ad59d94ba34bb0"
]
},
"ledger_entries": [{
"from_account": null,
"to_account": null,
"amount": {
"amount": 0,
"asset_id": 0
},
"memo": "Set balance vote info",
"memo_from_account": null
}
],
"fee": {
"amount": 100000,
"asset_id": 0
},
"created_time": "2015-01-25T04:26:01",
"received_time": "2015-01-25T04:26:01",
"extra_addresses": []
},
"required_signatures": [
"DVS2AgMjmUsKhUvgv9eRNkfKrqgtdadYrku8"
],
"outstanding_balances": [],
"notices": []
}
This appears to have taken the transaction in latest.trx, added the signature, and wrote the result back in latest.trx. Here is the diff between builder.trx (the unsigned version of the transaction) and latest.trx (the signed version):
$ diff builder.trx latest.trx
4c4
< "record_id": "0000000000000000000000000000000000000000",
---
> "record_id": "588316c670f32541363755f28d515f484668bc4a",
21c21,23
< "signatures": []
---
> "signatures": [
> "207d264bb6f0a41d6455cd6b9f2d6c1942f87fe461997e46d9b2f0941d6a95e8726d4182dbf05b828e09d93457667622d162abd9448b0cf75b57ad59d94ba34bb0"
> ]
38,39c40,41
< "created_time": "1970-01-01T00:00:00",
< "received_time": "1970-01-01T00:00:00",
---
> "created_time": "2015-01-25T04:26:01",
> "received_time": "2015-01-25T04:26:01",
I then can copy this latest.trx to the machine where my hot client is running (in reality I'm just doing this on the same machine for convenience). Then after opening the regular hot wallet and unlocking it, I run the following command to broadcast this signed transaction from the internet-enabled machine where the hot client is running:
default (unlocked) >>> wallet_builder_file_add_signature true
Transaction was invalid!
default (unlocked) >>> wallet_builder_file_add_signature true{
"transaction_record": {
"index": 0,
"record_id": "588316c670f32541363755f28d515f484668bc4a",
"block_num": 0,
"is_virtual": false,
"is_confirmed": false,
"is_market": false,
"trx": {
"expiration": "2015-01-25T05:19:39",
"slate_id": null,
"operations": [{
"type": "update_balance_vote_op_type",
"data": {
"balance_id": "DVS4sfmSA1jXb7swUkDRm323vhoqXxT69BGj",
"new_restricted_owner": "DVSCp2UnK2SYacZbrhuA1XCSnej9cGsLgqDW",
"new_slate": 0
}
}
],
"signatures": [
"207d264bb6f0a41d6455cd6b9f2d6c1942f87fe461997e46d9b2f0941d6a95e8726d4182dbf05b828e09d93457667622d162abd9448b0cf75b57ad59d94ba34bb0"
]
},
"ledger_entries": [{
"from_account": null,
"to_account": null,
"amount": {
"amount": 0,
"asset_id": 0
},
"memo": "Set balance vote info",
"memo_from_account": null
}
],
"fee": {
"amount": 100000,
"asset_id": 0
},
"created_time": "2015-01-25T04:26:01",
"received_time": "2015-01-25T04:26:01",
"extra_addresses": []
},
"required_signatures": [
"DVS2AgMjmUsKhUvgv9eRNkfKrqgtdadYrku8"
],
"outstanding_balances": [],
"notices": []
}
But as you can see it returns "Transaction was invalid!" as an error message. And sure enough I can see that the restricted_owner field for the balance has not been updated and is still null:
default (unlocked) >>> blockchain_list_balances DVS4sfmSA1jXb7swUkDRm323vhoqXxT69BGj 1
[[
"DVS4sfmSA1jXb7swUkDRm323vhoqXxT69BGj",{
"condition": {
"asset_id": 0,
"slate_id": 14656263436760093262,
"type": "withdraw_signature_type",
"data": {
"owner": "DVS2AgMjmUsKhUvgv9eRNkfKrqgtdadYrku8",
"memo": null
}
},
"balance": 10000000,
"restricted_owner": null,
"snapshot_info": null,
"deposit_date": "2015-01-24T23:59:30",
"last_update": "2015-01-24T23:59:30",
"meta_data": null
}
]
]
I thought about trying the "blockchain_broadcast_transaction" command instead to see if that could work, but that requires me to input the escaped JSON into the CLI and doesn't allow me instead provide a path to a file holding the transaction JSON. Anyway, I don't even know if that would help if the transaction itself is not formed properly.