Skip to content

Commit

Permalink
Merge pull request #32 from cardano-foundation/feat/is-34-remove-tx-c…
Browse files Browse the repository at this point in the history
…ardano-service

feat: IS-34 Get rid of the the transaction submission service in the relayer
  • Loading branch information
dale-smartosc committed May 4, 2024
2 parents c918b51 + b57616f commit 15a8669
Show file tree
Hide file tree
Showing 55 changed files with 1,270 additions and 6,047 deletions.
11 changes: 0 additions & 11 deletions cosmos/sidechain/x/clients/cardano/CardanoIbcHelper_stub.h

This file was deleted.

Binary file not shown.
Binary file not shown.
24 changes: 0 additions & 24 deletions proto-types/protos/ibc-go/tx-cardano/config.proto

This file was deleted.

82 changes: 0 additions & 82 deletions proto-types/protos/ibc-go/tx-cardano/key.proto

This file was deleted.

18 changes: 0 additions & 18 deletions proto-types/protos/ibc-go/tx-cardano/transaction.proto

This file was deleted.

3 changes: 1 addition & 2 deletions relayer/.env.example
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
SRC_RPC_ADDR=http://localhost:5001
DST_RPC_ADDR=http://localhost:26657

TX_CARDANO_HOST=0.0.0.0
TX_CARDANO_PORT=4884
OGMIOS_ENDPOINT=ws://localhost:1337
7 changes: 4 additions & 3 deletions relayer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ COPY ./proto-types ./../proto-types
# Build the application binary using the provided Makefile
RUN make build

# Start a new stage from a smaller base image to reduce final image size
FROM frolvlad/alpine-glibc:latest
FROM alpine:latest

RUN apk add --no-cache libc6-compat

# Install openssl, required for secure network communications
RUN apk add --no-cache openssl
Expand All @@ -37,6 +38,6 @@ COPY --from=builder /app/scripts ./scripts
COPY --from=builder /app/examples ./examples

# Use Dockerize to wait for the Node.js service to be ready before starting the application
#CMD dockerize -wait tcp://0.0.0.0:26657 -timeout 60s ./scripts/relayer-start.sh
# CMD dockerize -wait tcp://0.0.0.0:26657 -wait tcp://0.0.0.0:4884 -timeout 120s ./scripts/relayer-start.sh

CMD ["sleep", "infinity"]
3 changes: 0 additions & 3 deletions relayer/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,6 @@ proto-gen:
@echo "Generating Protobuf files"
@$(protoImage) sh ./scripts/protocgen.sh

proto-gen-tx-cardano:
protoc --proto_path=proto/cardano/tx-cardano proto/cardano/tx-cardano/*.proto --go_out=plugins=grpc:proto/cardano/tx-cardano/pb

proto-format:
@$(protoImage) find ./ -name "*.proto" -exec clang-format -i {} \;

Expand Down
3 changes: 3 additions & 0 deletions relayer/cmd/keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"io"
"strings"

"github.com/cardano/relayer/v1/relayer/chains/cardano"
"github.com/cardano/relayer/v1/relayer/chains/cosmos"
"github.com/cosmos/cosmos-sdk/crypto/hd"
sdk "github.com/cosmos/cosmos-sdk/types"
Expand Down Expand Up @@ -187,6 +188,8 @@ $ %s k r cosmoshub faucet-key "[mnemonic-words]"`, appName, appName)),
if algo == "" {
if ccp, ok := chain.ChainProvider.(*cosmos.CosmosProvider); ok {
algo = ccp.PCfg.SigningAlgorithm
} else if _, ok := chain.ChainProvider.(*cardano.CardanoProvider); ok {
algo = string(hd.Ed25519Type)
} else {
algo = string(hd.Secp256k1Type)
}
Expand Down
1 change: 1 addition & 0 deletions relayer/constant/constant.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ import "time"
const (
EpochPeriod = 5
ClientTrustingPeriod = EpochPeriod * 24 * time.Hour
OgmiosEndpoint = "OGMIOS_ENDPOINT"
)
14 changes: 0 additions & 14 deletions relayer/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,12 @@
version: '3.9'
services:
tx-cardano-service:
build:
context: ./tx-cardano
dockerfile: ./Dockerfile
volumes:
- ~/.relayer:/root/.relayer
ports:
- "4884:4884"
network_mode: "host"
env_file:
- ./tx-cardano/.env

relayer-service:
container_name: relayer
build:
context: ../
dockerfile: ./relayer/Dockerfile
volumes:
- ~/.relayer:/root/.relayer
depends_on:
- tx-cardano-service
network_mode: "host"
env_file:
- ./.env
21 changes: 15 additions & 6 deletions relayer/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ require (
github.com/echovl/cardano-go v0.1.14
github.com/ethereum/go-ethereum v1.10.26
github.com/gofrs/flock v0.8.1
github.com/golang/protobuf v1.5.3
github.com/golang/protobuf v1.5.4
github.com/google/go-cmp v0.5.9
github.com/google/go-github/v43 v43.0.0
github.com/grpc-ecosystem/grpc-gateway v1.16.0
Expand All @@ -35,7 +35,7 @@ require (
go.uber.org/zap v1.24.0
golang.org/x/mod v0.11.0
golang.org/x/sync v0.2.0
golang.org/x/text v0.12.0
golang.org/x/text v0.14.0
google.golang.org/genproto/googleapis/api v0.0.0-20230629202037-9506855d4529
google.golang.org/grpc v1.56.2
google.golang.org/protobuf v1.32.0
Expand Down Expand Up @@ -63,8 +63,11 @@ require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect
github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 // indirect
github.com/blinklabs-io/gouroboros v0.81.0 // indirect
github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect
github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 // indirect
github.com/btcsuite/btcutil v1.0.2 // indirect
github.com/buger/jsonparser v1.1.1 // indirect
github.com/cenkalti/backoff/v4 v4.1.3 // indirect
github.com/cespare/xxhash v1.1.0 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
Expand Down Expand Up @@ -93,6 +96,8 @@ require (
github.com/echovl/ed25519 v0.2.0 // indirect
github.com/felixge/httpsnoop v1.0.2 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/fxamacker/cbor v1.5.1 // indirect
github.com/fxamacker/cbor/v2 v2.6.0 // indirect
github.com/getsentry/sentry-go v0.23.0 // indirect
github.com/go-kit/kit v0.12.0 // indirect
github.com/go-kit/log v0.2.1 // indirect
Expand Down Expand Up @@ -131,8 +136,10 @@ require (
github.com/huandu/skiplist v1.2.0 // indirect
github.com/improbable-eng/grpc-web v0.15.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jinzhu/copier v0.4.0 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/jmhodges/levigo v1.0.0 // indirect
github.com/jsambuo/go-cardano-serialization v0.0.4 // indirect
github.com/klauspost/compress v1.16.3 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/kr/text v0.2.0 // indirect
Expand Down Expand Up @@ -164,6 +171,7 @@ require (
github.com/rs/cors v1.8.3 // indirect
github.com/rs/zerolog v1.30.0 // indirect
github.com/sasha-s/go-deadlock v0.3.1 // indirect
github.com/savaki/ogmigo v0.7.4 // indirect
github.com/spf13/afero v1.9.5 // indirect
github.com/spf13/cast v1.5.1 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
Expand All @@ -174,18 +182,19 @@ require (
github.com/tidwall/btree v1.6.0 // indirect
github.com/tklauser/numcpus v0.4.0 // indirect
github.com/ulikunitz/xz v0.5.11 // indirect
github.com/utxorpc/go-codegen v0.5.1 // indirect
github.com/x448/float16 v0.8.4 // indirect
github.com/zondax/hid v0.9.1 // indirect
github.com/zondax/ledger-go v0.14.1 // indirect
go.etcd.io/bbolt v1.3.7 // indirect
go.opencensus.io v0.24.0 // indirect
go.uber.org/atomic v1.10.0 // indirect
golang.org/x/crypto v0.11.0 // indirect
golang.org/x/crypto v0.22.0 // indirect
golang.org/x/exp v0.0.0-20230711153332-06a737ee72cb // indirect
golang.org/x/net v0.12.0 // indirect
golang.org/x/net v0.21.0 // indirect
golang.org/x/oauth2 v0.8.0 // indirect
golang.org/x/sys v0.11.0 // indirect
golang.org/x/term v0.10.0 // indirect
golang.org/x/sys v0.19.0 // indirect
golang.org/x/term v0.19.0 // indirect
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
google.golang.org/api v0.126.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
Expand Down

0 comments on commit 15a8669

Please sign in to comment.