Merge pull request #214 from zramsay/basecoin-basics
docs: clean up basecoin-basics
This commit is contained in:
commit
f4c45b6273
|
@ -62,13 +62,13 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #get this files director
|
|||
|
||||
# Basecoin Basics
|
||||
|
||||
Here we explain how to get started with a simple Basecoin blockchain,
|
||||
Here we explain how to get started with a basic Basecoin blockchain,
|
||||
how to send transactions between accounts using the `basecoin` tool,
|
||||
and what is happening under the hood.
|
||||
|
||||
## Install
|
||||
|
||||
Installing Basecoin is simple:
|
||||
With go, it's one command:
|
||||
|
||||
```shelldown[0]
|
||||
go get -u github.com/tendermint/basecoin/cmd/...
|
||||
|
@ -78,6 +78,7 @@ If you have trouble, see the [installation guide](install.md).
|
|||
|
||||
Note the above command installs two binaries: `basecoin` and `basecli`.
|
||||
The former is the running node. The latter is a command-line light-client.
|
||||
This tutorial assumes you have a 'fresh' working environment. See [how to clean up, below](#clean-up).
|
||||
|
||||
## Generate some keys
|
||||
|
||||
|
@ -85,12 +86,6 @@ Let's generate two keys, one to receive an initial allocation of coins,
|
|||
and one to send some coins to later:
|
||||
|
||||
```shelldown[1]
|
||||
# WARNING: this will wipe out any existing info in the ~/.basecli dir
|
||||
# including private keys, don't run if you have lots of local state already
|
||||
# while we're at it let's remove the working directory for the full node too
|
||||
basecli reset_all
|
||||
rm -rf ~/.basecoin
|
||||
|
||||
basecli keys new cool
|
||||
basecli keys new friend
|
||||
```
|
||||
|
@ -101,13 +96,9 @@ You'll need to enter passwords. You can view your key names and addresses with
|
|||
|
||||
## Initialize Basecoin
|
||||
|
||||
|
||||
To initialize a new Basecoin blockchain, run:
|
||||
|
||||
```shelldown[2]
|
||||
# WARNING: this will wipe out any existing info in the ~/.basecoin dir
|
||||
# don't run if you have lots of local state already
|
||||
rm -rf ~/.basecoin
|
||||
basecoin init <ADDRESS>
|
||||
```
|
||||
|
||||
|
@ -212,7 +203,7 @@ See `basecli tx send --help` for additional details.
|
|||
|
||||
Even if you don't see it in the UI, the result of every query comes with a
|
||||
proof. This is a Merkle proof that the result of the query is actually
|
||||
contained in the state. and the state's Merkle root is contained in a recent
|
||||
contained in the state. And the state's Merkle root is contained in a recent
|
||||
block header. Behind the scenes, `countercli` will not only verify that this
|
||||
state matches the header, but also that the header is properly signed by the
|
||||
known validator set. It will even update the validator set as needed, so long
|
||||
|
@ -220,7 +211,7 @@ as there have not been major changes and it is secure to do so. So, if you
|
|||
wonder why the query may take a second... there is a lot of work going on in
|
||||
the background to make sure even a lying full node can't trick your client.
|
||||
|
||||
In a latter [guide on InterBlockchainCommunication](ibc.md), we'll use these
|
||||
In a latter [guide on InterBlockchain Communication](ibc.md), we'll use these
|
||||
proofs to post transactions to other chains.
|
||||
|
||||
## Accounts and Transactions
|
||||
|
@ -265,7 +256,7 @@ an [IAVL tree](https://github.com/tendermint/go-merkle).
|
|||
|
||||
### Transactions
|
||||
|
||||
Basecoin defines a simple transaction type, the `SendTx`, which allows tokens
|
||||
Basecoin defines a transaction type, the `SendTx`, which allows tokens
|
||||
to be sent to other accounts. The `SendTx` takes a list of inputs and a list
|
||||
of outputs, and transfers all the tokens listed in the inputs from their
|
||||
corresponding accounts to the accounts listed in the output. The `SendTx` is
|
||||
|
@ -320,6 +311,18 @@ sure that the sum of coins of the inputs equals the sum of coins of the outputs
|
|||
(no creating money), and that all accounts that provide inputs have signed the
|
||||
transaction.
|
||||
|
||||
## Clean Up
|
||||
|
||||
**WARNING:** Running these commands will wipe out any existing information in both the `~/.basecli` and `~/.basecoin` directories, including private keys.
|
||||
|
||||
To remove all the files created and refresh your environment (e.g., if starting this tutorial again or trying something new), the following commands are run:
|
||||
|
||||
```shelldown[end-of-tutorials]
|
||||
basecli reset_all
|
||||
rm -rf ~/.basecoin
|
||||
rm -rf ~/.basecoin
|
||||
```
|
||||
|
||||
## Conclusion
|
||||
|
||||
In this guide, we introduced the `basecoin` and `basecli` tools, demonstrated
|
||||
|
|
Loading…
Reference in New Issue