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..a84268f 100644 --- a/README.md +++ b/README.md @@ -54,6 +54,53 @@ 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