circle fix, minor IBC tutorial

This commit is contained in:
rigel rozanski 2017-06-29 05:40:42 -04:00
parent a7c07ab3c0
commit 4e93be304e
3 changed files with 31 additions and 26 deletions

View File

@ -22,7 +22,7 @@ test_unit:
go test `glide novendor` go test `glide novendor`
#go run tests/tendermint/*.go #go run tests/tendermint/*.go
test_cli: tests/cli/shunit2 test_cli: get_shunit2
# sudo apt-get install jq # sudo apt-get install jq
@./tests/cli/basictx.sh @./tests/cli/basictx.sh
@./tests/cli/counter.sh @./tests/cli/counter.sh
@ -35,7 +35,7 @@ test_tutorial:
bash $$script ; \ bash $$script ; \
done done
tests/cli/shunit2: get_shunit2:
wget "https://raw.githubusercontent.com/kward/shunit2/master/source/2.1/src/shunit2" \ wget "https://raw.githubusercontent.com/kward/shunit2/master/source/2.1/src/shunit2" \
-q -O tests/cli/shunit2 -q -O tests/cli/shunit2
cp tests/cli/shunit2 docs/guide/shunit2 cp tests/cli/shunit2 docs/guide/shunit2

View File

@ -12,6 +12,7 @@ dependencies:
override: override:
- go get github.com/Masterminds/glide - go get github.com/Masterminds/glide
- go version - go version
- go get -u github.com/tendermint/tendermint/cmd/tendermint
- glide --version - glide --version
- mkdir -p "$PROJECT_PARENT_PATH" - mkdir -p "$PROJECT_PARENT_PATH"
- ln -sf "$HOME/$CIRCLE_PROJECT_REPONAME/" "$REPO" - ln -sf "$HOME/$CIRCLE_PROJECT_REPONAME/" "$REPO"

View File

@ -2,8 +2,8 @@
One of the most exciting elements of the Cosmos Network is the InterBlockchain One of the most exciting elements of the Cosmos Network is the InterBlockchain
Communication (IBC) protocol, which enables interoperability across different Communication (IBC) protocol, which enables interoperability across different
blockchains. We implemented IBC as a basecoin plugin, and we'll show you blockchains. We implemented IBC as a basecoin plugin, and we'll show you how to
how to use it to send tokens across blockchains! use it to send tokens across blockchains!
Please note, this tutorial assumes you are familiar with [Basecoin Please note, this tutorial assumes you are familiar with [Basecoin
plugins](/docs/guide/basecoin-plugins.md), but we'll explain how IBC works. You plugins](/docs/guide/basecoin-plugins.md), but we'll explain how IBC works. You
@ -175,15 +175,15 @@ The results of a query can thus be used as proof in an `IBCPacketPostTx`.
## Relay ## Relay
While we need all these packet types internally to keep track of all the While we need all these packet types internally to keep track of all the proofs
proofs on both chains in a secure manner, for the normal work-flow, on both chains in a secure manner, for the normal work-flow, we can run a relay
we can run a relay node that handles the cross-chain interaction. node that handles the cross-chain interaction.
In this case, there are only two steps. First `basecoin relay init`, In this case, there are only two steps. First `basecoin relay init`, which
which must be run once to register each chain with the other one, must be run once to register each chain with the other one, and make sure they
and make sure they are ready to send and recieve. And then are ready to send and recieve. And then `basecoin relay start`, which is a
`basecoin relay start`, which is a long-running process polling the queue long-running process polling the queue on each side, and relaying all new
on each side, and relaying all new message to the other block. message to the other block.
This requires that the relay has access to accounts with some funds on both This requires that the relay has access to accounts with some funds on both
chains to pay for all the ibc packets it will be forwarding. chains to pay for all the ibc packets it will be forwarding.
@ -195,14 +195,14 @@ tutorial.
Make sure you have installed [basecoin and basecli](/docs/guide/install.md). Make sure you have installed [basecoin and basecli](/docs/guide/install.md).
Basecoin is a framework for creating new cryptocurrency applications. It Basecoin is a framework for creating new cryptocurrency applications. It comes
comes with an `IBC` plugin enabled by default. with an `IBC` plugin enabled by default.
You will also want to install the [jq](https://stedolan.github.io/jq/) for You will also want to install the [jq](https://stedolan.github.io/jq/) for
handling JSON at the command line. handling JSON at the command line.
If you have any trouble with this, you can also look at the If you have any trouble with this, you can also look at the [test
[test scripts](/tests/cli/ibc.sh) or just run `make test_cli` in basecoin repo. scripts](/tests/cli/ibc.sh) or just run `make test_cli` in basecoin repo.
Otherwise, open up 5 (yes 5!) terminal tabs.... Otherwise, open up 5 (yes 5!) terminal tabs....
### Preliminaries ### Preliminaries
@ -225,7 +225,9 @@ alias basecoin1="basecoin --home $BCHOME1_SERVER"
alias basecoin2="basecoin --home $BCHOME2_SERVER" alias basecoin2="basecoin --home $BCHOME2_SERVER"
``` ```
This will give us some new commands to use instead of raw `basecli` and `basecoin` to ensure we're using the right configuration for the chain we want to talk to. This will give us some new commands to use instead of raw `basecli` and
`basecoin` to ensure we're using the right configuration for the chain we want
to talk to.
We also want to set some chain IDs: We also want to set some chain IDs:
@ -234,7 +236,8 @@ export CHAINID1="test-chain-1"
export CHAINID2="test-chain-2" export CHAINID2="test-chain-2"
``` ```
And since we will run two different chains on one machine, we need to maintain different sets of ports: And since we will run two different chains on one machine, we need to maintain
different sets of ports:
``` ```
export PORT_PREFIX1=1234 export PORT_PREFIX1=1234
@ -282,8 +285,9 @@ basecli1 query account $GOTNONE
### Setup Chain 2 ### Setup Chain 2
This is the same as above, except with `basecli2`, `basecoin2`, and `$CHAINID2`. This is the same as above, except with `basecli2`, `basecoin2`, and
We will also need to change the ports, since we're running another chain on the same local machine. `$CHAINID2`. We will also need to change the ports, since we're running
another chain on the same local machine.
Let's create new keys for test-chain-2: Let's create new keys for test-chain-2:
@ -315,13 +319,13 @@ basecli2 query account $BROKE
### Connect these chains ### Connect these chains
OK! So we have two chains running on your local machine, with different OK! So we have two chains running on your local machine, with different keys on
keys on each. Let's hook them up together by starting a relay process to each. Let's hook them up together by starting a relay process to forward
forward messages from one chain to the other. messages from one chain to the other.
The relay account needs some money in it to pay for the ibc messages, so The relay account needs some money in it to pay for the ibc messages, so for
for now, we have to transfer some cash from the rich accounts before we start now, we have to transfer some cash from the rich accounts before we start the
the actual relay. actual relay.
``` ```
# note that this key.json file is a hardcoded demo for all chains, this will # note that this key.json file is a hardcoded demo for all chains, this will