This repository was archived by the owner on May 2, 2025. It is now read-only.
generated from evstack/template-da-repo
-
Notifications
You must be signed in to change notification settings - Fork 2
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
3c3e9ea
add local sequencer and docker file
gupadhyaya 842fbe5
Merge branch 'main' into run_dummy
gupadhyaya e1c2c8d
Merge remote-tracking branch 'origin/main' into run_dummy
gupadhyaya 37b7949
add docker build to ci
gupadhyaya 63f65f5
upgrade compat to go 1.23
gupadhyaya dff6ddc
expose 50051
gupadhyaya File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: Docker Build & Publish | ||
|
||
# Trigger on all push events, new semantic version tags, and all PRs | ||
on: | ||
push: | ||
branches: | ||
- "main" | ||
tags: | ||
- "v*" | ||
pull_request: | ||
|
||
jobs: | ||
go-sequencing-docker: | ||
permissions: | ||
contents: write | ||
packages: write | ||
uses: rollkit/.github/.github/workflows/[email protected] # yamllint disable-line rule:line-length | ||
with: | ||
dockerfile: Dockerfile | ||
secrets: inherit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
build/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
FROM --platform=$BUILDPLATFORM golang:1.23-alpine AS build-env | ||
|
||
# Set working directory for the build | ||
WORKDIR /src | ||
|
||
COPY . . | ||
|
||
RUN go mod tidy -compat=1.23 && \ | ||
go build /src/cmd/local-sequencer/main.go | ||
|
||
# Final image | ||
FROM alpine:3.18.3 | ||
|
||
WORKDIR /root | ||
|
||
# Copy over binaries from the build-env | ||
COPY --from=build-env /src/main /usr/bin/local-sequencer | ||
|
||
EXPOSE 50051 | ||
|
||
CMD ["local-sequencer", "-listen-all"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
package main | ||
|
||
import ( | ||
"flag" | ||
"fmt" | ||
"log" | ||
"net" | ||
"os" | ||
"os/signal" | ||
"syscall" | ||
|
||
"github.com/rollkit/go-sequencing/proxy/grpc" | ||
"github.com/rollkit/go-sequencing/test" | ||
) | ||
|
||
const ( | ||
defaultHost = "localhost" | ||
defaultPort = "50051" | ||
defaultRollupId = "rollup-id" | ||
) | ||
|
||
func main() { | ||
var ( | ||
host string | ||
port string | ||
rollupId string | ||
listenAll bool | ||
) | ||
flag.StringVar(&port, "port", defaultPort, "listening port") | ||
flag.StringVar(&host, "host", defaultHost, "listening address") | ||
flag.StringVar(&rollupId, "rollup-id", defaultRollupId, "rollup id") | ||
flag.BoolVar(&listenAll, "listen-all", false, "listen on all network interfaces (0.0.0.0) instead of just localhost") | ||
flag.Parse() | ||
|
||
if listenAll { | ||
host = "0.0.0.0" | ||
} | ||
|
||
d := test.NewDummySequencer([]byte(rollupId)) | ||
srv := grpc.NewServer(d, d, d) | ||
log.Printf("Listening on: %s:%s", host, port) | ||
|
||
listenAddress := fmt.Sprintf("%s:%s", host, port) | ||
lis, err := net.Listen("tcp", listenAddress) | ||
if err != nil { | ||
log.Fatal("error while serving:", err) | ||
} | ||
go func() { | ||
_ = srv.Serve(lis) | ||
}() | ||
|
||
interrupt := make(chan os.Signal, 1) | ||
signal.Notify(interrupt, os.Interrupt, syscall.SIGINT) | ||
<-interrupt | ||
fmt.Println("\nCtrl+C pressed. Exiting...") | ||
os.Exit(0) | ||
} | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.