-
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.
Closes #1778 <!-- These comments should help create a useful PR message, please delete any remaining comments before opening the PR. --> <!-- If there is no issue number make sure to describe clearly *why* this PR is necessary. --> <!-- Mention open questions, remaining TODOs, if any --> ### This PR: Provides a versioned implementation of the Node Validator API. This API is meant to be used in conjunction with the Node Validator UI that has been designed on the Block Explorer. The create `node-metrics` was chosen over `node-validator` based on a recommendation from @clu8, as the crate and systems may be utilized without the node-validator aspects. <!-- Describe what this PR adds to this repo and why --> <!-- E.g. --> <!-- * Implements feature 1 --> <!-- * Fixes bug 3 --> <!-- ### This PR does not: --> <!-- Describe what is out of scope for this PR, if applicable. Leave this section blank if it's not applicable --> <!-- This section helps avoid the reviewer having to needlessly point out missing parts --> <!-- * Implement feature 3 because that feature is blocked by Issue 4 --> <!-- * Implement xyz because that is tracked in issue #123. --> <!-- * Address xzy for which I opened issue #456 --> ### Key places to review: <!-- Describe key places for reviewers to pay close attention to --> <!-- * file.rs, `add_integers` function --> <!-- Or directly comment on those files/lines to make it easier for the reviewers --> node-metrics/src/service/data_state/mod.rs node-metrics/src/service/client_state/mod.rs Usage example test is located in node-metrics/src/api/node_validator/v0/create_node_validator_api.rs <!-- ### How to test this PR: --> <!-- Optional, uncomment the above line if this is relevant to your PR --> <!-- If your PR is fully tested through CI there is no need to add this section --> <!-- * E.g. `just test` --> <!-- ### Things tested --> <!-- Anything that was manually tested (that is not tested in CI). --> <!-- E.g. building/running of docker containers. Changes to docker demo, ... --> <!-- Especially mention anything untested, with reasoning and link an issue to resolve this. --> <!-- Complete the following items before creating this PR --> <!-- [ ] Issue linked or PR description mentions why this change is necessary. --> <!-- [ ] PR description is clear enough for reviewers. --> <!-- [ ] Documentation for changes (additions) has been updated (added). --> <!-- [ ] If this is a draft it is marked as "draft". --> <!-- To make changes to this template edit https://github.com/EspressoSystems/.github/blob/main/PULL_REQUEST_TEMPLATE.md -->
- Loading branch information
Showing
36 changed files
with
6,768 additions
and
7 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
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
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 |
---|---|---|
|
@@ -236,6 +236,16 @@ services: | |
- ESPRESSO_SEQUENCER_LIBP2P_BIND_ADDRESS=0.0.0.0:$ESPRESSO_DEMO_SEQUENCER_LIBP2P_PORT_0 | ||
- ESPRESSO_SEQUENCER_LIBP2P_ADVERTISE_ADDRESS=sequencer0:$ESPRESSO_DEMO_SEQUENCER_LIBP2P_PORT_0 | ||
- ESPRESSO_SEQUENCER_IS_DA=true | ||
- ESPRESSO_SEQUENCER_IDENTITY_NODE_NAME=sequencer0 | ||
- ESPRESSO_SEQUENCER_IDENTITY_WALLET_ADDRESS=0x0000000000000000000000000000000000000000 | ||
- ESPRESSO_SEQUENCER_IDENTITY_COMPANY_NAME=Espresso Systems | ||
- ESPRESSO_SEQUENCER_IDENTITY_COMPANY_WEBSITE=https://www.espressosys.com/ | ||
- ESPRESSO_SEQUENCER_IDENTITY_OPERATING_SYSTEM=Linux 5.15.153.1 | ||
- ESPRESSO_SEQUENCER_IDENTITY_NETWORK_TYPE=local | ||
- ESPRESSO_SEQUENCER_IDENTITY_COUNTRY_CODE=US | ||
- ESPRESSO_SEQUENCER_IDENTITY_LATITUDE=40.7128 | ||
- ESPRESSO_SEQUENCER_IDENTITY_LONGITUDE=-74.0060 | ||
- ESPRESSO_SEQUENCER_PUBLIC_API_URL=http://sequencer0:$ESPRESSO_SEQUENCER_API_PORT/ | ||
- RUST_LOG | ||
- RUST_LOG_FORMAT | ||
- ASYNC_STD_THREAD_COUNT | ||
|
@@ -282,6 +292,16 @@ services: | |
- ESPRESSO_SEQUENCER_LIBP2P_BIND_ADDRESS=0.0.0.0:$ESPRESSO_DEMO_SEQUENCER_LIBP2P_PORT_1 | ||
- ESPRESSO_SEQUENCER_LIBP2P_ADVERTISE_ADDRESS=sequencer1:$ESPRESSO_DEMO_SEQUENCER_LIBP2P_PORT_1 | ||
- ESPRESSO_SEQUENCER_IS_DA=true | ||
- ESPRESSO_SEQUENCER_IDENTITY_NODE_NAME=sequencer1 | ||
- ESPRESSO_SEQUENCER_IDENTITY_WALLET_ADDRESS=0x0000000000000000000000000000000000000001 | ||
- ESPRESSO_SEQUENCER_IDENTITY_COMPANY_NAME=Espresso Systems | ||
- ESPRESSO_SEQUENCER_IDENTITY_COMPANY_WEBSITE=https://www.espressosys.com/ | ||
- ESPRESSO_SEQUENCER_IDENTITY_OPERATING_SYSTEM=Darwin 23.5.0 | ||
- ESPRESSO_SEQUENCER_IDENTITY_NETWORK_TYPE=local | ||
- ESPRESSO_SEQUENCER_IDENTITY_COUNTRY_CODE=GR | ||
- ESPRESSO_SEQUENCER_IDENTITY_LATITUDE=39.0742 | ||
- ESPRESSO_SEQUENCER_IDENTITY_LONGITUDE=21.8243 | ||
- ESPRESSO_SEQUENCER_PUBLIC_API_URL=http://sequencer1:$ESPRESSO_SEQUENCER_API_PORT/ | ||
- RUST_LOG | ||
- RUST_LOG_FORMAT | ||
- ASYNC_STD_THREAD_COUNT | ||
|
@@ -324,6 +344,16 @@ services: | |
- ESPRESSO_SEQUENCER_LIBP2P_BIND_ADDRESS=0.0.0.0:$ESPRESSO_DEMO_SEQUENCER_LIBP2P_PORT_2 | ||
- ESPRESSO_SEQUENCER_LIBP2P_ADVERTISE_ADDRESS=sequencer2:$ESPRESSO_DEMO_SEQUENCER_LIBP2P_PORT_2 | ||
- ESPRESSO_SEQUENCER_IS_DA=true | ||
- ESPRESSO_SEQUENCER_IDENTITY_NODE_NAME=sequencer2 | ||
- ESPRESSO_SEQUENCER_IDENTITY_WALLET_ADDRESS=0x0000000000000000000000000000000000000002 | ||
- ESPRESSO_SEQUENCER_IDENTITY_COMPANY_NAME=Espresso Systems | ||
- ESPRESSO_SEQUENCER_IDENTITY_COMPANY_WEBSITE=https://www.espressosys.com/ | ||
- ESPRESSO_SEQUENCER_IDENTITY_OPERATING_SYSTEM=Darwin 23.5.0 | ||
- ESPRESSO_SEQUENCER_IDENTITY_NETWORK_TYPE=local | ||
- ESPRESSO_SEQUENCER_IDENTITY_COUNTRY_CODE=CN | ||
- ESPRESSO_SEQUENCER_IDENTITY_LATITUDE=35.8617 | ||
- ESPRESSO_SEQUENCER_IDENTITY_LONGITUDE=104.1954 | ||
- ESPRESSO_SEQUENCER_PUBLIC_API_URL=http://sequencer2:$ESPRESSO_SEQUENCER_API_PORT/ | ||
- RUST_LOG | ||
- RUST_LOG_FORMAT | ||
- ASYNC_STD_THREAD_COUNT | ||
|
@@ -362,6 +392,17 @@ services: | |
- ESPRESSO_SEQUENCER_PRIVATE_STATE_KEY=$ESPRESSO_DEMO_SEQUENCER_STATE_PRIVATE_KEY_3 | ||
- ESPRESSO_SEQUENCER_LIBP2P_BIND_ADDRESS=0.0.0.0:$ESPRESSO_DEMO_SEQUENCER_LIBP2P_PORT_3 | ||
- ESPRESSO_SEQUENCER_LIBP2P_ADVERTISE_ADDRESS=sequencer3:$ESPRESSO_DEMO_SEQUENCER_LIBP2P_PORT_3 | ||
- ESPRESSO_SEQUENCER_IDENTITY_NODE_NAME=sequencer3 | ||
- ESPRESSO_SEQUENCER_IDENTITY_WALLET_ADDRESS=0x0000000000000000000000000000000000000003 | ||
- ESPRESSO_SEQUENCER_IDENTITY_COMPANY_NAME=Espresso Systems | ||
- ESPRESSO_SEQUENCER_IDENTITY_COMPANY_WEBSITE=https://www.espressosys.com/ | ||
- ESPRESSO_SEQUENCER_IDENTITY_OPERATING_SYSTEM=Microsoft Windows NT 10.0.22621.0 | ||
- [email protected] | ||
- ESPRESSO_SEQUENCER_IDENTITY_NETWORK_TYPE=local | ||
- ESPRESSO_SEQUENCER_IDENTITY_COUNTRY_CODE=CN | ||
- ESPRESSO_SEQUENCER_IDENTITY_LATITUDE=35.8617 | ||
- ESPRESSO_SEQUENCER_IDENTITY_LONGITUDE=104.1954 | ||
- ESPRESSO_SEQUENCER_PUBLIC_API_URL=http://sequencer3:$ESPRESSO_SEQUENCER_API_PORT/ | ||
- RUST_LOG | ||
- RUST_LOG_FORMAT | ||
- ASYNC_STD_THREAD_COUNT | ||
|
@@ -400,6 +441,16 @@ services: | |
- ESPRESSO_SEQUENCER_PRIVATE_STATE_KEY=$ESPRESSO_DEMO_SEQUENCER_STATE_PRIVATE_KEY_4 | ||
- ESPRESSO_SEQUENCER_LIBP2P_BIND_ADDRESS=0.0.0.0:$ESPRESSO_DEMO_SEQUENCER_LIBP2P_PORT_4 | ||
- ESPRESSO_SEQUENCER_LIBP2P_ADVERTISE_ADDRESS=sequencer4:$ESPRESSO_DEMO_SEQUENCER_LIBP2P_PORT_4 | ||
- ESPRESSO_SEQUENCER_IDENTITY_NODE_NAME=sequencer4 | ||
- ESPRESSO_SEQUENCER_IDENTITY_WALLET_ADDRESS=0x0000000000000000000000000000000000000004 | ||
- ESPRESSO_SEQUENCER_IDENTITY_COMPANY_NAME=Espresso Systems | ||
- ESPRESSO_SEQUENCER_IDENTITY_COMPANY_WEBSITE=https://www.espressosys.com/ | ||
- ESPRESSO_SEQUENCER_IDENTITY_OPERATING_SYSTEM=TempleOS 5.03 | ||
- ESPRESSO_SEQUENCER_IDENTITY_NETWORK_TYPE=local | ||
- ESPRESSO_SEQUENCER_IDENTITY_COUNTRY_CODE=AU | ||
- ESPRESSO_SEQUENCER_IDENTITY_LATITUDE=-25.2744 | ||
- ESPRESSO_SEQUENCER_IDENTITY_LONGITUDE=133.7751 | ||
- ESPRESSO_SEQUENCER_PUBLIC_API_URL=http://sequencer4:$ESPRESSO_SEQUENCER_API_PORT/ | ||
- RUST_LOG | ||
- RUST_LOG_FORMAT | ||
- ASYNC_STD_THREAD_COUNT | ||
|
@@ -542,6 +593,26 @@ services: | |
solver-db: | ||
condition: service_healthy | ||
|
||
node-validator: | ||
image: ghcr.io/espressosystems/espresso-sequencer/node-validator:main | ||
ports: | ||
- "$ESPRESSO_NODE_VALIDATOR_PORT:$ESPRESSO_NODE_VALIDATOR_PORT" | ||
environment: | ||
- ESPRESSO_NODE_VALIDATOR_STAKE_TABLE_SOURCE_BASE_URL=http://sequencer0:$ESPRESSO_SEQUENCER_API_PORT/v0/ | ||
- ESPRESSO_NODE_VALIDATOR_LEAF_STREAM_SOURCE_BASE_URL=http://sequencer0:$ESPRESSO_SEQUENCER_API_PORT/v0/ | ||
- ESPRESSO_NODE_VALIDATOR_INITIAL_NODE_PUBLIC_BASE_URLS=http://sequencer0:$ESPRESSO_SEQUENCER_API_PORT,http://sequencer1:$ESPRESSO_SEQUENCER1_API_PORT,http://sequencer2:$ESPRESSO_SEQUENCER2_API_PORT,http://sequencer3:$ESPRESSO_SEQUENCER3_API_PORT,http://sequencer4:$ESPRESSO_SEQUENCER4_API_PORT | ||
depends_on: | ||
sequencer0: | ||
condition: service_healthy | ||
sequencer1: | ||
condition: service_healthy | ||
sequencer2: | ||
condition: service_healthy | ||
sequencer3: | ||
condition: service_healthy | ||
sequencer4: | ||
condition: service_healthy | ||
|
||
sequencer-db-0: | ||
image: postgres | ||
user: root | ||
|
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,18 @@ | ||
FROM ubuntu:jammy | ||
|
||
ARG TARGETARCH | ||
|
||
RUN apt-get update \ | ||
&& apt-get install -y curl libcurl4 wait-for-it tini \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
ENTRYPOINT ["tini", "--"] | ||
|
||
COPY target/$TARGETARCH/release/node-metrics /bin/node-metrics | ||
RUN chmod +x /bin/node-metrics | ||
|
||
# Run a web server on this port by default. Port can be overridden by the container orchestrator. | ||
ENV ESPRESSO_NODE_VALIDATOR_PORT=80 | ||
|
||
CMD [ "/bin/node-metrics"] | ||
HEALTHCHECK --interval=1s --timeout=1s --retries=100 CMD curl --fail http://localhost:${ESPRESSO_NODE_VALIDATOR_PORT}/healthcheck || exit 1 | ||
EXPOSE ${ESPRESSO_NODE_VALIDATOR_PORT} |
Oops, something went wrong.