fix up basecli readme and basecoin-tool.md

This commit is contained in:
Ethan Buchman 2017-06-21 00:38:54 -04:00
parent e671ce6030
commit 43378a9b7b
2 changed files with 22 additions and 23 deletions

View File

@ -4,13 +4,6 @@ To keep things clear, let's have two shells...
`$` is for basecoin (server), `%` is for basecli (client) `$` is for basecoin (server), `%` is for basecli (client)
## Set up a clean basecoin, but don't start the chain
```
$ export BCHOME=~/.demoserve
$ basecoin init
```
## Set up your basecli with a new key ## Set up your basecli with a new key
``` ```
@ -24,16 +17,15 @@ And set up a few more keys for fun...
``` ```
% basecli keys new buddy % basecli keys new buddy
% basecli keys list % basecli keys list
% ME=`basecli keys get demo -o json | jq .address | tr -d '"'` % ME=$(basecli keys get demo | awk '{print $2}')
% YOU=`basecli keys get buddy -o json | jq .address | tr -d '"'` % YOU=$(basecli keys get buddy | awk '{print $2}')
``` ```
## Update genesis so you are rich, and start ## Set up a clean basecoin, initialized with your account
``` ```
$ vi $BCHOME/genesis.json $ export BCHOME=~/.demoserve
-> cut/paste your pubkey from the results above $ basecoin init $ME
$ basecoin start $ basecoin start
``` ```
@ -46,8 +38,8 @@ $ basecoin start
## Check your balances... ## Check your balances...
``` ```
% basecli proof state get --app=account --key=$ME % basecli query account $ME
% basecli proof state get --app=account --key=$YOU % basecli query account $YOU
``` ```
## Send the money ## Send the money
@ -55,9 +47,7 @@ $ basecoin start
``` ```
% basecli tx send --name demo --amount 1000mycoin --sequence 1 --to $YOU % basecli tx send --name demo --amount 1000mycoin --sequence 1 --to $YOU
-> copy hash to HASH -> copy hash to HASH
% basecli proof tx get --key $HASH % basecli query tx $HASH
% basecli query account $YOU
% basecli proof tx get --key $HASH --app base
% basecli proof state get --key $YOU --app account
``` ```

View File

@ -5,6 +5,15 @@ CLI](/docs/guide/basecoin-basics.md) and [how to implement a
plugin](/docs/guide/basecoin-plugins.md). In this tutorial, we provide more plugin](/docs/guide/basecoin-plugins.md). In this tutorial, we provide more
details on using the Basecoin tool. details on using the Basecoin tool.
# Generate a Key
Generate a key using the `basecli` tool:
```
basecli keys new mykey
ME=$(basecli keys get mykey | awk '{print $2}')
```
# Data Directory # Data Directory
By default, `basecoin` works out of `~/.basecoin`. To change this, set the By default, `basecoin` works out of `~/.basecoin`. To change this, set the
@ -12,14 +21,14 @@ By default, `basecoin` works out of `~/.basecoin`. To change this, set the
``` ```
export BCHOME=~/.my_basecoin_data export BCHOME=~/.my_basecoin_data
basecoin init basecoin init $ME
basecoin start basecoin start
``` ```
or or
``` ```
BCHOME=~/.my_basecoin_data basecoin init BCHOME=~/.my_basecoin_data basecoin init $ME
BCHOME=~/.my_basecoin_data basecoin start BCHOME=~/.my_basecoin_data basecoin start
``` ```
@ -30,7 +39,7 @@ we use ABCI, we can actually run them in different processes. First,
initialize them: initialize them:
``` ```
basecoin init basecoin init $ME
``` ```
This will create a single `genesis.json` file in `~/.basecoin` with the This will create a single `genesis.json` file in `~/.basecoin` with the
@ -168,7 +177,7 @@ You can reset all blockchain data by running:
basecoin unsafe_reset_all basecoin unsafe_reset_all
``` ```
Similarity you can reset client data by running: Similarly, you can reset client data by running:
``` ```
basecli reset_all basecli reset_all