diff --git a/.github/actions/spelling/expect.txt b/.github/actions/spelling/expect.txt index 8bcc521bf..21547a7b5 100644 --- a/.github/actions/spelling/expect.txt +++ b/.github/actions/spelling/expect.txt @@ -194,6 +194,7 @@ Concluson conditionaltokens configurator confixcmd +connectd consensuskeeper consensusmodulev consensustypes diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e1bb7fa78..47240ef16 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,7 +14,7 @@ jobs: build: strategy: matrix: - image: [{file: "slinky.e2e.Dockerfile", name: "slinky-simapp"}, {file: "slinky.sidecar.prod.Dockerfile", name: "slinky-sidecar"}, {file: "slinky.local.Dockerfile", name: "slinky-testapp"}, {file: "slinky.sidecar.e2e.Dockerfile", name: "slinky-e2e-sidecar"}] + image: [{file: "connect.e2e.Dockerfile", name: "connect-simapp"}, {file: "slinky.sidecar.prod.Dockerfile", name: "slinky-sidecar"}, {file: "connect.sidecar.prod.Dockerfile", name: "connect-sidecar"}, {file: "connect.local.Dockerfile", name: "connect-testapp"}, {file: "connect.sidecar.e2e.Dockerfile", name: "connect-e2e-sidecar"}] runs-on: ubuntu-latest-m permissions: contents: read @@ -109,6 +109,6 @@ jobs: values_file_name: "values-dev.yaml" modified_values: | { - ".chain.image.tag": "${{ fromJSON(steps.matrix_output.outputs.result).image['slinky-testapp'] }}", - ".sidecar.image.tag": "${{ fromJSON(steps.matrix_output.outputs.result).image['slinky-e2e-sidecar'] }}", + ".chain.image.tag": "${{ fromJSON(steps.matrix_output.outputs.result).image['connect-testapp'] }}", + ".sidecar.image.tag": "${{ fromJSON(steps.matrix_output.outputs.result).image['connect-e2e-sidecar'] }}", } diff --git a/.goreleaser.yml b/.goreleaser.yml index ff725b066..1f4cf7e0e 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -8,7 +8,15 @@ release: prerelease: true builds: - - main: 'cmd/slinky/main.go' + - main: 'cmd/connect/main.go' + goos: + - 'linux' + - 'darwin' + binary: 'connect' + id: 'connect' + ldflags: + - "-X github.com/skip-mev/slinky/cmd/build.Build={{.Version}}" + - main: 'cmd/connect/main.go' goos: - 'linux' - 'darwin' diff --git a/Makefile b/Makefile index 4c75948c6..e40a3f7ca 100644 --- a/Makefile +++ b/Makefile @@ -4,13 +4,13 @@ export VERSION := $(shell echo $(shell git describe --always --match "v*") | sed export COMMIT := $(shell git log -1 --format='%H') export COMETBFT_VERSION := $(shell go list -m github.com/cometbft/cometbft | sed 's:.* ::') -BIN_DIR ?= $(GOPATH)/bin +BIN_DIR ?= $(shell go env GOPATH)/bin BUILD_DIR ?= $(CURDIR)/build PROJECT_NAME = $(shell git remote get-url origin | xargs basename -s .git) HTTPS_GIT := https://github.com/skip-mev/slinky.git DOCKER := $(shell which docker) DOCKER_COMPOSE := $(shell which docker-compose) -HOMEDIR ?= $(CURDIR)/tests/.slinkyd +HOMEDIR ?= $(CURDIR)/tests/.connectd GENESIS ?= $(HOMEDIR)/config/genesis.json GENESIS_TMP ?= $(HOMEDIR)/config/genesis_tmp.json APP_TOML ?= $(HOMEDIR)/config/app.toml @@ -54,6 +54,8 @@ BUILD_TAGS := -X github.com/skip-mev/slinky/cmd/build.Build=$(TAG) build: tidy go build -ldflags="$(BUILD_TAGS)" \ -o ./build/ ./... + go build -ldflags="$(BUILD_TAGS)" \ + -o ./build/slinky ./cmd/connect run-oracle-client: build @./build/client --host localhost --port 8080 @@ -75,7 +77,8 @@ stop-sidecar-dev: @$(DOCKER_COMPOSE) -f $(DEV_COMPOSE) --profile sidecar down install: tidy - @go install -ldflags="$(BUILD_TAGS)" -mod=readonly ./cmd/slinky + @go install -ldflags="$(BUILD_TAGS)" -mod=readonly ./cmd/connect + @cp $(BIN_DIR)/connect $(BIN_DIR)/slinky .PHONY: build install run-oracle-client start-all-dev stop-all-dev @@ -85,8 +88,8 @@ install: tidy docker-build: @echo "Building E2E Docker image..." - @DOCKER_BUILDKIT=1 $(DOCKER) build -t skip-mev/slinky-e2e -f contrib/images/slinky.e2e.Dockerfile . - @DOCKER_BUILDKIT=1 $(DOCKER) build -t skip-mev/slinky-e2e-oracle -f contrib/images/slinky.sidecar.dev.Dockerfile . + @DOCKER_BUILDKIT=1 $(DOCKER) build -t skip-mev/connect-e2e -f contrib/images/connect.e2e.Dockerfile . + @DOCKER_BUILDKIT=1 $(DOCKER) build -t skip-mev/connect-e2e-oracle -f contrib/images/connect.sidecar.dev.Dockerfile . .PHONY: docker-build @@ -151,13 +154,13 @@ $(BUILD_DIR)/: @mkdir -p $(BUILD_DIR)/ delete-configs: - @rm -rf ./tests/.slinkyd/ + @rm -rf ./tests/.connectd/ build-market-map: @echo "Building market map..." @sh ./scripts/genesis.sh -# build-configs builds a slinky simulation application binary in the build folder (/test/.slinkyd) +# build-configs builds a connect simulation application binary in the build folder (/test/.connectd) build-configs: delete-configs build-market-map @dasel put -r toml 'instrumentation.enabled' -f $(CONFIG_TOML) -t bool -v true @dasel put -r toml 'rpc.laddr' -f $(CONFIG_TOML) -t string -v "tcp://0.0.0.0:26657" @@ -167,12 +170,12 @@ build-configs: delete-configs build-market-map @dasel put -r toml 'api.address' -f $(APP_TOML) -t string -v "tcp://0.0.0.0:1317" @dasel put -r toml 'api.enabled-unsafe-cors' -f $(APP_TOML) -t bool -v true -# start-app starts a slinky simulation application binary in the build folder (/test/.slinkyd) +# start-app starts a connect simulation application binary in the build folder (/test/.connectd) # this will set the environment variable for running locally start-app: - @./build/slinkyd start --log_level info --home $(HOMEDIR) + @./build/connectd start --log_level info --home $(HOMEDIR) -# build-and-start-app builds a slinky simulation application binary in the build folder +# build-and-start-app builds a connect simulation application binary in the build folder # and initializes a single validator configuration. If desired, users can supplement # other addresses using "genesis add-genesis-account address 10000000000000000000000000stake". # This will allow users to bootstrap their wallet with a balance. diff --git a/cmd/slinky/config/config.go b/cmd/connect/config/config.go similarity index 100% rename from cmd/slinky/config/config.go rename to cmd/connect/config/config.go diff --git a/cmd/slinky/config/config_test.go b/cmd/connect/config/config_test.go similarity index 99% rename from cmd/slinky/config/config_test.go rename to cmd/connect/config/config_test.go index 5f6c2a247..f18789d7c 100644 --- a/cmd/slinky/config/config_test.go +++ b/cmd/connect/config/config_test.go @@ -8,7 +8,7 @@ import ( "github.com/stretchr/testify/require" - cmdconfig "github.com/skip-mev/slinky/cmd/slinky/config" + cmdconfig "github.com/skip-mev/slinky/cmd/connect/config" oracleconfig "github.com/skip-mev/slinky/oracle/config" "github.com/skip-mev/slinky/providers/apis/defi/raydium" "github.com/skip-mev/slinky/providers/apis/marketmap" diff --git a/cmd/slinky/main.go b/cmd/connect/main.go similarity index 99% rename from cmd/slinky/main.go rename to cmd/connect/main.go index 62c3e0fd2..e09692fd7 100644 --- a/cmd/slinky/main.go +++ b/cmd/connect/main.go @@ -16,7 +16,7 @@ import ( "go.uber.org/zap" "github.com/skip-mev/slinky/cmd/build" - cmdconfig "github.com/skip-mev/slinky/cmd/slinky/config" + cmdconfig "github.com/skip-mev/slinky/cmd/connect/config" "github.com/skip-mev/slinky/oracle" "github.com/skip-mev/slinky/oracle/config" oraclemetrics "github.com/skip-mev/slinky/oracle/metrics" @@ -33,7 +33,7 @@ import ( var ( rootCmd = &cobra.Command{ Use: "oracle", - Short: "Run the slinky oracle server.", + Short: "Run the connect oracle server.", Args: cobra.NoArgs, RunE: func(_ *cobra.Command, _ []string) error { return runOracle() diff --git a/contrib/compose/docker-compose-dev.yml b/contrib/compose/docker-compose-dev.yml index 734d8f5f3..25663c1e9 100644 --- a/contrib/compose/docker-compose-dev.yml +++ b/contrib/compose/docker-compose-dev.yml @@ -6,7 +6,7 @@ services: market_generator: build: context: ../.. - dockerfile: ./contrib/images/slinky.generator.dev.Dockerfile + dockerfile: ./contrib/images/connect.generator.dev.Dockerfile entrypoint: [ "/usr/local/bin/scripts", "--use-core=$USE_CORE_MARKETS", @@ -36,11 +36,11 @@ services: oracle: build: context: ../.. - dockerfile: ./contrib/images/slinky.sidecar.dev.Dockerfile + dockerfile: ./contrib/images/connect.sidecar.dev.Dockerfile environment: - SLINKY_CONFIG_UPDATEINTERVAL=${SLINKY_CONFIG_UPDATEINTERVAL:-250ms} entrypoint: [ - "slinky", + "connect", "--market-config-path", "/data/markets.json", "--pprof-port", "6060", "--run-pprof", @@ -68,7 +68,7 @@ services: - USE_OSMOSIS_MARKETS=${USE_OSMOSIS_MARKETS:-false} build: context: ../.. - dockerfile: ./contrib/images/slinky.local.Dockerfile + dockerfile: ./contrib/images/connect.local.Dockerfile ports: - "26656:26656" - "26657:26657" @@ -85,9 +85,9 @@ services: oracle_with_blockchain: build: context: ../.. - dockerfile: ./contrib/images/slinky.sidecar.dev.Dockerfile + dockerfile: ./contrib/images/connect.sidecar.dev.Dockerfile entrypoint: [ - "slinky", + "connect", "--update-market-config-path", "/oracle/market.json", "--market-map-endpoint", "blockchain:9090", "--pprof-port", "6060", diff --git a/contrib/images/slinky.base.Dockerfile b/contrib/images/connect.base.Dockerfile similarity index 100% rename from contrib/images/slinky.base.Dockerfile rename to contrib/images/connect.base.Dockerfile diff --git a/contrib/images/slinky.e2e.Dockerfile b/contrib/images/connect.e2e.Dockerfile similarity index 60% rename from contrib/images/slinky.e2e.Dockerfile rename to contrib/images/connect.e2e.Dockerfile index 44323f854..6c53f4896 100644 --- a/contrib/images/slinky.e2e.Dockerfile +++ b/contrib/images/connect.e2e.Dockerfile @@ -1,6 +1,6 @@ -FROM ghcr.io/skip-mev/slinky-dev-base AS builder +FROM ghcr.io/skip-mev/connect-dev-base AS builder -WORKDIR /src/slinky +WORKDIR /src/connect COPY go.mod . @@ -12,11 +12,11 @@ RUN make build-test-app ## Prepare the final clear binary ## This will expose the tendermint and cosmos ports alongside -## starting up the sim app and the slinky daemon +## starting up the sim app and the connect daemon FROM ubuntu:rolling EXPOSE 26656 26657 1317 9090 7171 26655 8081 26660 RUN apt-get update && apt-get install jq -y && apt-get install ca-certificates -y -ENTRYPOINT ["slinkyd", "start"] +ENTRYPOINT ["connectd", "start"] -COPY --from=builder /src/slinky/build/* /usr/local/bin/ +COPY --from=builder /src/connect/build/* /usr/local/bin/ diff --git a/contrib/images/slinky.generator.dev.Dockerfile b/contrib/images/connect.generator.dev.Dockerfile similarity index 77% rename from contrib/images/slinky.generator.dev.Dockerfile rename to contrib/images/connect.generator.dev.Dockerfile index 89d44761f..57bd36ad9 100644 --- a/contrib/images/slinky.generator.dev.Dockerfile +++ b/contrib/images/connect.generator.dev.Dockerfile @@ -1,9 +1,9 @@ -# ./contrib/images/slinky.generator.dev.Dockerfile +# ./contrib/images/connect.generator.dev.Dockerfile # Stage 1: Build the Go application FROM golang:1.22 AS builder -WORKDIR /src/slinky +WORKDIR /src/connect COPY go.mod . @@ -15,7 +15,7 @@ RUN make build # Stage 2: Create a lightweight image for running the application FROM ubuntu:rolling -COPY --from=builder /src/slinky/build/* /usr/local/bin/ +COPY --from=builder /src/connect/build/* /usr/local/bin/ # Create the /data directory RUN mkdir -p /data diff --git a/contrib/images/slinky.local.Dockerfile b/contrib/images/connect.local.Dockerfile similarity index 74% rename from contrib/images/slinky.local.Dockerfile rename to contrib/images/connect.local.Dockerfile index a7f9b7d83..d1de6e102 100644 --- a/contrib/images/slinky.local.Dockerfile +++ b/contrib/images/connect.local.Dockerfile @@ -1,6 +1,6 @@ -FROM ghcr.io/skip-mev/slinky-dev-base AS builder +FROM ghcr.io/skip-mev/connect-dev-base AS builder -WORKDIR /src/slinky +WORKDIR /src/connect COPY go.mod . @@ -12,7 +12,7 @@ RUN make build-test-app ## Prepare the final clear binary ## This will expose the tendermint and cosmos ports alongside -## starting up the sim app and the slinky daemon +## starting up the sim app and the connect daemon EXPOSE 26656 26657 1317 9090 7171 26655 8081 26660 RUN apt-get update && apt-get install jq -y && apt-get install ca-certificates -y ENTRYPOINT ["make", "build-and-start-app"] diff --git a/contrib/images/slinky.sidecar.dev.Dockerfile b/contrib/images/connect.sidecar.dev.Dockerfile similarity index 57% rename from contrib/images/slinky.sidecar.dev.Dockerfile rename to contrib/images/connect.sidecar.dev.Dockerfile index c45a14630..164e40b2b 100644 --- a/contrib/images/slinky.sidecar.dev.Dockerfile +++ b/contrib/images/connect.sidecar.dev.Dockerfile @@ -1,6 +1,6 @@ -FROM ghcr.io/skip-mev/slinky-dev-base AS builder +FROM ghcr.io/skip-mev/connect-dev-base AS builder -WORKDIR /src/slinky +WORKDIR /src/connect COPY go.mod . @@ -13,8 +13,8 @@ RUN make build FROM ubuntu:rolling EXPOSE 8080 8002 -COPY --from=builder /src/slinky/build/* /usr/local/bin/ +COPY --from=builder /src/connect/build/* /usr/local/bin/ RUN apt-get update && apt-get install jq -y && apt-get install ca-certificates -y WORKDIR /usr/local/bin/ -ENTRYPOINT [ "slinky" ] +ENTRYPOINT [ "connect" ] diff --git a/contrib/images/slinky.sidecar.e2e.Dockerfile b/contrib/images/connect.sidecar.e2e.Dockerfile similarity index 54% rename from contrib/images/slinky.sidecar.e2e.Dockerfile rename to contrib/images/connect.sidecar.e2e.Dockerfile index 4effb42c4..9a8d1bc12 100644 --- a/contrib/images/slinky.sidecar.e2e.Dockerfile +++ b/contrib/images/connect.sidecar.e2e.Dockerfile @@ -1,6 +1,6 @@ -FROM ghcr.io/skip-mev/slinky-dev-base AS builder +FROM ghcr.io/skip-mev/connect-dev-base AS builder -WORKDIR /src/slinky +WORKDIR /src/connect COPY go.mod . @@ -13,8 +13,8 @@ RUN make build FROM ubuntu:rolling EXPOSE 8080 8002 -COPY --from=builder /src/slinky/build/* /usr/local/bin/ +COPY --from=builder /src/connect/build/* /usr/local/bin/ RUN apt-get update && apt-get install -y ca-certificates WORKDIR /usr/local/bin/ -ENTRYPOINT [ "slinky" ] +ENTRYPOINT [ "connect" ] diff --git a/contrib/images/connect.sidecar.prod.Dockerfile b/contrib/images/connect.sidecar.prod.Dockerfile new file mode 100644 index 000000000..304a86e1b --- /dev/null +++ b/contrib/images/connect.sidecar.prod.Dockerfile @@ -0,0 +1,19 @@ +FROM ghcr.io/skip-mev/connect-dev-base AS builder + +WORKDIR /src/connect + +COPY go.mod . + +RUN go mod download + +COPY . . + +RUN make build + +FROM gcr.io/distroless/base-debian11:debug +EXPOSE 8080 8002 + +COPY --from=builder /src/connect/build/* /usr/local/bin/ + +WORKDIR /usr/local/bin/ +CMD [ "connect" ] diff --git a/contrib/images/slinky.sidecar.prod.Dockerfile b/contrib/images/slinky.sidecar.prod.Dockerfile index f448885e7..fd1158fda 100644 --- a/contrib/images/slinky.sidecar.prod.Dockerfile +++ b/contrib/images/slinky.sidecar.prod.Dockerfile @@ -1,6 +1,6 @@ -FROM ghcr.io/skip-mev/slinky-dev-base AS builder +FROM ghcr.io/skip-mev/connect-dev-base AS builder -WORKDIR /src/slinky +WORKDIR /src/connect COPY go.mod . @@ -13,7 +13,9 @@ RUN make build FROM gcr.io/distroless/base-debian11:debug EXPOSE 8080 8002 -COPY --from=builder /src/slinky/build/* /usr/local/bin/ +COPY --from=builder /src/connect/build/* /usr/local/bin/ +COPY --from=builder /src/connect/scripts/deprecated-exec.sh /usr/local/bin/ WORKDIR /usr/local/bin/ -ENTRYPOINT [ "slinky" ] +ENTRYPOINT [ "deprecated-exec.sh" ] +CMD [ "slinky" ] diff --git a/scripts/deprecated-exec.sh b/scripts/deprecated-exec.sh new file mode 100755 index 000000000..202ef8abd --- /dev/null +++ b/scripts/deprecated-exec.sh @@ -0,0 +1,17 @@ +#!/busybox/sh + +echo " + _ + | | + ___| |_ ___ _ __ +/ __| __/ _ \| '_ \ +\__ \ || (_) | |_) | +|___/\__\___/| .__/ + | | + |_| + +WARNING: This container is deprecated and will be removed in future releases. +Please migrate to the corresponding Connect image." + +# Execute the binary passed as arguments +exec "$@" \ No newline at end of file diff --git a/tests/integration/slinky_integration_test.go b/tests/integration/slinky_integration_test.go index 7aad16b56..aa9c922ff 100644 --- a/tests/integration/slinky_integration_test.go +++ b/tests/integration/slinky_integration_test.go @@ -23,7 +23,7 @@ import ( var ( image = ibc.DockerImage{ - Repository: "skip-mev/slinky-e2e", + Repository: "skip-mev/connect-e2e", Version: "latest", UidGid: "1000:1000", } @@ -34,7 +34,7 @@ var ( gasAdjustment = 1.5 oracleImage = ibc.DockerImage{ - Repository: "skip-mev/slinky-e2e-oracle", + Repository: "skip-mev/connect-e2e-oracle", Version: "latest", UidGid: "1000:1000", } @@ -90,8 +90,8 @@ var ( denom = "stake" spec = &interchaintest.ChainSpec{ - ChainName: "slinky", - Name: "slinky", + ChainName: "connect", + Name: "connect", NumValidators: &numValidators, NumFullNodes: &numFullNodes, Version: "latest", @@ -102,10 +102,10 @@ var ( image, }, Type: "cosmos", - Name: "slinky", + Name: "connect", Denom: denom, ChainID: "chain-id-0", - Bin: "slinkyd", + Bin: "connectd", Bech32Prefix: "cosmos", CoinType: "118", GasAdjustment: gasAdjustment, diff --git a/tests/integration/slinky_suite.go b/tests/integration/slinky_suite.go index f3eeda53b..35b9764bf 100644 --- a/tests/integration/slinky_suite.go +++ b/tests/integration/slinky_suite.go @@ -47,7 +47,7 @@ func DefaultOracleSidecar(image ibc.DockerImage) ibc.SidecarConfig { HomeDir: "/oracle", Ports: []string{"8080", "8081"}, StartCmd: []string{ - "slinky", + "connect", "--oracle-config", "/oracle/oracle.json", }, ValidatorProcess: true, diff --git a/tests/petri/chain_config.go b/tests/petri/chain_config.go index 193a052c6..33308121c 100644 --- a/tests/petri/chain_config.go +++ b/tests/petri/chain_config.go @@ -26,14 +26,14 @@ func GetChainConfig() types.ChainConfig { Decimals: 6, NumValidators: 4, NumNodes: 2, - BinaryName: "slinkyd", + BinaryName: "connectd", Image: provider.ImageDefinition{ - Image: "skip-mev/slinky-e2e", + Image: "skip-mev/connect-e2e", UID: "1000", GID: "1000", }, SidecarImage: provider.ImageDefinition{ - Image: "skip-mev/slinky-e2e-oracle", + Image: "skip-mev/connect-e2e-oracle", UID: "1000", GID: "1000", }, diff --git a/tests/simapp/slinkyd/main.go b/tests/simapp/connectd/main.go similarity index 85% rename from tests/simapp/slinkyd/main.go rename to tests/simapp/connectd/main.go index 267de3ba9..9def26047 100644 --- a/tests/simapp/slinkyd/main.go +++ b/tests/simapp/connectd/main.go @@ -7,7 +7,7 @@ import ( svrcmd "github.com/cosmos/cosmos-sdk/server/cmd" "github.com/skip-mev/slinky/tests/simapp" - cmd "github.com/skip-mev/slinky/tests/simapp/slinkyd/testappd" + cmd "github.com/skip-mev/slinky/tests/simapp/connectd/testappd" ) func main() { diff --git a/tests/simapp/slinkyd/testappd/cmd_test.go b/tests/simapp/connectd/testappd/cmd_test.go similarity index 100% rename from tests/simapp/slinkyd/testappd/cmd_test.go rename to tests/simapp/connectd/testappd/cmd_test.go diff --git a/tests/simapp/slinkyd/testappd/root.go b/tests/simapp/connectd/testappd/root.go similarity index 100% rename from tests/simapp/slinkyd/testappd/root.go rename to tests/simapp/connectd/testappd/root.go diff --git a/tests/simapp/slinkyd/testappd/testnet.go b/tests/simapp/connectd/testappd/testnet.go similarity index 100% rename from tests/simapp/slinkyd/testappd/testnet.go rename to tests/simapp/connectd/testappd/testnet.go