Daniel Chew 69e4fee501 add /v2/updates/price/latest endpoint (#1225) 1 年之前
..
src 69e4fee501 add /v2/updates/price/latest endpoint (#1225) 1 年之前
.envrc.sample 6db59ff6d1 fix(hermes): correct the metrics server env var 2 年之前
.gitignore a1dff0f5ac feat: add serializers for pyth formats 2 年之前
Cargo.lock 009c5cdabe [audit] Secrets appear in environment variables and command line arguments (#1201) 1 年之前
Cargo.toml 245cc231fd refactor(hermes): improve logging 1 年之前
Dockerfile 0c25fccce5 chore(hermes): update wormhole config 2 年之前
README.md 0c25fccce5 chore(hermes): update wormhole config 2 年之前
build.rs 0c25fccce5 chore(hermes): update wormhole config 2 年之前
go.mod 0559b45936 feat(hermes): add datadog profiling 2 年之前
go.sum 0559b45936 feat(hermes): add datadog profiling 2 年之前
rust-toolchain 5f11c3d042 fix(hermes): fix rust version 2 年之前
shell.nix 272dbef9b3 fix(hermes): fix slot metadata bug 2 年之前

README.md

Hermes

Hermes is a web service designed to monitor both Pythnet and the Wormhole Network for the next generation of Pyth price updates. It supersedes the Pyth Price Service, offering these updates through a user-friendly web API. The service facilitates easy querying for recent price updates via a REST API, as well as provides the option to subscribe to a websocket for real-time updates. Hermes maintains compatibility with the price service API, allowing the Price Service JS client to seamlessly connect to an instance of Hermes and fetch on-demand price updates.

Getting Started

To set up and run a Hermes node, follow the steps below:

  1. Prerequisites: Hermes requires a running instance of Pythnet and the Wormhole spy RPC. You can find instructions for getting a Pythnet RPC instance from a node provider here and instructions for running a Wormhole spy RPC instance here. We recommend using Beacon, a highly available rewrite for spy, for production purposes.
  2. Install Rust nightly-2023-07-23: If you haven't already, you'll need to install Rust. You can do so by following the official instructions. Then, run the following command to install the required nightly version of Rust:

    rustup toolchain install nightly-2023-07-23
    
  3. Install Go: If you haven't already, you'll also need to install Go. You can do so by following the official instructions. If you are on a Mac with M series chips, make sure to install the arm64 version of Go.

  4. Clone the repository: Clone the Pyth Crosschain repository to your local machine using the following command:

    git clone https://github.com/pyth-network/pyth-crosschain.git
    
  5. Build the project: Navigate to the project directory and run the following command to build the project:

    cd hermes
    cargo build --release
    

    This will create a binary in the target/release directory.

  6. Run the node: To run Hermes for Pythnet, use the following command:

    ./target/release/hermes run \
     --pythnet-http-addr https://pythnet-rpc/ \
     --pythnet-ws-addr wss://pythnet-rpc/ \
     --wormhole-spy-rpc-addr https://wormhole-spy-rpc/
    

Your Hermes node will now start and connect to the Pythnet and Wormhole spy RPC. You can interact with the node using the REST and Websocket APIs on port 33999.

For local development, you can also run the node with cargo watch to restart it automatically when the code changes:

   cargo watch -w src -x "run -- run --pythnet-http-addr https://pythnet-rpc/ --pythnet-ws-addr wss://pythnet-rpc/ --wormhole-spy-rpc-addr https://wormhole-spy-rpc/