Closed ethanfrey closed 7 years ago
When I try the same in mintcoin, I get invalid signatures.
You can reproduce here: https://github.com/tendermint/basecoin-examples/blob/master/mintcoin/README.md#testing-with-a-cli
I will investigate more tomorrow, but any hints are welcome.
That's just how the counter plugin is written... https://github.com/tendermint/basecoin/blob/develop/plugins/counter/counter.go#L57
Not really an issue, is it?
Okay, if it is done in the plugin, that is fine. I saw the same issue with the Mintcoin plugin, which doesn't include those lines, and figured there was some cause in the framework. I'll just investigate mintcoin and accept the counter plugin behavior as correct.
The issue is not due to the plugin. There are a number of requirements set in basecoin core, that I don't feel need to be there. In particular, requiring a non-zero amount of coins.
https://github.com/tendermint/basecoin/blob/develop/types/tx.go#L56-L61
(This was an issue, as I gave an account the right to create coin, but without already having some, it couldn't execute the apptx to mint more coin)
Got beyond this an really weird issue. If I run basecoin start --in-proc --counter-plugin
, I can use the counter plugin fine:
mintcoin apptx --fee 1 --amount 2 counter --valid
CounterTx: {"Valid":true,"Fee":[{"denom":"blank","amount":1}]}
Signed AppTx:
{"gas":0,"fee":{"denom":"blank","amount":1},"type":"counter","input":{"address":"D397BC62B435F3CF50570FBAB4340FE52C60858F","coins":[{"denom":"blank","amount":2}],"sequence":1,"signature":[1,"5B2D87E4FFBFB72C06784D61F5496AD289810B8484FAA0C48BE4F7DC49781A2242D88D4D6C4E50AE3A6F309348E6BD563F8164F2E949141674713DD5576F4702"],"pub_key":[1,"B3588BDC92015ED3CDB6F57A86379E8C79A7111063610B7E625487C76496F4DF"]},"data":"0101010105626C616E6B0000000000000001"}
However, if I clean up the data dir and run mintcoin start --in-proc --counter-plugin
(which should have the same code), I get:
mintcoin apptx --fee 1 --amount 2 counter --valid
CounterTx: {"Valid":true,"Fee":[{"denom":"blank","amount":1}]}
Signed AppTx:
{"gas":0,"fee":{"denom":"blank","amount":1},"type":"counter","input":{"address":"D397BC62B435F3CF50570FBAB4340FE52C60858F","coins":[{"denom":"blank","amount":2}],"sequence":1,"signature":[1,"5B2D87E4FFBFB72C06784D61F5496AD289810B8484FAA0C48BE4F7DC49781A2242D88D4D6C4E50AE3A6F309348E6BD563F8164F2E949141674713DD5576F4702"],"pub_key":[1,"B3588BDC92015ED3CDB6F57A86379E8C79A7111063610B7E625487C76496F4DF"]},"data":"0101010105626C616E6B0000000000000001"}
BroadcastTxCommit got non-zero exit code: BaseInvalidSignature. ; Error in CheckTx;in validateInputAdvanced();Error (base) invalid signature;SignBytes: 010D6D696E745F636861696E5F69640100000000000000000105626C616E6B00000000000000010107636F756E7465720114D397BC62B435F3CF50570FBAB4340FE52C60858F01010105626C616E6B000000000000000201010001B3588BDC92015ED3CDB6F57A86379E8C79A7111063610B7E625487C76496F4DF01120101010105626C616E6B0000000000000001
Notice the exact same payload, pub key and signature in both cases.
Resolved this, I need to specify the chain_id in the client!
mintcoin apptx --chain_id mint_chain_id --fee 1 --amount 2 counter --valid
Added this comment in case anyone else has a similar problem, they may find the answer with search....
Start Server:
Try client:
The other tutorials (with sendtx and ibc didn't require fees...)