Skip to content

Commit

Permalink
Merge branch 'main' into vimystic/edit_rpcaddr
Browse files Browse the repository at this point in the history
  • Loading branch information
vimystic committed Sep 13, 2023
2 parents 3541a2d + 2aa59be commit da17f02
Show file tree
Hide file tree
Showing 11 changed files with 165 additions and 37 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ jobs:
runs-on: ubuntu-latest
steps:
# Install and setup go
- name: Set up Go 1.20
- name: Set up Go 1.21
uses: actions/setup-go@v4
with:
go-version: '1.20'
go-version: '1.21'

# setup gopath
- name: Set PATH
Expand All @@ -40,4 +40,4 @@ jobs:
uses: actions/upload-artifact@v1
with:
name: rly
path: ./build/rly
path: ./build/rly
58 changes: 39 additions & 19 deletions .github/workflows/interchaintest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ jobs:
events:
runs-on: self-hosted
steps:
- name: Set up Go 1.20
- name: Set up Go 1.21
uses: actions/setup-go@v4
with:
go-version: '1.20'
go-version: '1.21'

- name: checkout relayer
uses: actions/checkout@v2
Expand All @@ -31,10 +31,10 @@ jobs:
legacy:
runs-on: self-hosted
steps:
- name: Set up Go 1.20
- name: Set up Go 1.21
uses: actions/setup-go@v4
with:
go-version: '1.20'
go-version: '1.21'

- name: checkout relayer
uses: actions/checkout@v2
Expand All @@ -52,10 +52,10 @@ jobs:
multiple-paths:
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.20
- name: Set up Go 1.21
uses: actions/setup-go@v4
with:
go-version: '1.20'
go-version: '1.21'

- name: checkout relayer
uses: actions/checkout@v2
Expand All @@ -73,10 +73,10 @@ jobs:
misbehaviour:
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.20
- name: Set up Go 1.21
uses: actions/setup-go@v4
with:
go-version: '1.20'
go-version: '1.21'

- name: checkout relayer
uses: actions/checkout@v2
Expand All @@ -94,10 +94,10 @@ jobs:
fee-middleware:
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.20
- name: Set up Go 1.21
uses: actions/setup-go@v4
with:
go-version: '1.20'
go-version: '1.21'

- name: checkout relayer
uses: actions/checkout@v2
Expand All @@ -115,10 +115,10 @@ jobs:
fee-grant:
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.20
- name: Set up Go 1.21
uses: actions/setup-go@v4
with:
go-version: '1.20'
go-version: '1.21'

- name: checkout relayer
uses: actions/checkout@v2
Expand All @@ -133,13 +133,35 @@ jobs:
- name: interchaintest
run: make interchaintest-fee-grant

prepare-scenario-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Generate matrix
id: set-matrix
run: |
# Run the command and convert its output to a JSON array
TESTS=$(cd interchaintest && go test -list ^TestScenario | grep -v "^ok " | jq -R -s -c 'split("\n")[:-1]')
echo "matrix=${TESTS}" >> $GITHUB_OUTPUT
# Note : This job will not start until prepare-scenario-matrix completes sucessfully
scenarios:
needs: prepare-scenario-matrix
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
test: ${{fromJson(needs.prepare-scenario-matrix.outputs.matrix)}}

steps:
- name: Set up Go 1.20
- name: Set up Go 1.21
uses: actions/setup-go@v4
with:
go-version: '1.20'
go-version: '1.21'

- name: checkout relayer
uses: actions/checkout@v2
Expand All @@ -152,8 +174,6 @@ jobs:
${{ runner.os }}-go-
- name: interchaintest
run: make interchaintest-scenario

- name: Prune Docker images
if: always() #ensure dangling images are pruned after interchain-test scenario passes or fails
run: docker image prune -f
run: |
cd interchaintest
go test -run ${{ matrix.test }}
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "Release"
name: 'Release'

on:
push:
Expand All @@ -17,9 +17,9 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.20'
go-version: '1.21'

- run: echo https://github.com/cosmos/relayer/blob/${GITHUB_REF#refs/tags/}/CHANGELOG.md#${GITHUB_REF#refs/tags/} > ../release_notes.md
- run: echo https://github.com/cosmos/relayer/blob/${GITHUB_REF#refs/tags/}/CHANGELOG.md#${GITHUB_REF#refs/tags/} > ../release_notes.md

- name: setup release environment
run: |-
Expand Down
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
FROM --platform=$BUILDPLATFORM golang:1.20-alpine3.16 AS build-env
FROM --platform=$BUILDPLATFORM golang:1.21-alpine3.17 AS build-env

RUN apk add --update --no-cache curl make git libc-dev bash gcc linux-headers eudev-dev

ARG TARGETARCH
ARG BUILDARCH

RUN if [ "${TARGETARCH}" = "arm64" ] && [ "${BUILDARCH}" != "arm64" ]; then \
wget -c https://musl.cc/aarch64-linux-musl-cross.tgz -O - | tar -xzvv --strip-components 1 -C /usr; \
wget -c https://musl.cc/aarch64-linux-musl-cross.tgz -O - | tar -xzvv --strip-components 1 -C /usr; \
elif [ "${TARGETARCH}" = "amd64" ] && [ "${BUILDARCH}" != "amd64" ]; then \
wget -c https://musl.cc/x86_64-linux-musl-cross.tgz -O - | tar -xzvv --strip-components 1 -C /usr; \
wget -c https://musl.cc/x86_64-linux-musl-cross.tgz -O - | tar -xzvv --strip-components 1 -C /usr; \
fi

ADD . .

RUN if [ "${TARGETARCH}" = "arm64" ] && [ "${BUILDARCH}" != "arm64" ]; then \
export CC=aarch64-linux-musl-gcc CXX=aarch64-linux-musl-g++;\
export CC=aarch64-linux-musl-gcc CXX=aarch64-linux-musl-g++;\
elif [ "${TARGETARCH}" = "amd64" ] && [ "${BUILDARCH}" != "amd64" ]; then \
export CC=x86_64-linux-musl-gcc CXX=x86_64-linux-musl-g++; \
export CC=x86_64-linux-musl-gcc CXX=x86_64-linux-musl-g++; \
fi; \
GOOS=linux GOARCH=$TARGETARCH CGO_ENABLED=1 LDFLAGS='-linkmode external -extldflags "-static"' make install

Expand Down
22 changes: 19 additions & 3 deletions cmd/paths.go
Original file line number Diff line number Diff line change
Expand Up @@ -364,14 +364,25 @@ func pathsFetchCmd(a *appState) *cobra.Command {
cmd := &cobra.Command{
Use: "fetch",
Aliases: []string{"fch"},
Short: "Fetches the json files necessary to setup the paths for the configured chains",
Args: withUsage(cobra.NoArgs),
Short: "Fetches the json files necessary to setup the paths for the configured chains. Passing a chain name will only fetch paths for that chain",
Args: withUsage(cobra.RangeArgs(0, 1)),
Example: strings.TrimSpace(fmt.Sprintf(`
$ %s paths fetch --home %s
$ %s pth fch`, appName, defaultHome, appName)),
$ %s pth fch
$ %s pth fch cosmoshub`, appName, defaultHome, appName, appName)),
RunE: func(cmd *cobra.Command, args []string) error {
overwrite, _ := cmd.Flags().GetBool(flagOverwriteConfig)

// allow the relayer to only pull paths for a specific chain
chainReq := ""
if len(args) > 0 {
chainReq = args[0]
_, exist := a.config.Chains[chainReq]
if !exist {
return fmt.Errorf("chain %s not found in config", chainReq)
}
}

return a.performConfigLockingOperation(cmd.Context(), func() error {
chains := []string{}
for chainName := range a.config.Chains {
Expand All @@ -390,6 +401,11 @@ $ %s pth fch`, appName, defaultHome, appName)),
if chainB < chainA {
pair = chainB + "-" + chainA
}

if chainReq != "" && !strings.Contains(pair, chainReq) {
continue
}

chainCombinations[pair] = true
}
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/cosmos/relayer/v2

go 1.20
go 1.21

require (
cosmossdk.io/api v0.3.1
Expand Down
Loading

0 comments on commit da17f02

Please sign in to comment.