Skip to content

Commit

Permalink
plugins/cmd/chainlink-median: move to chainlink-feeds
Browse files Browse the repository at this point in the history
  • Loading branch information
jmank88 committed Nov 13, 2023
1 parent 58b0e25 commit 5f49586
Show file tree
Hide file tree
Showing 11 changed files with 21 additions and 121 deletions.
4 changes: 0 additions & 4 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,6 @@ chainlink-test: operator-ui ## Build a test build of chainlink binary.
chainlink-local-start:
./chainlink -c /etc/node-secrets-volume/default.toml -c /etc/node-secrets-volume/overrides.toml -secrets /etc/node-secrets-volume/secrets.toml node start -d -p /etc/node-secrets-volume/node-password -a /etc/node-secrets-volume/apicredentials --vrfpassword=/etc/node-secrets-volume/apicredentials

.PHONY: install-median
install-median: ## Build & install the chainlink-median binary.
go install $(GOFLAGS) ./plugins/cmd/chainlink-median

.PHONY: install-medianpoc
install-medianpoc: ## Build & install the chainlink-medianpoc binary.
go install $(GOFLAGS) ./plugins/cmd/chainlink-medianpoc
Expand Down
3 changes: 2 additions & 1 deletion core/scripts/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/smartcontractkit/chainlink/core/scripts

go 1.21
go 1.21.3

// Make sure we're working with the latest chainlink libs
replace github.com/smartcontractkit/chainlink/v2 => ../../
Expand Down Expand Up @@ -304,6 +304,7 @@ require (
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704 // indirect
github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20231109141932-cb1ea9020255 // indirect
github.com/smartcontractkit/chainlink-feeds v0.0.0-20231113191030-806c6b08541d // indirect
github.com/smartcontractkit/chainlink-relay v0.1.7-0.20231113174149-046d4ddaca1a // indirect
github.com/smartcontractkit/chainlink-solana v1.0.3-0.20231023133638-72f4e799ab05 // indirect
github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20231024133459-1ef3a11319eb // indirect
Expand Down
2 changes: 2 additions & 0 deletions core/scripts/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1464,6 +1464,8 @@ github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704 h1:T3lFWumv
github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704/go.mod h1:2QuJdEouTWjh5BDy5o/vgGXQtR4Gz8yH1IYB5eT7u4M=
github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20231109141932-cb1ea9020255 h1:Pt6c7bJU9wIN6PQQnmN8UmYYH6lpfiQ6U/B8yEC2s5s=
github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20231109141932-cb1ea9020255/go.mod h1:EHppaccd/LTlTMI2o4dmBHe4BknEgEFFDjDGMNuGb3k=
github.com/smartcontractkit/chainlink-feeds v0.0.0-20231113191030-806c6b08541d h1:v4yF2Uc5TIiPSESB4HMERQe86fIkettXoKaLSw0w9PM=
github.com/smartcontractkit/chainlink-feeds v0.0.0-20231113191030-806c6b08541d/go.mod h1:NRk1Qup2AtPr9ToOAv0zeOv5EbYMMJ+hjlepsTJfKpI=
github.com/smartcontractkit/chainlink-relay v0.1.7-0.20231113174149-046d4ddaca1a h1:G/pD8uI1PULRJU8Y3eLLzjqQBp9ruG9hj+wWxtyrgTo=
github.com/smartcontractkit/chainlink-relay v0.1.7-0.20231113174149-046d4ddaca1a/go.mod h1:M9U1JV7IQi8Sfj4JR1qSi1tIh6omgW78W/8SHN/8BUQ=
github.com/smartcontractkit/chainlink-solana v1.0.3-0.20231023133638-72f4e799ab05 h1:DaPSVnxe7oz1QJ+AVIhQWs1W3ubQvwvGo9NbHpMs1OQ=
Expand Down
69 changes: 0 additions & 69 deletions core/services/ocr2/plugins/median/plugin.go

This file was deleted.

3 changes: 2 additions & 1 deletion core/services/ocr2/plugins/median/services.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (

libocr "github.com/smartcontractkit/libocr/offchainreporting2plus"

"github.com/smartcontractkit/chainlink-feeds/median"
"github.com/smartcontractkit/chainlink-relay/pkg/loop"
"github.com/smartcontractkit/chainlink-relay/pkg/types"

Expand Down Expand Up @@ -125,7 +126,7 @@ func NewMedianServices(ctx context.Context,
argsNoPlugin.ReportingPluginFactory = median
srvs = append(srvs, median)
} else {
argsNoPlugin.ReportingPluginFactory, err = NewPlugin(lggr).NewMedianFactory(ctx, medianProvider, dataSource, juelsPerFeeCoinSource, errorLog)
argsNoPlugin.ReportingPluginFactory, err = median.NewPlugin(lggr).NewMedianFactory(ctx, medianProvider, dataSource, juelsPerFeeCoinSource, errorLog)
if err != nil {
err = fmt.Errorf("failed to create median factory: %w", err)
abort()
Expand Down
5 changes: 3 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/smartcontractkit/chainlink/v2

go 1.21
go 1.21.3

require (
github.com/Depado/ginprom v1.7.11
Expand Down Expand Up @@ -32,7 +32,6 @@ require (
github.com/graph-gophers/dataloader v5.0.0+incompatible
github.com/graph-gophers/graphql-go v1.3.0
github.com/hashicorp/consul/sdk v0.14.1
github.com/hashicorp/go-plugin v1.5.2
github.com/hdevalence/ed25519consensus v0.1.0
github.com/jackc/pgconn v1.14.1
github.com/jackc/pgtype v1.14.0
Expand Down Expand Up @@ -66,6 +65,7 @@ require (
github.com/shopspring/decimal v1.3.1
github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704
github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20231109141932-cb1ea9020255
github.com/smartcontractkit/chainlink-feeds v0.0.0-20231113191030-806c6b08541d
github.com/smartcontractkit/chainlink-relay v0.1.7-0.20231113174149-046d4ddaca1a
github.com/smartcontractkit/chainlink-solana v1.0.3-0.20231023133638-72f4e799ab05
github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20231024133459-1ef3a11319eb
Expand Down Expand Up @@ -212,6 +212,7 @@ require (
github.com/hashicorp/go-hclog v1.5.0 // indirect
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/go-plugin v1.5.2
github.com/hashicorp/golang-lru v0.6.0 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/hashicorp/yamux v0.0.0-20200609203250-aecfd211c9ce // indirect
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1465,6 +1465,8 @@ github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704 h1:T3lFWumv
github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704/go.mod h1:2QuJdEouTWjh5BDy5o/vgGXQtR4Gz8yH1IYB5eT7u4M=
github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20231109141932-cb1ea9020255 h1:Pt6c7bJU9wIN6PQQnmN8UmYYH6lpfiQ6U/B8yEC2s5s=
github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20231109141932-cb1ea9020255/go.mod h1:EHppaccd/LTlTMI2o4dmBHe4BknEgEFFDjDGMNuGb3k=
github.com/smartcontractkit/chainlink-feeds v0.0.0-20231113191030-806c6b08541d h1:v4yF2Uc5TIiPSESB4HMERQe86fIkettXoKaLSw0w9PM=
github.com/smartcontractkit/chainlink-feeds v0.0.0-20231113191030-806c6b08541d/go.mod h1:NRk1Qup2AtPr9ToOAv0zeOv5EbYMMJ+hjlepsTJfKpI=
github.com/smartcontractkit/chainlink-relay v0.1.7-0.20231113174149-046d4ddaca1a h1:G/pD8uI1PULRJU8Y3eLLzjqQBp9ruG9hj+wWxtyrgTo=
github.com/smartcontractkit/chainlink-relay v0.1.7-0.20231113174149-046d4ddaca1a/go.mod h1:M9U1JV7IQi8Sfj4JR1qSi1tIh6omgW78W/8SHN/8BUQ=
github.com/smartcontractkit/chainlink-solana v1.0.3-0.20231023133638-72f4e799ab05 h1:DaPSVnxe7oz1QJ+AVIhQWs1W3ubQvwvGo9NbHpMs1OQ=
Expand Down
3 changes: 2 additions & 1 deletion integration-tests/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/smartcontractkit/chainlink/integration-tests

go 1.21
go 1.21.3

// Make sure we're working with the latest chainlink libs
replace github.com/smartcontractkit/chainlink/v2 => ../
Expand Down Expand Up @@ -387,6 +387,7 @@ require (
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704 // indirect
github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20231109141932-cb1ea9020255 // indirect
github.com/smartcontractkit/chainlink-feeds v0.0.0-20231113191030-806c6b08541d // indirect
github.com/smartcontractkit/chainlink-relay v0.1.7-0.20231113174149-046d4ddaca1a // indirect
github.com/smartcontractkit/chainlink-solana v1.0.3-0.20231023133638-72f4e799ab05 // indirect
github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20231024133459-1ef3a11319eb // indirect
Expand Down
2 changes: 2 additions & 0 deletions integration-tests/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2369,6 +2369,8 @@ github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704 h1:T3lFWumv
github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704/go.mod h1:2QuJdEouTWjh5BDy5o/vgGXQtR4Gz8yH1IYB5eT7u4M=
github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20231109141932-cb1ea9020255 h1:Pt6c7bJU9wIN6PQQnmN8UmYYH6lpfiQ6U/B8yEC2s5s=
github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20231109141932-cb1ea9020255/go.mod h1:EHppaccd/LTlTMI2o4dmBHe4BknEgEFFDjDGMNuGb3k=
github.com/smartcontractkit/chainlink-feeds v0.0.0-20231113191030-806c6b08541d h1:v4yF2Uc5TIiPSESB4HMERQe86fIkettXoKaLSw0w9PM=
github.com/smartcontractkit/chainlink-feeds v0.0.0-20231113191030-806c6b08541d/go.mod h1:NRk1Qup2AtPr9ToOAv0zeOv5EbYMMJ+hjlepsTJfKpI=
github.com/smartcontractkit/chainlink-relay v0.1.7-0.20231113174149-046d4ddaca1a h1:G/pD8uI1PULRJU8Y3eLLzjqQBp9ruG9hj+wWxtyrgTo=
github.com/smartcontractkit/chainlink-relay v0.1.7-0.20231113174149-046d4ddaca1a/go.mod h1:M9U1JV7IQi8Sfj4JR1qSi1tIh6omgW78W/8SHN/8BUQ=
github.com/smartcontractkit/chainlink-solana v1.0.3-0.20231023133638-72f4e799ab05 h1:DaPSVnxe7oz1QJ+AVIhQWs1W3ubQvwvGo9NbHpMs1OQ=
Expand Down
8 changes: 6 additions & 2 deletions plugins/chainlink.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ COPY . .

# Build the golang binaries
RUN make install-chainlink
# Build LOOP Plugins
RUN make install-median

# Install medianpoc binary
RUN make install-medianpoc

# Link LOOP Plugin source dirs with simple names
RUN go list -m -f "{{.Dir}}" github.com/smartcontractkit/chainlink-feeds | xargs -I % ln -s % /chainlink-feeds
RUN go list -m -f "{{.Dir}}" github.com/smartcontractkit/chainlink-solana | xargs -I % ln -s % /chainlink-solana
RUN mkdir /chainlink-starknet
RUN go list -m -f "{{.Dir}}" github.com/smartcontractkit/chainlink-starknet/relayer | xargs -I % ln -s % /chainlink-starknet/relayer
Expand All @@ -30,6 +30,10 @@ RUN go list -m -f "{{.Dir}}" github.com/smartcontractkit/chainlink-starknet/rela
FROM golang:1.21-bullseye as buildplugins
RUN go version

WORKDIR /chainlink-feeds
COPY --from=buildgo /chainlink-feeds .
RUN go install ./cmd/chainlink-feeds

WORKDIR /chainlink-solana
COPY --from=buildgo /chainlink-solana .
RUN go install ./pkg/solana/cmd/chainlink-solana
Expand Down
41 changes: 0 additions & 41 deletions plugins/cmd/chainlink-median/main.go

This file was deleted.

0 comments on commit 5f49586

Please sign in to comment.