From dd4528b536aa3806b339e078f3b8f91261648679 Mon Sep 17 00:00:00 2001 From: Matthew Sevey <15232757+MSevey@users.noreply.github.com> Date: Wed, 13 Nov 2024 14:12:50 -0500 Subject: [PATCH 1/2] fix: dockerfile usage Add docker-build Makefile command. Add usage instructions for binary and docker to README. Add ENTRYPOINT to dockerfile to enable handing of additional flags easier. --- Dockerfile | 3 ++- Makefile | 8 +++++++- README.md | 44 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 53 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6ecec33..b96c62b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,4 +18,5 @@ COPY --from=build-env /src/main /usr/bin/local-sequencer EXPOSE 50051 -CMD ["local-sequencer", "-listen-all"] \ No newline at end of file +ENTRYPOINT ["local-sequencer"] +CMD ["-listen-all"] \ No newline at end of file diff --git a/Makefile b/Makefile index 04f5561..324463a 100644 --- a/Makefile +++ b/Makefile @@ -8,12 +8,18 @@ pkgs := $(shell go list ./...) run := . count := 1 -## build: Build local-da binary. +## build: Build local-sequencer binary. build: @echo "--> Building local-sequencer" @go build -o build/ ${LDFLAGS} ./... .PHONY: build +## docker-build: Build local-sequencer docker image. +docker-build: + @echo "--> Building local-sequencer docker image" + @docker build -t local-sequencer . +.PHONY: docker-build + ## help: Show this help message help: Makefile @echo " Choose a command run in "$(PROJECTNAME)":" diff --git a/README.md b/README.md index a254953..376869f 100644 --- a/README.md +++ b/README.md @@ -54,6 +54,50 @@ make test make lint ``` +## Local Sequencer + +In this repo there is a mock `local-sequencer` server that implements the `go-sequencing` interface. This server is useful for testing and development purposes. + +### Running the local sequencer binary + +To run the mock `local-sequencer` server, run the following command: + +```sh +make build +``` + +This will build the `local-sequencer` binary. To run the server, run: + +```sh +./build/local-sequencer +``` + +You will see an output like the following: + +```sh +2024/11/13 10:56:01 Listening on: localhost:50051 +``` + +### Running the local sequencer in Docker + +To run the mock `local-sequencer` server in Docker, run the following command: + +```sh +make docker-build +``` + +This will build a `local-sequencer` Docker image. To run the server, run: + +```sh +docker run -p 50051:50051 --rm local-sequencer +``` + +In order to connect your rollup to your local sequencer, you need to pass in the rollup ID by using the following command: + +```sh +docker run -p 50051:50051 --rm local-sequencer -listen-all -rollup-id=testing +``` + ## Contributing We welcome your contributions! Everyone is welcome to contribute, whether it's From 57bedf9e3d18d132d5867e245154bc9e76326c0a Mon Sep 17 00:00:00 2001 From: Matthew Sevey <15232757+MSevey@users.noreply.github.com> Date: Thu, 14 Nov 2024 09:38:08 -0500 Subject: [PATCH 2/2] chore: fix markdownlint errors --- README.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 376869f..a84268f 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,9 @@ make lint ## Local Sequencer -In this repo there is a mock `local-sequencer` server that implements the `go-sequencing` interface. This server is useful for testing and development purposes. +In this repo there is a mock `local-sequencer` server that implements the +`go-sequencing` interface. This server is useful for testing and development +purposes. ### Running the local sequencer binary @@ -72,7 +74,7 @@ This will build the `local-sequencer` binary. To run the server, run: ./build/local-sequencer ``` -You will see an output like the following: +You will see an output like the following: ```sh 2024/11/13 10:56:01 Listening on: localhost:50051 @@ -92,7 +94,8 @@ This will build a `local-sequencer` Docker image. To run the server, run: docker run -p 50051:50051 --rm local-sequencer ``` -In order to connect your rollup to your local sequencer, you need to pass in the rollup ID by using the following command: +In order to connect your rollup to your local sequencer, you need to pass in the +rollup ID by using the following command: ```sh docker run -p 50051:50051 --rm local-sequencer -listen-all -rollup-id=testing