update demo and ibc guide

This commit is contained in:
Ethan Buchman
2017-03-13 20:53:49 -04:00
parent fd6c20739d
commit f1ce14c284
5 changed files with 23 additions and 17 deletions
+3 -4
View File
@@ -1,9 +1,8 @@
## Deployment
Up until this point, we have only been testing the code as a stand-alone abci app,
which is nice for developing, but it is no blockchain. Just a blockchain-ready application.
Up until this point, we have only been testing the code as a blockchain with a single validator node running locally.
This is nice for developing, but it's not a real distributed application yet.
This section will demonstrate how to launch your basecoin-based application along
with a tendermint testnet and initialize the genesis block for fun and profit.
**TODO** Maybe we link to a blog post for this???
We do this using the [mintnet-kubernetes tool](https://github.com/tendermint/mintnet-kubernetes).
+1 -1
View File
@@ -310,7 +310,7 @@ If you've already run a basecoin blockchain, reset the data with
basecoin unsafe_reset_all
```
To start the blockchain, simply run
To start the blockchain with your new plugin, simply run
```
example-plugin start
+7 -5
View File
@@ -195,14 +195,14 @@ We can start the two chains as follows:
```
TMROOT=./data/chain1/tendermint tendermint node &> chain1_tendermint.log &
basecoin start --dir ./data/chain1/basecoin &> chain1_basecoin.log &
BASECOIN_ROOT=./data/chain1/basecoin basecoin start --abci-server &> chain1_basecoin.log &
```
and
```
TMROOT=./data/chain2/tendermint tendermint node --node_laddr tcp://localhost:36656 --rpc_laddr tcp://localhost:36657 --proxy_app tcp://localhost:36658 &> chain2_tendermint.log &
basecoin start --address tcp://localhost:36658 --dir ./data/chain2/basecoin &> chain2_basecoin.log &
BASECOIN_ROOT=./data/chain2/basecoin basecoin start --abci-server --address tcp://localhost:36658 &> chain2_basecoin.log &
```
Note how we refer to the relevant data directories. Also note how we have to set the various addresses for the second node so as not to conflict with the first.
@@ -226,6 +226,8 @@ export CHAIN_ID2=test_chain_2
export CHAIN_FLAGS1="--chain_id $CHAIN_ID1 --from ./data/chain1/basecoin/key.json"
export CHAIN_FLAGS2="--chain_id $CHAIN_ID2 --from ./data/chain2/basecoin/key.json --node tcp://localhost:36657"
export BASECOIN_ROOT="."
```
Let's start by registering `test_chain_1` on `test_chain_2`:
@@ -265,7 +267,7 @@ The former is used as input for later commands; the latter is human-readable, so
Let's send this updated information about `test_chain_1` to `test_chain_2`:
```
basecoin tx ibc --amount 10mycoin $CHAIN_FLAGS2 update --header 0x<header>--commit 0x<commit>
basecoin tx ibc --amount 10mycoin $CHAIN_FLAGS2 update --header 0x<header> --commit 0x<commit>
```
where `<header>` and `<commit>` are the hex-encoded header and commit returned by the previous `block` command.
@@ -275,10 +277,10 @@ along with proof the packet was committed on `test_chain_1`. Since `test_chain_2
of `test_chain_1`, it will be able to verify the proof!
```
basecoin tx ibc --amount 10mycoin $CHAIN_FLAGS2 packet post --from $CHAIN_ID1 --height <height + 1> --packet 0x<packet> --proof 0x<proof>
basecoin tx ibc --amount 10mycoin $CHAIN_FLAGS2 packet post --from $CHAIN_ID1 --height <height> --packet 0x<packet> --proof 0x<proof>
```
Here, `<height + 1>` is one greater than the height retuned by the previous `query` command, and `<packet>` and `<proof>` are the
Here, `<height>` is the height retuned by the previous `query` command, and `<packet>` and `<proof>` are the
`value` and `proof` returned in that same query.
Tada!