From 8536c7f17e7b085dba872421c48d18dcb24416ca Mon Sep 17 00:00:00 2001 From: Reisen Date: Fri, 17 Mar 2023 15:39:15 +0100 Subject: [PATCH 1/2] pyth-node: rename from price service and document --- .../server-rust => pyth_node}/.gitignore | 0 .../server-rust => pyth_node}/Cargo.lock | 0 .../server-rust => pyth_node}/Cargo.toml | 2 +- pyth_node/README.md | 85 +++++++++++++++++++ .../server-rust => pyth_node}/buf.gen.yaml | 0 .../server-rust => pyth_node}/build.rs | 0 .../server-rust => pyth_node}/go.mod | 0 .../server-rust => pyth_node}/go.sum | 0 .../server-rust => pyth_node}/shell.nix | 0 .../server-rust => pyth_node}/src/config.rs | 0 .../server-rust => pyth_node}/src/main.rs | 0 .../server-rust => pyth_node}/src/network.rs | 0 .../src/network/p2p.go | 0 .../src/network/p2p.rs | 0 .../src/network/rpc.rs | 0 .../src/network/rpc/rest.rs | 0 16 files changed, 86 insertions(+), 1 deletion(-) rename {price_service/server-rust => pyth_node}/.gitignore (100%) rename {price_service/server-rust => pyth_node}/Cargo.lock (100%) rename {price_service/server-rust => pyth_node}/Cargo.toml (97%) create mode 100644 pyth_node/README.md rename {price_service/server-rust => pyth_node}/buf.gen.yaml (100%) rename {price_service/server-rust => pyth_node}/build.rs (100%) rename {price_service/server-rust => pyth_node}/go.mod (100%) rename {price_service/server-rust => pyth_node}/go.sum (100%) rename {price_service/server-rust => pyth_node}/shell.nix (100%) rename {price_service/server-rust => pyth_node}/src/config.rs (100%) rename {price_service/server-rust => pyth_node}/src/main.rs (100%) rename {price_service/server-rust => pyth_node}/src/network.rs (100%) rename {price_service/server-rust => pyth_node}/src/network/p2p.go (100%) rename {price_service/server-rust => pyth_node}/src/network/p2p.rs (100%) rename {price_service/server-rust => pyth_node}/src/network/rpc.rs (100%) rename {price_service/server-rust => pyth_node}/src/network/rpc/rest.rs (100%) diff --git a/price_service/server-rust/.gitignore b/pyth_node/.gitignore similarity index 100% rename from price_service/server-rust/.gitignore rename to pyth_node/.gitignore diff --git a/price_service/server-rust/Cargo.lock b/pyth_node/Cargo.lock similarity index 100% rename from price_service/server-rust/Cargo.lock rename to pyth_node/Cargo.lock diff --git a/price_service/server-rust/Cargo.toml b/pyth_node/Cargo.toml similarity index 97% rename from price_service/server-rust/Cargo.toml rename to pyth_node/Cargo.toml index fa3db0b80e..5d59a060b4 100644 --- a/price_service/server-rust/Cargo.toml +++ b/pyth_node/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "price-service" +name = "pyth-node" version = "0.1.0" edition = "2021" diff --git a/pyth_node/README.md b/pyth_node/README.md new file mode 100644 index 0000000000..5ef0c1cbba --- /dev/null +++ b/pyth_node/README.md @@ -0,0 +1,85 @@ +Wormhole Node +================================================================================ + +Pyth Node is a highly available and versatile software that defines the Pyth +P2P network, Pyth API, and connects with the Pyth Geyser node software to +listen for PythNet events. It offers both REST and Websocket APIs for ease of +integration and interaction with the Pyth network stack. + +The Node can be run by anyone who wishes to participate / observe the PythNet +network operations. + +Overview +-------------------------------------------------------------------------------- + +Pyth was initially designed with a simple "Price Service" with a REST API. +However, as the project evolved, its architecture can be rethought and improved +to be a more general node software that incorporates the Price Service as one +of its components. + +The new architecture is more in line with other well-known projects in the +blockchain and P2P space, such as Solana, Bitcoin, and Cosmos chains, where +users who run the node can also act as observers with specific features +disabled. In our case, the node software can be run with or without a PythNet +validator running. + +Pyth Node has several responsibilities: + +- Offering a REST and Websocket API to interact with the Pyth network. +- Connecting to the Wormhole P2P network and listening for Pyth-related VAAs/Messages. +- Connecting to the Pyth P2P network and sharing Pyth-specific Account Updates. +- Connecting to PythNet itself via our Geyser plugin to allow for a fully + decentralised PythNet. + +The node is designed to fetch updates from either Pyth or Geyser networks for +high availability. + +Architecture +-------------------------------------------------------------------------------- + +The Pyth Node software consists of the following components: + +- *Wormhole P2P Connector*: Responsible for connecting to the Wormhole P2P network and listening for VAAs. +- *Pyth P2P Connector*: Responsible for connecting to the Pyth P2P network and listening for Account Updates. +- *Geyser Connector*: Responsible for connecting to the Geyser node software and listening for Account Updates. It can be disabled if desired to run the node as an observer, only listening to the Pyth P2P network. +- *REST API*: Provides an interface for external applications to interact with the node and retrieve information from the connected networks. +- *Websocket API*: Offers real-time data streaming and interaction with the node, enabling efficient updates and communication. + +Justification for the New Architecture +-------------------------------------------------------------------------------- + +The new architecture allows for increased flexibility and high availability by +incorporating multiple components that can be enabled or disabled based on +specific use cases. + +In particular this allows user's to run the node in order to participate in the +Pyth P2P network to observe prices and serve their own API/RPC. It also allows +a better data ownership model that allow's the Node software to be the main +source of responsibility when interacting with Pyth. + +Getting Started +-------------------------------------------------------------------------------- + +To set up and run a Pyth Node, follow the steps below: + +1. *Install Rust&: If you haven't already, you'll need to install Rust. You can + do so by following the official instructions. +2. *Clone the repository*: Clone the Pyth Node repository to your local + machine using the following command: + ```bash + git clone https://github.com/pyth-network/pyth-crosschain.git + ``` +3. *Build the project*: Navigate to the project directory and run the following command to build the project: + ```bash + cd pyth-node + cargo build --release + ``` + This will create a binary in the target/release directory. +4. *Run the node*: To run the Pyth Node, use the following command, replacing + ```bash + ./target/release/pyth-node run + ``` + Your Pyth Node will now start and connect to the specified networks. You + can interact with the node using the REST and Websocket APIs as described + in the [API Documentation](). + ``` diff --git a/price_service/server-rust/buf.gen.yaml b/pyth_node/buf.gen.yaml similarity index 100% rename from price_service/server-rust/buf.gen.yaml rename to pyth_node/buf.gen.yaml diff --git a/price_service/server-rust/build.rs b/pyth_node/build.rs similarity index 100% rename from price_service/server-rust/build.rs rename to pyth_node/build.rs diff --git a/price_service/server-rust/go.mod b/pyth_node/go.mod similarity index 100% rename from price_service/server-rust/go.mod rename to pyth_node/go.mod diff --git a/price_service/server-rust/go.sum b/pyth_node/go.sum similarity index 100% rename from price_service/server-rust/go.sum rename to pyth_node/go.sum diff --git a/price_service/server-rust/shell.nix b/pyth_node/shell.nix similarity index 100% rename from price_service/server-rust/shell.nix rename to pyth_node/shell.nix diff --git a/price_service/server-rust/src/config.rs b/pyth_node/src/config.rs similarity index 100% rename from price_service/server-rust/src/config.rs rename to pyth_node/src/config.rs diff --git a/price_service/server-rust/src/main.rs b/pyth_node/src/main.rs similarity index 100% rename from price_service/server-rust/src/main.rs rename to pyth_node/src/main.rs diff --git a/price_service/server-rust/src/network.rs b/pyth_node/src/network.rs similarity index 100% rename from price_service/server-rust/src/network.rs rename to pyth_node/src/network.rs diff --git a/price_service/server-rust/src/network/p2p.go b/pyth_node/src/network/p2p.go similarity index 100% rename from price_service/server-rust/src/network/p2p.go rename to pyth_node/src/network/p2p.go diff --git a/price_service/server-rust/src/network/p2p.rs b/pyth_node/src/network/p2p.rs similarity index 100% rename from price_service/server-rust/src/network/p2p.rs rename to pyth_node/src/network/p2p.rs diff --git a/price_service/server-rust/src/network/rpc.rs b/pyth_node/src/network/rpc.rs similarity index 100% rename from price_service/server-rust/src/network/rpc.rs rename to pyth_node/src/network/rpc.rs diff --git a/price_service/server-rust/src/network/rpc/rest.rs b/pyth_node/src/network/rpc/rest.rs similarity index 100% rename from price_service/server-rust/src/network/rpc/rest.rs rename to pyth_node/src/network/rpc/rest.rs From 16ffeb9e1ae846f59c1db76d88fbb3bec1145123 Mon Sep 17 00:00:00 2001 From: Reisen Date: Fri, 17 Mar 2023 14:52:27 +0000 Subject: [PATCH 2/2] pyth_node: Add visual architecture to README. --- {pyth_node => hermes}/.gitignore | 0 {pyth_node => hermes}/Cargo.lock | 64 +++--- {pyth_node => hermes}/Cargo.toml | 2 +- hermes/README.md | 200 ++++++++++++++++++ {pyth_node => hermes}/buf.gen.yaml | 0 {pyth_node => hermes}/build.rs | 0 {pyth_node => hermes}/go.mod | 0 {pyth_node => hermes}/go.sum | 0 {pyth_node => hermes}/shell.nix | 0 {pyth_node => hermes}/src/config.rs | 0 {pyth_node => hermes}/src/main.rs | 0 {pyth_node => hermes}/src/network.rs | 0 {pyth_node => hermes}/src/network/p2p.go | 0 {pyth_node => hermes}/src/network/p2p.rs | 0 {pyth_node => hermes}/src/network/rpc.rs | 0 {pyth_node => hermes}/src/network/rpc/rest.rs | 0 pyth_node/README.md | 85 -------- 17 files changed, 233 insertions(+), 118 deletions(-) rename {pyth_node => hermes}/.gitignore (100%) rename {pyth_node => hermes}/Cargo.lock (99%) rename {pyth_node => hermes}/Cargo.toml (98%) create mode 100644 hermes/README.md rename {pyth_node => hermes}/buf.gen.yaml (100%) rename {pyth_node => hermes}/build.rs (100%) rename {pyth_node => hermes}/go.mod (100%) rename {pyth_node => hermes}/go.sum (100%) rename {pyth_node => hermes}/shell.nix (100%) rename {pyth_node => hermes}/src/config.rs (100%) rename {pyth_node => hermes}/src/main.rs (100%) rename {pyth_node => hermes}/src/network.rs (100%) rename {pyth_node => hermes}/src/network/p2p.go (100%) rename {pyth_node => hermes}/src/network/p2p.rs (100%) rename {pyth_node => hermes}/src/network/rpc.rs (100%) rename {pyth_node => hermes}/src/network/rpc/rest.rs (100%) delete mode 100644 pyth_node/README.md diff --git a/pyth_node/.gitignore b/hermes/.gitignore similarity index 100% rename from pyth_node/.gitignore rename to hermes/.gitignore diff --git a/pyth_node/Cargo.lock b/hermes/Cargo.lock similarity index 99% rename from pyth_node/Cargo.lock rename to hermes/Cargo.lock index e27cd0fb8a..d6c4fd84cf 100644 --- a/pyth_node/Cargo.lock +++ b/hermes/Cargo.lock @@ -1453,6 +1453,38 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" +[[package]] +name = "hermes" +version = "0.1.0" +dependencies = [ + "anyhow", + "axum", + "axum-macros", + "bs58", + "dashmap", + "der 0.7.0", + "env_logger", + "futures", + "hex", + "lazy_static", + "libc", + "libp2p", + "log", + "rand 0.8.5", + "reqwest", + "ring", + "rusqlite", + "secp256k1", + "serde", + "serde_arrays", + "serde_cbor", + "serde_json", + "sha256", + "structopt", + "tokio", + "typescript-type-def", +] + [[package]] name = "hermit-abi" version = "0.1.19" @@ -2940,38 +2972,6 @@ dependencies = [ "syn", ] -[[package]] -name = "price-service" -version = "0.1.0" -dependencies = [ - "anyhow", - "axum", - "axum-macros", - "bs58", - "dashmap", - "der 0.7.0", - "env_logger", - "futures", - "hex", - "lazy_static", - "libc", - "libp2p", - "log", - "rand 0.8.5", - "reqwest", - "ring", - "rusqlite", - "secp256k1", - "serde", - "serde_arrays", - "serde_cbor", - "serde_json", - "sha256", - "structopt", - "tokio", - "typescript-type-def", -] - [[package]] name = "proc-macro-crate" version = "1.1.3" diff --git a/pyth_node/Cargo.toml b/hermes/Cargo.toml similarity index 98% rename from pyth_node/Cargo.toml rename to hermes/Cargo.toml index 5d59a060b4..302f226c33 100644 --- a/pyth_node/Cargo.toml +++ b/hermes/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "pyth-node" +name = "hermes" version = "0.1.0" edition = "2021" diff --git a/hermes/README.md b/hermes/README.md new file mode 100644 index 0000000000..0a163ca4eb --- /dev/null +++ b/hermes/README.md @@ -0,0 +1,200 @@ +# Hermes + +Hermes is a highly available and versatile software that defines the Pyth P2P +network. It also provides the public Pyth API and connects with the Pyth Geyser +node software to listen for Pythnet events. Hermes offers both REST and +WebSocket APIs for seamless integration and interaction with the Pyth network +stack. Anyone can run the Node to: + +1. Provide their own Pyth API for interacting with the Pyth Network stack. +2. Observe Pyth price updates in real-time. +3. Operate alongside their Pythnet validator for fully decentralized access to Pyth. + +## Getting Started + +To set up and run a Hermes node, follow the steps below: + +1. **Install Rust**: If you haven't already, you'll need to install Rust. You can + do so by following the official instructions. +2. **Install Go**: If you haven't already, you'll also need to install Go. You can + do so by following the official instructions. +3. **Clone the repository**: Clone the Pyth Crosschain repository to your local + machine using the following command: + ```bash + git clone https://github.com/pyth-network/pyth-crosschain.git + ``` +4. **Build the project**: Navigate to the project directory and run the following command to build the project: + ```bash + cd hermes + cargo build --release + ``` + This will create a binary in the target/release directory. +5. **Run the node**: To run Hermes, use the following command: + ```bash + ./target/release/hermes run --geyser-socket /tmp/geyser.ipc + ``` + Your Hermes node will now start and connect to the specified networks. You + can interact with the node using the REST and Websocket APIs as described + in the [API Documentation](). You can leave off the `--geyser-socket` arg + if you are planning to run the node without a Pythnet validator, it will + extract data only from the Pyth P2P network. Running a Pythnet node will + improve the speed and accuracy of network observations. + +## Architecture Overview + +For users who simply want to run the software, this section can be skipped. +However, for those interested in understanding Pyth's architecture, this +section explains the old and new architecture, as well as our motivation for +the design. + +### Background + +The Pyth project offers a cross-chain price oracle service for real-time access +to current prices of real-world assets. These prices are aggregated on Pythnet, +where core Pyth contracts are hosted, and pricing information is generated. The +Wormhole project currently sends these prices to other chains. + +To share these prices, the Pyth project provides a standalone application +called the Price Service, which queries the message API provided by Wormhole to +look for Pyth prices. + +The original communication flow can be visualized in the following graph: + +``` + +--------+ +--------+ +--------+ + | User 3 | | User 2 | | User 1 | + +--------+ +--------+ +--------+ + | | | + | | | + +--------------+--------------+ + | + v + +---------------------+ + | Price Service | (Weakly Decentralised) + +----------+----------+ + | + v + +---------------------+ + | Wormhole | (Decentralised) + +---------------------+ + ^ + | + v + + - - - - - - - - - + - - - - - - - - - - - + + ' Pythnet ' + ' ' + ' +----------------+ ' + ' | Pythnet Node 1 | ------+ ' + ' +----------------+ | ' + ' | | ' + ' | | ' + ' +----------------+ | ' (Decentralised) + ' | Pythnet Node 2 | | ' + ' +----------------+ | ' + ' | | ' + ' | | ' + ' +----------------+ +----------------+ ' + ' | Pythnet Node 3 | --- | Pythnet Node 4 | ' + ' +----------------+ +----------------+ ' + + - - - - - - - - - - - - - - - - - - - - - + +``` + +This design has issues due to latency and API complexity introduced by the +Price Service, which acts as a middleman between the user, Wormhole, and +Pythnet. Additionally, it does not represent a particularly decentralized +design, which was a weak point for Pyth. + +### New Model + +In the new model, we designed a single node-style service, Hermes, intended for +direct integration into Pythnet nodes. This aligns with other blockchain +projects where running standard node software allows users to act as observers +of the network: + +``` + +--------+ +--------+ +--------+ + | User 3 | | User 2 | | User 1 | + +--------+ +--------+ +--------+ + | | | + | | | + +--------------+--------------+ + | + v + + - - - - - - - - - + - - - - - - - - - - - + + ' Pythnet ' + ' ' + ' +----------------+ ' + ' | Pythnet Node 1 | ------+ ' + ' +----------------+ | ' + ' | |Hermes| | ' + ' | +------+ | ' + ' | | ' + ' +----------------+ | ' + ' | Pythnet Node 2 | | ' + ' +----------------+ | ' + ' | |Hermes| | ' + ' | +------+ | ' + ' | | ' + ' +----------------+ +----------------+ ' + ' | Pythnet Node 3 | --- | Pythnet Node 4 | ' + ' +----------------+ +----------------+ ' + ' |Hermes| |Hermes| ' + ' +------+ +------+ ' + + - - - - - - - - - - - - - - - - - - - - - + + ^ + | + v + +---------------------+ + | Wormhole | + +---------------------+ +``` + +In this new design, the Price Service is integrated into the Hermes node +service, decentralizing the API. Hermes is now also responsible for direct +communication with Wormhole over P2P, which reduces latency and simplifies +responsibilities. + +The new design offers several benefits: + +1. Hermes can participate as a P2P node in the Wormhole network directly. +2. Hermes nodes form a Pyth-specific P2P network with fast communication. +3. Hermes can directly observe on-chain state for faster operation. +4. Hermes can have its identity tied to a Pythnet node for authenticated operation. +5. Data ownership is clearer with the removal of the middleman. + +With tighter communication flow, we can define new behaviors such as +Pyth-specific threshold signing, fast price accumulation with proving (due to +direct node access), improved metrics and observations, and the ability for +users to run observe-only Hermes nodes to watch the Pyth network directly +instead of relying on a Price Service host. + +The Hermes node architecture is as follows: + +--- + +![image](https://user-images.githubusercontent.com/158967/225939587-f19cfe77-0393-4798-ad72-0022420d3e51.png) + +--- + +This is more in line with other well-known projects in the blockchain and P2P +space, such as Solana, Bitcoin, and Cosmos chains, where users who run the node +can also act as observers with specific features disabled. + +In our case, the node software can be run with or without a Pythnet validator +running due to it being designed to fetch updates from either Pyth or Geyser +networks for high availability. + +## Components + +The Hermes Node software consists of the following components: + +- **Wormhole P2P Connector**: Connects to the Wormhole P2P network and listens for VAAs. +- **Pyth P2P Connector**: Connects to the Pyth P2P network and listens for Account Updates. +- **Geyser Connector**: Connects to the Geyser node software and listens for Account Updates. +- **REST API**: Provides an interface for external applications to interact with Pythnet. +- **Websocket API**: Offers real-time data streaming for interacting with Pythnet. + +While Hermes will always participate in the Wormhole and Pyth P2P networks, the +Pyth network shares network updates on the Pyth layer and so can be run without +a Pythnet node running along-side it for a spy-only mode. This can be done by +running without specifying `--geyser-socket`. diff --git a/pyth_node/buf.gen.yaml b/hermes/buf.gen.yaml similarity index 100% rename from pyth_node/buf.gen.yaml rename to hermes/buf.gen.yaml diff --git a/pyth_node/build.rs b/hermes/build.rs similarity index 100% rename from pyth_node/build.rs rename to hermes/build.rs diff --git a/pyth_node/go.mod b/hermes/go.mod similarity index 100% rename from pyth_node/go.mod rename to hermes/go.mod diff --git a/pyth_node/go.sum b/hermes/go.sum similarity index 100% rename from pyth_node/go.sum rename to hermes/go.sum diff --git a/pyth_node/shell.nix b/hermes/shell.nix similarity index 100% rename from pyth_node/shell.nix rename to hermes/shell.nix diff --git a/pyth_node/src/config.rs b/hermes/src/config.rs similarity index 100% rename from pyth_node/src/config.rs rename to hermes/src/config.rs diff --git a/pyth_node/src/main.rs b/hermes/src/main.rs similarity index 100% rename from pyth_node/src/main.rs rename to hermes/src/main.rs diff --git a/pyth_node/src/network.rs b/hermes/src/network.rs similarity index 100% rename from pyth_node/src/network.rs rename to hermes/src/network.rs diff --git a/pyth_node/src/network/p2p.go b/hermes/src/network/p2p.go similarity index 100% rename from pyth_node/src/network/p2p.go rename to hermes/src/network/p2p.go diff --git a/pyth_node/src/network/p2p.rs b/hermes/src/network/p2p.rs similarity index 100% rename from pyth_node/src/network/p2p.rs rename to hermes/src/network/p2p.rs diff --git a/pyth_node/src/network/rpc.rs b/hermes/src/network/rpc.rs similarity index 100% rename from pyth_node/src/network/rpc.rs rename to hermes/src/network/rpc.rs diff --git a/pyth_node/src/network/rpc/rest.rs b/hermes/src/network/rpc/rest.rs similarity index 100% rename from pyth_node/src/network/rpc/rest.rs rename to hermes/src/network/rpc/rest.rs diff --git a/pyth_node/README.md b/pyth_node/README.md deleted file mode 100644 index 5ef0c1cbba..0000000000 --- a/pyth_node/README.md +++ /dev/null @@ -1,85 +0,0 @@ -Wormhole Node -================================================================================ - -Pyth Node is a highly available and versatile software that defines the Pyth -P2P network, Pyth API, and connects with the Pyth Geyser node software to -listen for PythNet events. It offers both REST and Websocket APIs for ease of -integration and interaction with the Pyth network stack. - -The Node can be run by anyone who wishes to participate / observe the PythNet -network operations. - -Overview --------------------------------------------------------------------------------- - -Pyth was initially designed with a simple "Price Service" with a REST API. -However, as the project evolved, its architecture can be rethought and improved -to be a more general node software that incorporates the Price Service as one -of its components. - -The new architecture is more in line with other well-known projects in the -blockchain and P2P space, such as Solana, Bitcoin, and Cosmos chains, where -users who run the node can also act as observers with specific features -disabled. In our case, the node software can be run with or without a PythNet -validator running. - -Pyth Node has several responsibilities: - -- Offering a REST and Websocket API to interact with the Pyth network. -- Connecting to the Wormhole P2P network and listening for Pyth-related VAAs/Messages. -- Connecting to the Pyth P2P network and sharing Pyth-specific Account Updates. -- Connecting to PythNet itself via our Geyser plugin to allow for a fully - decentralised PythNet. - -The node is designed to fetch updates from either Pyth or Geyser networks for -high availability. - -Architecture --------------------------------------------------------------------------------- - -The Pyth Node software consists of the following components: - -- *Wormhole P2P Connector*: Responsible for connecting to the Wormhole P2P network and listening for VAAs. -- *Pyth P2P Connector*: Responsible for connecting to the Pyth P2P network and listening for Account Updates. -- *Geyser Connector*: Responsible for connecting to the Geyser node software and listening for Account Updates. It can be disabled if desired to run the node as an observer, only listening to the Pyth P2P network. -- *REST API*: Provides an interface for external applications to interact with the node and retrieve information from the connected networks. -- *Websocket API*: Offers real-time data streaming and interaction with the node, enabling efficient updates and communication. - -Justification for the New Architecture --------------------------------------------------------------------------------- - -The new architecture allows for increased flexibility and high availability by -incorporating multiple components that can be enabled or disabled based on -specific use cases. - -In particular this allows user's to run the node in order to participate in the -Pyth P2P network to observe prices and serve their own API/RPC. It also allows -a better data ownership model that allow's the Node software to be the main -source of responsibility when interacting with Pyth. - -Getting Started --------------------------------------------------------------------------------- - -To set up and run a Pyth Node, follow the steps below: - -1. *Install Rust&: If you haven't already, you'll need to install Rust. You can - do so by following the official instructions. -2. *Clone the repository*: Clone the Pyth Node repository to your local - machine using the following command: - ```bash - git clone https://github.com/pyth-network/pyth-crosschain.git - ``` -3. *Build the project*: Navigate to the project directory and run the following command to build the project: - ```bash - cd pyth-node - cargo build --release - ``` - This will create a binary in the target/release directory. -4. *Run the node*: To run the Pyth Node, use the following command, replacing - ```bash - ./target/release/pyth-node run - ``` - Your Pyth Node will now start and connect to the specified networks. You - can interact with the node using the REST and Websocket APIs as described - in the [API Documentation](). - ```