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

fix: dockerfile usage #24

Merged
merged 2 commits into from
Nov 14, 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
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
47 changes: 47 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading