From 43378a9b7bd6df6ee5b3b48af829d56c6599129f Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Wed, 21 Jun 2017 00:38:54 -0400 Subject: [PATCH] fix up basecli readme and basecoin-tool.md --- cmd/basecli/README.md | 28 +++++++++------------------- docs/guide/basecoin-tool.md | 17 +++++++++++++---- 2 files changed, 22 insertions(+), 23 deletions(-) diff --git a/cmd/basecli/README.md b/cmd/basecli/README.md index 6e00f3d851..2443c92ae5 100644 --- a/cmd/basecli/README.md +++ b/cmd/basecli/README.md @@ -4,13 +4,6 @@ To keep things clear, let's have two shells... `$` 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 ``` @@ -24,16 +17,15 @@ And set up a few more keys for fun... ``` % basecli keys new buddy % basecli keys list -% ME=`basecli keys get demo -o json | jq .address | tr -d '"'` -% YOU=`basecli keys get buddy -o json | jq .address | tr -d '"'` +% ME=$(basecli keys get demo | awk '{print $2}') +% 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 --> cut/paste your pubkey from the results above - +$ export BCHOME=~/.demoserve +$ basecoin init $ME $ basecoin start ``` @@ -46,8 +38,8 @@ $ basecoin start ## Check your balances... ``` -% basecli proof state get --app=account --key=$ME -% basecli proof state get --app=account --key=$YOU +% basecli query account $ME +% basecli query account $YOU ``` ## Send the money @@ -55,9 +47,7 @@ $ basecoin start ``` % basecli tx send --name demo --amount 1000mycoin --sequence 1 --to $YOU -> copy hash to HASH -% basecli proof tx get --key $HASH - -% basecli proof tx get --key $HASH --app base -% basecli proof state get --key $YOU --app account +% basecli query tx $HASH +% basecli query account $YOU ``` diff --git a/docs/guide/basecoin-tool.md b/docs/guide/basecoin-tool.md index 0f89f7bd73..eb35ec9ea1 100644 --- a/docs/guide/basecoin-tool.md +++ b/docs/guide/basecoin-tool.md @@ -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 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 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 -basecoin init +basecoin init $ME basecoin start ``` or ``` -BCHOME=~/.my_basecoin_data basecoin init +BCHOME=~/.my_basecoin_data basecoin init $ME BCHOME=~/.my_basecoin_data basecoin start ``` @@ -30,7 +39,7 @@ we use ABCI, we can actually run them in different processes. First, initialize them: ``` -basecoin init +basecoin init $ME ``` 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 ``` -Similarity you can reset client data by running: +Similarly, you can reset client data by running: ``` basecli reset_all