Skip to content

Commit

Permalink
Feature/ccv (#2)
Browse files Browse the repository at this point in the history
* Updates to support CCV

* Re-added out/err redirect to log files

* Add multiple tries for linking. Upd chain waiting

* Minor fix to Github action. Update rly start

---------

Co-authored-by: Ashish Chandra <ashish@saga.xyz>
  • Loading branch information
ashishchandr70 and Ashish Chandra committed Sep 12, 2023
1 parent 2d3c8e5 commit 25fea58
Show file tree
Hide file tree
Showing 8 changed files with 363 additions and 90 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
pull_request:
push:
branches:
- master
- '**'

jobs:
build:
Expand Down
89 changes: 49 additions & 40 deletions .github/workflows/docker-publish.yaml
Original file line number Diff line number Diff line change
@@ -1,54 +1,63 @@
name: Create and publish a Docker image
name: Build and Push to DockerHub

on:
push:
tags:
- '**'
branches:
- '**'

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
- "v*.*.*"

jobs:
build-and-push-image:
docker:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

env:
GOPRIVATE: github.com/sagaxyz/*
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up QEMU
uses: docker/setup-qemu-action@v1

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Log in to the Container registry
uses: docker/login-action@v1
- name: Set up access to private Go modules
env:
GITHUB_USER: ${{ secrets.GH_USER }}
GITHUB_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}
run: git config --global url."https://${GITHUB_USER}:${GITHUB_TOKEN}@github.com".insteadOf "https://github.com"

- name: Checkout
uses: actions/checkout@v3
-
name: Git fetch everything
run: git fetch --prune --unshallow
- name: Setup Go
uses: actions/setup-go@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
go-version-file: './go.mod'
cache: true
- run: go version

- name: Compile rly
run : make build
-
name: Get Github tag
id: meta
uses: docker/metadata-action@v3
run: |
echo "::set-output name=tag::$(echo ${{github.ref_name}} | sed -e 's/^v//')"
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Login to DockerHub
uses: docker/login-action@v2
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and push Docker image
uses: docker/build-push-action@v2.7.0
registry: docker.io
username: sagaxyz
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build and push
uses: docker/build-push-action@v3
with:
context: .
platforms: linux/amd64,linux/arm64
file: Dockerfile
file: saga.Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
GITHUB_USER=${{ secrets.GH_USER }}
GITHUB_TOKEN=${{ secrets.GH_ACCESS_TOKEN }}
platforms: linux/amd64
tags: sagaxyz/go-relayer:${{ steps.meta.outputs.tag }}, sagaxyz/go-relayer:latest
2 changes: 1 addition & 1 deletion .github/workflows/interchaintest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
pull_request:
push:
branches:
- master
- main

jobs:
events:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ dist/

# Don't commit the vendor directory if anyone runs 'go mod vendor'.
/vendor
docker-compose.yml
37 changes: 37 additions & 0 deletions docker-compose.yml.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
version: '3'

services:
rly:
container_name: rly
image: "rly:latest"
build:
context: .
dockerfile: saga.Dockerfile
environment:
- KEYNAME=relayer
- PROVIDER_CHAINID=
- CONSUMER_CHAINID=
- PROVIDER_RLY_MNEMONIC=
- CONSUMER_RLY_MNEMONIC=
- KEYRING=test # remember to change to other types of keyring like 'file' in-case exposing to outside world, otherwise your balance will be wiped quickly. The keyring test does not require private key to steal tokens from you
- KEYALGO=secp256k1
- KEYPASSWD="passw0rdK3y"
- PROVIDER_RPC_ADDRESS=
- CONSUMER_RPC_ADDRESS=
- RLY_SRC_PORT=consumer # Do not change unless you know what you are doing. This impacts the IBC connection ports
- RLY_DST_PORT=provider # Do not change unless you know what you are doing
- RLY_ORDERING=ordered # Do not change unless you know what you are doing
- RLY_DEBUG=true # set it to false as needed
networks:
- localnet
ports:
- 5183:5183
volumes:
- ./rly/start-rly.sh:/root/start-rly.sh

volumes:
relayer:

networks:
localnet:

26 changes: 26 additions & 0 deletions rly/sample-rly.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"type": "cosmos",
"value": {
"key": "",
"chain-id": "",
"rpc-addr": "",
"account-prefix": "saga",
"keyring-backend": "test",
"gas-adjustment": 1.2,
"gas-prices": "0stake",
"min-gas-amount": 0,
"max-gas-amount": 0,
"debug": true,
"timeout": "20s",
"block-timeout": "",
"output-format": "json",
"sign-mode": "direct",
"extra-codecs": [],
"coin-type": null,
"signing-algorithm": "",
"broadcast-mode": "batch",
"min-loop-duration": 0,
"extension-options": [],
"feegrants": null
}
}
Loading

0 comments on commit 25fea58

Please sign in to comment.