Skip to content

Commit

Permalink
chore: Rename slinky=>connect (#669)
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric-Warehime authored Aug 14, 2024
1 parent 4aa8c56 commit e453035
Show file tree
Hide file tree
Showing 24 changed files with 107 additions and 57 deletions.
1 change: 1 addition & 0 deletions .github/actions/spelling/expect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ Concluson
conditionaltokens
configurator
confixcmd
connectd
consensuskeeper
consensusmodulev
consensustypes
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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'] }}",
}
10 changes: 9 additions & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
23 changes: 13 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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

Expand All @@ -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

Expand Down Expand Up @@ -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"
Expand All @@ -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.
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions cmd/slinky/main.go → cmd/connect/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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()
Expand Down
12 changes: 6 additions & 6 deletions contrib/compose/docker-compose-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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"
Expand All @@ -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",
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -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 .

Expand All @@ -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/
Original file line number Diff line number Diff line change
@@ -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 .

Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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 .

Expand All @@ -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"]
Expand Down
Original file line number Diff line number Diff line change
@@ -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 .

Expand All @@ -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" ]
Original file line number Diff line number Diff line change
@@ -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 .

Expand All @@ -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" ]
19 changes: 19 additions & 0 deletions contrib/images/connect.sidecar.prod.Dockerfile
Original file line number Diff line number Diff line change
@@ -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" ]
10 changes: 6 additions & 4 deletions contrib/images/slinky.sidecar.prod.Dockerfile
Original file line number Diff line number Diff line change
@@ -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 .

Expand All @@ -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" ]
17 changes: 17 additions & 0 deletions scripts/deprecated-exec.sh
Original file line number Diff line number Diff line change
@@ -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 "$@"
12 changes: 6 additions & 6 deletions tests/integration/slinky_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (

var (
image = ibc.DockerImage{
Repository: "skip-mev/slinky-e2e",
Repository: "skip-mev/connect-e2e",
Version: "latest",
UidGid: "1000:1000",
}
Expand All @@ -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",
}
Expand Down Expand Up @@ -90,8 +90,8 @@ var (

denom = "stake"
spec = &interchaintest.ChainSpec{
ChainName: "slinky",
Name: "slinky",
ChainName: "connect",
Name: "connect",
NumValidators: &numValidators,
NumFullNodes: &numFullNodes,
Version: "latest",
Expand All @@ -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,
Expand Down
Loading

0 comments on commit e453035

Please sign in to comment.