Skip to content

Commit

Permalink
fix up basecli readme and basecoin-tool.md
Browse files Browse the repository at this point in the history
  • Loading branch information
ebuchman committed Jun 21, 2017
1 parent e671ce6 commit 43378a9
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 23 deletions.
28 changes: 9 additions & 19 deletions cmd/basecli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

```
Expand All @@ -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
```

Expand All @@ -46,18 +38,16 @@ $ 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

```
% 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
```

17 changes: 13 additions & 4 deletions docs/guide/basecoin-tool.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,30 @@ 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
`BCHOME` environment variable:

```
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
```

Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 43378a9

Please sign in to comment.