Freshened up docs with --genesis and Makefile

This commit is contained in:
Ethan Frey 2017-06-28 13:21:14 +02:00
parent 64b434a375
commit 44e9ecce43
4 changed files with 39 additions and 25 deletions

View File

@ -74,12 +74,17 @@ Basecli is used for sending transactions and querying the state.
Leave Basecoin running and open a new terminal window. Here run:
```
basecli init --chain-id=test_chain_id --node=tcp://localhost:46657
basecli init --node=tcp://localhost:46657 --genesis=$HOME/.basecoin/genesis.json
```
Note it will ask you to verify the validator hash. For a blockchain on your local computer, don't worry about it.
If you're connecting to a blockchain over the internet, you should verify that the validator hash is correct.
This is so that all queries done with `basecli` can be cryptographically proven to be correct according to a known validator set.
If you provide the genesis file to basecli, it can calculate the proper chainID
and validator hash. Basecli needs to get this information from some trusted
source, so all queries done with `basecli` can be cryptographically proven to
be correct according to a known validator set.
Note: that --genesis only works if there have been no validator set changes
since genesis. If there are validator set changes, you need to find the current
set through some other method.
## Send transactions
@ -97,7 +102,7 @@ The first account is flush with cash, while the second account doesn't exist.
Let's send funds from the first account to the second:
```
basecli tx send --name=cool --amount=1000mycoin --to=0x$YOU --sequence=1
basecli tx send --name=cool --amount=1000mycoin --to=$YOU --sequence=1
```
Now if we check the second account, it should have `1000` 'mycoin' coins!

View File

@ -42,10 +42,10 @@ The default files are stored in `~/.counter`. In another window we can
initialize the light-client and send a transaction:
```
countercli init --chain-id=test_chain_id --node=tcp://localhost:46657
countercli init --node=tcp://localhost:46657 --genesis=$HOME/.counter/genesis.json
YOU=$(countercli keys get friend | awk '{print $2}')
countercli tx send --name=cool --amount=1000mycoin --to=0x$YOU --sequence=1
countercli tx send --name=cool --amount=1000mycoin --to=$YOU --sequence=1
```
But the Counter has an additional command, `countercli tx counter`, which

View File

@ -275,7 +275,7 @@ Now we can attach the client to the chain and verify the state.
The first account should have money, the second none:
```
basecli1 init --chain-id=$CHAINID1 --node=tcp://localhost:${RPC_PORT1}
basecli1 init --node=tcp://localhost:${RPC_PORT1} --genesis=${BCHOME1_SERVER}/genesis.json
basecli1 query account $MONEY
basecli1 query account $GOTNONE
```
@ -308,7 +308,7 @@ Now attach the client to the chain and verify the state.
The first account should have money, the second none:
```
basecli2 init --chain-id=$CHAINID2 --node=tcp://localhost:${RPC_PORT2}
basecli2 init --node=tcp://localhost:${RPC_PORT2} --genesis=${BCHOME2_SERVER}/genesis.json
basecli2 query account $MOREMONEY
basecli2 query account $BROKE
```
@ -359,7 +359,7 @@ The hard part is over, we set up two blockchains, a few private keys, and
a secure relay between them. Now we can enjoy the fruits of our labor...
```
# Here's an emptt account on test-chain-2
# Here's an empty account on test-chain-2
basecli2 query account $BROKE
```

View File

@ -1,5 +1,9 @@
# Install
If you aren't used to compile go programs and just want the released
version of the code, please head to our [downloads](https://tendermint.com/download)
page to get a pre-compiled binary for your platform.
On a good day, basecoin can be installed like a normal Go program:
```
@ -18,7 +22,12 @@ make all
```
This will create the `basecoin` binary in `$GOPATH/bin`.
Note the `make get_vendor_deps` command will install `glide` and the correct version of all dependencies.
`make all` implies `make get_vendor_deps` and uses `glide` to install the
correct version of all dependencies. It also tests the code, including
some cli tests to make sure your binary behaves properly.
If you need another branch, make sure to run `git checkout <branch>` before the `make` commands.
If you need another branch, make sure to run `git checkout <branch>`
before `make all`. And if you switch branches a lot, especially
touching other tendermint repos, you may need to `make fresh` sometimes
so glide doesn't get confused with all the branches and versions lying around.