Freshened up docs with --genesis and Makefile
This commit is contained in:
parent
64b434a375
commit
44e9ecce43
|
@ -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:
|
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 provide the genesis file to basecli, it can calculate the proper chainID
|
||||||
If you're connecting to a blockchain over the internet, you should verify that the validator hash is correct.
|
and validator hash. Basecli needs to get this information from some trusted
|
||||||
This is so that all queries done with `basecli` can be cryptographically proven to be correct according to a known validator set.
|
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
|
## 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:
|
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!
|
Now if we check the second account, it should have `1000` 'mycoin' coins!
|
||||||
|
|
|
@ -42,10 +42,10 @@ The default files are stored in `~/.counter`. In another window we can
|
||||||
initialize the light-client and send a transaction:
|
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}')
|
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
|
But the Counter has an additional command, `countercli tx counter`, which
|
||||||
|
|
|
@ -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:
|
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 $MONEY
|
||||||
basecli1 query account $GOTNONE
|
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:
|
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 $MOREMONEY
|
||||||
basecli2 query account $BROKE
|
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...
|
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
|
basecli2 query account $BROKE
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
# Install
|
# 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:
|
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`.
|
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.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue