From 4e93be304e4bb63424ea75f1346917030dc7e504 Mon Sep 17 00:00:00 2001 From: rigel rozanski Date: Thu, 29 Jun 2017 05:40:42 -0400 Subject: [PATCH] circle fix, minor IBC tutorial --- Makefile | 4 ++-- circle.yml | 1 + docs/guide/ibc.md | 52 +++++++++++++++++++++++++---------------------- 3 files changed, 31 insertions(+), 26 deletions(-) diff --git a/Makefile b/Makefile index 594cfab229..036d8fdabf 100644 --- a/Makefile +++ b/Makefile @@ -22,7 +22,7 @@ test_unit: go test `glide novendor` #go run tests/tendermint/*.go -test_cli: tests/cli/shunit2 +test_cli: get_shunit2 # sudo apt-get install jq @./tests/cli/basictx.sh @./tests/cli/counter.sh @@ -35,7 +35,7 @@ test_tutorial: bash $$script ; \ done -tests/cli/shunit2: +get_shunit2: wget "https://raw.githubusercontent.com/kward/shunit2/master/source/2.1/src/shunit2" \ -q -O tests/cli/shunit2 cp tests/cli/shunit2 docs/guide/shunit2 diff --git a/circle.yml b/circle.yml index 3034760d62..9884cd530e 100644 --- a/circle.yml +++ b/circle.yml @@ -12,6 +12,7 @@ dependencies: override: - go get github.com/Masterminds/glide - go version + - go get -u github.com/tendermint/tendermint/cmd/tendermint - glide --version - mkdir -p "$PROJECT_PARENT_PATH" - ln -sf "$HOME/$CIRCLE_PROJECT_REPONAME/" "$REPO" diff --git a/docs/guide/ibc.md b/docs/guide/ibc.md index c19d0d1854..0656fd3264 100644 --- a/docs/guide/ibc.md +++ b/docs/guide/ibc.md @@ -2,8 +2,8 @@ One of the most exciting elements of the Cosmos Network is the InterBlockchain Communication (IBC) protocol, which enables interoperability across different -blockchains. We implemented IBC as a basecoin plugin, and we'll show you -how to use it to send tokens across blockchains! +blockchains. We implemented IBC as a basecoin plugin, and we'll show you how to +use it to send tokens across blockchains! Please note, this tutorial assumes you are familiar with [Basecoin 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 -While we need all these packet types internally to keep track of all the -proofs on both chains in a secure manner, for the normal work-flow, -we can run a relay node that handles the cross-chain interaction. +While we need all these packet types internally to keep track of all the proofs +on both chains in a secure manner, for the normal work-flow, we can run a relay +node that handles the cross-chain interaction. -In this case, there are only two steps. First `basecoin relay init`, -which must be run once to register each chain with the other one, -and make sure they are ready to send and recieve. And then -`basecoin relay start`, which is a long-running process polling the queue -on each side, and relaying all new message to the other block. +In this case, there are only two steps. First `basecoin relay init`, which +must be run once to register each chain with the other one, and make sure they +are ready to send and recieve. And then `basecoin relay start`, which is a +long-running process polling the queue on each side, and relaying all new +message to the other block. 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. @@ -195,14 +195,14 @@ tutorial. Make sure you have installed [basecoin and basecli](/docs/guide/install.md). -Basecoin is a framework for creating new cryptocurrency applications. It -comes with an `IBC` plugin enabled by default. +Basecoin is a framework for creating new cryptocurrency applications. It comes +with an `IBC` plugin enabled by default. You will also want to install the [jq](https://stedolan.github.io/jq/) for handling JSON at the command line. -If you have any trouble with this, you can also look at the -[test scripts](/tests/cli/ibc.sh) or just run `make test_cli` in basecoin repo. +If you have any trouble with this, you can also look at the [test +scripts](/tests/cli/ibc.sh) or just run `make test_cli` in basecoin repo. Otherwise, open up 5 (yes 5!) terminal tabs.... ### Preliminaries @@ -225,7 +225,9 @@ alias basecoin1="basecoin --home $BCHOME1_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: @@ -234,7 +236,8 @@ export CHAINID1="test-chain-1" 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 @@ -282,8 +285,9 @@ basecli1 query account $GOTNONE ### Setup Chain 2 -This is the same as above, except with `basecli2`, `basecoin2`, and `$CHAINID2`. -We will also need to change the ports, since we're running another chain on the same local machine. +This is the same as above, except with `basecli2`, `basecoin2`, and +`$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: @@ -315,13 +319,13 @@ basecli2 query account $BROKE ### Connect these chains -OK! So we have two chains running on your local machine, with different -keys on each. Let's hook them up together by starting a relay process to -forward messages from one chain to the other. +OK! So we have two chains running on your local machine, with different keys on +each. Let's hook them up together by starting a relay process to forward +messages from one chain to the other. -The relay account needs some money in it to pay for the ibc messages, so -for now, we have to transfer some cash from the rich accounts before we start -the actual relay. +The relay account needs some money in it to pay for the ibc messages, so for +now, we have to transfer some cash from the rich accounts before we start the +actual relay. ``` # note that this key.json file is a hardcoded demo for all chains, this will