tendermint / basecoin-examples

DEPRECATED: Example code, showing how you can build your own cryptocurrency on top of basecoin
Apache License 2.0
10 stars 10 forks source link

Update to Cobra CLI #8

Closed rigelrozanski closed 7 years ago

rigelrozanski commented 7 years ago

In conjunction with Basecoin PR: https://github.com/tendermint/basecoin/pull/64 Updated CLI, new "simplified" basecoin and all associated documentation/tutorials

Important Trader Tutorial needs some work, I updated all the functional elements which are affected by this PR, everything compiles, however not every command in the tutorial works. This should be reviewed by the maintainer

ethanfrey commented 7 years ago

When testing the trader submodule, it looks like the glide file was not fixed properly

make get_vendor_deps
...
[ERROR] Failed to set version on github.com/tendermint/basecoin to b6283661a677dae9f92bb4d7394e963923d09d6a: Unable to update checked out version

I updated it to 95e40affb70ba1c8bd0227fea964ada776c9dc32, the current push on cli_cobra branch of basecoin.

Also, I adjusted the trader readme to flow like mintcoin (which works). I just don't understand why no genesis file is created???

➜  trader git:(cli_cobra) ✗ trader start
no existing db, creating new db
No genesis file at /Users/ethan/.trader/genesis.json, skipping...
NOTE[04-03|10:18:07] Starting Basecoin with Tendermint        module=commands chain_id=
NOTE[04-03|10:18:07] Loaded PrivValidator                     module=types file=/Users/ethan/.trader/priv_validator.json privValidator="PrivValidator{FF53DC6110597808B0682B6DB62FA8FFB70B7292 LH:0, LR:0, LS:0}"
Couldn't read GenesisDoc file: open /Users/ethan/.trader/genesis.json: no such file or directory
ethanfrey commented 7 years ago

I managed to get this to work by deleting all files by hand. The check in basecoin/cmd/commands/init.go is very fragile. Better to check existence per file. Will make changes there.

ethanfrey commented 7 years ago

From my side, this is good to merge (mintcoin and trader tutorials check out). I haven't done a deeper review than that.

rigelrozanski commented 7 years ago

Thanks for updating glide, it's been non-stop headaches. One of the big changes that was made in this PR is that each basecoin plugin now operates out of its own working directory aka '~./trader' so if you had not previously run 'trader init` then there would be no genesis, kind of finicky.

ethanfrey commented 7 years ago

Yeah, apparently there was a private_key.json there but no genesis.json (I don't know how that happened), and the init function wouldn't create the genesis in that case.

I fixed the init logic to make it check each file and generate those that are missing, rather than just check on to see if they are all there. But yes, in normal cases your code worked fine. I don't know what happened on my box

rigelrozanski commented 7 years ago

@ebuchman Before merge minor fix required based on whether Default home will contain the full directory or just folder directory (enforced to move to stay in ~./home) within Basecoin PR: https://github.com/tendermint/basecoin/pull/64