Author Topic: Workflow for a proposed transfer  (Read 3303 times)

0 Members and 1 Guest are viewing this topic.

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
you need the operation
account_update_operation
the required fields of that operation are returned if you run
get_prototype_operation account_update_operation

you can add fields for "owner" and "active" as well as "options" to change those settings individually (please, please test this in the testnet FIRST!!)
as for the active and owner permissions, the default fields can be seen from
get_prototype_operation account_create_operation 
which are weight_threshold and account, key and address auths.
If you take a look at the account fabian-secured, you can see how they should look if you have other accounts be part of the active permissions.
you can there also see that a public key (key_auth) is used for the owner permission

Offline abit

  • Committee member
  • Hero Member
  • *
  • Posts: 4664
    • View Profile
    • Abit's Hive Blog
  • BitShares: abit
  • GitHub: abitmore
@xeroc @abit
Is there a way to create a multi-sig account in the CLI?
It's easy in the GUI but it seems to me there is no command for this in the CLI.

Here is a list of all CLI commands:
Code: [Select]
(help)
(gethelp)
(info)
(about)

(get_prototype_operation)

(begin_builder_transaction)
(add_operation_to_builder_transaction)
(replace_operation_in_builder_transaction)
(set_fees_on_builder_transaction)
(preview_builder_transaction)
(sign_builder_transaction)
(propose_builder_transaction)
(remove_builder_transaction)

(approve_proposal)

(sign_transaction)

(is_new)
(is_locked)

(lock)(unlock)(set_password)

(dump_private_keys)
(get_private_key)

(list_my_accounts)
(list_accounts)
(list_account_balances)
(list_assets)

(import_key)
(import_accounts)
(import_account_keys)
(import_balance)

(suggest_brain_key)
(normalize_brain_key)

(register_account)
(upgrade_account)
(create_account_with_brain_key)

(sell_asset)
(borrow_asset)
(cancel_order)

(transfer)
(transfer2)

(get_transaction_id)

(create_asset)
(update_asset)
(update_bitasset)

(update_asset_feed_producers)
(publish_asset_feed)

(issue_asset)
(get_asset)
(get_bitasset_data)

(fund_asset_fee_pool)
(reserve_asset)

(global_settle_asset)
(settle_asset)
(whitelist_account)

(create_committee_member)

(get_witness)
(get_committee_member)

(list_witnesses)
(list_committee_members)

(create_witness)
(update_witness)

(create_worker)
(update_worker_votes)

(get_vesting_balances)
(withdraw_vesting)

(vote_for_committee_member)
(vote_for_witness)

(set_voting_proxy)

(set_desired_witness_and_committee_member_count)

(get_account)
(get_account_id)
(get_block)

(get_account_count)
(get_account_history)

(get_market_history)
(get_global_properties)
(get_dynamic_global_properties)
(get_object)

(load_wallet_file)


(get_limit_orders)
(get_call_orders)
(get_settle_orders)

(save_wallet_file)

(serialize_transaction)

(propose_parameter_change)
(propose_fee_change)

(dbg_make_uia)
(dbg_make_mia)
(flood_network)
(network_add_nodes)
(network_get_connected_peers)

(set_key_label)
(get_key_label)
(get_public_key)

(get_blind_accounts)
(get_my_blind_accounts)
(get_blind_balances)
(create_blind_account)
(transfer_to_blind)
(transfer_from_blind)
(blind_transfer)
(blind_history)
(receive_blind_transfer)
(begin_builder_transaction)
(add_operation_to_builder_transaction)
(replace_operation_in_builder_transaction)
(set_fees_on_builder_transaction)
(preview_builder_transaction)
(sign_builder_transaction)
(propose_builder_transaction)
(remove_builder_transaction)

CLI can do anything with above commands.

//Update:
The operation for setting an account to multi-sig is "account_update_operation".
« Last Edit: January 31, 2016, 01:01:12 am by abit »
BitShares committee member: abit
BitShares witness: in.abit

jakub

  • Guest
@xeroc @abit
Is there a way to create a multi-sig account in the CLI?
It's easy in the GUI but it seems to me there is no command for this in the CLI.

Here is a list of all CLI commands:
Code: [Select]
(help)
(gethelp)
(info)
(about)

(get_prototype_operation)

(begin_builder_transaction)
(add_operation_to_builder_transaction)
(replace_operation_in_builder_transaction)
(set_fees_on_builder_transaction)
(preview_builder_transaction)
(sign_builder_transaction)
(propose_builder_transaction)
(remove_builder_transaction)

(approve_proposal)

(sign_transaction)

(is_new)
(is_locked)

(lock)(unlock)(set_password)

(dump_private_keys)
(get_private_key)

(list_my_accounts)
(list_accounts)
(list_account_balances)
(list_assets)

(import_key)
(import_accounts)
(import_account_keys)
(import_balance)

(suggest_brain_key)
(normalize_brain_key)

(register_account)
(upgrade_account)
(create_account_with_brain_key)

(sell_asset)
(borrow_asset)
(cancel_order)

(transfer)
(transfer2)

(get_transaction_id)

(create_asset)
(update_asset)
(update_bitasset)

(update_asset_feed_producers)
(publish_asset_feed)

(issue_asset)
(get_asset)
(get_bitasset_data)

(fund_asset_fee_pool)
(reserve_asset)

(global_settle_asset)
(settle_asset)
(whitelist_account)

(create_committee_member)

(get_witness)
(get_committee_member)

(list_witnesses)
(list_committee_members)

(create_witness)
(update_witness)

(create_worker)
(update_worker_votes)

(get_vesting_balances)
(withdraw_vesting)

(vote_for_committee_member)
(vote_for_witness)

(set_voting_proxy)

(set_desired_witness_and_committee_member_count)

(get_account)
(get_account_id)
(get_block)

(get_account_count)
(get_account_history)

(get_market_history)
(get_global_properties)
(get_dynamic_global_properties)
(get_object)

(load_wallet_file)


(get_limit_orders)
(get_call_orders)
(get_settle_orders)

(save_wallet_file)

(serialize_transaction)

(propose_parameter_change)
(propose_fee_change)

(dbg_make_uia)
(dbg_make_mia)
(flood_network)
(network_add_nodes)
(network_get_connected_peers)

(set_key_label)
(get_key_label)
(get_public_key)

(get_blind_accounts)
(get_my_blind_accounts)
(get_blind_balances)
(create_blind_account)
(transfer_to_blind)
(transfer_from_blind)
(blind_transfer)
(blind_history)
(receive_blind_transfer)

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc

jakub

  • Guest
the first <approving-account> is actually just the "fee-paying-account".
Where is that stated that way? It is not correct.

It's in the documentation:
http://docs.bitshares.eu/bitshares/tutorials/propose-transaction.html

I'm gonna digest & test all this info and in a couple of days I hope to be able to provide a PR to make the docs more complete.

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
(1) In this command:
Code: [Select]
propose_builder_transaction2 0 neura-sx "2016-01-31T00:00:00" 3600 trueI know 3600 is the value for review_period_seconds but what does it mean in practice?
Does it mean that the multi-sig participants have only one hour (i.e. 3600 seconds) to accept the transaction?
If so, one hour starting from when?
The review period is at the very end of your time interval straight
ahead of expiration. If you proposal expired as 10am and you have 1h of
review period, then the review period lasts one hour from 9am to 10am.
During that time no particpant is able to add (or remove, afaik) his
approval.
This feature is mostyl (if not only) interesting for the committee whos
members can infact be voted out of committee during that period to make
a proposal fail even even if the committee approved it. Currently the
minimum review period for committee proposals is 1h which should
certainly be changed to something longer eventually.

You can savely set the review period to 0 unless you want to propose for
committee.

Quote
(2) What does this command do?
Code: [Select]
set_fees_on_builder_transactionWhat happens to the proposed transaction if I don't run this command?
For proposed transactions there are actually TWO fees necessary, first
the operation(s) you want to propose have to pay a fee, and secondly,
the proposal itself has to pay a fee.
The command above sets the fee in the transaction. Note that some
operations have a "fee_payed_by" parameter or so that contains the
account id of whoever payes the fee.

Quote
(3) In this command:
Code: [Select]
approve_proposal <approving-account> <proposal_id> {"active_approvals_to_add" : ["<account-name-required-for-approval>"]} falseWhat is the difference between <approving-account> and <account-name-required-for-approval>?
In what circumstances will they be different?
the first <approving-account> is actually just the "fee-paying-account".
Where is that stated that way? It is not correct.

jakub

  • Guest
(1) In this command:
Code: [Select]
propose_builder_transaction2 0 neura-sx "2016-01-31T00:00:00" 3600 trueI know 3600 is the value for review_period_seconds but what does it mean in practice?
Does it mean that the multi-sig participants have only one hour (i.e. 3600 seconds) to accept the transaction?
If so, one hour starting from when?

(2) What does this command do?
Code: [Select]
set_fees_on_builder_transactionWhat happens to the proposed transaction if I don't run this command?

(3) In this command:
Code: [Select]
approve_proposal <approving-account> <proposal_id> {"active_approvals_to_add" : ["<account-name-required-for-approval>"]} falseWhat is the difference between <approving-account> and <account-name-required-for-approval>?
In what circumstances will they be different?

Offline svk

(3)
Seem it has been merged into master for 2.0.160121
https://github.com/cryptonomex/graphene/commit/7a5c5c476d9762cbba1d745447191523ca5cd601

It seems to be available in my cli-wallet from the testnet .. what did you do differently that you do not have it?

I've compiled the CLI from CNX master, not from your testnet repo.

(To be able to connect the CLI the testnet, I've made this change in config.php)
Code: [Select]
#define GRAPHENE_SYMBOL "TEST"
#define GRAPHENE_ADDRESS_PREFIX "TEST"

It has worked so far (at least for the CLI), so I felt there was no need to recompile from your testnet repo.
But eventually I will compile from the testnet repo - I just need to find the time to do it.

Thank you xeroc, your help is very... helpful  :)

You can also play around with proposed transactions in the GUI locally, just checkout the branch 475-proposed-transfers:
Code: [Select]
git checkout 475-proposed-transfers
It's being held back due to a bug in the witness node only..
Worker: dev.bitsharesblocks

jakub

  • Guest
(3)
Seem it has been merged into master for 2.0.160121
https://github.com/cryptonomex/graphene/commit/7a5c5c476d9762cbba1d745447191523ca5cd601

It seems to be available in my cli-wallet from the testnet .. what did you do differently that you do not have it?

I've compiled the CLI from CNX master, not from your testnet repo.

(To be able to connect the CLI the testnet, I've made this change in config.php)
Code: [Select]
#define GRAPHENE_SYMBOL "TEST"
#define GRAPHENE_ADDRESS_PREFIX "TEST"

It has worked so far (at least for the CLI), so I felt there was no need to recompile from your testnet repo.
But eventually I will compile from the testnet repo - I just need to find the time to do it.

Thank you xeroc, your help is very... helpful  :)

Offline abit

  • Committee member
  • Hero Member
  • *
  • Posts: 4664
    • View Profile
    • Abit's Hive Blog
  • BitShares: abit
  • GitHub: abitmore
With broadcast! ..

Important note .. if you run propose_builder_transaction2 on the same builder -handle TWICE, you will get a proposal for a proposal for your transfer!!
so run it just once or start over ..
Run propose_builder_transaction2 once with false to check,
then run sign_builder_transaction [your_number] true to broadcast.
//Update: yes, just follow the example, the examples is very good.

(3)
Seem it has been merged into master for 2.0.160121
https://github.com/cryptonomex/graphene/commit/7a5c5c476d9762cbba1d745447191523ca5cd601

It seems to be available in my cli-wallet from the testnet .. what did you do differently that you do not have it?
It's you who did the merge and made 160121 the tag.
However I don't know whether CNX is using the master branch.
Your commit of license change is included in latest release, but the commit with propose_builder_transaction2 is not, which is even submitted earlier.
« Last Edit: January 27, 2016, 10:49:15 am by abit »
BitShares committee member: abit
BitShares witness: in.abit

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
With broadcast! ..

Important note .. if you run propose_builder_transaction2 on the same builder -handle TWICE, you will get a proposal for a proposal for your transfer!!
so run it just once or start over ..

jakub

  • Guest
Seem it has been merged into master for 2.0.160121
https://github.com/cryptonomex/graphene/commit/7a5c5c476d9762cbba1d745447191523ca5cd601

OK, thanks I'll try with the newest master.

Am I supposed to use propose_builder_transaction2 with broadcast or without?
And will propose_builder_transaction2 return the Proposal ID?

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
(3)
Seem it has been merged into master for 2.0.160121
https://github.com/cryptonomex/graphene/commit/7a5c5c476d9762cbba1d745447191523ca5cd601

It seems to be available in my cli-wallet from the testnet .. what did you do differently that you do not have it?
« Last Edit: January 27, 2016, 10:22:55 am by xeroc »

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
(1)
The issue here is that "propose_builder_transaction" is buggy .. it does not define a fee paying account.
That's why you have to sue "propose_builder_transaction2" ... which however was not merged into master yet .. (I can do that for testnet though)

(2)
The proposal id is created only after the transaction is included in the block. You can either
- take a look at the said block
- increment the last proposal id
- get a list of all proposal for an account using the witness node (websocket api)
« Last Edit: January 27, 2016, 10:22:20 am by xeroc »

jakub

  • Guest
I'm trying to understand the workflow described in the docs for creating a proposed transaction for a simple transfer.

On the testnet, first I did this:
Code: [Select]
begin_builder_transactionI got 0 as the Handle ID, so I did the next step: 
Code: [Select]
add_operation_to_builder_transaction 0 [0,{"from": "1.2.41","to": "1.2.51","amount": {"amount": 7777774,"asset_id": "1.3.0"}}]which went through without errors.

Now, when I do this:
Code: [Select]
propose_builder_transaction 0 "2016-01-27T00:00:00" 36000 falsethere is no error.

But when I try to broadcast it:
Code: [Select]
propose_builder_transaction 0 "2016-01-27T00:00:00" 36000 trueI get this error:
Code: [Select]
0 exception: unspecified
3030006 invalid_committee_approval: committee account cannot directly approve transaction
Committee account may only propose transactions

(1) Why is this happening?
How can I propose a transaction without broadcasting the proposal first?

(2) How do I get hold of the Proposal ID, so that the other party can approve the proposal?

(3) The CLI command propose_builder_transaction2 seems to be no longer available.
Can I use propose_builder_transaction instead?
What is the difference between propose_builder_transaction and propose_builder_transaction2?
« Last Edit: January 27, 2016, 10:21:02 am by jakub »