Skip to content

Commit

Permalink
Merge branch 'develop' into add-release-flow
Browse files Browse the repository at this point in the history
  • Loading branch information
gzukel authored Nov 2, 2023
2 parents a6f65f2 + af8c8a1 commit 2c5150e
Show file tree
Hide file tree
Showing 18 changed files with 117 additions and 43 deletions.
40 changes: 40 additions & 0 deletions Dockerfile-release
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
FROM golang:1.20-alpine as builder

ENV GOPATH /go
ENV GOOS=linux
ENV CGO_ENABLED=1

WORKDIR /go/delivery/zeta-node

RUN apk update && \
apk --no-cache add git make build-base jq openssh libusb-dev linux-headers bash curl tmux

COPY go.mod .
COPY go.sum .

RUN --mount=type=cache,target=/root/.cache/go-build \
go mod download

COPY . .

RUN --mount=type=cache,target=/root/.cache/go-build \
make install

RUN cp /go/bin/zetaclientd /usr/local/bin
RUN cp /go/bin/zetacored /usr/local/bin
RUN cp /go/bin/smoketest /usr/local/bin

#BUILD MAIN BINARY IMAGE
FROM golang:1.20-alpine

RUN apk --no-cache add jq bash curl wget nano tmux

COPY --chmod=765 --from=builder /usr/local/bin/zetaclientd /usr/local/bin/zetaclientd
COPY --chmod=765 --from=builder /usr/local/bin/zetacored /usr/local/bin/zetacored

WORKDIR /root/zetachain/

EXPOSE 26657
EXPOSE 26656
EXPOSE 1317
EXPOSE 9090
6 changes: 3 additions & 3 deletions cmd/zetaclientd/keygen_tss.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ import (
"github.com/rs/zerolog"
"github.com/tendermint/crypto/sha3"
"github.com/tendermint/tendermint/crypto/secp256k1"
tsscommon "github.com/zeta-chain/go-tss/common"
"github.com/zeta-chain/go-tss/keygen"
"github.com/zeta-chain/go-tss/p2p"
"github.com/zeta-chain/zetacore/common"
"github.com/zeta-chain/zetacore/x/crosschain/types"
observerTypes "github.com/zeta-chain/zetacore/x/observer/types"
mc "github.com/zeta-chain/zetacore/zetaclient"
"github.com/zeta-chain/zetacore/zetaclient/config"
"github.com/zeta-chain/zetacore/zetaclient/metrics"
tsscommon "gitlab.com/thorchain/tss/go-tss/common"
"gitlab.com/thorchain/tss/go-tss/keygen"
"gitlab.com/thorchain/tss/go-tss/p2p"
)

func GenerateTss(logger zerolog.Logger, cfg *config.Config, zetaBridge *mc.ZetaCoreBridge, peers p2p.AddrList, priKey secp256k1.PrivKey, ts *mc.TelemetryServer, tssHistoricalList []types.TSS, metrics *metrics.Metrics) (*mc.TSS, error) {
Expand Down
2 changes: 1 addition & 1 deletion cmd/zetaclientd/main.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package main

import (
ecdsakeygen "github.com/binance-chain/tss-lib/ecdsa/keygen"
"github.com/cosmos/cosmos-sdk/server"
svrcmd "github.com/cosmos/cosmos-sdk/server/cmd"
"github.com/rs/zerolog"
ecdsakeygen "github.com/zeta-chain/tss-lib/ecdsa/keygen"
"github.com/zeta-chain/zetacore/zetaclient/config"

"github.com/zeta-chain/zetacore/cmd"
Expand Down
2 changes: 1 addition & 1 deletion cmd/zetaclientd/p2p_diagnostics.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ import (
maddr "github.com/multiformats/go-multiaddr"
"github.com/rs/zerolog"
"github.com/tendermint/tendermint/crypto/secp256k1"
"github.com/zeta-chain/go-tss/p2p"
"github.com/zeta-chain/zetacore/common/cosmos"
mc "github.com/zeta-chain/zetacore/zetaclient"
"github.com/zeta-chain/zetacore/zetaclient/config"
"gitlab.com/thorchain/tss/go-tss/p2p"
)

func RunDiagnostics(startLogger zerolog.Logger, peers p2p.AddrList, bridgePk cryptotypes.PrivKey, cfg *config.Config) error {
Expand Down
2 changes: 1 addition & 1 deletion cmd/zetaclientd/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ import (
"github.com/rs/zerolog/log"
"github.com/spf13/cobra"
"github.com/tendermint/tendermint/crypto/secp256k1"
"github.com/zeta-chain/go-tss/p2p"
"github.com/zeta-chain/zetacore/common"
"github.com/zeta-chain/zetacore/x/crosschain/types"
observerTypes "github.com/zeta-chain/zetacore/x/observer/types"
mc "github.com/zeta-chain/zetacore/zetaclient"
"github.com/zeta-chain/zetacore/zetaclient/config"
metrics2 "github.com/zeta-chain/zetacore/zetaclient/metrics"
"gitlab.com/thorchain/tss/go-tss/p2p"
)

type Multiaddr = core.Multiaddr
Expand Down
4 changes: 2 additions & 2 deletions contrib/localnet/orchestrator/smoketest/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ func LocalSmokeTest(_ *cobra.Command, _ []string) {
observerClient := observertypes.NewQueryClient(grpcConn)

//Wait for Genesis
time.Sleep(20 * time.Second)
time.Sleep(30 * time.Second)

// initialize client to send messages to ZetaChain
zetaTxServer, err := NewZetaTxServer(
Expand All @@ -175,7 +175,7 @@ func LocalSmokeTest(_ *cobra.Command, _ []string) {
fmt.Printf("cctxClient.LastZetaHeight error: %s", err)
continue
}
if response.Height >= 30 {
if response.Height >= 60 {
break
}
fmt.Printf("Last ZetaHeight: %d\n", response.Height)
Expand Down
2 changes: 1 addition & 1 deletion contrib/localnet/scripts/genesis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ then

# 2. Add the observers, authorizations, required params and accounts to the genesis.json
zetacored collect-observer-info
zetacored add-observer-list
zetacored add-observer-list --keygen-block 55
cat $HOME/.zetacored/config/genesis.json | jq '.app_state["staking"]["params"]["bond_denom"]="azeta"' > $HOME/.zetacored/config/tmp_genesis.json && mv $HOME/.zetacored/config/tmp_genesis.json $HOME/.zetacored/config/genesis.json
cat $HOME/.zetacored/config/genesis.json | jq '.app_state["crisis"]["constant_fee"]["denom"]="azeta"' > $HOME/.zetacored/config/tmp_genesis.json && mv $HOME/.zetacored/config/tmp_genesis.json $HOME/.zetacored/config/genesis.json
cat $HOME/.zetacored/config/genesis.json | jq '.app_state["gov"]["deposit_params"]["min_deposit"][0]["denom"]="azeta"' > $HOME/.zetacored/config/tmp_genesis.json && mv $HOME/.zetacored/config/tmp_genesis.json $HOME/.zetacored/config/genesis.json
Expand Down
6 changes: 5 additions & 1 deletion contrib/localnet/scripts/start-zetaclientd-genesis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ else
num=$(echo $HOSTNAME | tr -dc '0-9')
node="zetacore$num"
MYIP=$(/sbin/ip -o -4 addr list eth0 | awk '{print $4}' | cut -d/ -f1)
SEED=$(curl --retry 10 --retry-delay 5 --retry-connrefused -s zetaclient0:8123/p2p)
SEED=""
while [ -z "$SEED" ]
do
SEED=$(curl --retry 10 --retry-delay 5 --retry-connrefused -s zetaclient0:8123/p2p)
done
rm ~/.tss/*
zetaclientd init --peer /ip4/172.20.0.21/tcp/6668/p2p/"$SEED" --zetacore-url "$node" --chain-id athens_101-1 --operator "$operatorAddress" --log-format=text --public-ip "$MYIP" --log-level 0
zetaclientd start
Expand Down
11 changes: 6 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ require (
cosmossdk.io/errors v1.0.0-beta.7
cosmossdk.io/math v1.0.0-rc.0
github.com/99designs/keyring v1.2.1
github.com/binance-chain/tss-lib v1.3.2
github.com/btcsuite/btcd v0.23.4
github.com/btcsuite/btcd/btcec/v2 v2.3.2
github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1
Expand All @@ -41,8 +40,9 @@ require (
github.com/pkg/errors v0.9.1
github.com/rakyll/statik v0.1.7
github.com/tendermint/crypto v0.0.0-20191022145703-50d29ede1e15
github.com/zeta-chain/go-tss v0.1.0
github.com/zeta-chain/protocol-contracts v1.0.2-athens3.0.20230816152528-db7d2bf9144b
gitlab.com/thorchain/tss/go-tss v0.0.0-00010101000000-000000000000
github.com/zeta-chain/tss-lib v0.1.7
google.golang.org/genproto/googleapis/api v0.0.0-20230530153820-e85fd2cbaebc
gopkg.in/yaml.v2 v2.4.0
)
Expand All @@ -57,6 +57,8 @@ require (

require (
github.com/DataDog/zstd v1.5.2 // indirect
github.com/agl/ed25519 v0.0.0-20200225211852-fd4d107ace12 // indirect
github.com/bnb-chain/tss-lib v1.5.0 // indirect
github.com/btcsuite/btcd/btcutil v1.1.3 // indirect
github.com/cespare/xxhash v1.1.0 // indirect
github.com/cockroachdb/errors v1.9.1 // indirect
Expand All @@ -65,6 +67,7 @@ require (
github.com/cockroachdb/redact v1.1.3 // indirect
github.com/cometbft/cometbft-db v0.7.0 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
github.com/decred/dcrd/dcrec/edwards/v2 v2.0.0 // indirect
github.com/dgraph-io/badger/v2 v2.2007.4 // indirect
github.com/dgraph-io/ristretto v0.1.0 // indirect
github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect
Expand Down Expand Up @@ -315,7 +318,7 @@ require (
)

replace (
github.com/binance-chain/tss-lib => gitlab.com/thorchain/tss/tss-lib v0.0.0-20201118045712-70b2cb4bf916
github.com/agl/ed25519 => github.com/binance-chain/edwards25519 v0.0.0-20200305024217-f36fc4b53d43
github.com/btcsuite/btcd => github.com/btcsuite/btcd v0.22.3
github.com/confio/ics23/go => github.com/cosmos/cosmos-sdk/ics23/go v0.8.0

Expand All @@ -326,8 +329,6 @@ replace (
// use cometbft
github.com/tendermint/tendermint => github.com/cometbft/cometbft v0.34.28
github.com/tendermint/tm-db => github.com/BlockPILabs/cosmos-db v0.0.3
gitlab.com/thorchain/tss/go-tss => github.com/brewmaster012/go-tss v0.0.0-20230724230849-ce080275bbad

)

replace github.com/cometbft/cometbft-db => github.com/notional-labs/cometbft-db v0.0.0-20230321185329-6dc7c0ca6345
Loading

0 comments on commit 2c5150e

Please sign in to comment.