Skip to content

Commit

Permalink
fix: dockerfile usage
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
MSevey committed Nov 13, 2024
1 parent 6a6065f commit dd4528b
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ COPY --from=build-env /src/main /usr/bin/local-sequencer

EXPOSE 50051

CMD ["local-sequencer", "-listen-all"]
ENTRYPOINT ["local-sequencer"]
CMD ["-listen-all"]
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)":"
Expand Down
44 changes: 44 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit dd4528b

Please sign in to comment.