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

Gaiad gentx command incorrect for offline/multisig keys #3730

Closed
sunnya97 opened this issue Feb 25, 2019 · 2 comments · Fixed by #3734
Closed

Gaiad gentx command incorrect for offline/multisig keys #3730

sunnya97 opened this issue Feb 25, 2019 · 2 comments · Fixed by #3734
Assignees

Comments

@sunnya97
Copy link
Member

sunnya97 commented Feb 25, 2019

If you use the gaiad gentx command with an offline key or multisig as the operator, it gives you bytes to sign.

$ gaiad gentx --name=multitest --amount=1stake

Bytes to sign:
{"account_number":"0","chain_id":"testing","fee":{"amount":[],"gas":"200000"},"memo":"56e39eda5725bac3646da34d2b3125bb41859d0a@10.0.1.35:26656","msgs":[{"type":"cosmos-sdk/MsgCreateValidator","value":{"commission":{"max_change_rate":"0.010000000000000000","max_rate":"0.200000000000000000","rate":"0.100000000000000000"},"delegator_address":"cosmos1gnu4d9xg0a8rrxdns3zw75vxh9txngslc2zw9m","description":{"details":"","identity":"","moniker":"testing","website":""},"min_self_delegation":"1","pubkey":"cosmosvalconspub1zcjduepqm0p2hyfm6wg8rtc26ps9d9704kendjwt2zsuh8d872nds7lv75as2judmq","validator_address":"cosmosvaloper1gnu4d9xg0a8rrxdns3zw75vxh9txngsla7kmfg","value":{"amount":"1","denom":"stake"}}}],"sequence":"0"}

Enter Amino-encoded signature:

Two issues here.

  1. It is missing the type information of StdTx. The entire above output needs to wrapped in:
{"type":"auth/StdTx","value":[output]}
  1. The key for the msgs in the tx json above is msgs but it should be msg.

The final proper output of this should have looked like this:

{"type":"auth/StdTx","value":{"account_number":"0","chain_id":"testing","fee":{"amount":[],"gas":"200000"},"memo":"7b3f8010567055f58038148bd66e091a4c0bf59e@192.168.86.156:26656","msg":[{"type":"cosmos-sdk/MsgCreateValidator","value":{"commission":{"max_change_rate":"0.010000000000000000","max_rate":"0.200000000000000000","rate":"0.100000000000000000"},"delegator_address":"cosmos1gnu4d9xg0a8rrxdns3zw75vxh9txngslc2zw9m","description":{"details":"","identity":"","moniker":"testing","website":""},"min_self_delegation":"1","pubkey":"cosmosvalconspub1zcjduepqt7gyfy0luwzjsdjev20z9shy54vl4rx2tejp8f5zaxrh3zgu3yrqdd6t9q","validator_address":"cosmosvaloper1gnu4d9xg0a8rrxdns3zw75vxh9txngsla7kmfg","value":{"amount":"100000000","denom":"stake"}}}],"sequence":"0"}}
@sunnya97
Copy link
Member Author

Also, it should have an option to write that to an output file, rather than to StdOut. Entering an Amino-encoded signature on the command line doesn't even make sense anyways; it's expecting the input to be in raw bytes encoding for some reason.

@cwgoes cwgoes added this to the v0.33.0 (Launch) milestone Feb 25, 2019
@alexanderbez
Copy link
Contributor

I think this should have a very similar/if not identical flow to #3698

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 a pull request may close this issue.

3 participants