From 7b2589c21ec0dead54a7994398f9c7486c787da0 Mon Sep 17 00:00:00 2001 From: Christopher Goes Date: Tue, 5 Nov 2019 01:57:08 +0100 Subject: [PATCH] Merge PR #174: IBC demo fixes --- go.mod | 2 +- go.sum | 35 +---------- ibc-demo.md | 147 +++++++++++++++++++++++-------------------- ibc-demo.sh | 178 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 260 insertions(+), 102 deletions(-) create mode 100755 ibc-demo.sh diff --git a/go.mod b/go.mod index c7082ed285..2c2846f38c 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.13 require ( github.com/btcsuite/btcd v0.0.0-20190807005414-4063feeff79a // indirect - github.com/cosmos/cosmos-sdk v0.34.4-0.20191030201649-0d595c862ea0 + github.com/cosmos/cosmos-sdk v0.34.4-0.20191102053406-d1f6c30cc5ee github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d // indirect github.com/golang/mock v1.3.1 // indirect github.com/onsi/ginkgo v1.8.0 // indirect diff --git a/go.sum b/go.sum index 6a90e0f2b4..4bcfd8ab6c 100644 --- a/go.sum +++ b/go.sum @@ -2,10 +2,8 @@ bou.ke/monkey v1.0.1/go.mod h1:FgHuK96Rv2Nlf+0u1OOVDpCMdsWyOFmeeketDHE7LIg= cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/99designs/keyring v1.1.2 h1:JJauROcU6x6Nh9uZb+8JgXFvyo0GUESLo1ixhpA0Kmw= github.com/99designs/keyring v1.1.2/go.mod h1:657DQuMrBZRtuL/voxVyiyb6zpMehlm5vLB9Qwrv904= -github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/VividCortex/gohistogram v1.0.0 h1:6+hBz+qvs0JOrrNhhmR7lFxo5sINxBCGXrdtl/UvroE= github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= github.com/Workiva/go-datastructures v1.0.50/go.mod h1:Z+F2Rca0qCsVYDS8z7bAGm8f3UkzuWYS/oBZz5a7VVA= github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= @@ -40,18 +38,11 @@ github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8Nz github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -github.com/cosmos/cosmos-sdk v0.34.4-0.20191015202154-28347bf5f736 h1:LPdkBmnrEw9bDH4KshLiRVuy9EJrJyWS+8T0YpZkGGE= -github.com/cosmos/cosmos-sdk v0.34.4-0.20191015202154-28347bf5f736/go.mod h1:DATGOvgReTZJ+NJRi+Z4Pi6DxuabkOU51MZhyP4qtY0= -github.com/cosmos/cosmos-sdk v0.34.4-0.20191029141616-9742c1440ec3 h1:Q8Oc0bcAmfLe7gTgibBr0NO/m3Rg5aqi8EsH0hW6c6U= -github.com/cosmos/cosmos-sdk v0.34.4-0.20191029141616-9742c1440ec3/go.mod h1:VmzpKwtYtelTVZuNkq/rkcgVawGpHckfRYS08JVcnqA= -github.com/cosmos/cosmos-sdk v0.34.4-0.20191030201649-0d595c862ea0 h1:LZc0hJa0W9opISQVJ0AUohyJANZVSUBPfQkVKlFu5jA= -github.com/cosmos/cosmos-sdk v0.34.4-0.20191030201649-0d595c862ea0/go.mod h1:VmzpKwtYtelTVZuNkq/rkcgVawGpHckfRYS08JVcnqA= -github.com/cosmos/cosmos-sdk v0.37.3 h1:v4IQIPq3zFB95ibAS7zqsnkZ/8SE3er16Og45EGHggo= +github.com/cosmos/cosmos-sdk v0.34.4-0.20191102035446-f72b3912da86 h1:zj3Rzlz492rj5EYcprWAG0p/xBaQtHN/KKwB1jzO+tI= +github.com/cosmos/cosmos-sdk v0.34.4-0.20191102035446-f72b3912da86/go.mod h1:VmzpKwtYtelTVZuNkq/rkcgVawGpHckfRYS08JVcnqA= github.com/cosmos/go-bip39 v0.0.0-20180618194314-52158e4697b8/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d h1:49RLWk1j44Xu4fjHb6JFYmeUnDORVwHNkDxaQ0ctCVU= github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= -github.com/cosmos/ledger-cosmos-go v0.10.3 h1:Qhi5yTR5Pg1CaTpd00pxlGwNl4sFRdtK1J96OTjeFFc= -github.com/cosmos/ledger-cosmos-go v0.10.3/go.mod h1:J8//BsAGTo3OC/vDLjMRFLW6q0WAaXvHnVc7ZmE8iUY= github.com/cosmos/ledger-cosmos-go v0.11.1 h1:9JIYsGnXP613pb2vPjFeMMjBI5lEDsEaF6oYorTy6J4= github.com/cosmos/ledger-cosmos-go v0.11.1/go.mod h1:J8//BsAGTo3OC/vDLjMRFLW6q0WAaXvHnVc7ZmE8iUY= github.com/cosmos/ledger-go v0.9.2 h1:Nnao/dLwaVTk1Q5U9THldpUMMXU94BOTWPddSmVB6pI= @@ -70,14 +61,10 @@ github.com/dvsekhvalnov/jose2go v0.0.0-20180829124132-7f401d37b68a/go.mod h1:7Bv github.com/etcd-io/bbolt v1.3.2/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw= github.com/etcd-io/bbolt v1.3.3 h1:gSJmxrs37LgTqR/oyJBWok6k6SvXEUerFTbltIhXkBM= github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw= -github.com/facebookgo/ensure v0.0.0-20160127193407-b4ab57deab51 h1:0JZ+dUmQeA8IIVUMzysrX4/AKuQwWhV2dYQuPZdvdSQ= github.com/facebookgo/ensure v0.0.0-20160127193407-b4ab57deab51/go.mod h1:Yg+htXGokKKdzcwhuNDwVvN+uBxDGXJ7G/VN1d8fa64= -github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 h1:JWuenKqqX8nojtoVVWjGfOF9635RETekkoH6Cc9SX0A= github.com/facebookgo/stack v0.0.0-20160209184415-751773369052/go.mod h1:UbMTZqLaRiH3MsBH8va0n7s1pQYcu3uTb8G4tygF4Zg= -github.com/facebookgo/subset v0.0.0-20150612182917-8dac2c3c4870 h1:E2s37DuLxFhQDg5gKsWoLBOB0n+ZW8s599zru8FJ2/Y= github.com/facebookgo/subset v0.0.0-20150612182917-8dac2c3c4870/go.mod h1:5tD+neXqOorC30/tWg0LCSkrqj/AR6gu8yY8/fpw1q0= github.com/fortytw2/leaktest v1.2.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= -github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= @@ -89,7 +76,6 @@ github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2 github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0 h1:MP4Eh7ZCb31lleYCFuwm0oe4/YGak+5l1vA2NOE80nA= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= -github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 h1:ZpnhV/YsD2/4cESfV5+Hoeu/iUR3ruzNvZ+yQfO03a0= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= @@ -98,12 +84,10 @@ github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zV github.com/gogo/protobuf v1.3.0/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.1 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls= github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.3.1-0.20190508161146-9fa652df1129/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= -github.com/golang/mock v1.3.1 h1:qGJ6qTW+x6xX/my+8YUVl4WNpX9B7+/l2tRsHGZ7f2s= github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.0/go.mod h1:Qd/q+1AKNOZr9uGQzbzCmRO6sUih6GTPZv6a1/R87v0= @@ -116,7 +100,6 @@ github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= -github.com/google/gofuzz v1.0.0 h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/gorilla/mux v1.7.3 h1:gnP5JzjVOuiZD07fKKToCAOjS0yOpj/qPETTXCCS6hw= github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= @@ -133,7 +116,6 @@ github.com/hashicorp/golang-lru v0.5.3 h1:YPkqC67at8FYaadspW/6uE0COsBxS2656RLEr8 github.com/hashicorp/golang-lru v0.5.3/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= @@ -154,10 +136,8 @@ github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6 github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515 h1:T+h1c/A9Gawja4Y9mFVWj2vyii2bbUNDw3kt9VxK2EY= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= -github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/libp2p/go-buffer-pool v0.0.2 h1:QNK2iAFa8gjAe1SPz6mHSMuCcjs+X1wlHzeOSqcmlfs= github.com/libp2p/go-buffer-pool v0.0.2/go.mod h1:MvaB6xw5vOrDl8rYZGLFdKAuk/hRoRZd1Vi32+RXyFM= @@ -180,18 +160,14 @@ github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRW github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.8.0 h1:VkHVNpR4iVnU8XQR6DBm8BqYjN7CRzw+xKUbVVbbW9w= github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/onsi/gomega v1.5.0 h1:izbySO9zDPmjJ8rDjLvkA2zJHIo+HkYXHnf7eN7SSyo= github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/otiai10/copy v1.0.2 h1:DDNipYy6RkIkjMwy+AWzgKiNTyj2RUI9yEMeETEpVyc= github.com/otiai10/copy v1.0.2/go.mod h1:c7RpqBkwMom4bYTSkLSym4VSJz/XtncWRAj/J4PEIMY= github.com/otiai10/curr v0.0.0-20150429015615-9b4961190c95/go.mod h1:9qAhocn7zKJG+0mI8eUu6xqkFDYS2kb2saOteoSB3cE= -github.com/otiai10/curr v0.0.0-20190513014714-f5a3d24e5776 h1:o59bHXu8Ejas8Kq6pjoVJQ9/neN66SM8AKh6wI42BBs= github.com/otiai10/curr v0.0.0-20190513014714-f5a3d24e5776/go.mod h1:3HNVkVOU7vZeFXocWuvtcS0XSFLcf2XUSDHkq9t1jU4= github.com/otiai10/mint v1.2.4/go.mod h1:d+b7n/0R3tdyUYYylALXpWQ/kTN+QobSq/4SRGBkR3M= -github.com/otiai10/mint v1.3.0 h1:Ady6MKVezQwHBkGzLFbrsywyp09Ah7rkmfjV3Bcr5uc= github.com/otiai10/mint v1.3.0/go.mod h1:F5AjcsTsWUqX+Na9fpHb52P8pcRX2CI6A3ctIT91xUo= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pelletier/go-toml v1.5.0 h1:5BakdOZdtKJ1FFk6QdL8iSGrMWsXgchNJcrnarjbmJQ= @@ -257,7 +233,6 @@ github.com/spf13/viper v1.4.0 h1:yXHLWeravcrgGyFSyCgdYpXQ9dR9c/WED3pg1RhxqEU= github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.2.0 h1:Hbg2NidpLE8veEBkEZTL3CvlkUIVzuU9jDplZO54c48= github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= @@ -269,8 +244,6 @@ github.com/syndtr/goleveldb v1.0.1-0.20190318030020-c3a204f8e965 h1:1oFLiOyVl+W7 github.com/syndtr/goleveldb v1.0.1-0.20190318030020-c3a204f8e965/go.mod h1:9OrXJhf154huy1nPWmuSrkgjPUtUNhA+Zmy+6AESzuA= github.com/tendermint/btcd v0.1.1 h1:0VcxPfflS2zZ3RiOAHkBiFUcPvbtRj5O7zHmcJWHV7s= github.com/tendermint/btcd v0.1.1/go.mod h1:DC6/m53jtQzr/NFmMNEu0rxf18/ktVoVtMrnDD5pN+U= -github.com/tendermint/crypto v0.0.0-20190823183015-45b1026d81ae h1:AOXNM7c2Vvo45SjAgeWF8Wy+NS7/NCqzRNpUc+HPAec= -github.com/tendermint/crypto v0.0.0-20190823183015-45b1026d81ae/go.mod h1:z4YtwM70uOnk8h0pjJYlj3zdYwi9l03By6iAIF5j/Pk= github.com/tendermint/crypto v0.0.0-20191022145703-50d29ede1e15 h1:hqAk8riJvK4RMWx1aInLzndwxKalgi5rTqgfXxOxbEI= github.com/tendermint/crypto v0.0.0-20191022145703-50d29ede1e15/go.mod h1:z4YtwM70uOnk8h0pjJYlj3zdYwi9l03By6iAIF5j/Pk= github.com/tendermint/go-amino v0.14.1/go.mod h1:i/UKE5Uocn+argJJBb12qTZsCDBcAYMbR92AaJVmKso= @@ -292,7 +265,6 @@ github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1: github.com/zondax/hid v0.9.0 h1:eiT3P6vNxAEVxXMw66eZUAAnU2zD33JBkfG/EnfAKl8= github.com/zondax/hid v0.9.0/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.etcd.io/bbolt v1.3.3 h1:MUGmc65QhB3pIlaQ5bB4LwqSj6GIonVJXpZiaKNyaKk= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= @@ -368,12 +340,9 @@ google.golang.org/grpc v1.23.1 h1:q4XQuHFC6I28BKZpo6IYyb3mNO+l7lSOxRuYTCiDfXk= google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/ibc-demo.md b/ibc-demo.md index 09dc21f173..b87a75c95c 100644 --- a/ibc-demo.md +++ b/ibc-demo.md @@ -7,7 +7,7 @@ This branch uses non-canonical branch of cosmos-sdk. Before building, run `go mo ```shell git clone git@github.com:cosmos/gaia cd gaia -git checkout fedekunze/ibc +git checkout cwgoes/ibc-demo-fixes make install gaiad version gaiacli version @@ -29,12 +29,12 @@ Fix the configuration files for both `gaiad` and `gaiacli` to allow both chains/ ```bash # Configure the proper database backend for each node and different listening ports -sed -i '' 's/"leveldb"/"goleveldb"/g' ibc0/n0/gaiad/config/config.toml -sed -i '' 's/"leveldb"/"goleveldb"/g' ibc1/n0/gaiad/config/config.toml -sed -i '' 's#"tcp://0.0.0.0:26656"#"tcp://0.0.0.0:26556"#g' ibc1/n0/gaiad/config/config.toml -sed -i '' 's#"tcp://0.0.0.0:26657"#"tcp://0.0.0.0:26557"#g' ibc1/n0/gaiad/config/config.toml -sed -i '' 's#"localhost:6060"#"localhost:6061"#g' ibc1/n0/gaiad/config/config.toml -sed -i '' 's#"tcp://127.0.0.1:26658"#"tcp://127.0.0.1:26558"#g' ibc1/n0/gaiad/config/config.toml +sed -i 's/"leveldb"/"goleveldb"/g' ibc0/n0/gaiad/config/config.toml +sed -i 's/"leveldb"/"goleveldb"/g' ibc1/n0/gaiad/config/config.toml +sed -i 's#"tcp://0.0.0.0:26656"#"tcp://0.0.0.0:26556"#g' ibc1/n0/gaiad/config/config.toml +sed -i 's#"tcp://0.0.0.0:26657"#"tcp://0.0.0.0:26557"#g' ibc1/n0/gaiad/config/config.toml +sed -i 's#"localhost:6060"#"localhost:6061"#g' ibc1/n0/gaiad/config/config.toml +sed -i 's#"tcp://127.0.0.1:26658"#"tcp://127.0.0.1:26558"#g' ibc1/n0/gaiad/config/config.toml gaiacli config --home ibc0/n0/gaiacli/ chain-id ibc0 gaiacli config --home ibc1/n0/gaiacli/ chain-id ibc1 gaiacli config --home ibc0/n0/gaiacli/ output json @@ -43,37 +43,31 @@ gaiacli config --home ibc0/n0/gaiacli/ node http://localhost:26657 gaiacli config --home ibc1/n0/gaiacli/ node http://localhost:26557 ``` -Add keys from each chain to the other and make sure that the key at `ibc1/n0/gaiacli/key_seed.json` is named `n1` on each `gaiacli` instance and the same for `n0`. After this is complete the results of `gaiacli keys list` from each chain should be identical. The following are instructions for how to do this on Mac: +Add keys from each chain to the other and make sure that the key at `ibc1/n0/gaiacli/key_seed.json` is named `n1` on each `gaiacli` instance and the same for `n0`. After this is complete the results of `gaiacli keys list` from each chain should be identical. The following commands will do the trick: ```bash -# These commands copy the seed phrase from each dir into the clipboard on mac -jq -r '.secret' ibc0/n0/gaiacli/key_seed.json | pbcopy -jq -r '.secret' ibc1/n0/gaiacli/key_seed.json | pbcopy - -# Remove the key n0 on ibc1 gaiacli --home ibc1/n0/gaiacli keys delete n0 +gaiacli keys test --home ibc0/n0/gaiacli n1 "$(jq -r '.secret' ibc1/n0/gaiacli/key_seed.json)" 12345678 +gaiacli keys test --home ibc1/n0/gaiacli n0 "$(jq -r '.secret' ibc0/n0/gaiacli/key_seed.json)" 12345678 +gaiacli keys test --home ibc1/n0/gaiacli n1 "$(jq -r '.secret' ibc1/n0/gaiacli/key_seed.json)" 12345678 +``` -# seed from ibc1/n0/gaiacli/key_seed.json -> ibc0/n1 -gaiacli --home ibc0/n0/gaiacli keys add n1 --recover - -# seed from ibc0/n0/gaiacli/key_seed.json -> ibc1/n0 -gaiacli --home ibc1/n0/gaiacli keys add n0 --recover - -# seed from ibc1/n0/gaiacli/key_seed.json -> ibc1/n1 -gaiacli --home ibc1/n0/gaiacli keys add n1 --recover +After this operation, check to make sure the keys match: -# Ensure keys match -gaiacli --home ibc0/n0/gaiacli keys list | jq '.[].address' -gaiacli --home ibc1/n0/gaiacli keys list | jq '.[].address' +```bash +gaiacli --home ibc0/n0/gaiacli keys list | jq -r '.[].address' +gaiacli --home ibc1/n0/gaiacli keys list | jq -r '.[].address' ``` -After configuration is complete, start your `gaiad` processes: +After configuration is complete, you will be able to start two `gaiad` processes: ```bash nohup gaiad --home ibc0/n0/gaiad start > ibc0.log & nohup gaiad --home ibc1/n0/gaiad start > ibc1.log & ``` +> NOTE: If you would like to look at the logs from the instances just `tail -f ibc0.log`. + ## IBC Command Sequence ### Client Creation @@ -82,13 +76,13 @@ Create IBC clients on each chain using the following commands. Note that we are ```bash # client for chain ibc1 on chain ibc0 -gaiacli --home ibc0/n0/gaiacli \ +echo -e "12345678\n" | gaiacli --home ibc0/n0/gaiacli \ tx ibc client create ibconeclient \ $(gaiacli --home ibc1/n0/gaiacli q ibc client node-state) \ --from n0 -y -o text # client for chain ibc0 on chain ibc1 -gaiacli --home ibc1/n0/gaiacli \ +echo -e "12345678\n" | gaiacli --home ibc1/n0/gaiacli \ tx ibc client create ibczeroclient \ $(gaiacli --home ibc0/n0/gaiacli q ibc client node-state) \ --from n1 -y -o text @@ -107,100 +101,117 @@ In order to send transactions using IBC there are two different handshakes that Create a `connection` with the following command: -> NOTE: This command broadcasts a total of 7 transactions between the two chains from 2 different wallets. At the start of the command you will be prompted for passwords for the two different keys. The command may then take some time. Please wait for the command to return! +> NOTE: This command broadcasts a total of 7 transactions between the two chains from 2 different wallets. At the start of the command you will be prompted for passwords for the two different keys (`12345678` for both). The command will then take some time, please wait for it to return! ```shell gaiacli \ --home ibc0/n0/gaiacli \ tx ibc connection handshake \ - conn0 ibconeclient $(gaiacli --home ibc1/n0/gaiacli q ibc client path) \ - conn1 ibczeroclient $(gaiacli --home ibc0/n0/gaiacli q ibc client path) \ + connectionzero ibconeclient $(gaiacli --home ibc1/n0/gaiacli q ibc client path) \ + connectionone ibczeroclient $(gaiacli --home ibc0/n0/gaiacli q ibc client path) \ --chain-id2 ibc1 \ --from1 n0 --from2 n1 \ --node1 tcp://localhost:26657 \ --node2 tcp://localhost:26557 ``` +After the password input, you should see output like the following: + +``` +ibc0 <- connection_open_init [OK] txid(B41C15A8F31524CB34EE061BA4418F48A3A37A7348BF8F818E67F5EE90AED45F) client(ibconeclient) connection(connectionzero) +ibc1 <- update_client [OK] txid(CD9F9AFD311DDF6B3604BCDD3DF371FAE93F76A01E66815AD6E2DCDDA942976D) client(ibconeclient) +ibc1 <- connection_open_try [OK] txid(F364081569703146978605D9079B751FA83E8766C749B1DA96054D2728DBD715) client(ibczeroclient) connection(connectionone) +ibc0 <- update_client [OK] txid(58A8E012E623303AA2B4A73099D00A6A3F34220E10FA5445251B1F7E6435EFF5) client(ibczeroclient) +ibc0 <- connection_open_ack [OK] txid(9535B4E25E204C129B91CF2FBDBD3E9AC17881AB4D4BFD4F57731E96D348B053) connection(connectionzero) +ibc1 <- update_client [OK] txid(50D737D7798E1D0A2E0452B7EDDC2D06A06524424F10B54F6400F148D9255DAF) client(ibconeclient) +ibc0 <- connection_open_confirm [OK] txid(CF0F7E54481D90A438A625E16EAB48F5480334AF090CE05736BDFACB69B8F798) connection(connectionone) +``` + Once the connection is established you should be able to query it: ```bash -gaiacli --home ibc0/n0/gaiacli q ibc connection connection conn0 --indent --trust-node -gaiacli --home ibc1/n0/gaiacli q ibc connection connection conn1 --indent --trust-node +gaiacli --home ibc0/n0/gaiacli q ibc connection end connectionzero --indent --trust-node +gaiacli --home ibc1/n0/gaiacli q ibc connection end connectionone --indent --trust-node ``` ### Channel Now that the `connection` has been created, it's time to establish a `channel` for the `ibc-mock` application protocol. This will allow sending of data between `ibc0` and `ibc1`. To create the `channel`, run the following command: -> NOTE: This command broadcasts a total of 7 transactions between the two chains from 2 different wallets. At the start of the command you will be prompted for passwords for the two different keys. The command may then take some time. Please wait for the command to return! +> NOTE: This command broadcasts a total of 7 transactions between the two chains from 2 different wallets. At the start of the command you will be prompted for passwords for the two different keys (`12345678` for both). The command will then take some time, please wait for it to return! ```bash gaiacli \ --home ibc0/n0/gaiacli \ tx ibc channel handshake \ - ibcmocksend chan0 conn0 \ - ibcmockrecv chan1 conn1 \ + ibconeclient bank channelzero connectionzero \ + ibczeroclient bank channelone connectionone \ --node1 tcp://localhost:26657 \ --node2 tcp://localhost:26557 \ --chain-id2 ibc1 \ --from1 n0 --from2 n1 ``` +You should see output like the following: + +``` +ibc0 <- channel_open_init [OK] txid(792E51E0455A8E0C85705C61A638A4D7C5399B3BA5AF6F29C85BB4E090FCA1B7) portid(bankbankbank) chanid(channelzero) +ibc1 <- update_client [OK] txid(CEA961B9BE931E7B06E6D5643486D267677E66A253F104BC00E2BCE1F9343C03) client(ibczeroclient) +ibc1 <- channel_open_try [OK] txid(D6BC3B03646EF61D1DA153C6678FE047DF76CB12981AC1D524C69C22124967D7) portid(bankbankbank) chanid(channelone) +ibc0 <- update_client [OK] txid(FA22E93601218CEA839FDEB7BD0D8F47D81E1172E18A8B21717675FF5C4BCF40) client(ibconeclient) +ibc0 <- channel_open_ack [OK] txid(1840343AFB2D5666F52440C199A1356C63A884A959F0A9A53175773CDB83006B) portid(bankbankbank) chanid(channelzero) +ibc1 <- update_client [OK] txid(BBE212C5041AC366C018BB97F8DF8A495562EAFFFF51BFDA7BBAE9952BE589D0) client(ibczeroclient) +ibc1 <- channel_open_confirm [OK] txid(69F50CA44AE6AD84BD24866E7DB7FE8ADFD9C484171662CB9E6F0C71BFC222A9) portid(bankbankbank) chanid(channelone) +``` + You can query the `channel` after establishment by running the following command: ```bash -gaiacli --home ibc0/n0/gaiacli query ibc channel channel ibcmocksend chan0 --indent --trust-node -gaiacli --home ibc1/n0/gaiacli query ibc channel channel ibcmockrecv chan1 --indent --trust-node +gaiacli --home ibc0/n0/gaiacli q ibc channel end bankbankbank channelzero --indent --trust-node +gaiacli --home ibc1/n0/gaiacli q ibc channel end bankbankbank channelone --indent --trust-node ``` -## Send Packet +### Send Packet -To send a packet using the `ibc-mock` application protocol, you need to know the channel you plan to send on, as well as the sequence number on the channel. To get the sequence you use the following commands: +To send a packet using the `bank` application protocol, you need to know the `channel` you plan to send on, as well as the `port` on the channel. You also need to provide an `address` and `amount`. Use the following command to send the packet: ```bash -# Returns the last sequence number -gaiacli --home ibc0/n0/gaiacli q ibcmocksend sequence chan0 - -# Returns the next expected sequence number, for use in scripting -gaiacli --home ibc0/n0/gaiacli q ibcmocksend next chan0 +gaiacli \ + --home ibc0/n0/gaiacli \ + tx ibc transfer transfer \ + bank channelzero \ + $(gaiacli --home ibc0/n0/gaiacli keys show n1 -a) 1stake \ + --from n0 \ + --source ``` -Now you are ready to send an `ibc-mock` packet down the channel (`chan0`) from chain `ibc0` to chain `ibc1`! To do so run the following commands to send a packet down the channel: +> NOTE: This commands returns the `height` at which it was committed, this should be at the beginning of the JSON output. The enviornment variable `TIMEOUT`. + +### Receive Packet + +Now, try querying the account on `ibc1` that you sent the `1stake` to, the account will be empty: ```bash -gaiacli --home ibc0/n0/gaiacli tx ibcmocksend sequence chan0 $(gaiacli --home ibc0/n0/gaiacli q ibcmocksend next chan0) --from n0 -o text -y +gaiacli --home ibc1/n0/gaiacli q account $(gaiacli --home ibc0/n0/gaiacli keys show n1 -a) ``` -### Receive Packet - -Once packets are sent, receipt must be confirmed on the destination chain. To `pull` the packets from `ibc0` on `ibc1`, run the following command: +To complete the transfer once packets are sent, receipt must be confirmed on the destination chain. To `recv-packet` from `ibc0` on `ibc1`, run the following command: ```bash gaiacli \ + tx ibc transfer recv-packet \ + bank channelzero ibczeroclient \ --home ibc1/n0/gaiacli \ - tx ibc channel pull ibcmockrecv chan1 \ - --node1 tcp://localhost:26557 \ + --packet-sequence 1 \ + --timeout $TIMEOUT \ + --from n1 \ --node2 tcp://localhost:26657 \ --chain-id2 ibc0 \ - --from n1 -``` - -This command sends two transactions. You should see the reciept of the packet: - -``` -ibc1 <- update-client [OK] txid(7D4B4DE7A6B8E1045CA7BEB16E21DD0491BED000E5FB0D05BBB7960AABE5CC78) client(c1) -ibc1 <- empty-packet [OK] txid(6E90B9CE19394D7D41CF55E4ADCC94D6169B476B45527F9C47346080C85A289F) packets(1) -``` - -> Note: This command pushes all the packets out of the channel with one command. Try pushing a **couple of packets** from `ibc0` to `ibc1` then fulshing them at once. You should see output like: - -``` -ibc1 <- update-client [OK] txid(21E0CE99A21DD7630A7DDE62459DD82C4051CC46B231A7B31529928B1B1B2C53) client(c1) -ibc1 <- empty-packet [OK] txid(92D76EF46FDCB3739DB06960BECCD7DA30AAA6AECA687DF4D92CC272D4941F7E) packets(2) + --source ``` -Once the packets have been sent, you can check the updated sequence by running: +Once the packets have been recieved you should see the `1stake` in your account on `ibc1`: ```bash -gaiacli --home ibc1/n0/gaiacli q ibcmockrecv sequence chan1 --trust-node +gaiacli --home ibc1/n0/gaiacli q account $(gaiacli --home ibc0/n0/gaiacli keys show n1 -a) ``` diff --git a/ibc-demo.sh b/ibc-demo.sh new file mode 100755 index 0000000000..c99aff1980 --- /dev/null +++ b/ibc-demo.sh @@ -0,0 +1,178 @@ +#!/bin/zsh + +GAIA_BRANCH=cwgoes/ibc-demo-fixes +GAIA_DIR=$(mktemp -d) +CONF_DIR=$(mktemp -d) + +echo "GAIA_DIR: ${GAIA_DIR}" +echo "CONF_DIR: ${CONF_DIR}" + +sleep 1 + +set -x + +echo "Killing existing gaiad instances..." + +killall gaiad + +set -e + +echo "Building Gaia..." + +cd $GAIA_DIR +git clone git@github.com:cosmos/gaia +cd gaia +git checkout $GAIA_BRANCH +make install +gaiad version +gaiacli version + +echo "Generating configurations..." + +cd $CONF_DIR && mkdir ibc-testnets && cd ibc-testnets +echo -e "\n" | gaiad testnet -o ibc0 --v 1 --chain-id ibc0 --node-dir-prefix n +echo -e "\n" | gaiad testnet -o ibc1 --v 1 --chain-id ibc1 --node-dir-prefix n + +if [ "$(uname)" = "Linux" ]; then + sed -i 's/"leveldb"/"goleveldb"/g' ibc0/n0/gaiad/config/config.toml + sed -i 's/"leveldb"/"goleveldb"/g' ibc1/n0/gaiad/config/config.toml + sed -i 's#"tcp://0.0.0.0:26656"#"tcp://0.0.0.0:26556"#g' ibc1/n0/gaiad/config/config.toml + sed -i 's#"tcp://0.0.0.0:26657"#"tcp://0.0.0.0:26557"#g' ibc1/n0/gaiad/config/config.toml + sed -i 's#"localhost:6060"#"localhost:6061"#g' ibc1/n0/gaiad/config/config.toml + sed -i 's#"tcp://127.0.0.1:26658"#"tcp://127.0.0.1:26558"#g' ibc1/n0/gaiad/config/config.toml +else + sed -i '' 's/"leveldb"/"goleveldb"/g' ibc0/n0/gaiad/config/config.toml + sed -i '' 's/"leveldb"/"goleveldb"/g' ibc1/n0/gaiad/config/config.toml + sed -i '' 's#"tcp://0.0.0.0:26656"#"tcp://0.0.0.0:26556"#g' ibc1/n0/gaiad/config/config.toml + sed -i '' 's#"tcp://0.0.0.0:26657"#"tcp://0.0.0.0:26557"#g' ibc1/n0/gaiad/config/config.toml + sed -i '' 's#"localhost:6060"#"localhost:6061"#g' ibc1/n0/gaiad/config/config.toml + sed -i '' 's#"tcp://127.0.0.1:26658"#"tcp://127.0.0.1:26558"#g' ibc1/n0/gaiad/config/config.toml +fi; + +gaiacli config --home ibc0/n0/gaiacli/ chain-id ibc0 +gaiacli config --home ibc1/n0/gaiacli/ chain-id ibc1 +gaiacli config --home ibc0/n0/gaiacli/ output json +gaiacli config --home ibc1/n0/gaiacli/ output json +gaiacli config --home ibc0/n0/gaiacli/ node http://localhost:26657 +gaiacli config --home ibc1/n0/gaiacli/ node http://localhost:26557 + +echo "Importing keys..." + +SEED0=$(jq -r '.secret' ibc0/n0/gaiacli/key_seed.json) +SEED1=$(jq -r '.secret' ibc1/n0/gaiacli/key_seed.json) +echo -e "12345678\n" | gaiacli --home ibc1/n0/gaiacli keys delete n0 + +echo "Seed 0: ${SEED0}" +echo "Seed 1: ${SEED1}" + +gaiacli keys test --home ibc0/n0/gaiacli n1 "$(jq -r '.secret' ibc1/n0/gaiacli/key_seed.json)" 12345678 +gaiacli keys test --home ibc1/n0/gaiacli n0 "$(jq -r '.secret' ibc0/n0/gaiacli/key_seed.json)" 12345678 +gaiacli keys test --home ibc1/n0/gaiacli n1 "$(jq -r '.secret' ibc1/n0/gaiacli/key_seed.json)" 12345678 + +echo "Keys should match:" + +gaiacli --home ibc0/n0/gaiacli keys list | jq '.[].address' +gaiacli --home ibc1/n0/gaiacli keys list | jq '.[].address' + +echo "Starting Gaiad instances..." + +nohup gaiad --home ibc0/n0/gaiad --log_level="*:debug" start > ibc0.log & +nohup gaiad --home ibc1/n0/gaiad --log_level="*:debug" start > ibc1.log & + +sleep 20 + +echo "Creating clients..." + +echo -e "12345678\n" | gaiacli --home ibc0/n0/gaiacli \ + tx ibc client create ibconeclient \ + $(gaiacli --home ibc1/n0/gaiacli q ibc client node-state) \ + --from n0 -y -o text + +echo -e "12345678\n" | gaiacli --home ibc1/n0/gaiacli \ + tx ibc client create ibczeroclient \ + $(gaiacli --home ibc0/n0/gaiacli q ibc client node-state) \ + --from n1 -y -o text + +sleep 3 + +echo "Querying clients..." + +gaiacli --home ibc0/n0/gaiacli q ibc client consensus-state ibconeclient --indent +gaiacli --home ibc1/n0/gaiacli q ibc client consensus-state ibczeroclient --indent + +echo "Establishing a connection..." + +gaiacli \ + --home ibc0/n0/gaiacli \ + tx ibc connection handshake \ + connectionzero ibconeclient $(gaiacli --home ibc1/n0/gaiacli q ibc client path) \ + connectionone ibczeroclient $(gaiacli --home ibc0/n0/gaiacli q ibc client path) \ + --chain-id2 ibc1 \ + --from1 n0 --from2 n1 \ + --node1 tcp://localhost:26657 \ + --node2 tcp://localhost:26557 + +sleep 2 + +echo "Querying connection..." + +gaiacli --home ibc0/n0/gaiacli q ibc connection end connectionzero --indent --trust-node +gaiacli --home ibc1/n0/gaiacli q ibc connection end connectionone --indent --trust-node + +echo "Establishing a channel..." + +gaiacli \ + --home ibc0/n0/gaiacli \ + tx ibc channel handshake \ + ibconeclient bank channelzero connectionzero \ + ibczeroclient bank channelone connectionone \ + --node1 tcp://localhost:26657 \ + --node2 tcp://localhost:26557 \ + --chain-id2 ibc1 \ + --from1 n0 --from2 n1 + +sleep 2 + +echo "Querying channel..." + +gaiacli --home ibc0/n0/gaiacli q ibc channel end bank channelzero --indent --trust-node +gaiacli --home ibc1/n0/gaiacli q ibc channel end bank channelone --indent --trust-node + +echo "Sending token packets from ibc0..." + +DEST=$(gaiacli --home ibc0/n0/gaiacli keys show n1 -a) + +gaiacli \ + --home ibc0/n0/gaiacli \ + tx ibc transfer transfer \ + bank channelzero \ + $DEST 1stake \ + --from n0 \ + --source + +echo "Enter height:" + +read -r HEIGHT + +TIMEOUT=$(echo "$HEIGHT + 1000" | bc -l) + +echo "Account before:" +gaiacli --home ibc1/n0/gaiacli q account $DEST + +echo "Recieving token packets on ibc1..." + +sleep 3 + +gaiacli \ + tx ibc transfer recv-packet \ + bank channelzero ibczeroclient \ + --home ibc1/n0/gaiacli \ + --packet-sequence 1 \ + --timeout $TIMEOUT \ + --from n1 \ + --node2 tcp://localhost:26657 \ + --chain-id2 ibc0 \ + --source + +echo "Account after:" +gaiacli --home ibc1/n0/gaiacli q account $DEST