Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: roles and multi sig #222

Merged
merged 3 commits into from
Aug 18, 2017
Merged

docs: roles and multi sig #222

merged 3 commits into from
Aug 18, 2017

Conversation

zramsay
Copy link
Contributor

@zramsay zramsay commented Aug 11, 2017

@zramsay zramsay requested a review from ethanfrey August 11, 2017 17:47
Next, we want to send coins _to_ that role. Notice that because this is the second transaction being sent by rich, we need to increase `--sequence` to `2`:

```
basecli tx send --fee=90mycoin --amount=10000mycoin --to=role:"10CAFE4E" --sequence=2 --name=rich
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

role:10CAFE4E works just as well as role:"10CAFE4E", do you find the second easier to read?

Copy link
Contributor Author

@zramsay zramsay Aug 18, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

@ethanfrey ethanfrey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice document. I added two minor points if you wish to address them. I will merge soon as is or wih fixes, as you wish, as there is a push to rename, and I want to close PRs first.

basecli tx send --amount=6000mycoin --from=role:"10CAFE4E" --to=65D406E028319289A0706E294F3B764F44EBA3CF --sequence=1 --assume-role="10CAFE4E" --name=poor --multi --prepare=tx.json
```

you'll be prompted for `poor`'s password and there won't be any `stdout` to the terminal. Note that the address in the `--to` flag matches the address of `poor`'s account from the beginning of the tutorial. The main output is the `tx.json` file that has just been created. In the above command, the `--assume-role` flag is used to (not clear, since we have --from), while the `--multi` flag is used in combination with `--prepare`, to specify the file that is prepared for a multi-sig transaction.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--from --to and --amount define the movement of money

you must explicitly say that you want to assume the role, rather than just signing it. imagine you are a member of a 1 or 10 account, would every tx you sign automatically have access to that other account?

the way the code works, the tx must explicitly state you are going to try to assume this role to evalate your permissions for this one transaction. does that make sense? can you explain it better?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll do a bit of a re-write

}
```

and voila! That's the basics for creating roles and sending multi-sig transactions. For 3 of 3, you'd repeat the last step for rich as well (recall that poor initiated the multi-sig transaction). We can check the balance of the role:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually the intermediate state would look like:

basecli tx --in=tx.json --name=igor --prepare=tx2.json

The prepare means to output it to disk rather than send it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will clarify 👍

@zramsay
Copy link
Contributor Author

zramsay commented Aug 18, 2017

cool. thanks for the notes to clarify. Will address within 24 hours.

@zramsay
Copy link
Contributor Author

zramsay commented Aug 18, 2017

couple fixes addressed, should be good to go

@ethanfrey ethanfrey merged commit 27d86c7 into cosmos:unstable Aug 18, 2017
ParthDesai pushed a commit to ChorusOne/cosmos-sdk that referenced this pull request Apr 19, 2021
sosedoff referenced this pull request in figment-networks/cosmos-sdk Jun 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants