-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add `espresso-dev-node` binary and friends. Currently docker image includes dev node, postgres and anvil. `builder_port` will be added in follow up (#1522). --------- Co-authored-by: sveitser <[email protected]> Co-authored-by: Abdul Basit <[email protected]> Co-authored-by: Abdul Basit <[email protected]> Co-authored-by: tbro <[email protected]>
- Loading branch information
Showing
20 changed files
with
696 additions
and
144 deletions.
There are no files selected for viewing
This file contains 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 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 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 |
---|---|---|
|
@@ -15,9 +15,6 @@ target/ | |
# Jetbrains editor | ||
.idea | ||
|
||
# vscode stuff | ||
.vscode/settings.json | ||
|
||
node_modules/ | ||
|
||
**/*DS_Store | ||
|
File renamed without changes.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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 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 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,32 @@ | ||
FROM postgres | ||
|
||
ARG TARGETARCH | ||
|
||
RUN apt-get update \ | ||
&& apt-get install -y curl libcurl4 wait-for-it tini \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
ENTRYPOINT ["tini", "--"] | ||
|
||
# Download an SRS file to avoid download at runtime | ||
ENV AZTEC_SRS_PATH=/kzg10-aztec20-srs-1048584.bin | ||
RUN curl -LO https://github.com/EspressoSystems/ark-srs/releases/download/v0.2.0/$AZTEC_SRS_PATH | ||
|
||
COPY target/$TARGETARCH/release/espresso-dev-node /bin/espresso-dev-node | ||
RUN chmod +x /bin/espresso-dev-node | ||
|
||
COPY target/$TARGETARCH/release/anvil /bin/anvil | ||
RUN chmod +x /bin/anvil | ||
|
||
COPY launch-dev-node-with-postgres /bin/launch-dev-node-with-postgres | ||
RUN chmod +x /bin/launch-dev-node-with-postgres | ||
|
||
# When running as a Docker service, we always want a healthcheck endpoint, so set a default for the | ||
# port that the HTTP server will run on. This can be overridden in any given deployment environment. | ||
ENV ESPRESSO_SEQUENCER_API_PORT=8770 | ||
HEALTHCHECK --interval=1s --timeout=1s --retries=100 CMD curl --fail http://localhost:${ESPRESSO_SEQUENCER_API_PORT}/status/block-height || exit 1 | ||
|
||
EXPOSE 8770 | ||
EXPOSE 8771 | ||
EXPOSE 8772 | ||
|
||
CMD [ "/bin/launch-dev-node-with-postgres"] |
This file contains 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 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 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 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 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,25 @@ | ||
#!/usr/bin/env bash | ||
set -euxo pipefail | ||
|
||
export ESPRESSO_SEQUENCER_POSTGRES_HOST=${ESPRESSO_SEQUENCER_POSTGRES_HOST:-localhost} | ||
export ESPRESSO_SEQUENCER_POSTGRES_PORT=${ESPRESSO_SEQUENCER_POSTGRES_PORT:-5432} | ||
export ESPRESSO_SEQUENCER_POSTGRES_USER=${ESPRESSO_SEQUENCER_POSTGRES_USER:-root} | ||
export ESPRESSO_SEQUENCER_POSTGRES_PASSWORD=${ESPRESSO_SEQUENCER_POSTGRES_PASSWORD:-password} | ||
|
||
export POSTGRES_USER=$ESPRESSO_SEQUENCER_POSTGRES_USER | ||
export POSTGRES_PASSWORD=$ESPRESSO_SEQUENCER_POSTGRES_PASSWORD | ||
|
||
export RUST_LOG=${RUST_LOG:-info} | ||
|
||
# Start postgres in the background | ||
docker-entrypoint.sh postgres & | ||
|
||
# Wait (twice) for postgres to be ready | ||
# Postgres can be falsely "ready" once before running init scripts. | ||
until pg_isready && sleep 1 && pg_isready; do | ||
echo "Waiting for postgres..." | ||
sleep 1 | ||
done | ||
|
||
# Start the dev node | ||
espresso-dev-node |
This file contains 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
Oops, something went wrong.