Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create an operators folder for churner and ejector #296

Merged
merged 3 commits into from
Mar 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,22 +61,22 @@ jobs:
run: forge --version

- name: Build contracts
run: |
cd contracts && forge build
run: |
cd contracts && forge build

# TODO: add back DA contracts if we will need them in tests.
# - name: Compile contracts
# run: |
# make compile-el
# make compile-dl

- name: Churner
run: go test -v ./churner/tests
- name: Churner
run: go test -v ./operators/churner/tests

- name: Indexer
- name: Indexer
run: go test -v ./core/indexer

- name: Node Plugin
- name: Node Plugin
run: go test -v ./node/plugin/tests

- name: Graph Indexer
Expand Down
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ lint:
go tool fix ./..
golangci-lint run

build:
cd churner && make build
build:
cd operators/churner && make build
cd disperser && make build
cd node && make build
cd retriever && make build
cd tools/traffic && make build

dataapi-build:
dataapi-build:
cd disperser && go build -o ./bin/dataapi ./cmd/dataapi

unit-tests:
Expand All @@ -60,17 +60,17 @@ integration-tests-node-plugin:
go test -v ./node/plugin/tests

integration-tests-inabox:
make build
make build
cd inabox && make run-e2e

integration-tests-inabox-nochurner:
make build
cd inabox && make run-e2e-nochurner

integration-tests-graph-indexer:
make build
make build
go test -v ./core/thegraph

integration-tests-dataapi:
make dataapi-build
make dataapi-build
go test -v ./disperser/dataapi
56 changes: 28 additions & 28 deletions inabox/bin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ function start_trap {
set -a
source $testpath/envs/churner.env
set +a
../churner/bin/server &
../operators/churner/bin/server &

pid="$!"
pids="$pids $pid"

for FILE in $(ls $testpath/envs/dis*.env); do
for FILE in $(ls $testpath/envs/dis*.env); do
set -a
source $FILE
set +a
Expand All @@ -30,7 +30,7 @@ function start_trap {
pids="$pids $pid"
done

for FILE in $(ls $testpath/envs/enc*.env); do
for FILE in $(ls $testpath/envs/enc*.env); do
set -a
source $FILE
set +a
Expand All @@ -40,7 +40,7 @@ function start_trap {
pids="$pids $pid"
done

for FILE in $(ls $testpath/envs/batcher*.env); do
for FILE in $(ls $testpath/envs/batcher*.env); do
set -a
source $FILE
set +a
Expand All @@ -49,27 +49,27 @@ function start_trap {
pid="$!"
pids="$pids $pid"
done

files=($(ls $testpath/envs/opr*.env))
last_index=$(( ${#files[@]} - 1 ))

for i in "${!files[@]}"; do
for i in "${!files[@]}"; do
if [ $i -eq $last_index ]; then
sleep 5 # Sleep for 5 seconds before the last loop iteration
fi
FILE=${files[$i]}
set -a
source $FILE
set +a
../node/bin/node &
../node/bin/node &

pid="$!"
pids="$pids $pid"
done

for pid in $pids; do
for pid in $pids; do
wait $pid
done
done
}

function start_detached {
Expand All @@ -88,20 +88,20 @@ function start_detached {
set -a
source $testpath/envs/churner.env
set +a
../churner/bin/server > $testpath/logs/churner.log 2>&1 &
../operators/churner/bin/server > $testpath/logs/churner.log 2>&1 &

pid="$!"
pids="$pids $pid"

./wait-for 0.0.0.0:${CHURNER_GRPC_PORT} -- echo "Churner up" &
waiters="$waiters $!"

for FILE in $(ls $testpath/envs/dis*.env); do
for FILE in $(ls $testpath/envs/dis*.env); do
set -a
source $FILE
set +a
id=$(basename $FILE | tr -d -c 0-9)
../disperser/bin/server > $testpath/logs/dis${id}.log 2>&1 &
../disperser/bin/server > $testpath/logs/dis${id}.log 2>&1 &

pid="$!"
pids="$pids $pid"
Expand All @@ -110,7 +110,7 @@ function start_detached {
waiters="$waiters $!"
done

for FILE in $(ls $testpath/envs/enc*.env); do
for FILE in $(ls $testpath/envs/enc*.env); do
set -a
source $FILE
set +a
Expand All @@ -124,22 +124,22 @@ function start_detached {
waiters="$waiters $!"
done

for FILE in $(ls $testpath/envs/batcher*.env); do
for FILE in $(ls $testpath/envs/batcher*.env); do
set -a
source $FILE
set +a
id=$(basename $FILE | tr -d -c 0-9)
../disperser/bin/batcher > $testpath/logs/batcher${id}.log 2>&1 &
../disperser/bin/batcher > $testpath/logs/batcher${id}.log 2>&1 &

pid="$!"
pids="$pids $pid"
done

for FILE in $(ls $testpath/envs/retriever*.env); do
for FILE in $(ls $testpath/envs/retriever*.env); do
set -a
source $FILE
set +a
../retriever/bin/server > $testpath/logs/retriever.log 2>&1 &
../retriever/bin/server > $testpath/logs/retriever.log 2>&1 &

pid="$!"
pids="$pids $pid"
Expand All @@ -148,7 +148,7 @@ function start_detached {
files=($(ls $testpath/envs/opr*.env))
last_index=$(( ${#files[@]} - 1 ))

for i in "${!files[@]}"; do
for i in "${!files[@]}"; do
if [ $i -eq $last_index ]; then
sleep 5 # Sleep for 5 seconds before the last loop iteration
fi
Expand All @@ -168,14 +168,14 @@ function start_detached {

echo $pids > $pid_file

for waiter in $waiters; do
for waiter in $waiters; do
wait $waiter
done
}


function stop_detached {

pid_file="$testpath/pids"
pids=$(cat $pid_file)

Expand All @@ -187,8 +187,8 @@ function stop_detached {
function start_anvil {

echo "Starting anvil server ....."
anvil --host 0.0.0.0 > /dev/null &
anvil_pid=$!
anvil --host 0.0.0.0 > /dev/null &
anvil_pid=$!
echo "Anvil server started ....."

echo $anvil_pid > ./anvil.pid
Expand Down Expand Up @@ -232,18 +232,18 @@ case "$1" in
EOF
;;
start)
start_trap ${@:2} ;;
start_trap ${@:2} ;;
start-detached)
start_detached ${@:2} ;;
start_detached ${@:2} ;;
stop)
stop_detached ${@:2} ;;
start-anvil)
start_anvil ${@:2} ;;
start_anvil ${@:2} ;;
stop-anvil)
stop_anvil ${@:2} ;;
stop_anvil ${@:2} ;;
start-graph)
start_graph ${@:2} ;;
start_graph ${@:2} ;;
stop-graph)
stop_graph ${@:2} ;;
stop_graph ${@:2} ;;
*)
esac
6 changes: 3 additions & 3 deletions inabox/deploy/codegen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import (
"os"
"text/template"

churner "github.com/Layr-Labs/eigenda/churner/flags"
dis "github.com/Layr-Labs/eigenda/disperser/cmd/apiserver/flags"
bat "github.com/Layr-Labs/eigenda/disperser/cmd/batcher/flags"
enc "github.com/Layr-Labs/eigenda/disperser/cmd/encoder/flags"
opr "github.com/Layr-Labs/eigenda/node/flags"
churner "github.com/Layr-Labs/eigenda/operators/churner/flags"
retriever "github.com/Layr-Labs/eigenda/retriever/flags"

"github.com/urfave/cli"
Expand All @@ -20,7 +20,7 @@ import (
var myTemplate = `
type {{.Name}} struct{
{{range $var := .Fields}}
{{$var.EnvVar}} string
{{$var.EnvVar}} string
{{end}}
}
func (vars {{.Name}}) getEnvMap() map[string]string {
Expand Down Expand Up @@ -108,7 +108,7 @@ func genVars(name string, flags []cli.Flag) string {

func main() {

configs := `package deploy
configs := `package deploy

import "reflect"
`
Expand Down
4 changes: 2 additions & 2 deletions node/cmd/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ RUN apk add --no-cache make musl-dev linux-headers gcc git jq bash

# build node with local monorepo go modules
COPY ./node /app/node
COPY churner /app/churner
COPY operators/churner /app/churner
COPY indexer /app/indexer
COPY common /app/common
COPY core /app/core
Expand All @@ -22,4 +22,4 @@ FROM alpine:3.18

COPY --from=builder /app/node/bin/node /usr/local/bin

ENTRYPOINT ["node"]
ENTRYPOINT ["node"]
2 changes: 1 addition & 1 deletion node/operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import (
"time"

grpcchurner "github.com/Layr-Labs/eigenda/api/grpc/churner"
"github.com/Layr-Labs/eigenda/churner"
"github.com/Layr-Labs/eigenda/common"
"github.com/Layr-Labs/eigenda/core"
"github.com/Layr-Labs/eigenda/operators/churner"
gethcommon "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
"google.golang.org/grpc"
Expand Down
2 changes: 1 addition & 1 deletion node/plugin/cmd/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ RUN apk add --no-cache make musl-dev linux-headers gcc git jq bash

# build node with local monorepo go modules
COPY ./node /app/node
COPY churner /app/churner
COPY operators/churner /app/churner
COPY indexer /app/indexer
COPY common /app/common
COPY core /app/core
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import (
"context"
"testing"

"github.com/Layr-Labs/eigenda/churner"
"github.com/Layr-Labs/eigenda/common/geth"
"github.com/Layr-Labs/eigenda/common/logging"
"github.com/Layr-Labs/eigenda/core"
"github.com/Layr-Labs/eigenda/operators/churner"
"github.com/stretchr/testify/assert"

dacore "github.com/Layr-Labs/eigenda/core"
Expand Down
6 changes: 3 additions & 3 deletions churner/cmd/Dockerfile → operators/churner/cmd/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ FROM golang:1.21.1-alpine3.18 as builder

RUN apk add --no-cache make musl-dev linux-headers gcc git jq bash

# build node with local monorepo go modules
COPY ./churner /app/churner
# build node with local monorepo go modules
COPY ./operators/churner /app/churner
COPY common /app/common
COPY core /app/core
COPY api /app/api
Expand All @@ -16,7 +16,7 @@ COPY go.sum /app
WORKDIR /app/churner

RUN --mount=type=cache,target=/go/pkg/mod \
--mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/root/.cache/go-build \
go build -o ./bin/churner ./cmd

FROM alpine:3.18
Expand Down
4 changes: 2 additions & 2 deletions churner/cmd/main.go → operators/churner/cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ import (
"os"

pb "github.com/Layr-Labs/eigenda/api/grpc/churner"
"github.com/Layr-Labs/eigenda/churner"
"github.com/Layr-Labs/eigenda/churner/flags"
"github.com/Layr-Labs/eigenda/common/geth"
"github.com/Layr-Labs/eigenda/common/healthcheck"
"github.com/Layr-Labs/eigenda/common/logging"
"github.com/Layr-Labs/eigenda/core/eth"
coreeth "github.com/Layr-Labs/eigenda/core/eth"
"github.com/Layr-Labs/eigenda/core/thegraph"
"github.com/Layr-Labs/eigenda/operators/churner"
"github.com/Layr-Labs/eigenda/operators/churner/flags"
"github.com/shurcooL/graphql"
"github.com/urfave/cli"
"google.golang.org/grpc"
Expand Down
2 changes: 1 addition & 1 deletion churner/config.go → operators/churner/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package churner
import (
"time"

"github.com/Layr-Labs/eigenda/churner/flags"
"github.com/Layr-Labs/eigenda/common/geth"
"github.com/Layr-Labs/eigenda/common/logging"
"github.com/Layr-Labs/eigenda/operators/churner/flags"
"github.com/urfave/cli"
)

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ import (
"math/big"
"testing"

"github.com/Layr-Labs/eigenda/churner"
"github.com/Layr-Labs/eigenda/common/geth"
"github.com/Layr-Labs/eigenda/common/logging"
commock "github.com/Layr-Labs/eigenda/common/mock"
"github.com/Layr-Labs/eigenda/core"
dacore "github.com/Layr-Labs/eigenda/core"
coremock "github.com/Layr-Labs/eigenda/core/mock"
indexermock "github.com/Layr-Labs/eigenda/core/thegraph/mock"
"github.com/Layr-Labs/eigenda/operators/churner"
gethcommon "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
"github.com/stretchr/testify/assert"
Expand Down
Loading
Loading