refactor(hermes): re-organize in monorepo

This commit is contained in:
Reisen 2024-04-15 09:45:22 +00:00 committed by Reisen
parent 0789d615d4
commit 45065e2851
54 changed files with 15 additions and 15 deletions

View File

@ -2,10 +2,10 @@ name: Check Hermes
on:
pull_request:
paths: [hermes/**]
paths: [apps/hermes/**]
push:
branches: [main]
paths: [hermes/**]
paths: [apps/hermes/**]
jobs:
test:
runs-on: ubuntu-latest
@ -20,4 +20,4 @@ jobs:
- name: Install protoc
uses: arduino/setup-protoc@v3
- name: Run executor tests
run: cargo test --manifest-path ./hermes/Cargo.toml
run: cargo test --manifest-path ./apps/hermes/Cargo.toml

View File

@ -37,7 +37,7 @@ jobs:
env:
AWS_REGION: us-east-1
- run: |
DOCKER_BUILDKIT=1 docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG -f hermes/Dockerfile .
DOCKER_BUILDKIT=1 docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG -f apps/hermes/Dockerfile .
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
env:
ECR_REGISTRY: public.ecr.aws

View File

@ -47,15 +47,15 @@ repos:
- id: cargo-fmt-hermes
name: Cargo format for Hermes
language: "rust"
entry: cargo +nightly-2024-03-26 fmt --manifest-path ./hermes/Cargo.toml --all -- --config-path rustfmt.toml
entry: cargo +nightly-2024-03-26 fmt --manifest-path ./apps/hermes/Cargo.toml --all -- --config-path rustfmt.toml
pass_filenames: false
files: hermes
files: apps/hermes
- id: cargo-clippy-hermes
name: Cargo clippy for Hermes
language: "rust"
entry: cargo +nightly-2024-03-26 clippy --manifest-path ./hermes/Cargo.toml --tests --fix --allow-dirty --allow-staged -- -D warnings
entry: cargo +nightly-2024-03-26 clippy --manifest-path ./apps/hermes/Cargo.toml --tests --fix --allow-dirty --allow-staged -- -D warnings
pass_filenames: false
files: hermes
files: apps/hermes
# Hooks for Fortuna
- id: cargo-fmt-fortuna
name: Cargo format for Fortuna

View File

@ -16,7 +16,7 @@ contracts, SDKs, and examples.
## Hermes
> [hermes](./hermes/)
> [hermes](./apps/hermes/)
Hermes is an off-chain service which constantly observes Pythnet and the
Wormhole network watching for price updates emitted from the Pyth contract. It

View File

@ -31,7 +31,7 @@ prometheus-client = { version = "0.21.2" }
prost = { version = "0.12.1" }
pyth-sdk = { version = "0.8.0" }
pyth-sdk-solana = { version = "0.9.0" }
pythnet-sdk = { path = "../pythnet/pythnet_sdk/", version = "2.0.0", features = ["strum"] }
pythnet-sdk = { path = "../../pythnet/pythnet_sdk/", version = "2.0.0", features = ["strum"] }
rand = { version = "0.8.5" }
reqwest = { version = "0.11.14", features = ["blocking", "json"] }
secp256k1 = { version = "0.27.0", features = ["rand", "recovery", "serde"] }

View File

@ -12,7 +12,7 @@ RUN rustup default nightly-2024-03-26
# Build
WORKDIR /src
COPY hermes hermes
COPY apps/hermes hermes
COPY pythnet/pythnet_sdk pythnet/pythnet_sdk

View File

@ -35,14 +35,14 @@ To set up and run a Hermes node, follow the steps below:
```
4. **Build the project**: Navigate to the project directory and run the following command to build the project:
```bash
cd hermes
cd apps/hermes
cargo build --release
```
This will create a binary in the target/release directory.
5. **Run the node**: To run Hermes for Pythnet, use the following command:
```bash
./target/release/hermes run \
cargo build --release run -- \
--pythnet-http-addr https://pythnet-rpc/ \
--pythnet-ws-addr wss://pythnet-rpc/ \
--wormhole-spy-rpc-addr https://wormhole-spy-rpc/

View File

@ -150,7 +150,7 @@ npm run start -- near \
docker run public.ecr.aws/pyth-network/xc-price-pusher:v<version> -- <above-arguments>
```
[hermes]: https://github.com/pyth-network/pyth-crosschain/tree/main/hermes
[hermes]: https://github.com/pyth-network/pyth-crosschain/tree/main/apps/hermes
### Command Line Arguments

View File

@ -1,7 +1,7 @@
# Price Service Client
[Pyth Network](https://pyth.network/) provides real-time pricing data in a variety of asset classes, including cryptocurrency, equities, FX and commodities.
These prices are available either via HTTP or WebSocket from [Hermes](/hermes).
These prices are available either via HTTP or WebSocket from [Hermes](/apps/hermes).
This library is a client for interacting with Hermes, allowing your application to consume Pyth real-time prices in on- and off-chain Javascript/Typescript applications.
## Installation