Skip to content

Commit

Permalink
Merge PR #278: Migrate to Gaia v3.0 part 1
Browse files Browse the repository at this point in the history
  • Loading branch information
jackzampolin authored Sep 21, 2020
1 parent 9490f4f commit 372bbfb
Show file tree
Hide file tree
Showing 79 changed files with 2,276 additions and 4,058 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,6 @@ jobs:
- uses: golangci/golangci-lint-action@master
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v1.27
version: v1.28
args: --timeout 10m
github-token: ${{ secrets.github_token }}
35 changes: 0 additions & 35 deletions .github/workflows/coco-tests.yml

This file was deleted.

28 changes: 0 additions & 28 deletions .github/workflows/mtd-tests.yml

This file was deleted.

35 changes: 0 additions & 35 deletions .github/workflows/rocketzone-tests.yml

This file was deleted.

2 changes: 1 addition & 1 deletion AUTHORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ contributions under the terms of the [Apache License, Version 2.0]
* Jack Zampolin (@jackzampolin)

[Apache License, Version 2.0]: https://www.apache.org/licenses/LICENSE-2.0
[LICENSE]: https://github.com/iqlusioninc/relayer/blob/master/LICENSE
[LICENSE]: https://github.com/ovrclk/relayer/blob/master/LICENSE
22 changes: 5 additions & 17 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
VERSION := $(shell echo $(shell git describe --tags) | sed 's/^v//')
COMMIT := $(shell git log -1 --format='%H')
SDKCOMMIT := $(shell go list -m -u -f '{{.Version}}' github.com/cosmos/cosmos-sdk)
GAIACOMMIT := $(shell go list -m -u -f '{{.Version}}' github.com/cosmos/gaia)
# GAIACOMMIT := $(shell go list -m -u -f '{{.Version}}' github.com/cosmos/gaia)
all: ci-lint install

###############################################################################
# Build / Install
###############################################################################

LD_FLAGS = -X github.com/iqlusioninc/relayer/cmd.Version=$(VERSION) \
-X github.com/iqlusioninc/relayer/cmd.Commit=$(COMMIT) \
-X github.com/iqlusioninc/relayer/cmd.SDKCommit=$(SDKCOMMIT) \
-X github.com/iqlusioninc/relayer/cmd.GaiaCommit=$(GAIACOMMIT)
LD_FLAGS = -X github.com/ovrclk/relayer/cmd.Version=$(VERSION) \
-X github.com/ovrclk/relayer/cmd.Commit=$(COMMIT) \
-X github.com/ovrclk/relayer/cmd.SDKCommit=$(SDKCOMMIT) \
-X github.com/ovrclk/relayer/cmd.GaiaCommit=$(GAIACOMMIT)

BUILD_FLAGS := -ldflags '$(LD_FLAGS)'

Expand Down Expand Up @@ -44,18 +44,6 @@ test:
test-gaia:
@TEST_DEBUG=true go test -mod=readonly -v ./test/... -run TestGaia*

test-mtd:
@TEST_DEBUG=true go test -mod=readonly -v ./test/... -run TestMtd*

test-rocketzone:
@TEST_DEBUG=true go test -mod=readonly -v ./test/... -run TestRocket*

test-agoric:
@TEST_DEBUG=true go test -mod=readonly -v ./test/... -run TestAgoric*

test-coco:
@TEST_DEBUG=true go test -mod=readonly -v ./test/... -run TestCoCo*

coverage:
@echo "viewing test coverage..."
@go tool cover --html=coverage.out
Expand Down
15 changes: 6 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

![GOZ](./docs/images/github-repo-banner.png)

![Relayer Build](https://github.com/iqlusioninc/relayer/workflows/Build%20then%20run%20CI%20Chains/badge.svg)
![Relayer Build](https://github.com/ovrclk/relayer/workflows/Build%20then%20run%20CI%20Chains/badge.svg)

The Cosmos IBC `relayer` package contains a basic relayer implementation that is
meant for users wishing to relay packets/data between sets of IBC enabled chains.
Expand All @@ -29,10 +29,7 @@ If you would like to join the relayer testnet, please [check out the instruction
| chain | tests | supported ports |
|-------|--------|----------------|
| [`gaia`](https://github.com/cosmos/gaia) | ![gaia](https://github.com/iqlusioninc/relayer/workflows/TESTING%20-%20gaia%20to%20gaia%20integration/badge.svg) | `transfer` |
| `microtick` | ![microtick](https://github.com/iqlusioninc/relayer/workflows/TESTING%20-%20mtd%20to%20ibc%20integration/badge.svg) | `transfer` |
| [`rocketzone`](https://github.com/rocket-protocol/rocketzone) | ![rocketzone](https://github.com/iqlusioninc/relayer/workflows/TESTING%20-%20rocketzone%20to%20ibc%20integration/badge.svg) | `transfer` |
| [`coco`](https://github.com/CosmicCompass/post-chain) | ![coco](https://github.com/CosmicCompass/relayer/workflows/TESTING%20-%20coco%20to%20ibc%20integration/badge.svg) | `transfer` |
| [`gaia`](https://github.com/cosmos/gaia) | ![gaia](https://github.com/ovrclk/relayer/workflows/TESTING%20-%20gaia%20to%20gaia%20integration/badge.svg) | `transfer` |

## Demoing the Relayer

Expand Down Expand Up @@ -69,10 +66,10 @@ $ cat ~/.relayer/config/config.yaml
$ rly keys restore ibc0 testkey "$(jq -r '.secret' data/ibc0/n0/gaiacli/key_seed.json)"
$ rly keys restore ibc1 testkey "$(jq -r '.secret' data/ibc1/n0/gaiacli/key_seed.json)"

# Then its time to initialize the relayer's lite clients for each chain
# All data moving forward is validated by these lite clients.
$ rly lite init ibc0 -f
$ rly lite init ibc1 -f
# Then its time to initialize the relayer's light clients for each chain
# All data moving forward is validated by these light clients.
$ rly light init ibc0 -f
$ rly light init ibc1 -f

# At this point the relayer --home directory is ready for normal operations between
# ibc0 and ibc1. Looking at the folder structure of the relayer at this point is helpful
Expand Down
24 changes: 10 additions & 14 deletions cmd/chains.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"github.com/spf13/cobra"
"gopkg.in/yaml.v2"

"github.com/iqlusioninc/relayer/relayer"
"github.com/ovrclk/relayer/relayer"
)

const (
Expand Down Expand Up @@ -52,8 +52,7 @@ func chainsAddrCmd() *cobra.Command {
return err
}

done := chain.UseSDKContext()
defer done()
chain.UseSDKContext()

addr, err := chain.GetAddress()
if err != nil {
Expand Down Expand Up @@ -108,12 +107,9 @@ func chainsShowCmd() *cobra.Command {
fmt.Printf(`chain-id: %s
rpc-addr: %s
trusting-period: %s
default-denom: %s
gas: %d
gas-prices: %s
key: %s
account-prefix: %s
`, c.ChainID, c.RPCAddr, c.TrustingPeriod, c.DefaultDenom, c.Gas, c.GasPrices, c.Key, c.AccountPrefix)
`, c.ChainID, c.RPCAddr, c.TrustingPeriod, c.Key, c.AccountPrefix)
return nil
}
},
Expand Down Expand Up @@ -197,10 +193,10 @@ func chainsListCmd() *cobra.Command {
default:
for i, c := range config.Chains {
var (
lite = xIcon
key = xIcon
path = xIcon
bal = xIcon
light = xIcon
key = xIcon
path = xIcon
bal = xIcon
)
_, err := c.GetAddress()
if err == nil {
Expand All @@ -212,17 +208,17 @@ func chainsListCmd() *cobra.Command {
bal = check
}

_, err = c.GetLatestLiteHeader()
_, err = c.GetLatestLightHeader()
if err == nil {
lite = check
light = check
}

for _, pth := range config.Paths {
if pth.Src.ChainID == c.ChainID || pth.Dst.ChainID == c.ChainID {
path = check
}
}
fmt.Printf("%2d: %-20s -> key(%s) bal(%s) lite(%s) path(%s)\n", i, c.ChainID, key, bal, lite, path)
fmt.Printf("%2d: %-20s -> key(%s) bal(%s) light(%s) path(%s)\n", i, c.ChainID, key, bal, light, path)
}
return nil
}
Expand Down
12 changes: 6 additions & 6 deletions cmd/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
"time"

"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/iqlusioninc/relayer/relayer"
"github.com/ovrclk/relayer/relayer"
"github.com/spf13/cobra"
"github.com/spf13/viper"
"gopkg.in/yaml.v2"
Expand Down Expand Up @@ -278,15 +278,15 @@ func defaultConfig() []byte {

// GlobalConfig describes any global relayer settings
type GlobalConfig struct {
Timeout string `yaml:"timeout" json:"timeout"`
LiteCacheSize int `yaml:"lite-cache-size" json:"lite-cache-size"`
Timeout string `yaml:"timeout" json:"timeout"`
LightCacheSize int `yaml:"light-cache-size" json:"light-cache-size"`
}

// newDefaultGlobalConfig returns a global config with defaults set
func newDefaultGlobalConfig() GlobalConfig {
return GlobalConfig{
Timeout: "10s",
LiteCacheSize: 20,
Timeout: "10s",
LightCacheSize: 20,
}
}

Expand Down Expand Up @@ -325,7 +325,7 @@ func validateConfig(c *Config) error {
}

for _, i := range c.Chains {
if err := i.Init(homePath, appCodec, cdc, to, debug); err != nil {
if err := i.Init(homePath, to, debug); err != nil {
return fmt.Errorf("did you remember to run 'rly config init' error:%w", err)
}
}
Expand Down
Loading

0 comments on commit 372bbfb

Please sign in to comment.