diff --git a/README.md b/README.md index 22b29bcb1a..55f46c0b95 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,6 @@ See the [install guide](/docs/guide/install.md) for more details. 1. See some [more example applications](/docs/guide/more-examples.md) 1. More features of the [Basecoin tool](/docs/guide/basecoin-tool.md) 1. Learn how to use [InterBlockchain Communication (IBC)](/docs/guide/ibc.md) -1. [Deploy testnets](deployment.md) running your basecoin application. +1. [Deploy testnets](/docs/guide/deployment.md) running your basecoin application. diff --git a/demo/start.sh b/demo/start.sh index d4891ecdd7..d1d7d97382 100644 --- a/demo/start.sh +++ b/demo/start.sh @@ -60,29 +60,34 @@ function waitForBlock() { done } +# make basecoin root vars +export BASECOIN_ROOT="." +BCROOT1="./data/chain1/basecoin" +BCROOT2="./data/chain2/basecoin" # grab the chain ids -CHAIN_ID1=$(cat ./data/chain1/basecoin/genesis.json | jq .[1]) +CHAIN_ID1=$(cat $BCROOT1/genesis.json | jq .[1]) CHAIN_ID1=$(removeQuotes $CHAIN_ID1) -CHAIN_ID2=$(cat ./data/chain2/basecoin/genesis.json | jq .[1]) +CHAIN_ID2=$(cat $BCROOT2/genesis.json | jq .[1]) CHAIN_ID2=$(removeQuotes $CHAIN_ID2) echo "CHAIN_ID1: $CHAIN_ID1" echo "CHAIN_ID2: $CHAIN_ID2" # make reusable chain flags -CHAIN_FLAGS1="--chain_id $CHAIN_ID1 --from ./data/chain1/basecoin/key.json" -CHAIN_FLAGS2="--chain_id $CHAIN_ID2 --from ./data/chain2/basecoin/key.json --node tcp://localhost:36657" +CHAIN_FLAGS1="--chain_id $CHAIN_ID1 --from $BCROOT1/key.json" +CHAIN_FLAGS2="--chain_id $CHAIN_ID2 --from $BCROOT2/key.json --node tcp://localhost:36657" + echo "" echo "... starting chains" echo "" # start the first node TMROOT=./data/chain1/tendermint tendermint node --skip_upnp --log_level=info &> $LOG_DIR/chain1_tendermint.log & -basecoin start --dir ./data/chain1/basecoin &> $LOG_DIR/chain1_basecoin.log & +BASECOIN_ROOT=$BCROOT1 basecoin start --abci-server &> $LOG_DIR/chain1_basecoin.log & # start the second node TMROOT=./data/chain2/tendermint tendermint node --skip_upnp --log_level=info --node_laddr tcp://localhost:36656 --rpc_laddr tcp://localhost:36657 --proxy_app tcp://localhost:36658 &> $LOG_DIR/chain2_tendermint.log & -basecoin start --address tcp://localhost:36658 --dir ./data/chain2/basecoin &> $LOG_DIR/chain2_basecoin.log & +BASECOIN_ROOT=$BCROOT2 basecoin start --address tcp://localhost:36658 --abci-server &> $LOG_DIR/chain2_basecoin.log & echo "" echo "... waiting for chains to start" diff --git a/docs/guide/deployment.md b/docs/guide/deployment.md index e6a7845fc9..74e954a25a 100644 --- a/docs/guide/deployment.md +++ b/docs/guide/deployment.md @@ -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). diff --git a/docs/guide/example-plugin.md b/docs/guide/example-plugin.md index 94cfc56c57..48da0da730 100644 --- a/docs/guide/example-plugin.md +++ b/docs/guide/example-plugin.md @@ -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 diff --git a/docs/guide/ibc.md b/docs/guide/ibc.md index f933c22ea7..165b962e44 100644 --- a/docs/guide/ibc.md +++ b/docs/guide/ibc.md @@ -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
--commit 0x +basecoin tx ibc --amount 10mycoin $CHAIN_FLAGS2 update --header 0x
--commit 0x ``` where `
` and `` 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 --packet 0x --proof 0x +basecoin tx ibc --amount 10mycoin $CHAIN_FLAGS2 packet post --from $CHAIN_ID1 --height --packet 0x --proof 0x ``` -Here, `` is one greater than the height retuned by the previous `query` command, and `` and `` are the +Here, `` is the height retuned by the previous `query` command, and `` and `` are the `value` and `proof` returned in that same query. Tada!